BrainFuck gives PACT a known Turing-complete instruction model.
PACT gives BrainFuck a Bitcoin-anchored, publicly replayable execution history. The honest claim stays narrow: the interpreter runs off-chain, but the program, the data, the output, and the proof objects can be anchored on Bitcoin and replayed deterministically by anyone.
A minimal interpreter with explicit state.
BrainFuck uses a program counter and a data pointer over a mutable tape. In this PACT form the program tape and data tape are never mixed. Program addresses are program:0, program:1, and so on. Data addresses are cell:0, cell:1, and so on. Integer cells do not wrap in v0.1. Input remains intentionally unsupported.
Parsed instructions, visible PC, deterministic jump map.
The phase-2 loop demo is ++[->+<]. The current program counter is highlighted in orange. Matching brackets are explicitly paired in PROGRAM_MAP, so loop jumps do not depend on runtime guessing.
| FROM | TO | NOTE |
|---|---|---|
| program:2 | program:7 | jump here if current value is 0 |
| program:7 | program:2 | jump back while current value is not 0 |
Loops and output are now explicit in the trace.
The loop demo below shows pointer movement, bracket jumps, and value updates as distinct steps. When a bracket jumps, jump=true is recorded inside the trace object.
| STEP | OPCODE | PC | DP | VALUE | JUMP |
|---|---|---|---|---|---|
| 0 | + | program:0 -> program:1 | cell:0 -> cell:0 | 0 -> 1 | no |
| 1 | + | program:1 -> program:2 | cell:0 -> cell:0 | 1 -> 2 | no |
| 2 | [ | program:2 -> program:3 | cell:0 -> cell:0 | 2 -> 2 | no |
| 3 | - | program:3 -> program:4 | cell:0 -> cell:0 | 2 -> 1 | no |
| 6 | ] | program:7 -> program:3 | cell:0 -> cell:0 | 1 -> 1 | yes |
| 11 | ] | program:7 -> program:8 | cell:0 -> cell:0 | 0 -> 0 | no |
Data result, jump table result, and emitted output objects.
Three demos currently prove the staged rollout. basic proves pointer and cell mutation, loop1 and loop2 prove bracket matching, and output proves that . emits first-class OUTPUT objects.
| OBJECT | STATUS | NOTE |
|---|---|---|
| PROGRAM | ready | parsed instructions live in the interpreter |
| PROGRAM_MAP | ready | jump pairs are generated deterministically before execution |
| STATE | ready | pc and dp are explicit in the PACT state object |
| TRACE | ready | contains jump metadata for bracket instructions |
| OUTPUT | ready | emitted by the . opcode |
| BITCOIN ANCHORS | pending Wiard go | no sats have been spent for BrainFuck-specific objects yet |