Plan and prerequisites

This plan gives the order of the book, what you have at the end of each part, and, for every chapter, its dependencies, what "done" means and the specifications it implements. Chapters 1–4, 8, 9, 11, 13–16, 18, 23, 24 and 27 moved here from Nostr From Scratch, whose chapters 1–13, 15 and 18 they were; their rows keep Nostr's done criteria. The other chapters are new; each row says whether it is implemented or planned.

The book ends in a full Bitcoin node of our own, written in Coax. It validates every consensus rule, keeps the chain state, syncs mainnet from genesis, relays transactions and blocks, keeps a mempool, and answers the RPCs wallets and Lightning call. Bitcoin Core is the reference. Our node must reach the same verdict as Core on every block. The full node below says which parts build it and how it earns trust.

What you need first

  • The Coax language: Coax book Parts I–III.
  • A built compiler: coax/build.sh.
  • No outside cryptography, Bitcoin or Lightning library. libsecp256k1, Bitcoin Core and other implementations appear only in tests and in comparisons (Parts XII, XIV and XVIII), never in the code the book builds.

The order

PartChaptersWhat you have at the end
I. Foundations1–3Bytes, big integers and the constant-time rules every later chapter follows.
II. Hashes, MACs and ciphers4–12Every hash, MAC and cipher Bitcoin and Lightning use, each checked against its published vectors.
III. secp256k113–18The curve from field arithmetic to scalar multiplication, point encodings and keys.
IV. Signatures19–25ECDSA as Bitcoin uses it, BIP-340 Schnorr signatures and batch verification.
V. Encodings and addresses26–30Base58Check, Bech32 and Bech32m, addresses and output descriptors.
VI. Keys from words31–33BIP-39 seed phrases, BIP-32 hierarchical keys and the standard derivation paths.
VII. Transactions and script34–40Transactions, their IDs, the script interpreter, signature hashes, timelocks and fees.
VIII. Taproot41–45The key tweak, script trees, the Taproot signature hash and tapscript.
IX. Blocks and consensus46–57Merkle trees, headers and proof of work, the chain parameters, every consensus rule with the chapter that checks it, and the UTXO set.
X. Chain state and storage58–64Connecting and disconnecting blocks, the block index, reorganizations, block files, a key-value store of our own, the coins cache and pruning.
XI. The network65–75P2P messages, BIP-324 encrypted transport, the handshake, peer discovery and connections, denial-of-service limits, headers sync and block download, compact blocks, filters, and Tor and I2P.
XII. Initial block download76–80From genesis to the tip: parallel script checks, faster verification, assumevalid, AssumeUTXO, and a mainnet sync whose UTXO set matches Bitcoin Core's.
XIII. The mempool and policy81–88Standardness, mempool acceptance, transaction relay, replacement, packages, eviction, fee estimation and block templates.
XIV. Operating the node89–93The node as a program: configuration and shutdown, the RPC and REST interface, indexes, notifications, and shadow mode beside Bitcoin Core.
XV. Wallets94–99PSBTs, coin selection, message signing, silent payments, miniscript and a descriptor wallet on our node.
XVI. Many signers100–103Multisig, MuSig2, FROST threshold signatures and adaptor signatures.
XVII. Lightning104–115Lightning built in Coax on our node: messages, the Noise handshake, channels, onions, gossip, payments, invoices and offers.
XVIII. Interop and verification116–120Test vector provenance, differential tests, Bitcoin Core's functional tests against our node, fuzzing and formal properties.
XIX. Bitcoin in OpenAgents121–124Where OpenAgents uses the stack: our node on Pylons and Metaverse OS, one seed, agent treasuries and paid requests.

Each part uses only earlier parts, except where a chapter's dependencies say otherwise. Nostr From Scratch needs Parts I–V.

The full node

Until 2026-11-02 the plan stopped at a bounded block-validation profile (the old chapter 50) and said it was not a node. Parts I–VIII and the first chapters of Parts IX and XI (Merkle trees, headers, retargeting, the witness commitment, the UTXO set, P2P messages, BIP-324, compact blocks and filters) are the pieces a node is made of, but they are not a node. A node also needs:

Missing pieceWhere it is now
Chain parameters for mainnet, testnet4, signet and regtestChapter 50
Every consensus rule, not a profile: time and version rules, buried deployments, checks outside script, sigop and weight limits, the subsidy, script flags by height and their historical exceptionsChapters 51–57
Connecting and disconnecting blocks with undo data, the block index, reorganizationsChapters 58–60
Storage: block files, our own key-value store (Core uses LevelDB), the coins cache with crash-safe flushes, pruningChapters 61–64
Peers: the handshake and feature negotiation, the address manager, outbound and inbound connection management, denial-of-service limits, Tor and I2PChapters 68–71 and 75
Initial block download: headers sync, parallel block download, the signature cache, parallel script checks, faster verification, assumevalid, AssumeUTXOChapters 72 and 76–80
The mempool and relay policy: standardness, acceptance, relay, RBF and TRUC, packages, eviction, fee estimation, block templatesChapters 81–88
Operation: the process, JSON-RPC and REST, indexes, notificationsChapters 89–92
Evidence that it agrees with Bitcoin CoreChapters 80, 93, 117 and 118

Wallets (Part XV) and Lightning (Part XVII) then run on our node instead of on a third-party chain source.

What "a full node" means here. Chapter 80 is the milestone. The node syncs mainnet from genesis over the public network. Its UTXO set at a pinned height must equal Bitcoin Core's: gettxoutsetinfo gives the same hash_serialized_3 and muhash. Chapter 93 runs the node in shadow mode beside Core. Chapter 118 runs Core's own functional tests against it.

