Tonolith is a deterministic 4-bit processor implemented as a TON smart contract.
The v1 design is intentionally chain-native: one immutable-program CPU contract stores compact architectural state and ROM, and permissionless internal messages advance bounded instruction batches. The runtime executor is an optimized architectural transition function designed for compact, deterministic on-chain execution.
Current status: Tonolith v1 has a single-instruction contract, canonical ROM/RAM layout, TypeScript assembler/emulator, differential trace, Fibonacci vector, fuzz and property tests, coverage, mutation evidence, gas snapshot, and a completed public testnet Fibonacci run. The implementation status and acceptance evidence are summarized below and in the linked release documentation.
- 18/18 Acton contract tests pass, including the 256-run fuzz test and the 97-step Fibonacci trace.
- 99.7% contract line coverage and 89.9% blended Acton coverage.
- 96.1% critical and major mutation score: 223 of 238 mutants killed.
- 19,527 gas measured worst-case accepted
Advancepath across 198 gas samples, withMAX_STEPS_PER_ADVANCE = 1. - 1,024 iterations in the deterministic TypeScript property test, with opcode, assembler, ROM, and differential test suites passing.
- 21-word Fibonacci program running inside a 1,024-word ROM and 256-nibble RAM architecture.
The Fibonacci instance completed on TON testnet in 98 account-history transactions: one deployment followed by 97 accepted one-instruction advances. The contract emitted the canonical sequence:
1, 1, 2, 3, 5, 8, 13
The final state is HALT at program counter 21 with instruction count 97,
output register 13, and core state hash
16925a27b1db66171cebb3d43c74702f06f4a362e302754f24026cca0a6bf2be.
- Open the Tonolith Fibonacci contract on TON testnet
- Open the deployment transaction
- ROM root:
029ccf15774f680518705bb7c8be4b2ca92f34a4ceb9c963e55609225398c748 - Static commitment:
50da71fe389768e885c8258c7f4f4a97b86598738eed974336d527e459024f08
The companion Tonolith Visualizer replays the public Fibonacci run as a working CPU: transaction timeline, instruction flow, registers, RAM, output events, and state-commitment changes are all shown in sequence.
Requirements:
- Acton 1.0.0;
- Node.js and npm for the TypeScript emulator, assembler, and tooling.
Initial local checks:
acton check
acton build
acton test
npm ci
npm run typecheck
npm test
npm run build
# Contract coverage and gas evidence
acton test --coverage --coverage-format text --coverage-minimum-percent 89
acton test --snapshot benchmarks/gas-v1.json --fuzz-seed 42
# Critical and major mutation gate
acton test --mutate --mutate-contract TonolithCpu --mutation-levels critical,majorThe selected MAX_STEPS_PER_ADVANCE is one instruction. The measured
worst-case accepted Advance path is 19,527 gas, below the v1 800,000-gas
ceiling. See docs/LOCAL_RELEASE.md for the complete
local evidence and docs/TESTNET.md for the public testnet
run record.
The testnet-only deployment runbook is docs/TESTNET.md, and
the Fibonacci script is scripts/deploy-fibonacci.tolk. It requires a funded
Acton wallet named tonolith-testnet; no wallet or secret is created by this
repository. See docs/CLAIMS.md for the evidence record and
release context.
Tonolith v2 is the versioned multi-core architecture under active engineering.
It adds an immutable TonolithCoreV2, versioned ABI and commitments, bounded
inboxes/outboxes, logical epochs, authenticated input delivery,
acknowledgements, retry-aware output dispatch, a permissionless bounded
AdvanceV2, a browser-safe SDK, an independent verifier, a testnet-only keeper,
and trace files that the Tonolith Visualizer
can consume.
The current local evidence includes 42/42 Acton tests, 74/74 TypeScript
tests, deterministic Fibonacci/CRC-4/cellular-automaton vectors, a two-core
counter pipeline, and a two-core 8-bit carry path. The v2 Fibonacci emulator
produces 1, 1, 2, 3, 5, 8, 13 in 97 one-step batches with final state hash
8238d6bbcd507f4a3b9cba3b1ad48b2d88fd6ab11f7068b75340a3f0044a9f1f.
The measured local V2Advance worst case is 47,997 gas. The selected
MAX_STEPS_PER_ADVANCE remains 1 until a real testnet gas reference and
the remaining action, storage, message-size, coverage, and mutation gates are
complete. The full v2 local release record,
batch-selection matrix, and
testnet validation ledger keep those evidence
levels separate. No v2 testnet deployment is claimed by the current branch.
Additional design references:
- docs/ISA.md — canonical instruction encoding and state model;
- docs/ROM.md — ROM/RAM cell layout and commitments;
- docs/ABI.md — messages, events, and error codes.
Tonolith defines a compact, deterministic architectural machine for TON. The repository separates executable implementation evidence, public-network observations, and broader interpretations so each release can be read at the level supported by its evidence.