Branch lovejoin-verification, from verification at 63cdb465. It stayed local until the fix was public: the xor32 fix merged into Lovejoin’s main as 29573c5 (PRs #165 and #166, 2026-11-05), and the branch went to main after it. The owner, 2026-11-03: “A lot of the seedelf web wallet depends on lovejoin working as well. Trickier and if something is found wrong then it would be bad for us to push it into this branch so maybe a local only branch until we prove it good?”
Status: ✅ done. Archived in 1.8.1’s release review, with what its PRs did at the end. What we claim from it, and where the claim stops, is CLAIMS.md; its rule for a property that comes back Falsified is in seedelf-verification’s README.
The work goes in seedelf-verification/Lovejoin/, beside Seedelf/, on the same pinned forks (chunk 41). The README’s rules for writing a property hold here.
| Step | Status |
|---|---|
| 1 · Setup, reference_holder and mix_box | ✅ 30 theorems (2026-11-03), every module in seconds, at most 525 MB |
| 2 · mix_logic’s easy parts | ✅ 6 theorems (2026-11-03) |
3 · serialise_data behind an opaque alias |
✅ #27’s commit on the fork (0a25f13, Rob van Leeuwen’s), in seedelf at 7fc0aa3, pinned on this branch; the Seedelf baseline unchanged |
| 4 · mix_logic, Owner | ✅ owner_withdraws_iff_proof (2026-11-03): the Lean vector’s z is Aiken’s, and a real proof halts after 3099 steps. Withdrawals of 1 to 3 boxes, every field symbolic (OwnClassic*, 9, on 68c5399): 1.8.0’s returns |
| 5 · mix_logic, Mix | ⬜ on v2 instead (step 8): the wallet moves to v2 alone, and the classic pool keeps only its Owner |
| 6 · fee_contract and one_shot_mint | ✅ on their templates, for every pool (step 8): OneShotMint (5) and FeeContract (5) (2026-11-03) |
| 7 · The token-pool templates | ✅ on v2 instead (step 8): the Mix for any token pool at n = 2 to 4. 8131b1d’s only mainnet pool (5 ₳) is empty |
| 8 · v2: the templates with xor32’s fix | ✅ (2026-11-03, PlutusCoreBlaster 68c5399), 230 theorems. On the test launch: MixChallenges (1), MixOutputs (4), MixDatums (3), Owner (1), the Mix iff at n = 2 (7) and n = 3 (13), and the templates for every pool (mix_box 29, one_shot_mint 5, fee_contract 5): 68. On mix_logic’s template, so for every pool: the Mix for any ADA or token pool at n = 2 to 4 (82), what it must pay (66), and Owner withdrawals of 1 to 4 boxes (OwnAny*, 14) |
| 9 · The wallet on v2 alone | ✅ 1.8.0, with chunk 44 (#363, #364); mainnet’s v2 5 ₳ pool (fcb3f5ec…) is live |
| 10 · Every transaction (the owner’s bar, 2026-11-04) | ✅ Seedelf, all three scripts (2026-11-05): the wallet with none to 128 signatories, always_false, the policy in every context, and kernel-checked covers (seedelf-verification’s README). v2 ✅: every script’s other purposes, mix_logic’s publish and reference_holder, 17 (./check.sh lovejoin-any-tx); mix_box’s spend (BoxPurposesAll.every_context_iff); mix_logic’s Owner and Mix withdrawals and one_shot_mint’s launch, kernel-checked, any list length (chunk 45, ./check.sh lovejoin-every) |
dev and #166 into main, 29573c5. The owner: the old pools hold 3 UTxOs and their users were told to leave, so the disclosure is fine. Lovejoin’s E2E job fails at installing Chromium on the runner’s Ubuntu 26.04, which the owner accepts (Lovejoin’s front end isn’t worked on).opaque-xor 68c5399, opaque-slice 96261cc), both pins on GitHub, and this branch into main, so the Seedelf work can branch from it.fcb3f5ec…): the template theorems already hold for it.Every transaction (2026-11-04): the same properties, with every field a script doesn’t read left as any Data (Seedelf’s AnyTx.lean, and AnyTxCover’s rfls for every V3 spend).
./check.sh seedelf-any-tx: 10 ok, 59 ✅, the longest run 1446 steps (a key missed among three signatories), at most 540 MB.
./check.sh 158 ok (PolicyBurn and PolicyMint fail on BitVec alone, as before) and ./check.sh seedelf-slice 10 ok. Every trace was recounted against its source: 377 ✅ and 7 controls Falsified, plus Slice’s 258 ✅ and 6. No trace logs a sorry.
gen-seedelf-signers.py, 250 ✅, the slowest 4 s at 355 MB). A 16,384-byte transaction holds at most 125.B fails, and mints of no lines or 2 to 5 lines fail (40 ✅).PolicyLinesAll and LinesAllAnyMint prove any mint that doesn’t flatten to exactly one line fails. They work by induction over the mint on a CEK evaluator (LinesAllCek). The chain’s budget allows about 3,000 lines.Slice/, a package of its own over PlutusCoreBlaster’s opaque-slice (96261cc, an opaque SliceByteString). It’s 256 per-index theorems and 2 off a byte, assembled in the kernel. Its spec was checked against Aiken on 9 contexts.AnyTxShapes and PolicyShapes show the scenarios are every V3 context. The policy’s cover assumes CardanoLedgerApiBlaster’s input and mint rules../check.sh lovejoin-any-tx: Template.AnyTxPurposes ok, 17 ✅, every parameter symbolic, so for every pool on v2’s templates.
open lines that named #import_uplc programs by namespace; those names are global (step 8’s second build).BoxPurposesAll.every_context_iff, and mix_logic’s Owner and Mix withdrawals by chunk 45, kernel-checked in every transaction. What that lets us claim is CLAIMS.md.What a Mix must pay, for every pool (2026-11-03, 68c5399): ./check.sh lovejoin-v2-outputs 24 ok, 66 theorems, the slowest module 61 s at 704 MB (MixTok4Outputs), the most memory 816 MB (MixTok4Datums). Each …OutSteps: honest halts after the general Mix’s own KAT count (11497, 19204 and 29007 for ADA at n = 2 to 4; 11798, 19505 and 29308 for tokens), and each of the eight changed outputs errors, long before the proofs are read.
What the claim can say: CLAIMS.md, with where it stops. This plan’s draft of 2026-11-03 limited it to Mixes and withdrawals of up to 4 boxes and to the scenarios’ layouts; chunk 45’s kernel-checked theorems lift both.
The wallet’s own code isn’t covered, but what a wrong Mix does is, for every pool (2026-11-03): V2/MixOutputs and V2/MixDatums hold at the test launch with two boxes alone, and the general Mix’s scenario fixes every box out as it should be, so it couldn’t say what a wrong one does. gen-lovejoin-mix-outputs.py takes them to mix_logic’s template, for the six families of the general Mix (ADA and token pools, n = 2 to 4), with the pool’s parameters, every box’s points and every proof field symbolic. It’s walk_outputs, so a Mix fails if:
…Outputs);…Datums).…Out’s mixCtxOuts) is the scenario’s Mix with its outputs given, and with the scenario’s outputs it is the scenario’s (mixCtxOuts_is_the_mix, by rfl). So each theorem changes one thing in the Mix whose iff the family proves.MixChallenges needs no lift: the general Mix’s spec has xor32 return none for a c of any other length, so a box with one fails its challenge theorem, for every pool and n = 2 to 4.v2’s general Mix (2026-11-03, 68c5399): ./check.sh lovejoin-v2-pools 42 ok: 82 theorems on mix_logic’s template, ADA pools at n = 2, 3 and 4 and token pools at n = 2, 3 and 4. Every pool parameter, box point and proof field is symbolic. The slowest module was 13 s at 740 MB (token pools at n = 4). Each family’s Steps: the KAT halts (11497, 19204 and 29007 steps for ADA at n = 2 to 4; 11798, 19505 and 29308 for tokens) with the spec true. Its first box’s or last box’s z changed errors with the spec false, and so does n = 2’s ADA KAT in a 5 ₳ pool.
Owner withdrawals of several boxes (2026-11-03, 68c5399): ./check.sh lovejoin-owner 35 ok, 23 theorems, the slowest module 9 s at 458 MB. The wallet withdraws one box a transaction (seedelf-wasm’s withdraw_in), but a withdrawal’s safety is about what anyone can build.
gen-lovejoin-owner.py): n boxes with every point and proof symbolic, a payer’s key input beside them, and two outputs, a Seedelf register at a wallet contract and then change, every field symbolic.OwnAny1* to OwnAny4*, any pool), and the deployed classic pool (OwnClassic1* to OwnClassic3*, 1.8.0’s returns).…Boxes), and with every proof verifying it succeeds (…Passes).Steps: honest proofs (box i (g1, x·g1), x = 0x5eed0e1f + i) halt with the spec true in all seven (v2: 3415, 4846, 6277 and 7708 steps for 1 to 4 boxes; classic: 3319, 4754 and 6189). z1 changed, the change a lovelace more, and two boxes’ proofs swapped each error with the spec false, all at the same step within a family: each breaks box 1’s proof, the change by moving the outputs it’s bound to.Everything on 68c5399 (2026-11-03): ./check.sh lovejoin 10 ok, ./check.sh lovejoin-v2 29 ok, 105 ✅: the classic pool’s 37 and v2’s 68. Every Steps line as before. V2/Mix3Steps: the KAT halts after 19204 steps, mixAccepts3 is true, and z11 or z33 changed errors (after 11486 and 18882 steps) with the spec false. The n = 3 theorems each solved in 0.02 s, at most 412 MB; (verbose: 1) is out.
Step 8’s Mix iff at n = 2, on 68c5399 (2026-11-03): MixFirst’ 3, MixSecond’s 3 and MixPasses’ 1 ✅, each solve 0.02 s and each module under 10 s at 366 MB, after the dependencies’ rebuild (93 s). V2/Steps unchanged on the new pin. The three tie-in lemmas elaborated. So a Mix of two moves boxes iff each box’s sigma-OR proof verifies against the boxes it pays, with every field of both proofs symbolic. (verbose: 1) is out.
V2/MixBranch, the diagnostic (2026-11-03): every uncompression (a constant input point, a constant output point, a symbolic t0) and z’s checks ✅; both equations ❌. The compiled UPLC (aiken uplc decode) shows why. DHTupleStatementPt is Data-encoded, so walk_outputs stores each box out’s point as bData(compress(uncompress a')), and each branch uncompresses it again. The script’s statement point is uncompress(compress(uncompress a')), the spec’s was uncompress a', and the solver can’t equate them over opaque builtins. branchHolds now takes the script’s form, and MixBranch is deleted.
precompute_statements’ comment says it saves N²−N uncompressions a Mix, but the record’s encoding undoes that. Each box out’s point is uncompressed, compressed, then uncompressed again in every branch: 2N + 2N² uncompressions and 2N compressions, where the comment counts 2N. While v2 isn’t launched, changing it costs no migration, but it changes mix_logic’s hash and its proofs re-run.
MixFirst’s second build (2026-11-03): mix_needs_the_first_challenge ✅ in 0.02 s, so the literal zero32 closed that gap. V2/Steps’ all-zero run errors after 7869 steps, spec false. Both branch theorems ❌ Falsified in under a second, so branchHolds and the script’s branch still differ somewhere. Each equation has the Owner’s shape (Valid on v2), and the stdlib’s from_int (n % field_prime), scale, add and equal match the spec. What the Owner never had is a constant point: there a and b are symbolic, while every Mix point is the KAT’s. V2/MixBranch (a diagnostic, run by name) takes box in 1’s first branch condition by condition: a constant point, a symbolic one, z’s checks, each equation. MixSecond didn’t finish in its first minutes, likely its own copy of the gap; it waits on this.
MixFirst’s first build (2026-11-03): ❌ Falsified in 0.6 s (Optimization 1.55 s), every field 32 zero bytes. With the real builtins that fails, since a 32-byte string isn’t a G1 point (V2/Steps now runs it): the solver passed it by its choice of the opaque functions. The likely cause: the spec’s zero32 was ofHex "00…", a recursive parser, where the script has a literal constant, so the xor folds started from different terms. Every other ofHex term is the scenario’s, on both sides. zero32 is a literal now, and each half is three theorems, so a second gap would name its check. The 85 ✅ stand: a term the solver can’t reduce only gives it more freedom, which can make a false Falsified, never a false Valid.
Step 8’s third build (2026-11-03): 18 ok, 1 TIMEOUT, every ok module in seconds, at most 523 MB.
V2/Steps: the KAT halts after 11497 steps, mixAccepts is true on it, and with z11 changed the script errors and the spec says false. v2’s Owner: valid halt after 3195, spec true; the other payout and z changed error, spec false.Template/Steps: at the classic L, each mix_box line is Lovejoin.Steps’ own, step for step, since the deployed script is the template applied. At v2’s L, v2’s withdrawal halts (1060) and the classic one’s errors (1089). The 5 ₳ pool’s own launch halts (1941); minting two or without the seed errors. A Mix’s fee halts (4393), a lovelace short errors, replenished halts (2933).owner_withdraws_iff_proof, the template’s 29 mix_box theorems, OneShotMint’s 5 and FeeContract’s 5. The classic mix_box modules, rebuilt under the xor alias, stayed ✅.MixProofs, the Mix iff as one theorem, ran past 30 minutes at 503 MB, its memory flat. The parts’ timed phases will say whether Lean or Z3 took the time. It’s now three theorems (V2/MixSplit), and MixProofs.lean is gone.Step 8’s second build (2026-11-03): MixOutputs’ 4 and MixDatums’ 3 Valid, in 10 s and 7 s at most 356 MB. V2/Logic failed on import Lovejoin.Scripts: #import_uplc and #prep_uplc names are global, whatever the namespace, so v2’s mixLogic met the classic pool’s (and appliedAmount Seedelf’s policy one). Now mixLogicV2 and appliedBoxValue; no bare mixLogic is left in V2/.
Step 8’s first build (2026-11-03): four ok. The KAT’s Mix halts after 11497 steps, and with its first box a lovelace over errors after 4802. mix_refuses_a_challenge_not_32_bytes is Valid in 3 s, peaking at 340 MB. The step 4 run in the same session: ten ok, 37 ✅.
Step 4’s first build (2026-11-03) failed on a name. toData is a class method, IsData.toData, so open CardanoLedgerApi.IsData.Class (toData) can’t name it. Fixed by opening (IsData). The second build was ✅.
Where everything was (chunk 41’s plan has where upstream stands since):
../blaster-forks/. The package pins the fork’s opaque-xor, 68c5399: seedelf 1e38b23, with the #71 and #72 review rounds, plus the xor alias. Slice/ pins opaque-slice, 96261cc, the same plus the slice alias.main at 29573c5. On main the fix is the cherry-pick ecc0313 of the owner’s 5cc3631, and every template builds byte for byte the same (extract-lovejoin-v2.sh, 2026-11-05).../lovejoin, for reading: git show c1239fb:contracts/… for the classic pool, and 8131b1d for the templates.Steps 2 and 3’s run (2026-11-03): eight ok, 36 ✅. mix_logic errors after 216 steps on minting, and on publish halts after 290 for its registration and errors after 290 for an unregistration. The Seedelf baseline was unchanged with #27’s alias pinned.
Step 1’s run (2026-11-03): seven ok, 30 ✅.
a = b halts after 889, three fields after 676;concrete/lovejoin_mix_box.sh.The rule is in seedelf-verification’s README (When a Lovejoin property comes back Falsified). This branch merged into main with the owner’s word, as #362.
c1239fb’s artifacts/mainnet/, from the 2026-09-26 deployment (Aiken v1.1.24), fully applied.extract-lovejoin.sh checks each against the hash seedelf-core pins (lovejoin::Protocol::of, mainnet). It checks mix_box and mix_logic against the reference scripts seedelf-core holds as they sit on chain (references.rs), the bytes the wallet spends against.c145c10f…, mix_logic 0dad3046…, fee_contract a072c7e8…, one_shot_mint f5592689… (the NFT policy), reference_holder 288fea77….8131b1d, seedelf-core’s templates.rs.
8131b1d was fetched into ../lovejoin on 2026-11-03 to read it. That checkout stays on its own branch.extract-lovejoin.sh: all five scripts ok, as above.concrete/lovejoin_mix_box.sh: ten one-input spends through Aiken’s evaluator, all as the source says:
a = b, a 47-byte a, the wrong constructor, three fields, I 7, no datum, and a well-formed datum stored by hash (audit finding F-2) all move with no withdrawal.Lovejoin/: Scripts (the imports), Box (the scenario: one box, the transaction’s only input), Steps (the concrete runs), and four property modules:
MixDatum (Constr 0 [B a, B b], both 48 bytes, a ≠ b). A well-formed box moves with mix_logic’s withdrawal of any amount, and not with another script’s or a key’s.Seedelf.WalletNoLock’s shapes cover. That includes a box stored by hash whatever its witness says (F-2), and holds for any redeemer.list.find, pairs.has_key). One box and one withdrawal, symbolic everywhere else, is the scenario.RegisterCredential certificate, for any credential, and fails for every other certificate.read_reference_datum looks for the pool’s NFT among the reference inputs. Fix one reference input holding it, with the deployed ReferenceDatum: denomination 10 ₳, 1 ₳ maximum fee per mix, and the three hashes.serialise_data behind an opaque alias ✅0a25f13 (its author kept), on our fork’s feat/opaque-serialise-data from main 1c23de8. It’s merged into seedelf as 7fc0aa3, which this branch pins. verification still pins c7d8741.serialise_data of the outputs and the input refs (Owner), and of the box value (Mix). PlutusCoreBlaster’s encoder can’t be translated (Lean-blaster #152, #153).encodeDataOpaque at the builtin’s dispatch.
seedelf branch, credited, as #72 took #29’s part.scalarOf does (README rule 7).concrete/lovejoin_owner.sh builds an Owner proof outside Lean, with Aiken’s evaluator for the curve points and serialise_data and Python for the hashes. The box is (g1, x·g1) with x = 0x5eed0e1f, the nonce is 0x1234567, and the proof is bound to a 9 ₳ payout. The deployed mix_logic returns unit for it, and crashes for the same proof with the payout a lovelace more, or with z changed.Lovejoin/Logic.lean holds the scenario: the reference input as it sits on chain (decoded from seedelf-core’s LOVEJOIN_MAINNET_REFERENCE), the box, one payout. It also holds the spec, ownerAccepts, line for line with validate_owner and schnorr.verify: the aliases, Int.fmod for scalar.from_int, and the G1 operations in the script’s order.Lovejoin/Owner.lean: owner_withdraws_iff_proof, with the box’s bytes, the proof and the payout’s key and amount symbolic.
Owner succeeds iff the box’s Schnorr proof verifies against ctx = blake2b_256(serialise(outputs) ‖ serialise(input refs) ‖ mix_script_hash). So an owner’s proof is bound to the transaction’s outputs and inputs, and can’t be replayed to redirect them.schnorr_kat.test.ak, mix_kat.test.ak), through Aiken and then Steps.schnorr.ak and bls.ak before writing the spec. point_from_bytes uses bytearray_to_integer (our alias) and the G1 operations, whose operand order the spec must follow (README rule 7).MixDatum.KILLED, split it by input, as chunk 40’s stop rules say.hash.ak’s Fiat-Shamir header calls from_int_big_endian on n. With n fixed it may evaluate away. If it reaches BitVec, it needs an IntegerToByteString alias, which chunk 41 deferred.PayMixFee and Replenish allow. Read it first.ReferenceDatum. On mainnet the seed (ba815aa5…#2) is spent, so the policy can never mint again, a ledger fact beside the theorem.V2/MixTok*), through mix_logic’s template. 8131b1d’s only mainnet pool (5 ₳) is empty, and the wallet moves to v2 alone.8131b1d’s scripts, applied to a launched pool’s parameters, after listing what changed from c1239fb and which theorems carry over.xor_bytearray(False, …), which truncates rather than fails. It’s committed as 5cc3631 on 8131b1d, with the owner’s eight boundary tests, in ../lovejoin-v2 (branch local/xor32-length-check).
../lovejoin, and its push URL is no-push-local-only.../lovejoin is back on its own branch with a clean tree: its untracked regression test and this folder’s patch, which carried it, are deleted (the owner, 2026-11-03), and the fix lives only in v2. This work never builds or runs a forged-challenge vector.templates_are_frozen’s hashes). A v2 pool still has its own P (its seed), L and M (mix_box applied to L).byteStringOp slices with String.dropRight and maps through UInt8. The fix is an opaque alias at the builtin, as chunk 41’s byteStringToInteger was: local/opaque-xor 96a36cb, from seedelf 7fc0aa3, push remote no-push-local-only.
opaque-xor, 68c5399.Lovejoin/V2/Mix.lean) is Lovejoin’s KAT mix_real_proofs_ada_pool_n2_passes as a full ScriptContext: its test launch (NFT policy abab…), its two boxes in and out, and its real proofs. extract-lovejoin-v2.sh applies mix_logic to that launch (60294352…).mix_refuses_a_challenge_not_32_bytes ✅. With the KAT’s four cs symbolic, a c of any other length, in any branch, fails the Mix. The rest of the proof stays the KAT’s (rule 4).V2/MixOutputs: no value leaves the pool. A box out anywhere but mix_box, with a stake credential or a reference script, with other lovelace than the box value, or with a token, fails the Mix (4 theorems).V2/MixDatums: a box out’s datum must be inline and well-formed, so every box paid out can be withdrawn (3 theorems).V2/Owner, step 4’s iff on v2. validate_owner and its libraries are the classic pool’s line for line, so the spec is Lovejoin.Classic’s, with v2’s mix_box hash.V2/MixSplit). The KAT’s transaction, with every field of both proofs symbolic, fails if box in 1’s proof doesn’t verify (MixFirst), fails if box in 2’s doesn’t (MixSecond), and succeeds with both (MixPasses). The spec is mixAccepts (V2/MixSpec, line for line with verify_pre). As one iff (MixProofs), it ran past 30 minutes.extract-lovejoin-v2.sh checks the classic pool’s mix_box and the 5 ₳ pool’s policy and fee_contract. So Lovejoin/Template/ takes the parameters as symbolic arguments, and its theorems hold for every pool on them, a v2 launch’s included.
Lovejoin.Classic’s 29 on the template (MixBoxPurpose, MixBoxGate, MixBoxNoLock).lovejoin, at reference_holder with no stake part or reference script, under a sane ReferenceDatum (OneShotMint, 5). With the ledger’s spend-once rule, a pool’s NFT exists once. mix_logic’s reference lookup relies on that.FeeContract, 5).V2/Mix3*): the KAT mix_real_proofs_ada_pool_n3_passes, generated from mix_kat.test.ak by a script and checked value for value (51 hex strings). The spec is n = 2’s unrolled for three, so each box’s four checks are four theorems, and Mix3Passes the converse.V2/MixAny*, V2/MixTok*, 82, written by gen-lovejoin-mix.py), and Owner withdrawals of 1 to 4 boxes (V2/OwnAny*, 14, by gen-lovejoin-owner.py). With the pool’s parameters symbolic, they hold for a real launch with no re-run.V2/Mix*Out*, …Outputs, …Datums, 66, by gen-lovejoin-mix-outputs.py): MixOutputs and MixDatums for every pool at n = 2 to 4.The owner, 2026-11-03: “if we did fix this and its formally verified then we could update lovejoin to only use this new contract since I think we almost already cleared out the old pools”.
MixOutputs, MixDatums) and the Owner iff, all Valid. mix_box’s source is the classic pool’s, unchanged (step 1’s gate), but its bytes take v2’s L, so the gate is re-run on them.templates.rs’s own rule), and so does the data layer’s copy, with the shared vectors re-recorded. Launches use v2 only, and pools on 8131b1d’s templates are shown only for their withdrawals.expect on left and right), “then continue with the formal verification on that new code base”, then the move (step 9).V2/MixAny*, mix_logic’s template).precompute_statements stays as it is. “So at N=4 which is the chain limit for a while if not forever, can be proven to be safe then we are good to go.”lovejoin-verification, into main, merged as c15603d5 on 2026-11-05): steps 1 to 8 and step 10’s first parts (Seedelf’s three scripts in every transaction, v2’s other purposes and mix_box’s spend), on the verification branch it was cut from (chunks 40 and 41), with the audit, and the pins on GitHub (97e168bf).d190f717): step 10’s last part, mix_logic’s withdrawals and one_shot_mint’s launch in every transaction, and CLAIMS.md.