Self-Hosting Shares
Last updated
Last updated
As mentioned in the Tech Overview section, you are given the option to host one of the shares on your servers for additional security of user wallets. Do note that if you opting to store shares on your own servers comes with the following risks:
If data is lost of damaged, users can potentially lose access to their funds.
If your service is down temporarily, users may not be able to access their wallets during the downtime.
If the latency of the endpoint is higher than 1000ms, it will result in degraded user experience.
We recommend you to only go for this option once your are familiar with using Metafi's embedded wallet service. If you require further assistance, please book a call using this link or feel free to ask us on our Discord server.
Please note that if you opt to host your own shares, you cannot change this in the future and will instead need to create a new project where you can pick Metafi's default share hosting option.
We require you to implement 2 endpoints to begin self-hosting shares. Once you implement these endpoints, please update the URLs on the Project Settings page of the developer portal.
POST
https://your-api.com/createShare
This URL will be invoked whenever a user creates a wallet using your API Key. The request body will contain the metafiUserId
and the unencrypted share, which you can then store on your database.
We recommend that you encrypt your share while saving to the database using a rotating key management system such as AWS KMS.
Name | Type | Description |
---|---|---|
GET
https://your-api.com/retrieveShare
This Endpoint will be invoked whenever we are reconstructing the user wallet and require your share. When returning the share, please ensure that it is decrypted.
Name | Type | Description |
---|---|---|
metafiUserId*
String
Metafi user ID
share*
String
The unencrypted share
metafiUserId
String
Metafi user ID