Sign in

Proof of History

Suggest an edit

Validators have to agree on the order of events, and figuring that out usually means a lot of back-and-forth voting before any real work can begin. Solana's answer is a clock that everyone can verify after the fact, without trusting anyone in particular. That clock is called Proof of History.

Validators' own clocks cannot settle the order of events

Different nodes have slightly different clocks, as the determinism lesson explained. Validator A might say 12:00:00.100 and validator B might say 12:00:00.150, with no way to tell which one is right. So validators cannot decide that one transaction came before another by looking at their clocks.

The usual fix is a timestamp that the block producer writes into the block. The other validators can check it only against their own clocks, which differ, so the producer has some freedom in choosing it and the network accepts it by exchanging messages. It also measures time no finer than one block. On Ethereum a new block is expected once per 12-second slot, as described in consensus on Ethereum. Instead of taking the producer's word for the time, Solana uses a clock whose readings anyone can recompute.

A hash chain measures elapsed time

Proof of History is a hash function applied to its own output, over and over. Each output becomes the input to the next. The hash function used is SHA-256, the same one Bitcoin uses for mining. It has no known shortcut, so given an input, there is no way to compute the result faster than running the function.

Proof of History hash chain from a seed through tick 0 to tick 3A row of boxes labeled tick 0 through tick 3 are linked by arrows labeled hash, showing a chain that starts from a seed where each tick's hash output feeds into the next tick. A box below titled 'Why this is a clock' explains that each tick is one SHA-256 of the previous tick, a single CPU can do about 10,000 per millisecond, and reaching tick N requires computing every step from 0 to N in order. Proof of History is a hash chain tick 0 starting seed hash tick 1 8c4f... d2a1 hash tick 2 f0b3... 7e94 hash tick 3 2a17... c8e2 . . . producing the chain takes time you cannot skip Why this is a clock Each tick is one SHA-256 of the previous tick. A single CPU can do this around 10,000 times per millisecond. No shortcut exists. To reach tick N, you have to compute every step from 0 to N in order. If you see tick N, you know the work between tick 0 and tick N actually happened.

To reach tick a thousand from tick zero, you must compute every tick between them in order. A single computer running this loop will produce tick N after a measurable amount of time, so the chain encodes time by the work that had to happen between one moment and the next, rather than by reading a clock.

Slow to produce, fast to verify

Producing the chain is strictly sequential. The leader who is responsible for advancing the clock has to compute each tick from the previous one, on a single CPU core, one at a time. More cores cannot help, and a faster machine cannot help much, so the chain advances at roughly the speed a single core can hash.

Verifying the chain is the opposite. To check that the chain is valid, you confirm that each tick really is the hash of the previous one, and that check is independent for every link. You can give a thousand different cores a different section of the chain, and they can all verify their slices at the same time.

Leader produces the hash chain sequentially; validators verify it in parallelThe top box shows the leader producing the chain as a repeating sequence of hashes on one CPU core, one tick at a time, which cannot be parallelized since each tick depends on the previous one. The bottom box shows validators A and B checking different tick ranges on separate cores at the same time, so a large network of validators can verify the whole chain far faster than one CPU produced it. Slow to produce, fast to verify The leader produces the chain (sequentially) leader: → hash → hash → hash → hash → hash → hash → hash → ... one CPU core, one tick at a time cannot be parallelized: each tick depends on the previous one Everyone else verifies the chain (in parallel) validator A: checks ticks 0..999 on core 1 validator A: checks ticks 1000..1999 on core 2 validator A: checks ticks 2000..2999 on core 3 validator B: checks ticks 0..999 on core 1, in parallel verification is just "does hashing this input give the next output?" each section is independent, so any number of cores or machines can split the work a network of 1,000 validators can verify the chain 1,000 times faster than one CPU produced it This is the asymmetry the network depends on. One CPU labors. Thousands verify cheaply.

The leader running the clock is a single machine, and the rest of the network, hundreds or thousands of validators, can keep up with it because they verify in parallel. Nobody has to vote on what time it is.

The clock is paid for in hardware. The leader keeps one core hashing all the time, and every validator recomputes every hash, which is fast only when the work is spread over many cores. What Solana traded for what lists what a validator machine needs.

Transactions are hashed into the chain

When a transaction arrives at the leader, the leader hashes the transaction's contents into the next tick along with the previous hash. Now the resulting tick depends on both the chain's history and that specific transaction.

Say the transaction goes into tick 2. Tick 3 is the hash of tick 2, so it depends on the transaction too, and moving the transaction to another place would change tick 2 and every tick after it. The transaction has a verifiable position on the clock: it happened at tick 2, no earlier and no later.

The recent_blockhash field you met in instructions and transactions is a snapshot of a recent point on the PoH chain. Including it in the transaction proves the transaction was built after that point, which is what keeps old transactions from being replayed indefinitely. Once the blockhash falls outside the validity window of about 150 slots, roughly a minute, the network rejects any transaction still referencing it.

Four steps from PoH ticks to slots to validator consensus in Solana block productionA vertical flow of four boxes connected by arrows, titled "Where PoH sits in Solana's block production." It shows the leader's hash chain ticking roughly every 6.25 microseconds, transactions getting stamped into ticks, ticks grouping into slots every 64 ticks (about 400 ms), and finally Tower BFT validators voting to finalize slots into the canonical chain. Where PoH sits in Solana's block production 1. PoH ticks (the clock) The leader runs the hash chain continuously. Each tick is a verified moment in time. A new tick happens about every 6.25 microseconds. 2. Transactions get stamped into the chain As transactions arrive, the leader hashes their contents into the next tick. Now each transaction has a verifiable position: "this happened at tick N." 3. Ticks group into slots (the blocks) Every 64 ticks (about 400 ms) the leader produces a slot, which is Solana's block. The slot wraps everything the leader did during that window. 4. Validators vote (the actual consensus) A separate mechanism, Tower BFT, takes the slots and finalizes them into the canonical chain. PoH is the timestamps. Consensus is the agreement on which sequence of slots is the real one.

The leader bundles up everything that happened in a window of roughly 400 milliseconds into a block. That window is called a slot, and a slot can pass without a block, as the leader schedule lesson shows later.

What PoH is and is not

PoH is a clock, and it is not Solana's consensus mechanism. Consensus is the process by which validators agree on which version of history is the canonical one when multiple are possible. Solana's consensus mechanism is called Tower BFT. It runs on top of PoH and uses the timestamps PoH provides, so the votes do not have to settle when each event happened. Validators see the same PoH chain everyone else sees, vote on which slots they believe are valid, and the network converges on a single canonical sequence.

PoH is also not what makes Solana secure. It does not protect against double-spends, censorship, or invalid state transitions. Those protections come from the consensus layer and the runtime's validation rules. PoH only protects against rewriting the order of past events, since rewriting would require redoing all the hash work between the rewritten point and the present.

In practice, almost nothing about your day-to-day Solana development depends on the internals of PoH. You include a recent_blockhash in every transaction, you see slots arrive at roughly 400ms intervals, and you read confirmations from validators voting on those slots.