{
  "schema": "blueprint-dag.v1",
  "id": "leanpcs-8288-privacy",
  "problem": "keccak-proving",
  "workstream": "W3-B",
  "title": "leanPCS (WHIR over KoalaBear^5) & EIP-8288 PQ Privacy Pool Settlement",
  "description": "Collaborative Lean 4 blueprint for KoalaBear quintic extension arithmetic packed in EVM uint256 registers, WHIR multilinear Reed-Solomon folding soundness, Fiat-Shamir Keccak transcript security, verify8288Batch bytecode refinement, malicious-builder soundness, and <20k amortized gas 2-in-2-out PQ privacy joinsplits.",
  "policyVersion": 8,
  "trunkEpoch": 0,
  "trunkCheckpointRef": null,
  "upstreamPins": {
    "toolchain": "leanprover/lean4:v4.36.0",
    "ethlibCommit": "212d502f4cdecf59985e427a7c31e5a623be5416",
    "supportingPackages": [
      "Verified-zkEVM/VCVio",
      "lean-crypto-foundations/QuantumFoundations",
      "Verified-zkEVM/PolyFun"
    ]
  },
  "nodes": [
    {
      "id": "W3B.KoalaBearQuinticIrred",
      "kind": "spec",
      "title": "KoalaBear Prime & Verified Quintic Irreducible Polynomial Spec",
      "statementSummary": "Proves p = 2^31 - 2^24 + 1 = 2130706433 is prime with 2-adicity 24 and establishes an algebraically verified degree-5 irreducible polynomial over F_p via Frobenius GCD checks (fixing naive X^5 - 3 reducibility when 5 does not divide p-1).",
      "leanTarget": {
        "modulePath": "lean/KoalaBearQuintic.lean",
        "topTheorem": "Wave3.PCS.koalaBear_quintic_irreducible"
      },
      "dependsOn": [],
      "status": "ready",
      "claim": null,
      "settlement": null,
      "decomposition": null,
      "ratchet": null
    },
    {
      "id": "W3B.PackedU256ExtArith",
      "kind": "lemma",
      "title": "Packed uint256 (5x31-bit) F_{p^5} Arithmetic EVM Refinement",
      "statementSummary": "Proves exact homomorphism between bit-packed uint256 five-limb EVM modular arithmetic (add/sub/mul/Frobenius) and the abstract F_{p^5} field ring without limb overflow.",
      "leanTarget": {
        "modulePath": "lean/PackedExtArith.lean",
        "topTheorem": "Wave3.PCS.packedU256_mul_correct"
      },
      "dependsOn": [
        "W3B.KoalaBearQuinticIrred"
      ],
      "status": "pending",
      "claim": null,
      "settlement": null,
      "decomposition": null,
      "ratchet": null
    },
    {
      "id": "W3B.WhirFoldSoundness",
      "kind": "lemma",
      "title": "WHIR 2^k-ary Multilinear Reed-Solomon Folding & STIR Proximity Soundness",
      "statementSummary": "Formalizes WHIR folding soundness error over F_{p^5} at 100+ bit post-quantum security using PolyFun and QuantumFoundations list-decoding bounds.",
      "leanTarget": {
        "modulePath": "lean/WhirSoundness.lean",
        "topTheorem": "Wave3.PCS.whir_fold_soundness"
      },
      "dependsOn": [
        "W3B.KoalaBearQuinticIrred"
      ],
      "status": "pending",
      "claim": null,
      "settlement": null,
      "decomposition": null,
      "ratchet": null
    },
    {
      "id": "W3B.FiatShamirGrinding",
      "kind": "lemma",
      "title": "Keccak-256 Fiat-Shamir Transcript & PoW Grinding Soundness",
      "statementSummary": "Proves VCVio random-oracle binding of the canonical 96-byte DepClaim96 block commitment (depsHash) and WHIR challenge squeezing with PoW grinding security.",
      "leanTarget": {
        "modulePath": "lean/FiatShamirGrinding.lean",
        "topTheorem": "Wave3.PCS.fiatShamir_grinding_sound"
      },
      "dependsOn": [
        "W3B.KoalaBearQuinticIrred"
      ],
      "status": "pending",
      "claim": null,
      "settlement": null,
      "decomposition": null,
      "ratchet": null
    },
    {
      "id": "W3B.VerifierBytecodeRefinement",
      "kind": "evm-refinement",
      "title": "verify8288Batch EVM Runtime Bytecode-to-WHIR Refinement",
      "statementSummary": "Proves via EthLib.Execution.Evm.runFrame that verify8288Batch(depsHash, B, whirProof) faithfully executes F_{p^5} sumcheck, Merkle query openings, and out-of-domain checks against the WHIR verifier spec.",
      "leanTarget": {
        "modulePath": "lean/VerifierBytecodeRefinement.lean",
        "topTheorem": "Wave3.PCS.verify8288Batch_refines_spec"
      },
      "dependsOn": [
        "W3B.PackedU256ExtArith",
        "W3B.WhirFoldSoundness",
        "W3B.FiatShamirGrinding"
      ],
      "status": "pending",
      "claim": null,
      "settlement": null,
      "decomposition": null,
      "ratchet": null
    },
    {
      "id": "W3B.MaliciousBuilder8288Sound",
      "kind": "lemma",
      "title": "Malicious Custom-Builder EIP-8288 Settlement Soundness",
      "statementSummary": "Proves that an adversarial block builder cannot forge or omit any 96-byte DepClaim96 in depsHash when settled against verify8288Batch, and shows how FOCIL closes builder censorship.",
      "leanTarget": {
        "modulePath": "lean/MaliciousBuilder8288.lean",
        "topTheorem": "Wave3.PCS.malicious_builder_soundness"
      },
      "dependsOn": [
        "W3B.VerifierBytecodeRefinement"
      ],
      "status": "pending",
      "claim": null,
      "settlement": null,
      "decomposition": null,
      "ratchet": null
    },
    {
      "id": "W3B.PqPrivacyPoolConservation",
      "kind": "lemma",
      "title": "2-in-2-out PQ Privacy Pool Value Conservation & Nullifier Uniqueness",
      "statementSummary": "Proves strict balance conservation and double-spend impossibility for hash-based commitment-nullifier 2-in-2-out privacy spends settled via EIP-8288 modeTag 0x00000004.",
      "leanTarget": {
        "modulePath": "lean/PqPrivacyPool8288.lean",
        "topTheorem": "Wave3.Privacy.pool_value_conservation"
      },
      "dependsOn": [
        "W3B.VerifierBytecodeRefinement"
      ],
      "status": "pending",
      "claim": null,
      "settlement": null,
      "decomposition": null,
      "ratchet": null
    },
    {
      "id": "W3B.GasRecord_Sub20kAmortized",
      "kind": "synthesis-record",
      "title": "Quantitative Gas Frontier: <20k Amortized EIP-8288 + leanPCS Batch Gas",
      "statementSummary": "Quantitative synthesis ratchet driving amortized per-claim EIP-8288 + leanPCS verification gas from the ~8,000,000 standalone STARK baseline down below 20,000 gas at B >= 256.",
      "leanTarget": {
        "modulePath": "lean/BatchGasRecord.lean",
        "topTheorem": "Wave3.PCS.amortized_gas_bound"
      },
      "dependsOn": [
        "W3B.VerifierBytecodeRefinement",
        "W3B.MaliciousBuilder8288Sound",
        "W3B.PqPrivacyPoolConservation"
      ],
      "status": "pending",
      "claim": null,
      "settlement": null,
      "decomposition": null,
      "ratchet": {
        "metric": "evm_gas",
        "direction": "minimize",
        "baselineValue": 8000000,
        "targetThreshold": 20000,
        "currentBest": null,
        "history": [],
        "open": true
      }
    }
  ]
}
