Wallets

Learn the basics of all components involved in creating a blockchain wallet ecosystem

Blockchain wallets are the next best thing since sliced bread (or since Amala, if you’re Nigerian).

In this article, we will walk through all components and workflows involved in creating a blockchain wallet ecosystem for asset backed tokens (fiat, commodities).

But here’s a rule of thumb:

The simplest blockchain wallets don’t expose the details of blockchains to end users. The end users don’t even need to know they are dealing with a blockchain.

Wallet Customer Journey

Wallet Customer Journey

We’ve highlighted a bunch of terms in the diagram above. Let’s dig a bit deeper into them.

  • Customer: Your organization’s customers. Interstellar does not interact with your customers in any form. Your organization will have to decide who is a customer and who isn’t.

  • Wallet App: Your organization WILL create a wallet frontend application that your customers will interact with.

  • Customer Authentication: Your organization will have to decide and implement how customers authenticate into the wallet app.

  • Wallet Backend: Your organization WILL create a wallet backend that the wallet frontend will interact with. The frontend should never have to communicate directly with the underlying blockchain APIS.

  • Customer Blockchain Account: The blockchain only interacts with its internal blockchain accounts which are defined by a blockchain keypair (public key and secret key). It is important to map real customer identifiers (e.g. bank account number, or mobile phone number) to blockchain accounts. Sample code to perform automatic mapping between customer accounts and customer blockchain accounts can be found here.

  • Blockchain Distribution Accounts: Blockchain distribution accounts distribute blockchain funds to customer blockchain accounts. Their secret keys are usually stored on backend servers to automatically process deposits and withdrawals on behalf of customers.Distribution accounts get their funds from blockchain issuer accounts.

  • Blockchain Issuing Accounts: All blockchain custom tokens (fiat, commodities) are tied to blockchain issuing accounts. The blockchain issuer accounts act like Central Banks. They have the ability to generate more tokens of the asset they issue into the blockchain network. The total amount of tokens in circulation is determined by the blockchain issuing accounts, thus making it one of the most critical accounts to secure in the blockchain wallet infrastructure. As such, only top level management should have access to blockchain issuing accounts.

The rest of this document exposes best practices for the management of Blockchain Issuer Accounts, Blockchain Distribution accounts and workflows to introduce new custom tokens into the blockchain.

Separation of concerns

While actively developing your blockchain wallet backend and frontend, you might have used the same keys for your blockchain issuing and distribution accounts.

Unfortunately this is not generally recommended in production environments:

  • No separation of responsibility between the development team, the deployment team, and the business decision makers.

  • Issuer accounts are like your Central Bank accounts…access to these accounts should ideally only belong to business decision makers, and their secret keys should almost never ever be placed on a server for automation purposes.

High level workflow overview.

Prerequisites: Create an arbitrary blockchain issuer account, and an arbitray blockchain distribution account. Also make sure you have a strategy to map real user accounts to blockchain accounts.

Create and fund a blockchain issuer account. Secret key should only be shared by decision makers.

Create and fund a blockchain distribution account. Secret key should be kept on production servers for automatic distribution of funds.

Note: The blockchain issuing account has unlimited tokens for the tokens it issues.

StepBlockchain Distribution Account BalanceBlockchain Customer A Account BalanceBlockchain Customer B Account Balance
Initital State0 NGN0 NGN0 NGN
1. Management issues 10M naira into circulation
The 10M Naira will come from the blockchain issuing account
0+10M
= 10M NGN
0 NGN0 NGN
2. Customer [A] deposits 3M real NGN via Wallet App10M - 3M
= 7 NGN
0 + 3M
= 3M NGN
0 NGN
3. Customer [A] sends 1M blockchain NGN to Customer [B] via Wallet App7M NGN3M - 1M
= 2M NGN
0 + 1M
= 1M NGN
4. Customer [A] decides to withdraw their remaining 2M blockchain NGN to real bank NGN via Wallet App7M + 2M
= 9M NGN
2M - 2M
= 0 NGN
1M NGN
  1. Issue more tokens: The blockchain issuing account will issue (mint) 10M Naira into the blockchain by sending 10M blockchain Nairas to the Naira blockchain distribution account.

  2. Fund customer accounts. Customer A deposits 3M Naira into a real bank account. 3M Naira should leave the blockchain distribution account automatically and go to the Customer A’s blockchain account. Customer A’s blockchain account balance will show 3M blockchain Naira, meanwhile the blockchain distribution account will now have a balance of 7M Naira.

  3. Customer account transactions: Customer A sends 1M blockchain nairas to Customer B via the Wallet App. Customer A’s blockchain balance will now be 2M Naira, meanwhile Customer B’s blockchain balance will now be 1M Nairas.

  4. Customer withdraws funds: Customer A decides to withdraw their remaining 2M Naira from blockchain Nairas to real bank nairas. In that case, the backend should send funds from customer A’s blockchain account back to the blockchain distribution account; and process bank transactions accordingly.

Proposed Workflow For Governance around Issuing Accounts and Distribution Accounts.

  • Interstellar will manage the Blockchain Issuing Account on behalf of the organization.

  • Interstellar will communicate this blockchain Issuing Account to the organization’s deployment team responsible for deploying backend applications to production.

  • All requests to mint more assets into the blockchain will flow from the organization’s management to Interstellar using :

  • For backup purposes, and to ensure business continuity, the organization is expected to generate their own blockchain private/public keypair. The generated public key should be communicated to Interstellar, who will set up the organization’s key as a backup to the Blockchain Issuing Account. The organization should jealousy guard the secret key of this backup key.

  • The organization is also expected to generate their own keys for their various blockchain distribution accounts. The blockchain distribution keys to be used in production should be generated by the organization’s production backend deployment team. The public keys of these distribution accounts should be communicated to Interstellar to help reduce the risk of Interstellar sending tokens to the wrong blockchain distribution accounts.