Consensus is a compatibility problem. A second implementation is dangerous in one way: if it disagrees with Core about one block, it splits from the network. Reimplementing the rules is not enough. The node must also reproduce Core's historical behaviour, including its bugs: the BIP-30 exception blocks, the OP_CHECKMULTISIG dummy element, FindAndDelete, SIGHASH_SINGLE with no matching output, and the script flag exceptions. Four rules follow:

  • Every consensus rule is in chapter 57's rule table. Each row names the chapter that checks the rule and a block that breaks it.
  • Bitcoin Core is pinned to one revision in chapter 116: ddea9196, a master revision of 2026-11-02 past v32, not a release. Policy that changes between releases (standardness, mempool limits, OP_RETURN size) follows that revision.
  • Until chapters 80, 93 and 118 are done, our node decides no money for OpenAgents on its own. A wallet or Lightning decision checks Core's verdict as well.
  • The node is not file-compatible with Core's chainstate. Chapter 61 reads Core's blk*.dat files so you can import them. Everything else uses our own formats.

What stays out. The GUI, Core's built-in wallet (Part XV builds a descriptor wallet instead), and the legacy BIP-37 bloom-filter service. Chapter 75 covers Tor and I2P. CJDNS, UPnP and NAT-PMP are left out until there is a need.

Every chapter

Part I. Foundations

ChapterDepends onDone meansSpec
1. Bytes, hex and base64 — implementedcoax:5, coax:6Every RFC 4648 test vector for base64 (coax/tests/vectors/upstream/rfc/rfc4648.txt) passes, and every non-canonical form refuses. Hex and base64 round trips hold for every length up to the profile limit in a #forall check. coax mutate leaves zero survivors on the codec files.RFC 4648
2. Big integers in fixed limbs — implemented1, coax:13Limb operations match the big-integer oracle on edge values: 0, 1, p - 1, 2^256 - 1 and values at each magnitude bound. A #forall check confirms no intermediate exceeds its declared bound. Native and wasm builds give the same bytes.—
3. Constant-time rules and secrets — implemented1, 2, coax:23A leaky branch fixture and a leaky index fixture are each detected by the timing harness. The constant-time checker refuses a seeded secret-dependent branch with its diagnostic. Every secret buffer in Parts II–V is erased on success and on every failure path.—

Part II. Hashes, MACs and ciphers

ChapterDepends onDone meansSpec
4. SHA-256 — implemented1Every NIST CAVS 11.0 vector in coax/tests/vectors/upstream/nist/SHA256ShortMsg.rsp and SHA256LongMsg.rsp passes. Every split of a 1,000-byte message gives the same digest. The compression kernel moves out of the compiler-fingerprint module without changing a digest.FIPS 180-4
5. SHA-256d and tagged hashes — implemented4The txids of pinned mainnet transactions and the genesis block hash match their published values. The tag hashes for BIP0340/challenge, TapLeaf, TapBranch, TapTweak and TapSighash match the BIP texts.BIP-340, BIP-341
6. RIPEMD-160 and HASH160 — implemented1, 4The test vectors in the RIPEMD-160 paper pass. HASH160 of BIP-32 vector 1's master public key gives its published fingerprint.RIPEMD-160 (Dobbertin, Bosselaers and Preneel, 1996)
7. SHA-512 — implemented1, 4Every NIST CAVS vector in SHA512ShortMsg.rsp and SHA512LongMsg.rsp passes.FIPS 180-4
8. HMAC-SHA256 — implemented4RFC 4231 SHA-256 cases 1–7 (coax/tests/vectors/upstream/rfc/rfc4231.txt) pass. A tag that differs in one bit is refused by the constant-time comparison.RFC 2104, RFC 4231
9. HKDF — implemented8RFC 5869 SHA-256 cases 1–3 (coax/tests/vectors/upstream/rfc/rfc5869.txt) pass. An expand request of 255 * 32 + 1 bytes refuses.RFC 5869
10. SipHash-2-4 — implemented1, 3, 5The 64 vectors of the SipHash reference implementation pass.SipHash (Aumasson and Bernstein, 2012)
11. ChaCha20 — implemented1RFC 8439 sections 2.3.2 and 2.4.2 vectors (coax/tests/vectors/upstream/rfc/rfc8439.txt) pass. A request that would pass counter 2^32 - 1 refuses.RFC 8439
12. Poly1305 and ChaCha20-Poly1305 — implemented11, 3RFC 8439 sections 2.5.2 and 2.8.2 vectors pass. A tag that differs in one bit refuses and releases no plaintext.RFC 8439

Part III. secp256k1

ChapterDepends onDone meansSpec
13. Field arithmetic mod p — implemented2, 3Every operation matches the big-integer oracle on edge and random values. Inverse and square root use fixed chains, checked by the constant-time harness. Zero mutation survivors in secp_field.coax.SEC 2
14. Scalars mod n — implemented2, 3Scalar operations match the big-integer oracle. Out-of-range keys and s values refuse, each with its own status.SEC 2, BIP-340
15. The secp256k1 group law — implemented13Group laws hold on random points: associativity, P + (-P) = O, 2P = P + P. lift_x refuses every x whose x^3 + 7 is not a square.SEC 1, SEC 2
16. Scalar multiplication — implemented14, 15, 3All three paths give the oracle's point for random and edge scalars (0, 1, n - 1). The constant-time paths pass the timing harness with leaky controls detected.SEC 2
17. Point encodings: compressed, uncompressed and x-only — implemented15Compressed, uncompressed and x-only encodings round-trip for random points. Hybrid encodings (0x06, 0x07) and points off the curve refuse.SEC 1, BIP-340
18. Keys and randomness — implemented14, 3, 16A key drawn on each host is a valid scalar, and a forced out-of-range draw is retried. A signer reply with the wrong ID, pubkey or body is refused.BIP-340

Part IV. Signatures

