How to Develop a Custodial Wallet for Cryptocurrencies? 

With the increasing hype of blockchain, cryptocurrencies, NFT & metaverse, now startups are moving from web2 towards web3. Thus increasing demand for the Crypto wallet. Still, people are confused between custodial wallet & non-custodial wallets.

In this post, I will not be talking about the difference between custodial & non-custodial wallet, if you want to know the difference, read it here

Here I will try to give you a design overview of a custodial wallet,  I will help you to see the architecture behind it, so that you can use this knowledge in building your own Custodial Wallet.

What is Custodial Wallet ?

A Custodial Wallet is defined as a wallet in which the private keys are held by a third party. This means the third party has full control over your funds while you only have to give permission to send or receive payments. 

Why you should choose a Custodial wallet? 

If you are building a mobile or web app, and you want the wallet functionality, so here are the following reason, why you should choose Custodial Wallet over non-custodial wallet.

  1. User Experience: Connecting to an external wallet like metamask, with an application is not straightforward all the time, and it affect the user experience. Also, it’s not easy to connect to an external wallet, with an app. So if you don’t want your user, to connect the app/website with any external wallet, and you still want to use crypto coins , you should use a custodial wallet.
  2. Less Educated Targetted Customer: Not everyone today has knowledge of web3, metamask, trust wallet, And other web3 wallets, so it creates a hindrance for them, to use your application. So if your app user is not that educated in the field of blockchain and crypto and you still want to use crypto technology in the app, then you should use Custodial wallet, where wallet will be connect with their account. ( JWT)
  3. Control: By using a Custodial wallet, the owners of the platform, have control over the usage/deposit & withdrawal. so  If you want to control your user’s wallet, you should use a Custodial wallet.

How to develop a Custodial Wallet?

Here is the overview, about developing a custodial wallet, which will ultimately require you to develop the following functionalities.

  1. Authentication –  there should be an Authentication module. Every user should have their email/password. They should have the ability to Login via email and password or using Social Methods like Google, Facebook, etc.

2. Creating wallet Addresses for each user – If the user Login for FIrst time, Create an address for the user, using the private key, which should be generated considering the security in the mind. You need to do this operation for each blockchain you are using. The syntax can be different for different blockchain

Onsignup trigger diagram of custodial wallet
Onsignup Trigger

3. KYC ( Know your Customer) – There should be a user’s KYC and it should be approved before the user start using the wallet. Although it is not required technically, but it is really necessary because of the legal compliances.

Either you can create your Custom KYC Module, where you collect data from users and Verify it from the Admin panel or use any 3rd Party API like https://onfido.com/, which will do the collection and verification for you.

4. Multifactor Authentication ( MFA) – there should be MFA enabled with the user account, to protect a few critical actions like sending money to any address, deleting an account, etc. it can be done using: 

  • Mobile number & OTP
  • Google Authenticator

5. Coin List – There should be an API to fetch all the supported & currently active coins, in the Platform. You have to create this list from the Admin panel.

6. Fund Balance – There should be an API, to fetch a list of coins, their quantity and the price, the user is holding. If you are using more than one blockchain, you need to query the data from more than one blockchain, concatenate the array and send it to the user. To calculate the price in FIAT currency, you can use any Crypto Exchange API like Coinbase.

Crypto Fund Balance Screen of custodial wallet
Crypto Fund Balance Screen

7. Get Deposit Address – If someone wants to deposit the cryptocurrency in your wallet, they will need a deposit Address or a QR code. So there should be an API, to fetch the user’s deposit address for a given network.

P.S:  Deposit Addresses will be different for different blockchain
Deposit Address of Custodial Wallet
Deposit Address

8. View Transactions – There should be an API to get the transaction of any account(address). You can also add a currency filter, to get a transaction for a specific cryptocurrency.

9. Send Crypto Currency – Now, it is time to create a transaction object, ( if the user wants to send the crypto coin). There should be an API, which will send the transaction. Transaction will be signed in the backend using the private key for user’s wallet.

Custodial Wallet Trasaction flow
Trasaction Flow

Conclusion : 

After going through the post, you must have got an idea about the what is custodial wallet, why & when you should use custodial wallet, and how to build a custodial wallet.

In case you are looking for a Custodial or noncustodial wallet, for your business use case, feel free to get in touch with us at admin@thriftysoft.tech or contact us on Skype

We will be happy to help you 😊