Skip to main content

PQ Pubkey Registry

Note encryption is hybrid: a sender needs the recipient's ML-KEM-768 public key. PqPubkeyRegistry is the on-chain directory that makes that key resolvable by any sender including one who has never interacted with the recipient.

What it stores

mapping(bytes32 pkdKey => bytes32 pubkeyHash) public pubkeyHash; // write-once

It maps a recipient's BabyJubJub transmission key to the keccak hash of their ML-KEM-768 public key, where pkdKey = keccak256(abi.encode(pkdX, pkdY)). The full public key is emitted in the PqPubkeyRegistered(pkdKey, pubkey) event for indexers/wallets to fetch, only its hash is kept in storage.

Registration is authorized and write-once

Anyone could claim to register a key, so the registry requires proof that the registrant controls the BJJ key, via a raw BabyJubJub Schnorr signature over a chain-bound preimage.