ChapterDepends onDone meansSpec
19. Verify ECDSA — implemented5, 14, 16, 17Every case in Wycheproof's ecdsa_secp256k1_sha256_bitcoin_test.json gives its expected result. A high-S signature refuses under the low-S rule.SEC 1, BIP-62, BIP-146
20. Sign with ECDSA — implemented19, 8, 18, 3RFC 6979 nonces match published secp256k1 vectors. Every signature is low-S and verifies in an independent library. A secret-probe run finds no secret-dependent branch.RFC 6979, BIP-62, BIP-146
21. Strict DER — implemented19, 20Every DER case in Bitcoin Core's script_tests.json that BIP-66 decides gives its expected result.BIP-66
22. Public key recovery and signed messages — implemented19, 20, 17, 26, 6, 1Bitcoin Core signmessage signatures for pinned keys verify, and recovery returns the signing key. A recovery ID out of range refuses.Bitcoin Core signmessage
23. Verify a Schnorr signature — implemented4, 14, 16All 19 BIP-340 vectors in coax/tests/vectors/upstream/bip340/test-vectors.csv give their expected result. Fast and reference paths agree on every vector and on random signatures.BIP-340
24. Sign with Schnorr — implemented23, 18, 3The BIP-340 signing rows (secret key, aux and message given) produce the expected signatures byte for byte. A secret-probe run finds no secret-dependent branch in the emitted signer. An independent library verifies 10,000 signatures from the Coax signer.BIP-340
25. Batch verification — implemented23The nine valid BIP-340 vectors, with messages of 0 to 100 bytes, verify as one batch; each invalid vector refuses the batch it joins, for its reason; one changed bit in one signature refuses; two wrong signatures that cancel without randomizers are refused with them. Batch and single verification agree on seeded batches, and on 300 random batches of up to 64 in native builds. Point operations and time per signature are measured against single verification. Every line of the example agrees with an independent Python model.BIP-340, BIP-342

Part V. Encodings and addresses

