What are Confidential Transfers?
Confidential transfers enable you to transfer tokens between token accounts without revealing the transfer amount. This is useful for privacy-preserving transactions. Only the transfer amounts and token balances are private. The 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 on how to use the Confidential Transfer extension
How does it work?
The Confidential Transfer 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 the confidential transfer extension.
- Create token accounts with confidential transfer extension 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.
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 the Confidential Transfer extension
Create Token Account
How to configure a token account with the Confidential Transfer extension
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 transfer tokens
Issuer Guide
How to issue and operate a confidential transfer token (approve policy, auditors, fees, mint and burn)
The diagram below shows a detailed sequence of the basic flow for confidential token transfers:
Confidential Transfer Instructions
The full list of Confidential Transfer extension instructions are as follows:
| Instruction | Description |
|---|---|
InitializeMint | Sets up mint account for confidential transfers. This instruction must be included in the same transaction as TokenInstruction::InitializeMint instruction. |
UpdateMint | Updates confidential transfer settings for a mint. |
ConfigureAccount | Sets up a token account for confidential transfers. |
ApproveAccount | Approves a token account for confidential transfers 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 transfers using an ElGamalRegistry account instead of VerifyPubkeyValidity proof. |
Is this page helpful?