Overview
The ciphertext-ciphertext equality proof certifies that two ElGamal ciphertexts (possibly encrypted under different public keys) contain the same plaintext message. The prover must provide:- The decryption key for the first ciphertext
- The randomness (opening) used to generate the second ciphertext
Proof Structure
TheCiphertextCiphertextEqualityProof contains seven components:
Commitment for the first public key
Commitment combining message and first ciphertext handle
Commitment for the second ciphertext
Commitment for the second public key
Masked secret key of the first keypair
Masked plaintext message
Masked randomness of the second ciphertext
Proof Data Context
Generating a Proof
Verification
The verification performs a batch check of multiple algebraic relations using challenge scalarsc, w, ww, and www:
The verification rejects identity points for public keys and the first ciphertext. However, the second ciphertext is allowed to be the identity point, as this is a common state in Token-2022.
Use Cases
- Token transfers: Proving the amount withdrawn from one account equals the amount deposited to another
- Cross-account validation: Verifying consistency between encrypted balances across different accounts
- Confidential transactions: Ensuring input and output amounts match in private transactions
- Multi-party computations: Proving encrypted shares represent the same value
Security Considerations
Proof Size
Total size: 224 bytes (7 × 32 bytes)- 4 Ristretto points (128 bytes)
- 3 scalars (96 bytes)
Related Proofs
- Ciphertext-Commitment Equality: For proving equality between a ciphertext and Pedersen commitment
- Zero-Ciphertext: For proving a ciphertext encrypts zero
Source Code
Sigma proof implementation:zk-sdk/src/sigma_proofs/ciphertext_ciphertext_equality.rs:41
Proof data structure: zk-sdk/src/zk_elgamal_proof_program/proof_data/ciphertext_ciphertext_equality.rs:39