Overview
The public key validity proof certifies that a given ElGamal public key is valid - specifically, that the prover knows the corresponding secret key. This proof is essential for establishing that a public key was generated correctly and not arbitrarily chosen. The protocol guarantees computational soundness and perfect zero-knowledge in the random oracle model.This proof verifies the discrete logarithm relationship between the public key and the base point H, demonstrating knowledge of the secret key without revealing it.
Proof Structure
ThePubkeyValidityProof is remarkably compact with only two components:
Commitment to the random masking factor:
Y = y * HThe masked inverse of the secret key:
z = c * s^(-1) + yProof Data Context
Generating a Proof
Deriving Keys from Signers
You can also prove validity of derived keys:Verification
The verification checks the algebraic relation:His the Pedersen commitment base pointPis the ElGamal public key being verifiedcis the challenge scalar from the transcriptzandYare from the proof
P = s * H for some secret scalar s known to the prover.
Use Cases
- Key registration: Proving a public key is well-formed when registering it on-chain
- Account creation: Validating ElGamal public keys during confidential account setup
- Key rotation: Proving new public keys are properly generated
- Multi-signature setups: Verifying all participants have valid keys
- Token account initialization: Ensuring confidential token accounts have valid encryption keys
Security Considerations
Why Inverse?
Unlike other proofs that mask the secret key asz = c*s + y, this proof uses the inverse: z = c*s^(-1) + y. This design prevents certain attacks where an adversary could verify relations without knowing the actual secret key.
Proof Size
Total size: 64 bytes (2 × 32 bytes)- 1 Ristretto point (32 bytes)
- 1 scalar (32 bytes)
Implementation Notes
From the source code (sigma_proofs/pubkey_validity.rs:58):
Related Proofs
- Grouped Ciphertext Validity: Proves ciphertexts can be decrypted with valid keys
- Zero-Ciphertext: Proves knowledge of secret key for a specific ciphertext
Source Code
Sigma proof implementation:zk-sdk/src/sigma_proofs/pubkey_validity.rs:40
Proof data structure: zk-sdk/src/zk_elgamal_proof_program/proof_data/pubkey_validity.rs:35