Seedelf-Wallet

Seedelf in every transaction, kernel-checked

Kernel-checked proofs of exactly when each of Seedelf’s three deployed scripts accepts, in every transaction: no Blaster, no step limit, any number of signatories, any mint, any inputs. They rest on Lean’s own axioms alone (propext, Classical.choice, Quot.sound), and the #guard_msgs checks in Typed, PolicyTyped and AlwaysFalse fail the build otherwise. What they let us claim is in CLAIMS.md. The record of how they were built is in the archive: chunk 48.

The method is Lovejoin/Every’s, so read Lovejoin/Every/README.md first: the spec is the compiled code read back as Lean over Data, and there’s one Ev theorem per region, with induction for each loop. This page has what’s different here.

Building

The modules

Module Theorem What it says
Scalar dec_ap, dec_some, dec_none_le, dec_none_lt i_45, scalar.from_bytearray_big_endian: Some(n) when 0 ≤ n < q, else None
Prove prove_ev i_36 … i_41, schnorr.prove as compiled (proveOpt): z decodes, g decompresses, c decodes, g_r and u decompress, then g^z = g_r · u^c
Signers signer_loop i_51, list.has(extra_signatories, vkh), by induction on the list: any length
Register register_ev the Register’s spend (registerOpt): the proof, then field 8’s signatories
Datum datum_ev Some(d): exactly Constr 0 [B g, B u] is a Register, anything else accepts
Root wallet_root the whole wallet on any context Data: unitIf (walletBool ctx)
Typed wallet_exec_iff, wallet_exec_error, wallet_accepts_iff the wallet for every typed V3 ScriptContext, in wallet.ak’s terms (walletAccepts, schnorrProve)
AlwaysFalse always_false_errors always_false reaches Error on any argument, and never halts
PolicyBase ap_eqBS, ap_eqInt, ap_cons_ok, ap_cons_err the builtins at a cased result; the policy’s spec (burnOpt, mintOpt, tokenName)
Burn burn_ev the burn block: one line, own policy, slice(0, 4, tkn) = 5eed0e1f, amount -1
Mint mint_ev the mint block: one line, the first input’s reference, consByteString, own policy, token_name.generate, amount 1
PolicyRoot policy_root the whole policy on any context Data: unitIf (policyBool ctx), the xor
PolicyTyped policy_exec_iff, policy_exec_error, policy_accepts_iff the policy for every typed V3 ScriptContext, in seedelf.ak’s terms (policyAccepts, flatLine, seedelfName)

The flatten loops are LinesAllLoops’ and LinesAllAnyMint’s (flatten_apply_any), which were already kernel-checked.

Pitfalls already paid for

These are on top of Lovejoin’s.

Paths

Base.lean’s regAt is the Register check’s delay. The other wallet paths are suffixes of it: the decode, the check and the loop. Datum.lean’s datumAt is where Some(d) is bound. The policy’s burnBody and mintBody are the xor’s two arguments. Generate any new path with Lovejoin/Every/tools/ from pseudo.py’s printout, never by hand.

Plans and records