bmc Bitcoin Machine Code Consensus
GitHub

Consensus, Mempool & Core v32.1 Parity

Bitcoin Core v32.1 is the consensus and behavioral oracle for bmc (v0.2.1; Core v32.1 introduces zero consensus changes over v31.1 and updates mempool/deployment/wallet RPC shapes & Tor PoW defenses). Every soft-fork activation, script flag, UTXO set digest, and mempool policy rule is validated differentially against Core.

1. Consensus Rules Enforced

Rule / BIPImplementationVerification
Header & PoW Validation bad-diffbits retarget schedule, MTP timestamp rules, bad-version (BIP34/66/65), BIP94 testnet4 timewarp rule (enforced across IBD, P2P push, and submitblock). test_pow_rules, test_hdr_lowwork, mainnet + testnet4 sync
Script VM & Flags Full Bitcoin Script interpreter in x86-64/ARM64 assembly. Activation heights and historical exception block hashes are auto-generated directly from Bitcoin Core v31.1 via validation/gen_script_flags.py. script-flags-check, test_interp_core_vectors, test_verify_core_vectors
SegWit v0 (BIP141/143/144) Strict BIP144 marker=0x00 flag=0x01 parsing, witness commitment verification on every block & compact-block reconstruction, weight ≤ 4,000,000, sigop cost ≤ 80,000. test_segwit_real, test_bip143_diff, test_witness_commitment
Taproot (BIP340/341/342) Key-path Schnorr, script-path Tapscript (OP_CHECKSIGADD, validation weight budget, annex handling, leaf version 0xc0), BIP341 sighash. test_bip341_diff, test_taproot_block_diff, test_tapscript_interp
UTXO & Money Range BIP30 duplicate-coinbase check, 100-block coinbase maturity, duplicate-input check, MAX_MONEY (21M BTC) per-output and cumulative sum checks, provably unspendable output filtering. test_money_range, test_bip30_daemon, test_audit_2026_11_27
Signet (BIP325) Public and custom signetchallenge block-signature enforcement via the same script VM, with challenge-derived network magic. test_signet_solution, live signet nodes
Reorgs & Fork Choice Cumulative chainwork fork choice, full-chain rev*.dat undo disconnect/reconnect, crash-consistent rewind, and post-reorg mempool reconciliation. test_reorg, test_undo_log, test_sto1_crash

2. MuHash3072 Parity Attestation Ledger

Consensus UTXO parity is proven by comparing gettxoutsetinfo muhash <height> between bmc and Bitcoin Core at pinned heights. Identical 256-bit MuHash3072 digests and coin counts prove every coin created and spent since genesis matches Core entry-for-entry.

Date (UTC)HeightUTXO CountMuHash3072 PrefixMilestone
2026-11-28977,993162,539,9132fb8d471d06986ebv0.2.1 vs. Bitcoin Core v32.1 live mainnet oracle (20,118,501.09791503 BTC, exact 64-hex match)
2026-10-24972,848exact matchidentical to Core v31.1Post-2026-10-23 security review & formal verification full from-genesis sync
2026-10-10970,710exact matchidentical to Core v31.1Release benchmark Run 46 (3h 17m 55s IBD + all indexes)
2026-09-30969,273exact match25640fa6c830242cCore-matched defaults IBD capstone
2026-09-28968,910165,238,604c120bbaf14e37bdbSafegcd MuHash inverse + AVX2 keystream (20,090,116.75 BTC)
2026-09-27968,821165,210,914ee7594826ad13e65assumevalid=0 full-script verification from genesis (8h 0m)
2026-09-25968,570165,271,8526cc459ddaa38e1admacOS Apple Silicon (arm64) mainnet vs local Bitcoin Core

3. Core v32.1 Cluster Mempool & Relay Policy

  • Cluster Limits & Linearization: Enforces Core v32.1 cluster limits (limitclustercount=64, limitclustersize=101 kvB) with optimal cluster linearization (mempool_cluster.c, verified across 3,000 randomized DAGs). getblocktemplate assembles candidate blocks in whole linearization chunk feerate order.
  • Full RBF: Unconditional full replace-by-fee with the 100-candidate cap, rules 3 & 4, and post-replacement feerate-diagram improvement verification.
  • TRUC (BIP431 v3) & Ephemeral Dust: Enforces v3 topology constraints, sibling eviction, and 0-fee ephemeral-dust sweep rules across both single-tx and multi-tx package contexts.
  • Atomic Package Admission: Both submitpackage and P2P 1-parent-1-child (1p1c) relay evaluate packages over an in-memory parent overlay, verify aggregate feerate and package RBF, and roll back any committed members in reverse order if a subsequent member fails during Pass-2 commit.
  • Input & Standardness Enforcement: Rejects duplicate inputs, out-of-range outputs, overflowed output sums, non-standard witness versions, and oversize sigop/witness transactions (with dynamically sized buffers supporting >512-input transactions).

4. Block-Policy Fee Estimator

asm/daemon/fee_estimator.c is a direct C port of Bitcoin Core's CBlockPolicyEstimator: three confirmation horizons (short 12×1, medium 24×2, long 42×24 blocks), 237 exponential feerate buckets (100 to 1e7 sat/kvB at 1.05× spacing), conservative & economical estimation modes, and atomic persistence to fee_estimates.dat (with strict finite/non-negative validation on load and F_FULLFSYNC on macOS).

5. Intentional Differences from Bitcoin Core

AreaBitcoin Machine Code (bmc)Bitcoin Core v32.1
Datadir FormatCustom monotonic framed archive + custom LSM UTXO store (not interchangeable with Core datadirs)Arrival-order blk*.dat + LevelDB chainstate
Binary Namesbmcbitcoind, bmc_cli, bmc_rpcd, bmcbitcoind.pid (coexists on same host with Core)bitcoind, bitcoin-cli, bitcoind.pid
IndexesBuilt incrementally as sorted runs during IBD; adds native addrindex and Esplora facadeBuilt via sequential index threads; no address index or Esplora
gettxoutsetinfoDefaults to muhash (via coinstatsindex); hash_serialized_3 explicitly refusedSupports hash_serialized_3 and muhash
Legacy / OmittedRefuses deprecated testnet3; omits GUI, UPnP/NAT-PMP, BIP37 bloom filters, and loadtxoutset (export dumptxoutset works)Includes Qt GUI, loadtxoutset, optional BIP37