ChapterDepends onDone meansSpec
26. Base58Check — implemented5BIP-32 extended keys and pinned P2PKH and P2SH addresses decode and re-encode exactly. A one-character change fails the checksum.Bitcoin Core base58.cpp
27. Bech32 — implemented1Every valid and invalid BIP-173 Bech32 vector in coax/tests/vectors/upstream/bip173/bip-0173.mediawiki gives its expected result. A Bech32m string refuses (BIP-350's strings, pinned for chapter 28).—
28. Bech32m — implemented27Every valid and invalid BIP-350 vector gives its expected result, including the witness-version rules.BIP-350
29. Addresses: P2PKH, P2SH, P2WPKH, P2WSH and P2TR — implemented6, 17, 26, 28Every BIP-173 and BIP-350 segwit address vector and pinned P2PKH and P2SH addresses map to their scriptPubKeys and back.BIP-13, BIP-141, BIP-173, BIP-341, BIP-350
30. Output descriptors and their checksum — implemented29, 32, 33The BIP-380 checksum vectors and the BIP-381–386 examples parse and give their stated scripts.BIP-380 to BIP-386

Part VI. Keys from words

ChapterDepends onDone meansSpec
31. Seed phrases — implemented4, 7, 8The BIP-39 English vectors give their entropy, mnemonic and seed through PBKDF2-HMAC-SHA512. A phrase with a bad checksum refuses.BIP-39, RFC 8018
32. Hierarchical deterministic keys — implemented6, 16, 31BIP-32 test vectors 1–5 give every extended key, and vector 5's invalid keys refuse.BIP-32
33. Derivation paths — implemented29, 32The BIP-44, BIP-84 and BIP-86 vectors give their addresses, and NIP-06's path gives the Nostr book's chapter 46 key.BIP-44, BIP-84, BIP-86, NIP-06

Part VII. Transactions and script

ChapterDepends onDone meansSpec
34. Transactions and their serialization — implemented1, 3, 5Every transaction in Bitcoin Core's tx_valid.json and tx_invalid.json parses, and serialization round-trips byte for byte with and without witnesses.BIP-144
35. Txids, wtxids and malleability — implemented34Txids and wtxids of pinned segwit transactions match. Changing a witness changes the wtxid and leaves the txid. Each third-party change to a pinned legacy spend (encoding, n − s, push form, dummy, extra item) gives a new txid, and Core's four changed forms of 23b397ed are rebuilt byte for byte.BIP-141
36. The script interpreter — implemented6, 19, 21, 34Every case in Bitcoin Core's script_tests.json gives its expected result under its stated flags.Bitcoin Core script_tests.json
37. Legacy signature hashes — implemented34, 36Every case in Bitcoin Core's sighash.json gives its digest, including SIGHASH_SINGLE with no matching output.Bitcoin Core sighash.json
38. Segwit v0 signature hashes — implemented5, 34, 36BIP-143's examples give their digests for every hash type.BIP-143
39. Timelocks — implemented36The CHECKLOCKTIMEVERIFY and CHECKSEQUENCEVERIFY cases in script_tests.json and tx_valid.json pass, and BIP-68 sequence encodings round-trip.BIP-65, BIP-68, BIP-112, BIP-113
40. Weight, vsize and fees — implemented34Weight and vsize of the pinned mainnet transactions match their published values (mempool.space, rust-bitcoin), and their fees match mempool.space's. The sigop-adjusted vsize follows Bitcoin Core's GetVirtualTransactionSize, and pre-signing estimates of the pinned P2WPKH and key-path P2TR spends equal their signed weights.BIP-141

Part VIII. Taproot

ChapterDepends onDone meansSpec
41. The key tweak and the key path — implemented5, 24BIP-341's wallet-test-vectors.json key-path tweaks and signatures match.BIP-341
42. Script trees: tapleaves and tapbranches — implemented41BIP-341's script-tree vectors give every leaf hash, Merkle root and output key.BIP-341
43. Taproot signature hashes — implemented34, 41Every BIP-341 key-path and script-path signature hash vector matches, for every hash type.BIP-341
44. Tapscript — implemented36, 43The seven Taproot rows of Bitcoin Core's script_tests.json give Core's results, and so do 83 key-path, script-path and tapscript spends checked against a Python transliteration of Core. (script_assets_test.json is generated at test time, not pinned, so it is not extracted.)BIP-342
45. Control blocks and script-path spends — implemented42, 44Script-path spends from BIP-341's vectors verify. A control block with the wrong parity or path refuses.BIP-341

Part IX. Blocks and consensus

ChapterDepends onDone meansSpec
46. Merkle trees and the duplicate-leaf flaw — implemented3, 5, 34Merkle roots of pinned mainnet blocks match their headers. A block whose last transaction is duplicated is detected (CVE-2012-2459).CVE-2012-2459
47. Block headers and proof of work — implemented2, 3, 5The genesis header and pinned headers hash below their targets; a header with one changed bit does not. nBits decodes and encodes as Bitcoin Core's SetCompact and GetCompact on Core's cases, and the work of each pinned header matches.Bitcoin Core pow.cpp, arith_uint256.cpp
48. Compact targets, retargeting and chainwork — implemented47Chapter 47 builds the compact form and the work of one header; this chapter adds the retarget and the sum. nBits round-trips for every mainnet retarget to a pinned height (973,728), computed retargets match the chain, and chainwork to block 966,143 matches Bitcoin Core's nMinimumChainWork, the getblockheader chainwork of its defaultAssumeValid block.Bitcoin Core pow.cpp, BIP-54, BIP-94
49. The witness commitment — implemented35, 46Block 514,999's coinbase commitment equals SHA-256d of its computed witness root and reserved value, and the script GenerateCoinbaseCommitment writes for them. Eighteen blocks, built from it with Core's blocktools.py, get Core's verdicts: bad-witness-nonce-size, bad-witness-merkle-match, unexpected-witness or none, with the last matching output counting; IsBlockMutated tells a changed witness, a repeated transaction and a wrong root apart. Every line of the example agrees with Core's rules transliterated over messages.py.BIP-141
50. Chain parameters: mainnet, testnet4, signet and regtest — implemented5, 36, 47, 48Each network's genesis block hashes to its published hash, and its message start, default port, address prefixes and deployment heights match Bitcoin Core's chainparams.cpp at the pinned release. A signet block whose solution fails the network's challenge refuses.BIP-94, BIP-325, Bitcoin Core chainparams.cpp
51. Header rules: time, versions and deployments — implemented47, 48, 50Median time past and the two-hour future limit decide pinned headers as Bitcoin Core does, and testnet4's timewarp rule refuses its counterexample. The buried deployments (BIP-34, BIP-65, BIP-66, CSV, segwit and Taproot) activate at the chain parameters' heights, and a header whose version is below an active deployment's minimum refuses.BIP-9, BIP-90, BIP-94, BIP-113
52. Transaction checks outside script — implemented34, 35, 39, 40Every case in tx_invalid.json that fails before the script interpreter refuses with its reason: no inputs or outputs, a value out of range, an overflowing total (CVE-2010-5139), duplicate inputs (CVE-2018-17144), a coinbase spent before 100 confirmations and a non-final transaction.BIP-68, BIP-113, CVE-2010-5139, CVE-2018-17144
53. Sigops, weight and block limits — implemented36, 40Legacy, P2SH and witness signature-operation costs of pinned transactions and blocks match Bitcoin Core. A block over 4,000,000 weight units or 80,000 sigop cost refuses.BIP-16, BIP-141
54. The subsidy and the coinbase — implemented34, 50The subsidy at every halving matches, and is zero from height 6,930,000. A coinbase that claims one satoshi more than subsidy plus fees refuses, and so does a coinbase without its BIP-34 height after activation.BIP-34, BIP-42
55. Script flags by height and their exceptions — implemented36, 44, 50, 51Native rule selection matches pinned Core for mainnet headers 0–2,016, every buried deployment boundary on all five networks, the BIP-16 and Taproot hash exceptions, both BIP-30 repeat blocks, known BIP-34 ancestry and resuming BIP-30 at 1,983,702. Block connection applies the selected rules in chapter 58.BIP-16, BIP-30, BIP-341, Bitcoin Core validation.cpp
56. The UTXO set and MuHash3072 — implemented2, 4, 11, 17, 34MuHash3072 of pinned UTXO sets matches Bitcoin Core's gettxoutsetinfo muhash. Adding then removing an element restores the hash.Bitcoin Core muhash.cpp
57. Validate a block: every consensus rule — implemented43, 45, 46, 49, 51, 52, 53, 54, 55, 56Thirteen pinned historical blocks, including buried activations, Taproot, both BIP-30 repeats and the script-flag hash exceptions, validate against independent predecessor coins. Native and sanitized checks match 35 live Core regtest verdicts and four testnet4/signet cases; the rule table maps every consensus family to its checking chapter. Mainnet parent context is independently supplied, not an own-node sync.BIP-30, BIP-34, BIP-141, BIP-341, BIP-342, Bitcoin Core validation.cpp

Part X. Chain state and storage

ChapterDepends onDone meansSpec
58. Connect and disconnect a block — implemented34, 49, 56, 57, 59, 62Full validated connects/disconnects use a distinct v1 profile and atomically commit coins, complete inverses, exact Core undo and tip. The 102-block live Core regtest journey matches every undo body and full UTXO MuHash through two disconnects. All 1,335 frame cuts are atomic; the mainnet 170,060–170,063 touched-coin range restores its exact pre-state and MuHash. Native file and sanitizer checks retain the archival-parent boundary.Bitcoin Core undo.h, validation.cpp
59. The block index and the most-work chain — implemented48, 51Mainnet's headers from genesis to 2,016 are accepted with Core's header checks and select block 2,016, with chainwork 2,017 times that of 0x1d00ffff; a changed header fails high-hash and an orphan prev-blk-not-found. On mined regtest forks a fork with less work loses, equal work goes to the block whose data arrived first (then the lower pointer), and a header without data never becomes the tip. A block found invalid is marked with all its descendants, never becomes the tip, and headers on it refuse as bad-prevblk and duplicate-invalid. Core's skiplist_tests.cpp and blockchain_tests.cpp cases pass, and every line of the example agrees with Core's transliterated chain.cpp, blockstorage.cpp and validation.cpp.Bitcoin Core chain.cpp, node/blockstorage.cpp, validation.cpp
60. Reorganizations and invalid chains — implemented57, 58, 59, 62Validated detach/attach paths share one atomic batch; invalid descendants are excluded, damaged bodies remain retryable, and both fork directions, full UTXO/MuHash and recovery agree with a running Core node.Bitcoin Core validation.cpp
61. Block files and undo files — implemented5, 34Core-format block and undo records append durably and read by body position, with xor.dat masking and undo checksums bound to the previous block. The file tool imports Core 32.1's 2,501-record regtest file byte for byte. Every physical cut retains exactly the complete prefix; malformed nonzero framing refuses without truncation. Chapter 58 produces the exact serialized undo body and binds it to its validated commit.Bitcoin Core blockstorage.cpp
62. A key-value store for the chainstate — implemented1, 5Reads, writes, deletes and ordered iteration match a reference map on random workloads. A crash at every write of a recorded workload restarts to exactly the last committed batch.—
63. The coins cache and crash-safe flushes — implemented56, 58, 60, 62A bounded private delta coalesces complete validated transitions into one synced flush. A crash at every frame byte recovers a complete cursor; replayed archived blocks restore the same full-set MuHash as Core. The cache stays within its accounted resident-memory limit.Bitcoin Core coins.cpp
64. Pruning — planned61, 63A pruned node keeps its block files under the configured target, keeps at least the last 288 blocks, and still reorganizes across them.Bitcoin Core blockstorage.cpp

Part XI. The network

ChapterDepends onDone meansSpec
65. P2P messages and checksums — implemented5, 34The developer reference's version, getblocks, headers, inv, addr, addrv2, feefilter and ping samples parse and re-serialize exactly, and every line the example prints matches Bitcoin Core's own messages.py. A bad magic, a bad checksum, a length above 4,000,000 and a badly padded command each refuse in Core's order.Bitcoin P2P protocol
66. ElligatorSwift — implemented15, 17All 76 rows of BIP-324's ellswift_decode_test_vectors.csv decode to their x, all 256 cases of xswiftec_inv_test_vectors.csv give BIP-324's t or refuse where it lists none, and the key exchange of every packet_encoding_test_vectors.csv row gives its shared x and secret. Every line of the example agrees with BIP-324's reference.py.BIP-324
67. The v2 encrypted transport — implemented9, 12, 65, 66All 7 rows of BIP-324's packet_encoding_test_vectors.csv give their keys, terminators, session ID and ciphertext from the private key, including the rows after 999 and 1,024 packets (rekeying) and the 4,000,001- and 16,777,215-byte packets, and a receiver opens each one that Core accepts. Every line of the example agrees with BIP-324's reference.py and Core's net.cpp.BIP-324
68. The handshake and feature negotiation — implemented65, 67Two nodes complete version and verack in memory over v1, over v2, with a v1 initiator at a v2 responder (detected from 16 bytes), and with a v2 initiator at a v1-only node (retried in v1), negotiating wtxidrelay, sendaddrv2 and sendcmpct; our version and every payload the handshake sends equal Core's bytes. The version checks refuse in Core's order, each negotiation message after verack disconnects as Core does, and every line of the example agrees with Core's transliterated ProcessMessage, messages.py and BIP-324's reference.py. Interop with a running Core is chapter 118's.BIP-130, BIP-133, BIP-152, BIP-155, BIP-339
69. Addresses and the address manager — implemented5, 10, 65, 68addr and addrv2 round-trip for every BIP-155 network through chapter 65's reader. Core's bucket vectors (tried 40, new 786) and its addrman_tests.cpp cases pass: collisions, multiplicity, test-before-evict, GetAddr's 2,006 and 461, peers.dat in Core's format 4 with its corruption cases. One source group sending 20,000 addresses fills 62 of 1,024 new buckets and wins 38 of 400 selections once 1,000 honest addresses arrive. DNS seeds are all queried at once only with no known address; otherwise after 11 s or 5 min, 3 at a time while outbound connections are short. Every line of the example agrees with Core's transliterated AddrMan, ProcessAddrs and RelayAddress.BIP-155, Bitcoin Core addrman.cpp
70. Connections: outbound, block-relay-only, feelers and eviction — implemented68, 69A simulated node fills 8 full-relay and 2 block-relay-only slots from 10 network groups, starting with its anchor, and makes feeler and extra block-relay-only connections on exponential timers; the stale extra peer is dropped. With its inbound slots full it evicts by Bitcoin Core's protected-peer rules: Core's peer_protection_test cases and peer_eviction_test for 0 to 199 candidates pass, and 329 connections from 3 attacker groups evict none of 60 honest peers. Every line of the example agrees with Core's transliterated ThreadOpenConnections, SelectNodeToEvict and EvictExtraOutboundPeers.Bitcoin Core net.cpp, node/eviction.cpp
71. Misbehavior, limits and denial of service — implemented68, 70Every message limit refuses its oversized case with Core's verdict and reason; a misbehaving peer is discouraged and disconnected unless noban, manual or local; MurmurHash3 matches Core's 14 vectors and the rolling bloom filter remembers its last entries in fixed memory (100,000 discouragements keep the last 50,000, forget the oldest and match none of 20,000 others); headers below the anti-DoS threshold start a presync bounded at about 1.4 MB; and flood control holds a peer to about 15 MB. Every line agrees with Core's transliterated net_processing.cpp, net.cpp, bloom.cpp and headerssync.cpp.Bitcoin Core net_processing.cpp, banman.cpp, common/bloom.cpp, headerssync.cpp
72. Headers sync and block download — implemented46, 59, 65, 68, 71From genesis the node downloads headers by locator, presyncs them against low-work spam, and fetches blocks from many peers through a moving window, replacing a peer that stalls. It syncs regtest and signet from Bitcoin Core peers to their tips.Bitcoin Core net_processing.cpp, headerssync.cpp
73. Compact blocks — implemented10, 35, 49, 65, 68Block 413,567's SipHash keys, first short IDs and 9,614-byte cmpctblock equal those of Core's messages.py. Mainnet block 514,999 is rebuilt byte for byte from a mempool and an extra pool after a getblocktxn for the two missing transactions; a duplicate short ID fails, colliding pool entries are asked for, and a wrong transaction or witness fails IsBlockMutated. Core's blockencodings_tests.cpp cases pass, and every line of the example agrees with InitData, FillBlock and MaybeSetPeerAsAnnouncingHeaderAndIDs transliterated over messages.py.BIP-152
74. Compact block filters — implemented10, 46BIP-158's testnet-19.json filters and filter headers match.BIP-157, BIP-158
75. Proxies, Tor and I2P — implemented68, 70The three onion addresses of Tor's rend-spec-v3 and Core's net_tests.cpp names read and print with their SHA3-256 checksums, and BIP-155 carries their keys and I2P's hashes as net_tests.cpp expects; a changed character refuses. Core's SOCKS5 client, with stream isolation credentials, connects through a model proxy for every name length and stops at each reply code; SAM v3.1 sessions and streams run on replies from Core's i2p_tests.cpp and the SAM specification, each failure blamed on the peer or the proxy as Core does; and -onlynet, -proxy, -onion and -i2psam give Core's reachable networks, routes and errors. No live Tor or I2P is used. Every line of the example agrees with an independent Python model.BIP-155, Tor rend-spec-v3, I2P SAM v3, RFC 1928, RFC 1929

Part XII. Initial block download

ChapterDepends onDone meansSpec
76. The signature cache and parallel script checks — planned57Script checks run on every core and give the same verdicts as one thread over a pinned block range. A transaction verified on mempool entry is not verified again in its block, and the cache is keyed by a salted hash.Bitcoin Core sigcache.cpp, checkqueue.h
77. Faster verification: the GLV endomorphism — implemented16, 19, 23Verification with the endomorphism and wider windows agrees with chapter 16's path on random and edge inputs (2,000 splits and 300 multiplications against Python, libsecp256k1's near-bound scalars), chapters 19 and 23's suites (464 Wycheproof cases, 19 BIP-340 vectors, libsecp256k1 differentials) give the same results on it, and 200 fresh signatures verify at a measured rate within a stated factor of libsecp256k1 on the same machine (about 1.6 times chapter 16's rate; with the fast path of 2026-11-13, libsecp256k1 about 1.4 times faster).Gallant, Lambert and Vanstone (2001)
78. assumevalid — planned57, 72Below the pinned assumevalid block the node skips script checks only for ancestors of that block buried under its stated work; every other rule still runs. With assumevalid off the node reaches the same UTXO set.Bitcoin Core validation.cpp
79. AssumeUTXO snapshots — planned56, 63, 72The node loads a pinned mainnet UTXO snapshot whose hash matches the chain parameters, follows the tip from it at once, and validates from genesis in the background. A snapshot with one changed coin refuses.Bitcoin Core dumptxoutset, loadtxoutset
80. Sync mainnet from genesis — planned63, 64, 72, 76, 77, 78The node syncs mainnet from genesis to a pinned height over the public network, and its UTXO set at that height equals Bitcoin Core's gettxoutsetinfo (hash_serialized_3 and muhash). The chapter records time, memory and disk on stated hardware next to Bitcoin Core's on the same machine.—

