What are Confidential Balances?
Confidential Balances is a Token-2022 extension that lets you transfer tokens between token accounts without revealing the transfer amount. This is useful for privacy-preserving transactions. Only transfer amounts and token balances are private. Token account addresses remain public.
- Protocol Overview - Details on the underlying cryptographic protocol
- Quick Start Guide - Setup and basic CLI commands
- Confidential Balances Cookbook - Code snippets showing how to use Confidential Balances
How does it work?
The Confidential Balances extension adds instructions to the Token Extension program that allows you to transfer tokens between accounts without revealing the transfer amount.
The basic flow of confidential token transfers is as follows:
- Create a mint account with Confidential Balances enabled.
- Create token accounts with Confidential Balances enabled for the sender and recipient.
- Mint tokens to the sender account.
- Deposit sender's public balance to confidential pending balance.
- Apply sender's pending balance to confidential available balance.
- Confidentially transfer tokens from sender token account to recipient token account.
- Apply recipient's pending balance to confidential available balance.
- Withdraw recipient's confidential available balance to public balance.
Auditor keys
A Confidential Balances mint can store an optional global auditor ElGamal public key. When one is configured, every confidential transfer includes the amount encrypted for the sender, recipient, and auditor. The transfer proof verifies that all three ciphertexts contain the same amount. The public still cannot read the amount, but the holder of the auditor secret key can decrypt transfer amounts for that mint.
The Confidential Balances authority sets the auditor key when initializing the
extension or changes it later with UpdateMint. The authority can rotate or
clear the key. A rotation applies only to future transfers, so retain prior
secret keys when historical audit access is required. Auditor keys provide read
access; they do not authorize token transfers or reveal an account's full
confidential balance.
For setup and rotation examples, see Configure an auditor. Wallets, explorers, exchanges, and compliance providers should also review the auditor integration guidance.
For more details on the steps in the confidential transfer flow, see the corresponding pages:
Create Mint Account
How to create a mint account with Confidential Balances enabled
Create Token Account
How to configure a token account with Confidential Balances enabled
Deposit Tokens
How to deposit tokens to confidential pending balance
Apply Pending Balance
How to apply pending balance to available confidential balance
Withdraw Tokens
How to withdraw tokens from confidential available balance
Transfer Tokens
How to confidentially transfer tokens between token accounts
Integration Guide
How wallets, explorers, and exchanges can support Confidential Balances tokens
Issuer Guide
How to issue and operate a Confidential Balances token (approve policy, auditors, fees, mint and burn)
The diagram below shows a detailed sequence of the basic flow for confidential token transfers:
Confidential Balances Instructions
The full list of Confidential Balances extension instructions is as follows:
| Instruction | Description |
|---|---|
InitializeMint | Enables Confidential Balances on a mint account. This instruction must be included in the same transaction as TokenInstruction::InitializeMint instruction. |
UpdateMint | Updates the mint's account approval policy and optional global auditor ElGamal public key. |
ConfigureAccount | Enables Confidential Balances on a token account. |
ApproveAccount | Approves a token account for Confidential Balances if the mint requires approval for new token accounts. |
EmptyAccount | Empties the pending and available confidential balances to allow closing a token account. |
Deposit | Converts public token balance into pending confidential balance. |
Withdraw | Converts available confidential balance back to public balance. |
Transfer | Transfers tokens between token accounts confidentially. |
ApplyPendingBalance | Converts pending balance into available balance after deposits or transfers. |
EnableConfidentialCredits | Allows a token account to receive confidential token transfers. |
DisableConfidentialCredits | Blocks incoming confidential transfers while still allowing public transfers. |
EnableNonConfidentialCredits | Allows a token account to receive public token transfers. |
DisableNonConfidentialCredits | Blocks regular transfers to make account receive only confidential transfers. |
TransferWithFee | Transfers tokens between token accounts confidentially with a fee. |
ConfigureAccountWithRegistry | Alternative way to configure token accounts for Confidential Balances using an ElGamalRegistry account instead of VerifyPubkeyValidity proof. |
Is this page helpful?