Overview
Theproof_data module contains data types for all supported zero-knowledge proofs. Each proof type consists of:
- Context data - Public values being certified
- Proof - Cryptographic proof data
ProofType Enum
Enumeration of all supported proof types.
ZkProofData Trait
All proof data types implement theZkProofData trait.
Zero Ciphertext Proof
Certifies that an ElGamal ciphertext encrypts the value zero.ZeroCiphertextProofData
Proof data for the
VerifyZeroCiphertext instruction.Size: 192 bytes (96 bytes context + 96 bytes proof)Fields
The context data for verification (96 bytes)
The cryptographic proof (96 bytes)
Methods
Creates a new zero-ciphertext proof.
ZeroCiphertextProofContext
Context data needed to verify a zero-ciphertext proof.Size: 96 bytes
Fields
The ElGamal public key (32 bytes)
The ElGamal ciphertext that encrypts zero (64 bytes)
Ciphertext-Ciphertext Equality Proof
Certifies that two ElGamal ciphertexts encrypt the same message.CiphertextCiphertextEqualityProofData
Proof data for the
VerifyCiphertextCiphertextEquality instruction.Fields
The context data containing both ciphertexts and public keys
The cryptographic proof
Methods
new
(first_keypair: &ElGamalKeypair, second_pubkey: &ElGamalPubkey, first_ciphertext: &ElGamalCiphertext, second_ciphertext: &ElGamalCiphertext, second_opening: &PedersenOpening, amount: u64) -> Result<Self>
Creates a ciphertext-ciphertext equality proof.
CiphertextCiphertextEqualityProofContext
Context data for ciphertext-ciphertext equality verification.Size: 192 bytes
Fields
The first ElGamal public key (32 bytes)
The second ElGamal public key (32 bytes)
The first ElGamal ciphertext (64 bytes)
The second ElGamal ciphertext (64 bytes)
Ciphertext-Commitment Equality Proof
Certifies that an ElGamal ciphertext and a Pedersen commitment encode the same value.CiphertextCommitmentEqualityProofData
Proof data for the
VerifyCiphertextCommitmentEquality instruction.Fields
The context data containing the ciphertext, commitment, and public key
The cryptographic proof
CiphertextCommitmentEqualityProofContext
Context data for ciphertext-commitment equality verification.
Public Key Validity Proof
Certifies that an ElGamal public key is well-formed and the prover knows the corresponding secret key.PubkeyValidityProofData
Proof data for the
VerifyPubkeyValidity instruction.Size: 96 bytes (32 bytes context + 64 bytes proof)Fields
The context data containing the public key (32 bytes)
The cryptographic proof (64 bytes)
Methods
Creates a public key validity proof.
PubkeyValidityProofContext
Context data for public key validity verification.Size: 32 bytes
Fields
The ElGamal public key to be proved (32 bytes)
Percentage with Cap Proof
Certifies that a tuple of Pedersen commitments satisfy a percentage relation.PercentageWithCapProofData
Proof data for the
VerifyPercentageWithCap instruction.Fields
The context data containing the commitments
The cryptographic proof
PercentageWithCapProofContext
Context data for percentage-with-cap verification.
Batched Range Proofs
Certify that Pedersen commitments encode values within specific bit ranges.BatchedRangeProofU64Data
Proof data for 64-bit batched range proofs.Certifies that commitments encode positive numbers with total bit-length ≤ 64.
BatchedRangeProofU128Data
Proof data for 128-bit batched range proofs.Certifies that commitments encode positive numbers with total bit-length ≤ 128.
BatchedRangeProofU256Data
Proof data for 256-bit batched range proofs.Certifies that commitments encode positive numbers with total bit-length ≤ 256.
BatchedRangeProofContext
Context data shared by all batched range proof types.
Grouped Ciphertext Validity Proofs
Certify that grouped ElGamal ciphertexts are well-formed and can be decrypted by the associated private keys.GroupedCiphertext2HandlesValidityProofData
Proof data for grouped ciphertexts with 2 decrypt handles.
Fields
The context data containing the grouped ciphertext
The cryptographic proof
GroupedCiphertext3HandlesValidityProofData
Proof data for grouped ciphertexts with 3 decrypt handles.
Fields
The context data containing the grouped ciphertext
The cryptographic proof
Batched Variants
Batched proof for two grouped ciphertexts with 2 handles each.More efficient than two individual proofs.
Batched proof for two grouped ciphertexts with 3 handles each.More efficient than two individual proofs.