Part XIII. The mempool and policy

ChapterDepends onDone meansSpec
81. Policy is not consensus: standardness — implemented36, 40, 53Every standardness rule (output types, size, dust, OP_RETURN data and witness limits) refuses its pinned non-standard transaction with Bitcoin Core's reason at the pinned release, and each of those transactions still validates in a block: CheckTransaction, the inputs' value, VerifyScript under the consensus flags, and the block's weight and sigop cost. Core's test_IsStandard and max_standard_legacy_sigops cases pass, and every line of the example agrees with Core's transliterated policy.cpp and solver.cpp.Bitcoin Core policy.cpp
82. Mempool acceptance and limits — partly implemented57, 81Bounded unvalidated local mempool observations and their fees are runnable (mempool-v0); full completion requires matching Bitcoin Core's testmempoolaccept verdicts, script execution, and package/size limits on a pinned corpus.Bitcoin Core validation.cpp, txmempool.cpp
83. Transaction relay and orphans — planned68, 82Transactions announced by wtxid are requested, accepted and announced onward with Bitcoin Core's randomized delays. A transaction with a missing parent waits in a bounded orphan pool and is accepted when the parent arrives.BIP-339, Bitcoin Core net_processing.cpp
84. Replacement: RBF and TRUC — planned82Replacements are accepted or refused as Bitcoin Core decides on its replacement cases, including the fee-rate and total-fee rules and the version-3 (TRUC) topology limits.BIP-125, BIP-431
85. Packages, CPFP and anchors — planned82, 84One-parent-one-child packages, and pay-to-anchor outputs with zero-fee parents, are accepted and relayed as Bitcoin Core accepts them. A package below the minimum fee rate refuses.BIP-331, Bitcoin Core policy/packages.cpp
86. Eviction, expiry and persistence — planned82A full mempool evicts the lowest fee-rate transactions first and raises its minimum fee, transactions expire after two weeks, and a restart reloads the saved mempool.Bitcoin Core txmempool.cpp
87. Fee estimation — planned82Over a replayed history of blocks and mempool entries, estimates for 2, 6 and 144 blocks meet the success rate Bitcoin Core's estimatesmartfee targets.Bitcoin Core fees.cpp
88. Block templates and mining — planned49, 54, 82getblocktemplate chooses transactions by fee rate within the weight and sigop limits, and a regtest block mined from its template is accepted by Bitcoin Core.BIP-22, BIP-23

