Protocol
Transfers and proofs
A confidential transfer moves an encrypted amount between two accounts and carries the proofs that convince the chain the move was legal. Nothing is decrypted at any point, including by the validator that produces the block.
What a transfer carries
An ordinary SPL transfer has a u64 in its instruction data. A confidential transfer has ciphertexts and references to proofs, and the amount appears as a number nowhere in the transaction. The instruction reads the sender available balance from the sender account and the ElGamal public key from the receiver account, then writes back a new sender balance and a credit to the receiver pending balance.
The receiver signs nothing and need not be online. The program adds the encrypted amount into their pending balance homomorphically, and they turn it into spendable funds later by applying it, as described in confidential balances.
Encrypted under both keys
The sender has to read their own history and the receiver has to spend what they were sent, so the amount is encrypted under both keys at once, in one structure rather than two. An ElGamal ciphertext here is a Pedersen commitment to the amount plus a decryption handle for each public key that should be able to open it. The commitment is shared; the handles are the small per-key pieces. A transfer therefore carries one commitment and two handles, sender and receiver, or three when the mint configures an auditor. Each party combines the commitment with their own handle and secret key and recovers the same number.
The amount is carried as a low and a high ciphertext rather than one, for the same reason the pending balance is split: recovering an integer from an ElGamal ciphertext is a bounded search. Both halves are covered by the proofs.
The three proofs
The program has to be convinced of three separate things, each with its own proof. None reveal the amount, and all are generated on the sender device before the transaction is sent.
Range proof
Proves the values hidden in the commitments lie inside the allowed interval: the chunks of the transfer amount, and the balance left on the sender account. This is the proof standing between the ledger and counterfeit money. Arithmetic on encrypted values wraps, so a sender moving more than they held would get not an error but a remainder underflowed into an enormous number, and the range proof makes that statement unprovable. It covers several commitments in one batched proof and is by a wide margin the largest artifact in the transaction.
Equality proof
Proves that two encodings of the same quantity really do encode the same quantity: the new sender balance ciphertext written to the account, and the commitment the range proof was built over. Without it the two halves of the argument are not joined, and a sender could prove a small number was in range while writing an unrelated ciphertext into their account.
Validity proof
Proves the grouped ciphertexts are well formed under the public keys they claim to be under, so each handle genuinely corresponds to the shared commitment and to that key. This is what guarantees the receiver can decrypt what they were sent, rather than receiving a credit that is permanently unreadable and so permanently unspendable. Where a mint has an auditor, it also forces the auditor handle to be honest.
Together: value is conserved, nothing went negative, and everyone named in the transfer can open their own view of it. The proofs say nothing about who sent, who received, when or which mint, all of which are plainly visible on chain and were never the thing being hidden.
How verification happens
Token-2022 does not verify any of these itself. That is the job of Solana's native ZkElGamalProof program, which exposes one instruction per proof type and does nothing but accept or reject. Token-2022 then checks that the right verification happened for this transfer, with the right public inputs. Two ways to arrange it.
- Inline. The verify instructions sit in the same transaction, ahead of the transfer, and the transfer points at them by instruction offset. One transaction, nothing left behind.
- Staged. A verify instruction can write its verified public inputs into a proof context account instead. That account persists, so verification can happen in an earlier transaction and the transfer merely references it. The context accounts are closed afterwards to reclaim rent.
// inline: everything in one transaction
ComputeBudget SetComputeUnitLimit
ZkElGamalProof Verify... (proof data in the instruction)
Token2022 ConfidentialTransfer (proof_instruction_offset)
// staged: proofs verified first, transfer references the context accounts
tx 1 ZkElGamalProof VerifyBatchedRangeProof -> context A
tx 2 ZkElGamalProof VerifyCiphertextCommitmentEquality -> context B
ZkElGamalProof VerifyGroupedCiphertextValidity -> context C
tx 3 Token2022 ConfidentialTransfer (context A B C)
ZkElGamalProof CloseContextState x3The exact verify instruction for each proof depends on how many handles the ciphertexts carry and how wide the batched range proof must be, so a mint with an auditor uses a different validity instruction. The shape above does not change.
Compute and size
The real constraint is not cryptographic. It is that a Solana transaction is capped at 1232 bytes. A batched range proof is substantial on its own, and a transfer needs it alongside an equality proof, a validity proof, the transfer instruction, every account key and the signatures. That budget is usually what breaks first, which is the entire reason proof context accounts exist.
Settlement is still ordinary Solana: one instruction in one transaction, normal finality, no bridge, no second chain, no waiting period. What can take more than one transaction is the proof staging in front of it and the cleanup behind it.
Compute is the second constraint. Verification is elliptic curve arithmetic, among the more expensive things that run on Solana, so a transaction doing it should raise its compute unit limit explicitly with a ComputeBudget instruction rather than rely on the default allotment. Cost scales with the size of the batched proof, which is another argument for giving verification its own transaction. Proof generation is a separate cost falling on the client: building a range proof takes real time in a browser tab, before anything can be sent.
The auditor key
A mint can configure an auditor ElGamal public key in its confidential transfer settings. When that field is set, every transfer of the mint must include a third handle under the auditor key, the validity proof must cover it, and a transfer that omits it is rejected. The holder of the auditor secret key can decrypt every transfer amount on that mint.
Say that plainly rather than softly: an auditor key is a standing ability to read every transfer amount on the mint, for as long as whoever holds it holds it. It confers nothing else. An auditor cannot move funds, cannot sign for a holder, cannot block a transfer, and cannot read anything on other mints.
It is a property of the mint, not of your account, so you cannot opt out by configuring your account differently. Before holding a confidential balance of a mint you did not create, read the mint and check two things: whether the auditor field is set, and whether the confidential transfer authority still exists. A live authority can set or rotate an auditor key later, affecting transfers from that point on. Where none is configured the field is empty and transfers carry two handles only.
What an observer learns
A validator processes a confidential transfer the way it processes anything else: check signatures, run the programs, write the result. It holds no decryption key and the proof program never recovers a plaintext, so the amount is not available to it at any stage. Verification is a yes or no, and a yes means only that the statement held.
If that distinction matters for what you are building, read the threat model before you design around it. Amount confidentiality is a strong property and a narrow one, and most mistakes come from assuming it is wider.