Skip to content
This repository was archived by the owner on Mar 11, 2025. It is now read-only.

Commit 1c3af5e

Browse files
[token-2022] Add doc regarding the ability of withdraw withheld authority [ZELLIC-3.4] (#3773)
* Mention the corresponding proof instruction in the token instruction doc * add warning about withheld fees authority
1 parent fcb44af commit 1c3af5e

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

token/program-2022/src/extension/confidential_transfer/instruction.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,9 @@ pub enum ConfidentialTransferInstruction {
110110
/// prior to account closing if no instructions beyond
111111
/// `ConfidentialTransferInstruction::ConfigureAccount` have affected the token account.
112112
///
113+
/// In order for this instruction to be successfully processed, it must be accompanied by the
114+
/// `VerifyCloseAccount` instruction of the `zk_token_proof` program in the same transaction.
115+
///
113116
/// * Single owner/delegate
114117
/// 0. `[writable]` The SPL Token account.
115118
/// 1. `[]` Instructions sysvar.
@@ -157,6 +160,9 @@ pub enum ConfidentialTransferInstruction {
157160
/// Fails if the source or destination accounts are frozen.
158161
/// Fails if the associated mint is extended as `NonTransferable`.
159162
///
163+
/// In order for this instruction to be successfully processed, it must be accompanied by the
164+
/// `VerifyWithdraw` instruction of the `zk_token_proof` program in the same transaction.
165+
///
160166
/// Accounts expected by this instruction:
161167
///
162168
/// * Single owner/delegate
@@ -179,6 +185,10 @@ pub enum ConfidentialTransferInstruction {
179185

180186
/// Transfer tokens confidentially.
181187
///
188+
/// In order for this instruction to be successfully processed, it must be accompanied by
189+
/// either the `VerifyTransfer` or `VerifyTransferWithFee` instruction of the `zk_token_proof`
190+
/// program in the same transaction.
191+
///
182192
/// Fails if the associated mint is extended as `NonTransferable`.
183193
///
184194
/// * Single owner/delegate
@@ -266,6 +276,10 @@ pub enum ConfidentialTransferInstruction {
266276
/// Transfer all withheld confidential tokens in the mint to an account. Signed by the mint's
267277
/// withdraw withheld tokens authority.
268278
///
279+
/// In order for this instruction to be successfully processed, it must be accompanied by the
280+
/// `VerifyWithdrawWithheldTokens` instruction of the `zk_token_proof` program in the same
281+
/// transaction.
282+
///
269283
/// Accounts expected by this instruction:
270284
///
271285
/// * Single owner/delegate
@@ -307,6 +321,10 @@ pub enum ConfidentialTransferInstruction {
307321
/// `HarvestWithheldTokensToMint` and then move the withheld fees from mint to a specified
308322
/// destination account using `WithdrawWithheldTokensFromMint`.
309323
///
324+
/// In order for this instruction to be successfully processed, it must be accompanied by the
325+
/// `VerifyWithdrawWithheldTokens` instruction of the `zk_token_proof` program in the same
326+
/// transaction.
327+
///
310328
/// Accounts expected by this instruction:
311329
///
312330
/// * Single owner/delegate

token/program-2022/src/extension/confidential_transfer/mod.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,20 @@ pub struct ConfidentialTransferMint {
5757
/// `ConfidentialTransferInstruction::ConfigureAccount`)
5858
pub auto_approve_new_accounts: PodBool,
5959

60+
/// Authority to decode any transfer amount in a confidential transafer.
61+
///
6062
/// * If non-zero, transfers must include ElGamal cypertext with this public key permitting the
6163
/// auditor to decode the transfer amount.
6264
/// * If all zero, auditing is currently disabled.
6365
pub auditor_encryption_pubkey: EncryptionPubkey,
6466

67+
/// Authority to withraw withheld fees that are associated with accounts. It must be set to an
68+
/// all zero pubkey if the mint is not extended for fees.
69+
///
70+
/// Note that the withdraw withheld authority has the ability to decode any withheld fee
71+
/// amount that are associated with accounts. When combined with the fee parameters, the
72+
/// withheld fee amounts can reveal information about transfer amounts.
73+
///
6574
/// * If non-zero, transfers must include ElGamal cypertext of the transfer fee with this
6675
/// public key. If this is the case, but the base mint is not extended for fees, then any
6776
/// transfer will fail.

0 commit comments

Comments
 (0)