spl_token_2022/extension/confidential_mint_burn/
mod.rs

1use {
2    crate::extension::{Extension, ExtensionType},
3    bytemuck::{Pod, Zeroable},
4    solana_zk_sdk::encryption::pod::{
5        auth_encryption::PodAeCiphertext,
6        elgamal::{PodElGamalCiphertext, PodElGamalPubkey},
7    },
8};
9
10/// Maximum bit length of any mint or burn amount
11///
12/// Any mint or burn amount must be less than `2^48`
13pub const MAXIMUM_DEPOSIT_TRANSFER_AMOUNT: u64 = (u16::MAX as u64) + (1 << 16) * (u32::MAX as u64);
14
15/// Bit length of the low bits of pending balance plaintext
16pub const PENDING_BALANCE_LO_BIT_LENGTH: u32 = 16;
17
18/// Confidential Mint-Burn Extension instructions
19pub mod instruction;
20
21/// Confidential Mint-Burn Extension processor
22pub mod processor;
23
24/// Confidential Mint-Burn proof verification
25pub mod verify_proof;
26
27/// Confidential Mint Burn Extension supply information needed for instructions
28#[cfg(not(target_os = "solana"))]
29pub mod account_info;
30
31/// Confidential mint-burn mint configuration
32#[derive(Clone, Copy, Debug, Default, PartialEq, Pod, Zeroable)]
33#[repr(C)]
34pub struct ConfidentialMintBurn {
35    /// The confidential supply of the mint (encrypted by `encryption_pubkey`)
36    pub confidential_supply: PodElGamalCiphertext,
37    /// The decryptable confidential supply of the mint
38    pub decryptable_supply: PodAeCiphertext,
39    /// The ElGamal pubkey used to encrypt the confidential supply
40    pub supply_elgamal_pubkey: PodElGamalPubkey,
41}
42
43impl Extension for ConfidentialMintBurn {
44    const TYPE: ExtensionType = ExtensionType::ConfidentialMintBurn;
45}