General Use Case

How to use Virtual Accounts

Introducing the Crypto Exchange Use Case

A crypto Exchange is a web application where end-users can trade their crypto assets. The Owner of the Exchange is the one who owns the private keys to all of the user's crypto assets - in this case, we are talking about a Custodial Exchange leveraging a Custodial Wallet.

‌Trades are not performed on the blockchain (on-chain), as this would be slow and expensive. All the trades are virtual transactions between end-user accounts (off-chain).

Exchange Workflow

Step_1: Setting up the application

Includes prerequisites like blockchain wallet creation and creating exchange service accounts for gathering fees.

Step_2: Registration of new end-users in the application

The steps that need to be executed when new users register in the exchange

Step_3: End-user application journey

What kind of actions end-users can take while in the application

Step_4: Trading

Enabling end-users to trade their assets

Step_5: Observe Security Basics

Additional information is available in the following article.


Good to Know

  • A custodial wallet is a wallet where a third party holds the private keys, not the crypto assets owner. The provider has full control over crypto assets, while end Users only have permission to send or receive payments.
  • Every Exchange must have wallets for every crypto asset it supports.
  • Every end-user of the Exchange must obtain accounts for every asset they are trading.
  • The exchange operator defines the trading pairs that can be traded by users and usually charges a fee for every trade performed.

📘

Note

Virtual Accounts can only handle one (1) single currency per Virtual Account.


Important

The intended use case for Virtual Accounts (VA) is as a Self-Custodial Exchange, meaning all withdrawals are expected to be tracked in the VA ledger.

  • Tatum does not hold custody of mnemonics or private keys. As a result, it is technically possible to sign transactions using VA ledger deposit addresses outside the VA ledger and Tatum endpoints. For more details, refer to this article.
  • The blockchain’s on-chain balance takes precedence over the VA ledger. If unregistered transactions occur, the VA ledger will become misaligned, leading to liquidity inconsistencies between the on-chain balance and the off-chain VA ledger.
  • Virtual Accounts are designed to hold a limited number of deposit addresses (1-5). While adding many more deposit addresses may appear functional, this setup often leads to unrecoverable synchronisation issues across users over time.
  • Any on-chain assets already present in a blockchain address to bind to a Virtual Account will be ignored. More information HERE.
  • Deposits are only "recognized" as long as the "currency" of the VA matches the on-chain asset deposited
  • If a mistake occurs when creating or storing a withdrawal in the VA ledger, it can be deleted and retried. Check this article for addtional details.
  • Withdrawals from a VA deposit address can be automated using VA Blockchain Operations endpoints, ensuring they are properly logged in the VA ledger.

🚧

Attention

  • You are expected to hold 1:1 asset liquidity between the VA off-chain ledger and your end-users on-chain assets.
  • To avoid potential disruptions and ensure consistent performance, we recommend adhering to the intended usage of 1-5 deposit addresses per Virtual Account.
  • Be mindful of Tatum Derivation Path.

❗️

Warning

  • All withdrawals must be registered and executed through VA-specific endpoints.
  • Using standard blockchain transaction methods to sign and broadcast a transaction from a VA-linked deposit address bypasses the VA ledger, leadings to balance discrepancies. If this happens, the withdrawal must be manually registered.