LPsLux Proposals
Zero-Knowledge Proofs
LP-8020

Z-Chain Proof Aggregation Authority

Final

Z-Chain rolls N per-validator ML-DSA signatures into one 192-byte proof for the cert lane, registers every accepted verifying key under one Merkle root that the round descriptor carries, and runs the Poseidon2 commitment-tree privacy lane on the same commitment

Category
Core
Created
2021-08-01

Abstract

Z-Chain is the proof aggregation authority. It owns three responsibilities, all rooted in the same chain commitment zchain_vk_root[32] carried in the QuasarRoundDescriptor:

  1. The MLDSAGroth16 cert-lane rollup — the third Quasar cert lane. Z-Chain produces a single Groth16 proof attesting "N valid ML-DSA-65 signatures over subject from this validator set", replacing per-validator ML-DSA verification on the consensus path.
  2. A general-purpose verifying-key registry — Halo2, Plonky2, Risc0, STARK, and future proof systems register their verifying keys under zchain_vk_root. Any C-Chain contract can call a Z-Chain precompile to verify a proof against a registered key.
  3. The UTXO privacy lane — Poseidon2 commitment trees with STARK proofs for shielded transfers.

zchain_vk_root is the single Merkle root committing to every verifying key Z-Chain accepts in the active epoch — both the cert-lane key and the registered application keys.

Z-Chain itself is LP-8000; the shielded pool is LP-8010; the strict post-quantum identity rollup is LP-8030.

The MLDSAGroth16 cert-lane rollup

Why a rollup and not a threshold scheme

Threshold ML-DSA has no FIPS standard: research constructions hit a rejection-sampling circular dependency (~/work/lux/proofs/quasar-cert-soundness.tex, appendix A). This lane therefore takes the non-threshold path:

  1. Each validator individually signs certificate_subject with its ML-DSA-65 identity key (LP-4400).
  2. The proposer ships those N raw ML-DSA signatures off-chain to a Z-Chain prover.
  3. Z-Chain produces a single 192-byte Groth16 proof over BLS12-381 attesting "N valid ML-DSA-65 signatures over subject from validator set V", where V is defined by pchain_validator_root.
  4. The cert ingress carries the proof plus a 32-byte public-inputs hash — not the N raw ML-DSA shares.
  5. The GPU verifier (LP-5622 drain_cert_lane) runs one Groth16 pairing check per cert.

Wire shape

struct MLDSAGroth16Artifact {
    uint8_t proof[192];             // Groth16 proof over BLS12-381
    uint8_t public_inputs_hash[32]; // bound to subject + validator set root
};

Public inputs include:

  • certificate_subject[32] — must equal QuasarRoundDescriptor.certificate_subject
  • pchain_validator_root[32] — defines the eligible signer set
  • validator_bitmap_hash[32] — commitment to which validators contributed
  • n_signers — the N count, which must clear the threshold

The verifier

verify_mldsa_groth16(subject, proof, public_inputs_hash, zchain_vk_root)

selects the active verifying key from zchain_vk_root at the round's epoch.

Costs

OperationCPUGPU (MLX / Metal / CUDA)
ML-DSA-65 sign (per validator)495 µs—
ML-DSA-65 verify (per validator)181 µs—
Z-Chain Groth16 prove (n=21 validators)~400 ms~5–15 ms
Groth16 verify (cert side)1–3 ms200–500 µs (batched)
Per-cert amortized verify (n=21)2–5 ms200–500 µs

A linear N×ML-DSA verification at n=21 would cost about 3.8 ms per cert. The rollup is comparable on CPU and dominates on GPU — which is the whole reason the lane exists.

Verifying-key rotation

The MLDSAGroth16 proving system has its own verifying key. Rotation requires:

  1. an off-chain trusted-setup ceremony — Powers of Tau plus a circuit-specific phase 2, with existing ceremony artifacts at ~/work/lux/proofs/groth16-setup/;
  2. registration of the new key into Z-Chain via RegisterVKTx;
  3. zchain_vk_root updating at the next epoch boundary;
  4. rounds beyond the boundary verifying against the new key, while older rounds remain verifiable against the prior key, anchored in their epoch's zchain_vk_root.

The verifying-key registry

Z-Chain accepts any proof system whose verifying key is registered. The registry is a sparse Merkle tree keyed by vk_id:

zchain_vk_root = MerkleRoot(vk_id → VKEntry)
struct VKEntry {
    uint32_t proof_system;     ///< 0=Groth16, 1=Halo2, 2=Plonky2,
                               ///< 3=Risc0, 4=STARK, 5+=reserved
    uint32_t curve_id;         ///< 0=BLS12-381, 1=BN254, 2=Pasta, ...
    uint8_t  vk_hash[32];      ///< hash of the VK bytes
    uint64_t vk_offset;        ///< byte offset into vk_arena
    uint64_t vk_len;           ///< VK byte length
    uint64_t epoch_active;     ///< first epoch this VK is accepted
    uint64_t epoch_retired;    ///< 0 = active; otherwise last accepting epoch
    uint64_t fee_per_verify;   ///< gas cost on the C-Chain verify precompile
};

Registered systems at genesis

