Moving Tokens Between Public and Confidential Token Accounts

For tokens to be used confidentially, they need to be moved from the public balance to a confidential balance. This process is also reversible, allowing you to move tokens back to the public balance if needed.

Moving Tokens to Confidential Balance

  1. Deposit Tokens to Confidential Balance: Once your account is configured, deposit tokens from the public balance to the confidential balance.

    spl-token deposit-confidential-tokens <MINT_PUBKEY> <AMOUNT> --address <ACCOUNT_PUBKEY>
    • After this, tokens will be removed from the public balance and stored confidentially.

Moving Tokens Back to Public Balance

  1. Withdraw from Confidential Balance: If you want to move tokens back to the public balance, use this command:

    spl-token withdraw-confidential-tokens <MINT_PUBKEY> <AMOUNT> --address <ACCOUNT_PUBKEY>
    • This makes the tokens visible again for regular, non-confidential transfers.

Last updated