TeachMeBitcoin

The Checkpoint Anchor: Why old history is "Hardened."

From TeachMeBitcoin, the free encyclopedia Reading time: 3 min

16. The Checkpoint Anchor: Why old history is "Hardened."

In the "Forge of the Consensus," we have seen that every block is verified by its Proof of Work (Chapter 5). But what if a massive miner—one with more energy than the rest of the world combined—decided to rewrite the blockchain starting from the very first block? This is known as a 512-Block Attack or a "Long-Range Rewrite." To prevent this theoretical catastrophe, Bitcoin Core uses Checkpoints. These are hard-coded "Hashes" of specific blocks in history that the node knows to be true. For the Sovereign Architect, the Checkpoint is the "Anchor of the Past."

A checkpoint tells the node: "No matter what any miner says, Block 295,000 must have this specific hash." If a miner tries to send a different version of the past, your node will ignore it instantly, even if the miner has spent more energy than the rest of the planet. It is the "Hardened History" of the network.

Analyzing the Anchor: CheckIndexAgainstCheckpoint

In the source code (src/validation.cpp), the node checks every incoming block header against the list of known-good hashes.

/**
 * PEDAGOGICAL ANALYSIS: THE ANCHOR OF THE PAST
 * This logic ensures that the node is on the "Official History" of Bitcoin.
 */
bool ChainstateManager::CheckIndexAgainstCheckpoint(const CBlockHeader& header, ...)
{
    // 1. We look up the "Checkpoints" for the current network (Mainnet, Testnet).
    const MapCheckpoints& checkpoints = m_params.Checkpoints();

    // 2. We check if the current "Step" (Height) is a checkpoint height.
    // (e.g., Height 295,000).
    auto it = checkpoints.find(nHeight);

    // 3. If it is, we compare the block's hash to the hard-coded truth.
    if (it != checkpoints.end() && hash != it->second) {
        return false; // This is a "Fake History"!
    }

    return true; // The block is consistent with the anchors.
}

Explaining the Anchor: The North Star

The Sovereignty of the Hardened Past

As a Sovereign Architect, you know that the "Deep Past" of Bitcoin is the most secure data on Earth. By using checkpoints, your node is anchoring itself to the "Sacrifices of the Miners" who came before you. You are the "Master of the Anchor," ensuring that your bank is built on a foundation of "Immutable History" that no current power can rewrite. You are the "Guardian of the Eternal Record."


☕ Help support TeachMeBitcoin

TeachMeBitcoin is an ad-free, open-source educational repository curated by a passionate team of Bitcoin researchers and educators for public benefit. If you found our articles helpful, please consider supporting our hosting and ongoing content updates with a clean donation:

Ethereum: 0x578417C51783663D8A6A811B3544E1f779D39A85
Bitcoin: bc1q77k9e95rn669kpzyjr8ke9w95zhk7pa5s63qzz
Solana: 4ycT2ayqeMucixj3wS8Ay8Tq9NRDYRPKYbj3UGESyQ4J
Address copied to clipboard!