Seedelf-Wallet

Chunk 46 · The proofs on IOG’s own tools

This plan came in on branch web-wallet/verification-on-upstream. Once the work starts, it happens in seedelf-verification/, on a branch of its own from main, and in the fork clones in ../blaster-forks/, as in chunk 41.

Status: 🚧 steps 1 and 3 done 2026-11-08; step 2 in progress: on #77 both kernel families pass, and so does Blaster’s Lovejoin but the Mix over a symbolic pool, which times out (2026-11-13). The owner: “a chunk about how we want to get this working in the main repo”.

Every theorem today is proved over our forks of Lean-blaster and PlutusCoreBlaster (lakefile.lean, and Slice/lakefile.lean). Done means: both lakefiles require both tools from input-output-hk, and every theorem still proves. Any theorem that doesn’t goes in the README’s Not proved, with its reason.

Chunks 40 and 41 are the record: the baseline, the rules and the fork setup. The main rule: the owner runs every build, through check.sh’s cap. None of it is repeated here.

Where it stands (2026-11-07)

Each patch our pins carry beyond IOG’s main, and how it gets there:

Patch In our pin Its way upstream State
#454, a datatype’s parameter names Blaster 25c0ee0 Lean-blaster #455 Open, and MERGEABLE since the rebase was force-pushed on 2026-11-08 (step 1), waiting on its reviewers. main’s line 928 still has the bug
The BLS12-381 operands in order PlutusCore 68c5399 PlutusCoreBlaster #73 Merged 2026-11-08 (8f76ba5)
encodeDataOpaque (#27’s serialise_data) 68c5399 #77 instead; #27 is a draft, silent since July —
xorByteStringOpaque 68c5399 #77 instead; never offered —
sliceByteStringOpaque Slice/’s 96261cc #77 instead; never offered —
byteStringToIntegerOpaque upstream main (#71) #77 removes it in favour of the definition Merged 2026-11-05
Fq1.t a Nat upstream main (#72) — Merged 2026-11-03

The upstream check of 2026-11-12

Steps

  1. ✅ #455 back to mergeable. Rebased in ../blaster-forks/Lean-blaster (2026-11-07) onto main 983f10f:
    • the fix is a1a2ccf and the test e540263, on fix/datatype-param-names;
    • local/455-test-only is the test alone on 983f10f (a0e68dd, push-guarded);
    • the comment and the PR body in ../blaster-forks/posts/ say so.

    The owner runs the check: the test should fail on the test-only branch and pass with the fix.

    • The first run (2026-11-07), under Z3 5.3.1, failed on both branches in the same way, on smt.case_split_relevant_first, before the bug: it showed nothing. Rerun it with Z3’s nightly first on PATH.
    • The rerun (2026-11-07), Z3 nightly 5.4.0 ff86ba7: the test-only branch failed with #454’s five errors (unknown sorts @ε and @β, @isInt (@PUnit)), and the fix gave four Valid and one Expected Falsified, in 29 s at 451 MB.
    • Posted (2026-11-08): the owner force-pushed (head e540263), PATCHed the body and commented. #455 shows MERGEABLE, waiting on its reviewers. The fork’s seedelf branch keeps 25c0ee0, which our pins use.
  2. 🚧 Our suite on #77, before it merges. What we find is worth a comment on #77 either way: it tests a design they’re reviewing on real scripts.
    • Set up (2026-11-08), nothing pushed:
      • The tools: ../blaster-forks/PlutusCoreBlaster-pr77, branch local/pr77-test. That’s #77’s head 4aa6e2a with #73 merged in (cae98df), push-guarded.
      • Our proofs: ../Seedelf-Wallet-pr77, a worktree of main on its own push-guarded local/pr77-test. Both of its lakefiles require that PlutusCoreBlaster by path, and Blaster stays on 25c0ee0, under Z3 5.3.1.
      • The changes: scalarOf calls PlutusCore.Bitwise.byteStringToInteger, and Slice/’s three slices call sliceByteString. No alias is left in either package.
    • First results (2026-11-08), every trace checked for #77’s path:
      • Seedelf.WalletRegister: ✅ Valid.
      • Slice.Pr77Probe, the policy’s rule at index 0 and at 255 over #77’s own slice: ✅ Valid both. The module took 395 s at 1,060 MB, with its package’s first build.
      • Slice.Pr77AnyIndex, the rule over a symbolic index from 0 to 255: ✅ Valid, in 2 s at 277 MB, with no sorry. #77’s consByteStringV2 builds the byte with byteStr, not UInt8, so one theorem can replace Index0–Index3’s 256.
      • Controls, so none of these is a vacuous Valid:
        • Slice.Controls, its six mutants now over #77’s slice: ✅ Expected Falsified, all six.
        • Slice.Pr77AnyIndexControls, over the symbolic index: ✅ Expected Falsified, all three. N1 flips the answer, N2 drops the prefix check, and N3 judges the run at idx by the rule at 255 - idx.
      • None of these needed Spec. Each property applies the same definitions on both sides, so Blaster proved them with the three primitives uninterpreted.
      • CardanoLedgerApiBlaster 9938562 built unchanged on #77.
    • The comment (../blaster-forks/posts/plutuscoreblaster-77-comment.md): posted by the owner 2026-11-08 (#77).
    • The full run (2026-11-08):
      • Slice/: every module ok, with all 256 per-index theorems, the two off-byte ones, the kernel’s combination of them (Rule) and Controls.
      • Seedelf: every module ok but four, each fixed in the scratch copy:
        • PolicyLinesAll, and LinesAllAnyMint through its import. cek_rfl’s whnf at default transparency stopped at #77’s @[irreducible] instByteViewString: an unsolved Decidable.rec on the minted name’s equality. Under withTransparency .all (whnf and isDefEq) both pass, and their theorems still depend only on propext, Classical.choice and Quot.sound.
        • PolicyBurn and PolicyMint, the README’s Not proved success theorems. On main they fail on BitVec. On #77 without Spec they come back Falsified, since the primitives are uninterpreted. With a PlutusCore.Bytes.Spec → premise, all four are ✅ Valid, in about 2 s each.
      • The four under Spec: no Falsified control, but the encoding has a model. Seedelf/Pr77SpecControls.lean holds Spec → False, a burn off #0 failing, a burn off #256 succeeding, and the mint judged by #1’s name. All four come back Undetermined at 60 s, since a Falsified needs Z3 to build a model of Spec’s quantifiers.
        • mpetruska’s answer (2026-11-08): PlutusCore.Bytes.spec proves Spec in the kernel. That settles Lean’s side, not Blaster’s translation.
        • The translation (2026-11-08): Seedelf/Pr77SpecModel.smt2 in the scratch worktree takes uncons, cpStr and byteStr as the real functions on SMT strings, alphabet 0x0–0x2FFFF. Z3 finds every conjunct holds of that interpretation (each negation unsat, a false sanity fact sat). Blaster writes each byte literal as one code point (Term.lean, strLitSmt).
        • So a Valid under Spec isn’t vacuous, and these four stand with the other Blaster results. The limit: the .smt2 is our transcription of Spec, not Blaster’s dump of it.
    • Blaster reports Undetermined as a warning, even under solve-result: 1, so check.sh says ok for it. The main tree’s logs on 2026-11-08: 1,466 Valid, 239 Expected Falsified, 0 Undetermined. ✅ check.sh now fails such a module as UNDETERM (#372).
    • The kernel families on #77 (2026-11-13), with the scratch worktree fast-forwarded to main 4e5ee500, so chunk 48’s Seedelf/Every/ is in:
      • A script moved every alias call left (Lovejoin/, Seedelf/Every/, Audit/, gen-lovejoin-owner.py) onto #77’s definitions:
        • .ofNat (byteStringToIntegerOpaque e s) became PlutusCore.Bitwise.byteStringToInteger e s, which is .ofNat of a Nat on #77 too;
        • xorByteStringOpaque became PlutusCore.Bitwise.xorByteString;
        • encodeDataOpaque became PlutusCore.Cbor.encodeData.
      • ✅ seedelf-every: 28 ok. lovejoin-every: 76 ok. No sorry, the headline theorems’ axiom guards hold (Lean’s three), and the peaks are main’s (Collect 12.8 GB, Mint 9.5 GB).
      • It took three changes:
        • Lovejoin.Every.Walk: ev_go computed the real encodeData of a literal Constr xt [B a, B b] into its CBOR, where the alias stayed folded, so the proof’s cases hx : encodeData … no longer matched. attribute [local irreducible] PlutusCore.Cbor.encodeData keeps it folded for the tactics. The kernel ignores the attribute, and the theorems state the real definition.
        • Seedelf.Every.PolicyTyped: #77’s consByteStringV2 writes the name’s byte with byteStr, and our seedelfName keeps UInt8. #77’s own consByteStringV2_eq_cons bridges them (one rw, and its import).
        • Seedelf.PolicyLinesAll: attribute [local semireducible] PlutusCore.Bytes.instByteViewString, #77’s route, replaces 11-08’s .all in cek_rfl. .all also unfolded the encodeData that Walk needs folded. So cek_rfl stays as on main.
      • The “check first” below, answered: the kernel proofs lean on an alias being opaque in one place, Walk’s literal Constr. Owner’s cases on encodeData of a symbolic list, Fold’s xor and Shared’s byteStringToInteger against q passed unchanged.
    • The migration, for step 4:
      • scalarOf, and the alias calls the script moves;
      • the three slices in Slice/Common.lean and two in Controls.lean;
      • the seal opened in PolicyLinesAll, encodeData kept folded in Walk, and seedelfName_eq’s bridge;
      • Spec on the four success theorems, discharged with PlutusCore.Bytes.spec;
      • Spec on every Mix challenge and success theorem, and LogicOwnerScalar’s spare exact dropped;
      • optionally Index0–Index3’s 256 theorems as one (Pr77AnyIndex, with its controls).
    • The Blaster Lovejoin families on #77 (2026-11-13), same worktree:
      • lovejoin (classic): 25 ok.
      • lovejoin-any-tx, all but the Mix: every module ok after two slips, both ours. LogicOwnerScalar’s last exact found no goal, since on #77 the simp before it closes it. The script wrote LogicOwnerHash’s qualified …Data.encodeDataOpaque as …Data.PlutusCore.Cbor.encodeData.
      • lovejoin-v2: 84 ok, among them every output, datum and owner module (OwnAny1–4). The 31 Mix modules failed, each on its challenge theorem (the xor of the cs) or its success theorem. Every branch theorem stayed ✅ Valid.
        • Without Spec, n = 2’s came back ❌ Falsified, on “bytes” above 255 (\u{113}): the primitives were uninterpreted. The rest stopped at Blaster’s 540 s.
        • Fixed pools: with PlutusCore.Bytes.Spec → on those theorems, all of Mix{First,Second,Passes} and Mix3{First,Second,Third,Passes} are ✅ Valid, in 6–9 s each.
        • Symbolic pools (MixAny*, MixTok*: M, bl and the token are variables): still past 540 s with Spec, at about 2.8 GB. Tried: MixAnyFirst, MixAnySecond, MixAnyPasses, MixTok2Box1. The challenge hashes the outputs’ datums, so the real CBOR of a datum with symbolic fields reaches the solver. With the alias, the spec and the script shared one folded encodeData.
      • lovejoin-any-tx’s Mix: 27 modules past 10 m: every Mix (2 to 4 boxes, ADA and token), their controls, MixIff and FeeMix. Their pools are symbolic too. A killed build prints no verdicts, so which theorems stall isn’t known.
      • Not yet tried: the audit.
    • So on #77 as it stands, Blaster’s Mix over a symbolic pool doesn’t prove. CLAIMS.md’s Lovejoin claim is the kernel’s (Lovejoin.Every), which passes, so what’s lost is a Blaster cross-check family, not a claim. Ways on, the owner’s call:
      • ask on #77 for a way to keep encodeData uninterpreted in a goal, sealed like the byte primitives or by a Blaster option;
      • prove in Lean the CBOR facts the challenge needs and give them as premises, as Spec is;
      • retire those modules for the kernel’s every-transaction proof, which covers every pool;
      • stay on the fork for them until one of these lands.
    • The follow-up: the owner added it to the first comment with --edit-last (2026-11-08). A short reply to mpetruska is ../blaster-forks/posts/plutuscoreblaster-77-reply-spec.md; the owner’s call.
    • Our slip: the follow-up suggested documenting the seal, which #77’s README and Bytes.lean’s header already do (attribute [local semireducible] PlutusCore.Bytes.instByteViewString, with_unfolding_all, decide +kernel). The first of these replaced our .all-in-a-tactic on 2026-11-13.
    • The tools. A local PlutusCoreBlaster branch, push-guarded as local/455-test-only is: #77’s head, plus #73. The two share no file but Tests/Basic.lean’s imports. None of our aliases.
    • Our side, on a branch from main:
      • Each alias call becomes the builtin’s definition.
      • Each Blaster goal that reads bytes gains PlutusCore.Bytes.Spec as a premise. PlutusCore.Bytes.spec discharges it in the kernel, so the stated theorem keeps its form.
      • Require the local branch by path only in an uncommitted scratch copy, never committed (chunk 41’s rule).
    • Cheapest first: Seedelf.WalletRegister alone, then Slice/’s rule over the real slice at one index, then the rest.
      • Keep each under the cap: the definitions may cost Blaster more than the opaque terms did.
    • Check first: whether Lovejoin’s kernel-checked proofs (chunk 45) lean on the aliases being opaque. A proof that rewrote over an uninterpreted xor or encodeData may need the definition’s lemmas instead.
    • If WalletRegister or the policy’s rule doesn’t prove on #77: say so on #77 with the minimal case, and keep our aliases.
  3. ✅ #73 merged 2026-11-08 (8f76ba5), approved by mpetruska: “Nice catch, thank you!”. No nudge needed.
  4. ⬜ Off the forks, as each fix lands.
    • #455 on main: require Blaster from IOG at that main commit, in both lakefiles, then lake update Blaster alone.
    • #73 and #77 on main: require PlutusCore from IOG at that commit, in both lakefiles, with step 2’s migration merged.
    • After each one:
      • run ./extract.sh and the Lovejoin extracts, ./check.sh, ./check.sh seedelf-slice, the Lovejoin families and audit-quick;
      • compare against chunk 40’s baseline and today’s counts;
      • re-read Lean-blaster #389 and #224.
    • Then the docs: CLAIMS.md’s “our fork” lines, and the README’s Running it, What a ✅ is worth and Not proved.
  5. Archive this file once both lakefiles name only IOG.

Carried from chunks 40 and 41

Who does what

As in chunk 41:

The owner’s decisions