People argue about Bitcoin’s rules as though they were written somewhere authoritative. They are not. The whitepaper is a description that predates most of the system, BIPs are proposals and records, and the only thing that decides whether a block is valid is what the software on each node does when it sees one.
That sounds unsatisfying and is actually convenient, because code is specific. A claim about Bitcoin can be checked against a line.
Where are the numbers everyone quotes?
In two small header files, and they are shorter than most articles about them.
src/consensus/amount.h defines MAX_MONEY as 21,000,000 times the
number of satoshis in a coin, along with a MoneyRange helper used
throughout validation. The comment above it is worth reading in full,
because it corrects a misunderstanding that appears constantly: the
constant is explicitly not the total supply — the actual supply is
less, for several reasons — but a sanity check, and the comment notes
that its exact value is consensus critical because changing it could
cause a fork.
src/consensus/consensus.h holds most of the rest. The maximum block
weight of four million. Eighty thousand as the cap on signature
operation cost. A coinbase maturity of one hundred blocks. The witness
scale factor of four, which is the source of the discount everyone
discusses. Five numbers that shape almost every argument about
Bitcoin’s capacity and economics, in a file you can read in a minute.
Why is the consensus surface kept small?
Because every line inside it is a line that must behave identically everywhere, forever.
Code in the consensus path cannot be refactored freely. A change that is obviously equivalent to a reader may not be equivalent at an edge case, and an edge case handled differently is a chain split rather than a bug report. That is why the directory is small, why changes to it attract disproportionate review, and why apparently cosmetic improvements are often declined.
It also explains an organising effort that has been running for years:
separating the consensus engine from everything else, so that the part
which must never change behaviour is clearly bounded and the rest —
wallet, RPC, networking, policy — can evolve normally. The
src/kernel/ directory is that boundary being drawn.
For a reader the practical consequence is good news. The surface you have to understand in order to check Bitcoin’s rules is deliberately kept to a size one person can read, and the effort to keep it that way is itself one of the project’s quieter commitments.
Where is the issuance schedule?
Split between a parameter and a function, which is why people misquote it.
src/kernel/chainparams.cpp sets nSubsidyHalvingInterval to 210,000
for mainnet, alongside the proof-of-work target spacing of ten minutes,
the two-week retarget timespan, the genesis block, and the heights at
which each past soft fork took effect. It is the file to open when
somebody asserts a historical activation date.
The subsidy itself is computed in src/validation.cpp, which halves
fifty coins once per interval and returns zero once the shifts exhaust
the value. The twenty-one million figure is therefore not written
anywhere as the supply; it is the limit of a geometric series that the
code computes one block at a time, which is a more accurate mental
model than a cap being enforced.
Where does validation actually happen?
In a few functions with unglamorous names, and the division between them matters.
CheckBlock and CheckTransaction perform context-free checks: things
decidable by looking at the data alone, like whether a transaction has
inputs, whether outputs are in range, whether the Merkle root matches.
ConnectBlock performs the contextual ones, which need the chain state
— whether the inputs exist and are unspent, whether scripts verify,
whether the coinbase claims more than it should.
src/pow.cpp holds the retarget: compare how long the last 2,016
blocks took against the two weeks intended, clamp the ratio to between
a quarter and four, and scale the target. That is the whole difficulty
adjustment, in about ten lines, and reading it is the fastest cure for
the belief that it is complicated.
src/script/interpreter.cpp evaluates scripts. It is longer and denser
than the rest, and it is where the rules about what a signature proves
ultimately live.
What is deliberately not in those files?
Everything in src/policy/, which is the distinction the directory
names make for you.
Relay and mempool behaviour — minimum fee rates, standardness, dust thresholds, replacement rules, topology limits — lives separately precisely because none of it decides validity. A transaction your node refuses to relay can still be mined, and a block containing it is valid.
Reading the two directories side by side teaches the policy distinction better than any explanation of it. One is a set of constraints every node must share or the network splits; the other is a set of preferences each operator chooses, and the code is organised to keep them apart.
How do you check a claim?
Find the constant, then find what uses it.
The first half is easy and misleading on its own. A constant tells you a value and not whether anything enforces it, and Bitcoin has constants that are advisory, constants that are defaults, and constants that are consensus critical. The second half — searching for where the name appears — is what distinguishes them.
Take coinbase maturity. The constant is in consensus.h; searching for
COINBASE_MATURITY finds the check in the contextual validation path
that rejects a transaction spending a coinbase output too early. Now
the claim is verified: not “a document says a hundred blocks” but “this
function rejects the block, and every node runs it.”
The same procedure answers most factual disputes about Bitcoin in under ten minutes, and it is the only method that does not end in an appeal to somebody’s authority.
Does this mean reading other implementations is useless?
No — it means reading them is how you find where the rules are ambiguous.
Several projects implement Bitcoin’s consensus rules, as libraries, as alternative nodes, or as educational exercises. None of them defines the rules, and all of them are useful for the same reason: where two implementations disagree, there is something the rules do not state clearly, and those are precisely the places worth looking.
That also sets the limit on how useful a written specification would
be. A document can describe MAX_BLOCK_WEIGHT perfectly and still omit
the behaviour that matters, because the behaviour that matters is
usually an edge case nobody thought to describe — the serialisation of
an unusual transaction, the order in which two checks are applied, the
handling of a value at a boundary.
So the practical advice for a reader checking a claim is to go to the code first and to the explanations second, and to treat any disagreement between an explanation and the source as a defect in the explanation. That includes this one, and it is the only standard that stays correct as the software changes.
Is the code really the specification?
Yes, and more completely than for most software.
In an ordinary system, a specification is normative and an implementation that differs has a bug. In a consensus system the implementation’s behaviour is the rule, bugs included, because a node that handles an edge case differently from the rest of the network is not conforming more correctly — it is on a different chain.
Bitcoin has demonstrated this twice. A database lock limit nobody had written down was a consensus rule in 2013, and a 64-byte transaction ambiguity in the Merkle tree remains one today. Neither appears in any specification, and both are part of the rules in the only sense that matters.
The consequence for a reader is that there is no shortcut. A document describing Bitcoin’s rules, including this article, is a summary of behaviour and the behaviour is the authority.
Check it yourself
Pick a claim you have repeated and locate it. Good candidates: the block weight limit, the halving interval, the maturity period, the retarget clamp. Each is one constant and one usage.
Then check that your own node agrees, which is the part that converts reading into verification:
bitcoin-cli getblockstats <height> | grep -E 'subsidy|total_weight'
bitcoin-cli getblockchaininfo | grep -E 'blocks|difficulty'
The subsidy your node reports for a block should equal fifty coins halved once per 210,000 blocks of height, and the supply itself can be totalled the same way. If it does, you have checked a rule against both the source and a running implementation, which is the whole of what verification means here.
What remains uncertain
How much of the behaviour nobody has written down. Two undocumented consensus rules have been found by accident. The number remaining is unknown by construction, and the proposal to tidy up the known ones has not activated.
Whether a second implementation would clarify or endanger this. A written specification derived from the code would make claims checkable without reading C++, and an implementation built from that specification would be a new way for the network to split. Both arguments are serious and neither has prevailed.
Whether readability keeps up. The consensus-critical surface is small and the surrounding code is not. As the codebase grows, the share of it that an interested non-specialist can audit falls, which erodes the property this article is recommending without any single change being responsible.
Sources
- First-partyBitcoin Core — src/consensus/amount.h ↗
- First-partyBitcoin Core — src/consensus/consensus.h ↗
- First-partyBitcoin Core — src/kernel/chainparams.cpp ↗
- First-partyBitcoin Core — src/validation.cpp ↗
- First-partyBitcoin Core — src/pow.cpp ↗