Repository navigation
Open
Labels
assuranceIndependent testing, vectors, or audit evidencedesign-adrRequires an accepted ADR or security design before implementationenhancementNew feature or requestsecuritySecurity-sensitive correctness or trust-boundary work
Description
Goal
Consolidate all remaining cryptographic, on-chain, interop, scalability, and assurance work required to promote ZeroJ's PlonK BLS12-381 prover, off-chain verifier, and on-chain Plutus V3 verifier from Experimental to Beta (matching Groth16's testnet / non-value-bearing Beta bar — noting that production/value-bearing mainnet use still requires an independent external cryptographic audit).
Current Baseline (Already Completed)
- Full 5-round BLS12-381 PlonK prover (
PlonKProverBLS381), pure-Java verifier (PlonkBLS12381Verifier), and on-chain Plutus V3 KZG batch-opening verifier (PlonkBLS12381Lib, 1-input and bounded1..8MPI profiles). - Universal snarkjs
0.7.6.ptauSRS streaming importer (PtauImporterBLS381),t3 = n + 6SRS sizing, defensive SRS snapshot pinning,SecureRandombatched RLC pairing checks (SrsConsistencyBLS381), and$O(n^2)$ loop elimination inPlonKSetupBLS381/PlonKProverBLS381(PR Fix streaming PtauImporterBLS381, size PlonK t3 to n+6, and withdraw PlonKZkeyImporterBLS381 (ADR-0066) #121 / ADR-0066, PR ADR-0068: DSL soundness, PlonK scaling, MPF canonicality & gadget hardening #125 / ADR-0068). - Sigma bijection checks, KZG synthetic-division zero-remainder assertion, non-infinity commitment resampling,
nPublic <= 2^power, and off-chainZ_H(zeta) != 0check (PR Harden crypto, symbolic DSL, on-chain/JMT, CI, notices, and docs (ADR-0069) #126). - Live
snarkjs@0.7.6.ptau -> setup -> prove -> verifyCI gate and independentgnark v0.14.0PlonK BLS12-381 vectors inassurance.yml.
Consolidated Roadmap & Tasks
1. Cardano v2 Profile — Strong Fiat-Shamir, Domain Parity & Single-Decode Verifier (ADR-0069) (R3)
- M1 (Spec & KATs): Finalize exact byte-level
zeroj-plonk-cardano-v2transcript schedule (explicit v2 domain separator, VK digest bindingqM, qL, qR, qO, qC, s1, s2, s3, canonical 96-byte compressedX2 = tau * G2,power,k1,k2,nPublic, and length-prefixed public inputs; full transcript chaining across all challenges includingu). Publish independent Python/Rust reference KAT vectors covering VK/X2binding and challenge boundaries (zeta in {0, 1, omega},Z_H(zeta) == 0). - M2 (Off-chain Prover & Verifier): Implement
TranscriptEncoding.CARDANO_V2inPlonKProverBLS381andPlonkBLS12381Verifierwhile keeping the legacy snarkjs0.7.6v1 profiles intact and strictly separated byproofFormat. Add negative tests for missing VK/X2binding,utampering, degenerate challenges, andv1↔v2cross-profile replay. - M3 (On-chain Plutus V3 Verifier — supersedes [On-Chain] Optimize PlonK on-chain verifier (PlonkBLS12381Lib) CPU budget on Plutus V3 #43): Implement single-decode v2 Plutus V3 library/validators in
zeroj-onchain-julc:- Decompress each compressed 48-byte G1 VK/proof point once via CIP-0381
bls12_381_G1_uncompress(eliminating repeated decompressions across the 19 current call sites inPlonkBLS12381Lib). - Enforce
zeta != 0andZ_H(zeta) = zeta^n - 1 != 0directly on-chain (closing the v1 gap wherePlonkBLS12381Libchecks onlyzeta != 1,zeta != omega, and public-input slots). - Audit and trim redundant validator
@Paramfields; profile Plutus V3 CPU/memory budget (targeting a major reduction from the current ~4.58–4.71B CPU) and validate end-to-end on Yaci DevKit.
- Decompress each compressed 48-byte G1 VK/proof point once via CIP-0381
2. Cross-Provider Acceleration & Differential Verification (R2/R3)
- Add
blst-backed verification / MSM acceleration path for PlonK BLS12-381 (matching Groth16's pure-Java +blstdual-provider architecture; relates to Add provider-neutral G1/G2 multi-scalar multiplication to Bls12381Provider #22). - Add cross-provider differential tests verifying identical accept/reject semantics between pure-Java and
blstPlonK verifiers across positive, malformed, and adversarial inputs.
3. Unified Pipeline, Scale & Interop (R1/R2)
- Unified API facade (supersedes [PlonK] Introduce unified PlonKPipeline and PlonKKeys facade matching Groth16Pipeline #42): Introduce
PlonKKeys(AutoCloseable) andPlonKPipelinematchingGroth16Keys/Groth16Pipeline(compilation,.ptau/ proving-key cache management, witness generation, and proving). - Large-circuit scaling & benchmarks (supersedes remaining benchmarking scope of [PlonK] Optimize PlonK setup and prover with O(n log n) FFT / coset NTT polynomial evaluations #38): Benchmark setup/prover memory and throughput on larger domains (
$n \ge 2^{14}$ –$2^{18}$), and evaluate flat/mmap key storage for larger PlonK circuits if heap becomes a bottleneck. - snarkjs
.zkeyinterop decision (follow-up to ADR-0066): Either implement a full snarkjs0.7.6PlonK.zkeyimporter matchingplonk_setup.jssection layout (with live snarkjs CI round-trip tests) or formally keep.ptau-only import as the supported path and remove theUnsupportedOperationExceptionstub.
4. On-Chain Application Binding & Example Validators (R2)
- Ship a bound PlonK on-chain spending validator example demonstrating
ScriptContextbinding, replay protection, and state/UTxO continuity (parallel toGroth16BLS12381TxOutRefBindingVerifier/Groth16AuthenticatedStateTransitionValidator), verified in Julc VM and Yaci DevKit.
5. Assurance, Fuzzing & Promotion Gates (R2/R3)
- Add property-based and Jazzer fuzz tests covering PlonK wire/JSON/CBOR decoding, Fiat-Shamir transcripts, adversarial proofs/VKs, and
PlonKCompilergate/permutation lowering (relates to [Enhancement] Implement Jazzer fuzzing and differential checks for ZeroJ cryptographic boundaries #107). - Record reproducible Julc VM + Yaci DevKit E2E results and updated Plutus V3 budget tables before promoting PlonK from Experimental to Beta in
README.mdand docs. - (Production / mainnet gate — separate from Beta): Complete an independent external cryptographic audit covering the PlonK prover, off-chain verifier, v2 transcript, and Plutus V3 validator.
Superseded / Consolidated Issues
This issue consolidates and supersedes:
- [PlonK] Optimize PlonK setup and prover with O(n log n) FFT / coset NTT polynomial evaluations #38 (
O(n^2)loops were already eliminated in PR ADR-0068: DSL soundness, PlonK scaling, MPF canonicality & gadget hardening #125 / ADR-0068; remaining large-circuit benchmarking/scaling is tracked in Section 3 above) - [PlonK] Introduce unified PlonKPipeline and PlonKKeys facade matching Groth16Pipeline #42 (
PlonKPipeline/PlonKKeysfacade — tracked in Section 3 above) - [On-Chain] Optimize PlonK on-chain verifier (PlonkBLS12381Lib) CPU budget on Plutus V3 #43 (
PlonkBLS12381Libon-chain Plutus V3 CPU optimization — tracked in Section 1 M3 above)
Related (kept open separately due to broader scope): #22, #107.
Metadata
Metadata
Assignees
Labels
assuranceIndependent testing, vectors, or audit evidencedesign-adrRequires an accepted ADR or security design before implementationenhancementNew feature or requestsecuritySecurity-sensitive correctness or trust-boundary work
Activity