Part XIV. Operating the node

ChapterDepends onDone meansSpec
89. The node process: configuration, data directory, logs and shutdown — planned63The node reads its configuration file and flags, keeps its state in one data directory, logs by category, and on a signal at any point shuts down cleanly and restarts at the same tip.—
90. JSON-RPC and REST — partly implementedExplorer profile: 29, 59, 61, 62, 91, 125; full profile also requires 82Read-only explorer REST and JSON-RPC, bound to one durable snapshot, are runnable. Full completion requires the following. The node answers the Bitcoin Core RPCs that wallets and Lightning implementations call (getblockchaininfo, getblock, getblockheader, getrawtransaction, gettxout, sendrawtransaction, estimatesmartfee, getblocktemplate, submitblock and the others the chapter names) with Core's JSON for the same chain, behind cookie authentication.Bitcoin Core RPC
91. Indexes: transactions, filters and coin statistics — partly implementedTransaction profile: 34, 58, 59, 60, 61, 62; full profile also requires 56, 74The light transaction index persists full-txid positions with the chainstate, prefers active matches and preserves stale entries across reorgs, with independent native and durable-file comparisons. Full completion still requires filter and historical coin-statistics indexes, node management and Core RPC parity.Bitcoin Core index/txindex.cpp; BIP-157
92. Notifications for wallets and Lightning — planned60, 82A subscriber receives every connected and disconnected block and every mempool entry and removal in order, across a reorganization, and resumes from its last block after a restart.—
93. Shadow mode beside Bitcoin Core — planned80, 90Run beside a Bitcoin Core node on the same peers for a stated period, the node gives the same verdict on every header and block and holds the same tip. Any difference stops it and records the block.—

