Talk about blockchain long enough and the conversation drifts into buzzwords like "decentralized trustless ledgers." Strip away the hype and ask a grounded engineering question: what actually gets written onto the SSD inside a blockchain node?
There is no exotic hardware. A blockchain is stored on ordinary hard drives and NVMe SSDs as cryptographically linked blocks, embedded key-value databases, and serialized binary transaction logs replicated independently across thousands of computers.
1. The Core Data Structure: Hash-Linked Blocks
At its simplest, a block is just a small structured record containing:
- Block Header: Version, timestamp, nonce/consensus proof, Merkle root summarizing transactions, and the cryptographic hash (
SHA-256) of the previous block. - Transaction List: Input references, cryptographic signatures proving ownership, and output amounts/state transitions.
Because every block embeds the hash of its predecessor, altering a single bit inside Block #10 immediately changes Block #10's SHA-256 hash—breaking the previousHash link inside Block #11, #12, and every block built after it. Tampering is instantly detectable in milliseconds.
You can build and verify a real hash-linked blockchain directly in Node.js using built-in node:crypto:
import crypto from "node:crypto";
interface Block {
index: number;
timestamp: string;
data: string;
previousHash: string;
hash: string;
}
function hashBlock(index: number, timestamp: string, data: string, previousHash: string): string {
const payload = `${index}|${timestamp}|${data}|${previousHash}`;
return crypto.createHash("sha256").update(payload).digest("hex");
}
function createBlock(index: number, data: string, previousHash: string): Block {
const timestamp = new Date().toISOString();
return {
index,
timestamp,
data,
previousHash,
hash: hashBlock(index, timestamp, data, previousHash),
};
}
const genesis = createBlock(0, "Genesis Ledger", "0".repeat(64));
const block1 = createBlock(1, "Alice -> Bob: 2.5 units", genesis.hash);
console.log("Block 0 Hash:", genesis.hash.slice(0, 20) + "...");
console.log("Block 1 Prev:", block1.previousHash.slice(0, 20) + "...");
console.log("Chain Intact:", block1.previousHash === genesis.hash);2. How Nodes Actually Store Hundreds of Gigabytes on Disk
When a full node (like Bitcoin Core or an Ethereum client) runs on a Linux machine, it does not keep one massive JSON file in memory. Instead, it splits disk storage across optimized layers:
- Raw Append-Only Block Files (
blk*.dat): Sequential binary files containing raw serialized blocks exactly as received over peer-to-peer TCP sockets. Writing sequentially keeps SSD wear low and throughput fast. - Embedded Key-Value Indexes (
LevelDBorRocksDB): Searching raw block files sequentially would beO(n)slow. Clients maintain fast local key-value indexes mapping block hashes -> file byte offsets, plus the live UTXO / Account State Trie (who currently owns what!). - State Pruning & Snapshots: Rather than forcing every machine to keep hundreds of gigabytes of obsolete historical spent outputs, pruned nodes verify every block cryptographically on the fly and discard old raw blocks while retaining the verified active state database.
3. Merkle Trees: Proving Membership Without Downloading Everything
Wait—how does a lightweight mobile wallet verify that a transaction really sits inside a 2 MB block without downloading gigabytes of raw files?
Every transaction in a block gets hashed pairwise up into a binary Merkle Tree until one 32-byte root hash (Merkle Root) sits inside the 80-byte block header. To prove a transaction exists inside a block of 4,000 transactions, a mobile wallet only needs 12 small sibling hashes (log2(4096)) instead of all 4,000 full transactions!
4. Consensus: Why Every Machine Writes the Same History
Since no central server sits in charge, thousands of independent nodes communicate over a gossip peer-to-peer network. Whenever a new block is proposed and verified against consensus rules (Proof of Work difficulty or Proof of Stake validator attestations), every node independently appends that block to its own local NVMe drive and updates its local state database.
Write-Ahead Safety and Fork Reorganizations
What happens when two valid blocks reach different sides of the planet within the same second—causing a temporary 1-block chain split? Full nodes cannot simply mutate balances destructively in place and throw away history. Instead, database updates track undo logs (rev*.dat in Bitcoin or versioned state snapshots) alongside LevelDB/RocksDB write batches.
If an alternative chain branch overtakes the node's local tip in accumulated work or stake finality, the client rolls back its state trie cleanly using the stored undo log for the orphaned block, applies the winning branch transactions atomically, and updates its canonical chain index—preserving deterministic state consistency across restarts or sudden power loss.
5. Hardware Realities: Why SSD IOPS Decide Node Sync Speed
Running a full verifying node tests your storage hardware far more than your network card:
- Random Lookups Dominate Validation: Every transaction inside a newly arrived block forces hundreds of random reads against the active UTXO set or Account State Trie to confirm unspent funds and valid nonces.
- LSM-Tree Compaction Pressure: Both
LevelDBandRocksDBbuffer updates in memory (MemTable) before writing sorted SSTable levels to disk. Because HDD seek heads stall at ~100 random reads per second while modern NVMe SSDs sustain tens of thousands of random IOPS, spinning hard drives fall hours behind live block verification while NVMe nodes validate blocks smoothly in milliseconds.
Summary
Physically, a blockchain is simply deterministic software maintaining an append-only binary log of hash-chained blocks alongside fast local key-value state databases (LevelDB/RocksDB), undo logs, and Merkle proofs on everyday NVMe SSDs—replicated independently across peers so no single server can rewrite past history silently.