Proof systemCurveUse caseVerify cost (cert side)
Groth16BLS12-381MLDSAGroth16 cert lane1–3 ms CPU / 200–500 µs GPU
Halo2Pasta (Pallas / Vesta)recursive proofs, no trusted setup5–10 ms CPU
Plonky2Goldilocksfast prover, FRI-based3–8 ms CPU
Risc0BN254 wrapped to Groth16RISC-V program proofs1–3 ms CPU after wrap
STARKbinary fieldsthe UTXO privacy lane5–15 ms CPU

New systems append; the registry never reorders.

The C-Chain verify precompile

A C-Chain contract verifies a proof by calling Z-Chain's verify precompile with vk_id, the proof, and the public inputs. The precompile resolves vk_id against zchain_vk_root in the current QuasarRoundDescriptor, selects the verifier for proof_system, runs the verification, and returns 1 for valid or 0 for invalid — reverting only on malformed input.

interface ZChainVerify {
    function verify(
        bytes32 vk_id,
        bytes calldata proof,
        bytes calldata public_inputs
    ) external view returns (bool);
}

Gas cost is VKEntry.fee_per_verify, set per key at registration.

Registration transaction

struct RegisterVKTx {
    uint32_t proof_system;
    uint32_t curve_id;
    uint8_t  vk_bytes[];          // serialized VK
    uint64_t fee_per_verify;
    uint64_t epoch_active;
    Sig      governance_sig;      // multi-sig
};

Registration requires a governance signature (LP-0085) and a trusted-setup attestation if the proof system requires one — Groth16 does; Halo2, Plonky2, Risc0, and STARK do not.

The UTXO privacy lane

UTXO model

Each unspent output is a leaf in a Poseidon2 Merkle tree (LP-4350):

commitment = Poseidon2(value || owner_pubkey || blinding_factor)

The root is stored on-chain. Individual commitments reveal nothing about value or owner.

Transaction structure

FieldDescription
nullifiers[]Poseidon2 hash of spent input commitments; prevents double spend
commitments[]New output commitments
proofSTARK proof of validity
rootMerkle root at proof-generation time

STARK circuit

The prover demonstrates, without revealing inputs, that:

  1. each nullifier corresponds to a commitment in the Merkle tree;
  2. the prover knows the preimage — value, owner pubkey, blinding factor — for each input;
  3. the sum of input values equals the sum of output values plus fee;
  4. each output commitment is correctly formed.

STARK proofs are used for transparency — no trusted setup — and post-quantum resistance. The STARK verifying key is registered in zchain_vk_root under proof_system = 4.

Nullifier tracking

A nullifier set is maintained on-chain. Each nullifier can appear once; submitting a duplicate reverts the transaction.

nullifier = Poseidon2(commitment || spending_key)

Performance

MetricValue
Proof generation (2-in, 2-out)1.2 s
Proof verification (on-chain)180,000 gas
Merkle tree depth32 (supports 4B UTXOs)
Nullifier setappend-only sparse Merkle tree

Replay-proof binding

Every Z-Chain artifact — cert-lane proof, application proof, UTXO nullifier inclusion — inherits the replay-proof property: proofs bind certificate_subject, which in turn binds pchain_validator_root || qchain_ceremony_root || zchain_vk_root plus the parent block, state, and execution roots. A proof for round R is structurally invalid in round R+1 even if the public inputs would otherwise admit a replay, because the verifying-key lookup itself fails when zchain_vk_root differs.

Security Considerations

  1. Trusted-setup discipline. Groth16 verifying keys, including the cert-lane key, require a trusted setup. Lux uses a Powers of Tau ceremony archived under ~/work/lux/proofs/groth16-setup/ with more than 50 contributors. A key lacking a setup attestation MUST be rejected by RegisterVKTx.
  2. Blinding factors must be cryptographically random. Reuse leaks value correlation in the privacy lane.
  3. Recent-root requirement. The Merkle root used in a UTXO proof must be within 256 blocks of the round's commitment, which bounds timing attacks.
  4. STARK proofs provide 128-bit security with post-quantum resistance.
  5. MLDSAGroth16 soundness rests on Groth16 over BLS12-381 — classical security around 128 bits — AND on the underlying ML-DSA-65, at NIST PQ level 3. Compromise of either breaks this lane. That is acceptable because Quasar runs three lanes and any one suffices for finality if the others fail. It also means this lane is classically bounded: a deployment running the strict post-quantum profile forbids pairings on the wire and uses the P3Q lane (LP-8030) instead.
  6. Verifying-key rotation is atomic. Rotation lands at epoch boundaries. A round straddling the boundary uses the prior epoch's key, enforced by selecting zchain_vk_root from the round's descriptor rather than from a global pointer.
  7. No trusted setup for application keys. Halo2, Plonky2, Risc0, and STARK need no trusted setup, so their keys are registrable without setup attestations.

Reference

ResourceLocation
Z-Chain VMgithub.com/luxfi/zvm/
Poseidon2 implementationgithub.com/luxfi/crypto/poseidon2/
STARK provergithub.com/luxfi/crypto/stark/
Groth16 cert-lane provergithub.com/luxfi/zchain/groth16/
Halo2 verifiergithub.com/luxfi/zchain/halo2/
Plonky2 verifiergithub.com/luxfi/zchain/plonky2/
Risc0 verifiergithub.com/luxfi/zchain/risc0/
Trusted-setup ceremony~/work/lux/proofs/groth16-setup/
Cert-lane verifier wiringLP-5622
Cert subject and its bindingLP-0122
Chain topologyLP-1340

Copyright and related rights waived via CC0.