Part XV. Wallets

ChapterDepends onDone meansSpec
94. PSBT — implemented34, 38, 43Every valid and invalid PSBT in BIP-174 and BIP-370 parses or refuses as stated.BIP-174, BIP-370
95. Coin selection and change — implemented40, 94Branch-and-bound and fallback selection pass Bitcoin Core's coin-selection cases, and no selection pays more than its stated fee rate allows.Bitcoin Core coinselection.cpp
96. Message signing — implemented22, 36, 42, 43, 94BIP-322's simple and full vectors verify.BIP-322
97. Silent payments — implemented16, 24, 28, 29, 32, 41BIP-352's send_and_receive_test_vectors.json give every output and scan result.BIP-352
98. Miniscript — planned30, 36, 44The BIP-379 examples type-check, compile to their stated scripts and satisfy.BIP-379
99. A descriptor wallet on our node — planned30, 33, 92, 94, 95A descriptor wallet finds its coins by rescan and by notification, builds, signs and broadcasts a spend on signet through our node, and survives a reorganization that removes a payment.BIP-380

Part XVI. Many signers

ChapterDepends onDone meansSpec
100. Multisig — implemented30, 362-of-3 P2WSH sortedmulti descriptors give their addresses, and a spend signed by two keys validates.BIP-11, BIP-67
101. MuSig2 — implemented24, 41Every BIP-327 vector file (key aggregation, nonces, signing, aggregation and tweaks) gives its result. A reused nonce refuses.BIP-327
102. FROST threshold signatures — implemented101The FROST draft BIP's vectors give their results. A signature from fewer than t signers refuses.RFC 9591, FROST draft BIPs
103. Adaptor signatures — implemented24A BIP-340 pre-signature for a point T pre-verifies against its key, message and T and not against others, completes with t into a signature that BIP-340 verifies, and gives t back from that signature. A reused nonce recovers the key and a reused point lets a third party complete a second pre-signature. Six vectors from an independent Python implementation on BIP-340's pinned reference.py match byte for byte, and every line agrees with it.BIP-340

Part XVII. Lightning

