Back To Schedule

Consensus Critical

How Bitcoin Core uses C++ to Maintain Network Agreement

13:00 - 14:00 Wednesday 11th March 2026 UTC
Beginner
Intermediate
Advanced
Design

Bitcoin manages over a trillion dollars in network value as of October 2025. How? Through roughly ten thousand lines of consensus-critical validation logic that has been written using purely C++ code which has to produce identical results across about twenty-four thousand independent nodes running the consensus engine (or validation logic) on completely different platforms. Think about that for a second that one bug doesn't just crash a program. It can permanently split a distributed network of nodes into something like nothing existed.

This talk digs into Bitcoin Core's consensus engine (the original client Satoshi Nakamoto) wrote from three angles. We'll look at the core validation architecture first: how components like CBlockIndex tree, CCoinsView hierarchy, and CChainState work together to manage blockchain state. Then we'll explore some fascinating historical consensus vulnerabilities that actually became permanent features—like the CVE-2010-5139 integer overflow that somehow created 184 billion fraudulent coins, or the 2013 Berkeley DB fork where database lock limits accidentally became consensus rules. And finally, we'll examine the C++ design constraints that absolute determinism forces on us: why floating-point arithmetic is completely off-limits, how the serialization framework enforces platform-independent byte ordering, and why the script interpreter's stack-based virtual machine has to preserve even obvious bugs like OP_CHECKMULTISIG's off-by-one error.

Yuvicc

Yuvraj is a Bitcoin Core contributor currently focused on the Bitcoin Kernel project — an effort to modularize and extract Bitcoin’s consensus engine into a reusable API for external projects. His work includes developing Java language bindings for the introduced C API.

VolumetricCondensed