Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,16 @@ ci/lint/lint.sh

## Using the tools

The editable install adds five console scripts:
The editable install adds seven console scripts:

```
.venv/bin/bitlisp [tx.json] # REPL with stepping debugger
.venv/bin/bitlisp-run <program> [solution] <tx.json> # single-spend runner
.venv/bin/bitlisp-asm [text] # text to serialized bytecode hex
.venv/bin/bitlisp-disasm [hex] # serialized bytecode hex to text
.venv/bin/bitlisp-compile [source] # v0 language source to bytecode hex
.venv/bin/bitlisp-curry [hex] --arg <value> # fix values into a program
.venv/bin/bitlisp-uncurry [hex] # split a curried program back out
```

`bitlisp-run` reports the verdict, the emitted conditions, and the
Expand Down
14 changes: 10 additions & 4 deletions docs/execution-plan.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,13 @@ descriptions, and commit messages*
- [x] **Unit 6b: includes and the compile-time forms.** Split from unit 6 (decision by Evan, 2026-08-16): an include mechanism needs its own recorded decision against the self-containment rule, a program compiling identically pasted into the REPL. Scope expanded and resequenced ahead of unit 7 (decision by Evan, 2026-08-16, on a two-corpus census of tibetswap and chia-gaming): source-level include of shared constants and functions, computed compile-time constants, and inline functions. Every production puzzle file in both corpora imports shared definitions, and tibetswap defines nine of every ten functions inline. The census corrected the earlier deferral's premise: chia-gaming never abandoned source-level import, its compiled-sibling hash plumbing lives in its build layer outside the language, and that import stays deferred with `bitlisp-compile -T` covering the need manually in v0. `let` stays out, two uses across both corpora, both in tests. `assign` stays held on unit 7 evidence with a pre-registered trigger: benchmark-puzzle helpers that exist only to name intermediate values. Landed 2026-08-16 as `include`, computed `defconstant`, and `defun-inline`, stated in `docs/lang/language.md`. Decisions by Evan, 2026-08-16, via the approved unit plan: the self-containment rule is amended to the form plus its include files resolved through the same explicit search path everywhere, a repeat include dedupes by resolved file and a cycle errors where the classic reference dies on the collision or recurses without bound, `defconstant` evaluates its value on the reference VM under the default budget (a pinned break with unit 4's verbatim semantics, the modern defconst behavior under the classic keyword), and `defun-inline` keeps call-by-name laziness while closing classic's probe-verified sharp edges: arity checked, quoted content untouched, shadowing impossible, expansion depth-capped. Compiled representatives joined `compiled-programs.json`.
- [x] **Unit 6c: the macro reversal.** Landed 2026-08-16 as the removal of `defmacro`, `qq`, and `unquote` and the addition of `assert`, `and`, and `or` as fixed compiler forms with classic utility_macros semantics, reversing unit 6 (decision by Evan, 2026-08-16, both sides steelmanned under ground rule 3). The evidence: three usage surveys (Chia's canonical 91-puzzle corpus, the corpora vendored in references/, and chia-gaming) found no novel macro in any deployed puzzle, short-circuit assert, and, and or the entire production vocabulary, and chia-gaming's production referee choosing built-in destructuring over the structural macro sitting unbuilt beside it. The reserved-word set change breaks compatibility in both directions, pinned by the loader test. Compiled representatives joined `vectors/vm/compiled-programs.json`, and `macro-programs.json` left with the feature.
- [x] **Unit 6d: the forms two puzzles asked for** (added 2026-08-22, decision by Evan, skeleton change under ground rule 6): `let` with several bindings, compiled as the naming helpers are written by hand, `list*` consing its arguments onto a tail, the list library completed, and a shared puzzle test harness. Evidence: the eight authoring observations in `docs/puzzles/singleton.md`. Declared widths for curried values stay on the typed v1 ledger. Sequenced after the identity-assert rework and before the payment pool, so the remaining puzzles are written with the forms rather than rewritten. Landed 2026-08-23: `let` compiles as the one-shot naming helper with parallel bindings matching the modern Chialisp dialect, `list*` is a recorded tooling divergence, `append`, `reverse`, `sum`, and `last` complete `puzzles/lib/list.blib`, and `python/tests/puzzle_support.py` owns the shared harness. Compiled representatives joined `compiled-programs.json`, and both puzzles' bytes did not move.
- [ ] **Unit 7: the four benchmark puzzles, written in the language, as the acceptance artifact:** vault, payment pool, async offer, singleton wrapper. This phase makes them exist and run, Phase 4 measures them. One PR per puzzle where size warrants. Style constraint (decision by Evan, 2026-08-16, simplified by unit 6c, widened by unit 6b's resequencing): the puzzles are plain functions, the fixed forms, and the unit 6b surfaces, there being no macro system, and the authoring experience feeds the typed v1 gate's ledger note on whether unit 6c's cut ever binds. Vault first, resequenced ahead of the pool (decision by Evan, 2026-08-16): core semantics match BIP-345, one PR, plus the keyless leader/follower consolidation path over the message ledger with its theft vectors, the evaluation doc's section 3.2 benchmark. Recovery posture is a curried per-instance choice, keyless or keyed (decision by Evan, 2026-08-16). The vault's dispatch helpers exist only to name a reconstructed root once, the pre-registered assign trigger firing, evidence for the unit 7 ledger note. Singleton wrapper second, landed 2026-08-22 (PR 59), resequenced ahead of the pool and the offer: the Chia shape does not port, because a txid commits input outpoints but not input scripts and no VM operator performs the taproot tweak, so the lineage scriptPubKey is constant per launch and the state rides in a tagged OP_RETURN of the creating transaction, read back through two transaction preimages. The constant scriptPubKey is the built shape, both sides stated in `docs/puzzles/singleton.md` (decision by Evan, 2026-08-22, on the census below), and the taproot-tweak operator condition-record decision 3 declined is flagged for the Phase 4 gate with this puzzle as the case that answers decision 3's objection. The helpers that name a txid and an inner hash once are the assign trigger firing again. Value question answered 2026-08-22 in that doc (census of the vendored Chia corpora plus the Bitcoin constructions): Ark, Lightning, vaults, and pools get identity from the root outpoint and need no singleton, the lineage machinery is what the fungible asset token needs, and the remaining lineage effort belongs there. The token is a capability-and-risk study, not a goal: BitLisp does not want fungible asset tokens on Bitcoin, it wants to know what the vocabulary can build and what that exposes (decision by Evan, 2026-08-22). The name BAT1 applies if a standard is ever written. Eight authoring observations across the vault and the singleton are recorded there for the ledger. The fungible asset token joins the unit as a capability-and-risk study (decision by Evan, 2026-08-22): not a goal, built on the singleton's lineage machinery to know what the vocabulary can build and what it exposes, BAT1 only if a standard is ever written. Remaining order: the identity-assert rework of both landed puzzles, unit 6d, then the payment pool, the async offer, and the token study.
- [ ] **Unit 7: the four benchmark puzzles, written in the language, as the acceptance artifact:** vault, payment pool, async offer, singleton wrapper. This phase makes them exist and run, Phase 4 measures them. One PR per puzzle where size warrants. Style constraint (decision by Evan, 2026-08-16, simplified by unit 6c, widened by unit 6b's resequencing): the puzzles are plain functions, the fixed forms, and the unit 6b surfaces, there being no macro system, and the authoring experience feeds the typed v1 gate's ledger note on whether unit 6c's cut ever binds. Vault first, resequenced ahead of the pool (decision by Evan, 2026-08-16): core semantics match BIP-345, one PR, plus the keyless leader/follower consolidation path over the message ledger with its theft vectors, the evaluation doc's section 3.2 benchmark. Recovery posture is a curried per-instance choice, keyless or keyed (decision by Evan, 2026-08-16). The vault's dispatch helpers exist only to name a reconstructed root once, the pre-registered assign trigger firing, evidence for the unit 7 ledger note. Singleton wrapper second, landed 2026-08-22 (PR 59), resequenced ahead of the pool and the offer: the Chia shape does not port, because a txid commits input outpoints but not input scripts and no VM operator performs the taproot tweak, so the lineage scriptPubKey is constant per launch and the state rides in a tagged OP_RETURN of the creating transaction, read back through two transaction preimages. The constant scriptPubKey is the built shape, both sides stated in `docs/puzzles/singleton.md` (decision by Evan, 2026-08-22, on the census below), and the taproot-tweak operator condition-record decision 3 declined is flagged for the Phase 4 gate with this puzzle as the case that answers decision 3's objection. The helpers that name a txid and an inner hash once are the assign trigger firing again. Value question answered 2026-08-22 in that doc (census of the vendored Chia corpora plus the Bitcoin constructions): Ark, Lightning, vaults, and pools get identity from the root outpoint and need no singleton, the lineage machinery is what the fungible asset token needs, and the remaining lineage effort belongs there. The token is a capability-and-risk study, not a goal: BitLisp does not want fungible asset tokens on Bitcoin, it wants to know what the vocabulary can build and what that exposes (decision by Evan, 2026-08-22). The name BAT1 applies if a standard is ever written. Eight authoring observations across the vault and the singleton are recorded there for the ledger. The fungible asset token joins the unit as a capability-and-risk study (decision by Evan, 2026-08-22): not a goal, built on the singleton's lineage machinery to know what the vocabulary can build and what it exposes, BAT1 only if a standard is ever written. Resequenced 2026-09-05 (decision by Evan, skeleton change under ground rule 6, on the whole-repo review in PR 66): the commitment scheme (unit 8) and the vault measurement (unit 9) come before the pool, because the vault's serialized program is 2,562 bytes, about 640 vb under the witness discount before its solution, control block, and transaction, against the 526 vb single-exit gate and the evaluation doc's 336 to 374 vb envelope estimate. Remaining order: unit 8, unit 9, then the payment pool, then the async offer. The token study leaves the unit: deferred past Phase 5, built only if a reviewer asks what the vocabulary exposes.
- [ ] **Unit 8: the commitment scheme** (added 2026-09-05, decision by Evan, pulled forward from Phase 4): `spec/SPEC.md` sections 2 and 3 written as a real design with the vault as the workload. The leaf version, what the leaf commits to, the witness layout, per-path leaves so a spend reveals only the executed path, the currying discipline, and whether shared library code (`tx-wire`, `curry-hash`) is committed once or revealed per spend. A Fable design session, landing in `spec/` before any code. The singleton's constant-scriptPubKey workaround is the first case it must answer.
- [ ] **Unit 9: the vault measured under unit 8** (added 2026-09-05, decision by Evan): the vault re-pinned under the commitment scheme and every spend path's vbyte total recorded in the evaluation doc against the 526 vb gate, pass or miss. The number decides the pool's shape and the compiler question below before the pool is written.

**Standing constraints:**

- **Language frozen** (2026-09-05, decision by Evan): no new special forms, library surfaces, or authoring conveniences until a puzzle shows a gap that costs witness bytes. The one language question left open is code size: whether the compiler gains an optimizer (environment rebuild per call, `let` at one apply plus one cons per binding) or the benchmarks take the pre-registered hand-written fallback, decided on the unit 9 number.
- **Hard scope boundary.** v0 is a small s-expression language with Chialisp-class ergonomics, BitLisp-native, no BLS vocabulary. Out of scope: static types, a Rue-class frontend, editor tooling, optimization beyond the obvious. The typed v1 question is a separate gate after Phase 5 review (ledger notes: 2026-08-11, types would let the REPL print by known type. 2026-08-16, whether the unit 6c macro cut holds for v1, decided on the unit 7 authoring experience. 2026-08-22, eight observations from two puzzles in `docs/puzzles/singleton.md`: `let` first, domain guards as the typing evidence, a standard list library, `list*`, a shared test harness, and a Phase 4 encoding-operator cost question).
- **Compiler correctness story.** The compiler sits outside spec-before-code, but compiler bugs become fund-loss bugs for users: every construct gets compile-and-run tests against the reference VM, and every compiled benchmark puzzle is pinned as a vector the same day.
- **Fallback, pre-registered:** if v0 slips, Phase 4 proceeds with the stock Chialisp toolchain off-tree, constrained to the CLVM intersection. The stopgap never enters the tree. The fallback covers the language units only; the front end does not slip out of the phase.
Expand All @@ -104,7 +107,9 @@ descriptions, and commit messages*

**Goal:** replace every (est.) in the evaluation doc; make the gate empirical; settle the hardened-impl structure.

- [ ] Serialize the benchmark puzzles. Measure bytes.
- [ ] Serialize the benchmark puzzles. Measure bytes. The vault's first-order number moved to Phase 3 unit 9 (2026-09-05).
- [ ] One honest comparator, not eight (2026-09-05, decision by Evan): a CTV plus CSFS pool exit from the current public work, measured the same way as ours, replaces the roadmap's benchmark-per-candidate item. The other candidates keep their (est.) columns and the essay says so.
- [ ] The weight mapping before any "fits the gate" claim (2026-09-05): cost units are CLVM's and the gate is in vbytes, and nothing about fees can be said until the bridge exists.
- [ ] Measure what a transaction-parsing or fixed-width encoding operator family would remove from a lineage spend's cost and bytes before deciding one (added 2026-08-22, decision by Evan): the singleton's serialization library is the workload, and the preimage bytes stay in the witness either way.
- [ ] Revisit the taproot tweak operator condition-record decision 3 declined, at the asset token study (added 2026-08-22, decision by Evan): the singleton answers decision 3's objection, and the token decides whether state in the scriptPubKey is worth a point multiplication.
- [ ] Commitment-hash utility for the front end (queued 2026-08-14): a command printing what a scriptPubKey commits to. Deferred here because the commitment scheme decides its output.
Expand All @@ -126,13 +131,14 @@ descriptions, and commit messages*

**Goal:** the confidence experiment.

- [ ] Essay from the evaluation doc spine, open problems stated plainly.
- [ ] Narrow hostile review of `spec/VALIDATION.md` now, not after Phase 4 (2026-09-05, decision by Evan): the validator is finished, it is the novel surface, and a structural finding there reworks everything built on it. One reader who wants it to be wrong, given the spec, the vector runner, and the invariant suites. The fresh-reader predictability exercise owed from Phase 2 runs as part of it.
- [ ] Essay from the evaluation doc spine, open problems stated plainly, at a tenth the length of the record docs.
- [ ] Publish `spec/` publicly with the essay.
- [ ] Website: bitlisp.org (bitlisp.com and .net redirect) serving the essay, rendered spec, and docs from a pinned commit. The site never gates sharing.
- [ ] In-web playground once the site exists: Pyodide running the real Python reference VM and the v0 compiler. A JavaScript reimplementation is explicitly rejected.
- [ ] Delving Bitcoin post; direct note to AJ with the measured artifacts and an invitation to break VALIDATION.md.
- [ ] Track objections and revise the evaluation doc against them, including downward.
- [ ] Owed from Phase 2: the fresh-reader predictability exercise.
- [ ] Owed from Phase 2: the fresh-reader predictability exercise, folded into the validator review above (2026-09-05).

**Done when:** essay live; at least 3 substantive external technical responses engaged; the evaluation doc revised against actual objections.

Expand Down
Loading