ChapterDepends onDone meansSpec
104. Messages and TLVs — implemented1All 18 BigSize decodings and 8 encodings of BOLT 1's Appendix A, all 57 TLV streams of Appendix B in their namespaces (with the n1 values), and the 5 init messages of Appendix C give BOLT 1's results. An unknown even type, feature bit or message type refuses; an unknown odd one is ignored. Every line of the example agrees with an independent Python reader.BOLT 1
105. The Noise handshake — implemented9, 12, 16All 15 handshake vectors of BOLT 8's Appendix A, 5 initiator and 10 responder, give its acts and session keys or the error it names, and the message vectors' six outputs match byte for byte across two key rotations. Every line of the example agrees with an independent Python handshake.BOLT 8
106. Commitment keys and revocation — implemented4, 16BOLT 3's Appendix E gives its base point, per-commitment point, localpubkey, localprivkey, revocationpubkey and revocationprivkey byte for byte, and each private key times G is its public key. Every line of the example agrees with an independent Python derivation.BOLT 3
107. Shachain — implemented4All 5 generation vectors of BOLT 3's Appendix D give its secrets, and all 9 storage vectors accept their good inserts and refuse at the insert BOLT 3 marks as an error. A 10,000-commitment store looks up every secret in 14 slots. Every line of the example agrees with an independent Python store.BOLT 3
108. Commitment and HTLC transactions — implemented38, 100, 106All 16 commitments of BOLT 3's Appendix C (static_remotekey) and all 9 of Appendix F (anchors), each signed by both peers, and all 48 of their HTLC-timeout and HTLC-success transactions match byte for byte, and Appendix B's funding transaction does too. The signed transactions spend their outputs under chapter 36's interpreter, and a wrong preimage or an early delayed spend fails. Every line of the example agrees with an independent Python builder.BOLT 3
109. Open, update and close a channel — implemented104, 105, 107, 108Two in-process nodes open a channel with BOLT 2's v1 messages, add, fulfill and fail HTLCs both ways with commitment_signed and revoke_and_ack, lose a message and recover with channel_reestablish, refuse messages out of order, and close with a closing_signed fee negotiation. Every commitment is built and its signatures checked with chapter 108's builder, the force-close and closing transactions spend the funding output under chapter 36's interpreter, and every line agrees with an independent Python model.BOLT 2
110. Watch the chain — planned92, 109A revoked commitment broadcast on regtest is swept by the penalty transaction, and an expired HTLC times out, with our node as the only chain source.BOLT 5
111. Onion routing and blinded paths — implemented8, 11, 16The onion of BOLT 4's onion-test.json matches byte for byte and every hop reads its payload; the error packets of onion-error-test.json and the "Returning Errors" trace match at every node and the origin finds the erring hop; the blinded paths of route-blinding-test.json, the blinded payment onion and the onion message match at every hop. A tampered onion fails its HMAC. Every line of the example agrees with an independent Python Sphinx.BOLT 4
112. Gossip and the channel graph — implemented19, 104BOLT 7's six node_announcement vectors verify and each alias refuses; the ten messages of extended-queries.json read with their stated fields, except the five in zlib, which BOLT 7 now forbids and which refuse. BOLT 7 has no announcement or update vectors, so the example signs its own with generated keys: a changed byte, swapped node IDs, the wrong end's key, a stale timestamp and an unknown channel or node refuse. Every line of the example agrees with an independent Python reader and writer.BOLT 7
113. Find a route and pay — implemented109, 111, 112, 114Payments route over five in-process nodes whose channels open, update and settle with chapter 109's messages: the cheapest route under fees and a uniform liquidity model, a multi-part payment the payee holds until total_msat, a temporary_channel_failure read from the error onion and retried another way, a route hint to a private channel, and an unknown invoice refused without retry. Every line of the example agrees with an independent Python payer and network.BOLT 2, BOLT 4, BOLT 7, BOLT 11
114. Invoices — implemented22, 27All 31 examples of BOLT 11's invoice-test.json are valid or invalid as stated, each invalid one for its reason; the 11 signature breakdowns match; every valid example decodes to its stated fields and payee and is written again to the same text. A changed character refuses. Every line of the example agrees with an independent Python reader and writer.BOLT 11
115. Offers — implemented5, 24, 104BOLT 12's format strings, all 53 offers of offers-test.json (each invalid one for its reason), the Merkle roots, tagged hash and signature of signature-test.json, and the 5 valid and 23 invalid payer proofs of payer-proof-test.json give their stated results; the request and every payer proof are written again byte for byte. A changed character of a signed request refuses. Every line of the example agrees with an independent Python reader and writer.BOLT 12

Part XVIII. Interop and verification

ChapterDepends onDone meansSpec
116. Test vectors and their provenance — implemented—Every vector the book uses is pinned with its source and hash, and the pin check fails on an edited vector. All 316 pins pass check_vectors.py (and --fetch for the 309 single-URL files), every Bitcoin Core file is at the target ddea9196 or a listed exception, and check_pins.py fails on an edited vector, a stale inventory or index, an unpinned citation or a drifting generator.—
117. Differential tests — planned24, 36, 43, 57Signatures, signature hashes, script results and block verdicts agree with libsecp256k1 and Bitcoin Core on generated inputs.—
118. Bitcoin Core's functional tests against our node — planned68, 90The Bitcoin Core functional tests that drive a node over P2P and RPC (feature_block.py and the p2p_* and mempool_* tests the chapter names) pass against our node on one of our own machines, never the owner's Mac. Each test that does not apply is listed with its reason.Bitcoin Core test/functional
119. Fuzzing — implemented26, 34, 65, 94, 114, 116Every parser (transactions, scripts, P2P messages, PSBTs, addresses and invoices) runs under the fuzzer with no crash and no accepted malformed input. Done for transactions, P2P headers and version payloads, PSBTs, BOLT 11 invoices and Base58Check: 100,000 seeded inputs per parser in checked and release builds, each compared code for code with a Python reference, with no crash and no accepted input that fails to write back. Scripts, descriptors and addresses are not fuzzed yet.—
120. Formal properties — planned57Each named property (round trips, refusal of non-canonical encodings and the consensus rule table) has a checked model or a stated boundary.—

Part XIX. Bitcoin in OpenAgents

ChapterDepends onDone meansSpec
121. One seed for Nostr and Bitcoin — implemented31, 33One BIP-39 phrase gives the Nostr key and the wallet keys, and restoring from the phrase gives the same addresses.BIP-39, NIP-06
122. Agent treasuries — implemented94, 100, 101A 2-of-3 treasury spend is signed by independent key agents and broadcast on signet, and an independent wallet tool recovers the coins.NIP-KEYS
123. Paying for requests and verified work — implemented113, 114, 121#authority two-leg (WORKER + VALIDATOR) settlement policy with idempotency, rolling 24h UTC caps, default-OFF owner arming, and truthful receipt invariants, qualified live on Bitcoin mainnet via Breez Spark (200 sats worker + 50 sats validator, 0 sat fee).x402, BOLT 11, Breez Spark
124. Our node on Pylons and Metaverse OS — planned89, 93A Pylon and a Metaverse OS machine run the node from its Nix module and sync it, and OpenAgents' on-chain checks query it instead of a third-party chain source.—

Explorer extension: address index (chapter 125)

Added for #12704 after the original 124-chapter plan. Full validation remains outside the explorer light profile.

ChapterDepends onDone meansSpec
125. Address history, balances and spends — implemented29, 58, 60, 91Exact-script histories, confirmed balances and output spend links share the light chain's atomic batch. Native debug/release answers match independent transaction replay through both reorg directions; every crash cut exposes one whole snapshot.Explorer address-index schema 1