Proof of History Explained by a Water Clock
A useful analogy for understanding Solana’s network architecture.
What is Proof of History?
To recap, blockchain technology at its simplest, is a trustless, peer to peer, decentralized network of computers (or nodes) that verify transactions along a digital ledger. One of the main issues of the PoW bitcoin algorithm is agreement on time and order of transactions.
A Proof of History (PoH) protocol based blockchain relies on a cryptographic way to create a reliable ordering of transactions/events recorded to the ‘ledger’ to solve the issue of agreement on time, and it allows for almost instant finality of hundreds of thousands of transactions per second.
For those who have already plunged headfirst into the blockchain space, resources like Solana’s website, the whitepaper, and the various conversations on Solana’s Telegram have given a more technical breakdown of how PoH works.
However, for the burgeoning many who have just entered the blockchain realm or are avid, non-technical believers in blockchain technology, this post will serve to explain PoH in simpler terms.
The Water Clock Analogy
The way an ancient water clock worked is that a regulated flow of water would drip into a vessel at a constant rate. Marks on the vessel and the rising level of the water would allow the ancient Greeks to record the passage of time.
Similarly, to record the passage of time, Solana’s PoH based blockchain uses a verifiable delay function, whose output cryptographically verifies that real time has passed in the process of generating that output (i.e. running the function). In this case, the blockchain’s rising ‘levels’ aren’t seconds or a unit of time, but simply sequential outputs of hashed blockchain state and count. In this way, just like a water clock, you know that the lower levels or ‘marks’ (hashes) had to come before the higher levels or ‘marks’ (hashes).
Rough sketch of ancient water clock (Wikipedia)
The specific verifiable delay function that Solana uses is a preimage resistant hash function. This is, in simple terms, a function that takes a bunch of data (the input) and spits out a small, fixed-size output. For instance, a large video can be put through a preimage resistant hash function and come out the other end as 256 bits. Or a piece of string data, like the name of your favorite restaurant can be hashed into a fixed, tiny bit-sized amount of data. The usefulness of these functions lies in security. No matter the given input data, there’s no way to predict the exact output — you have to execute the entire function to actually know the output (this is the cryptography part of why blockchain technology works and is very hard to ‘hack’).
Given this, if we run this function in a loop, taking a previous output as an input, and do this as fast and as we can, there is no way to know exactly what the output will be, oh let’s say, a million hash functions from now. If we run this with a counter and record how many times it’s been looped and the current state (hash value), together these pieces of information represent the data structure that tells us time has passed. We can also ‘append’ external data into this stream of hashes, by hashing the data together with the current state (hash). Because the PoH stream is verifiably ordered, we can then know exactly where in time any appended event and/or message was inserted into the stream. So no matter how fast or how many pieces of data get recorded to the growing PoH based data structure, we know what data/messages had to come before or after other ‘blocks’ through upper and lower bounds on time. Similar to the levels in a water clock.
Broadcasting the ‘water clock’ to the network
While running this function does take real time to generate eventual ‘blocks’ in this PoH digital ledger, we can take each slice of the data structure and verify them separately, in parallel, on gpu cores. For example, if your laptop boasts an 8 core processor, it can run multiple parallel processes at the same time. A modern GPU card can verify the transactions on this time based digital ledger almost instantly. This kind of verification method is also much faster than Bitcoin’s blockchain PoW protocol.
Now, when a decentralized network receives the various pieces of the data structure, because of the cryptographically reliable ordering of events encoded in the blockchain, all the nodes are able to receive and trust the order of the structure without having to re-verify them. To return to our analogy, the various nodes on the decentralized network are essentially receiving a snapshot of a cryptographic ancient water clock with the up to date, verified ledger of events, data and messages that have been added to the blockchain.
And just like a water clock, you don’t need to agree on a timezone or timestamp (since PoH makes it very easy to operate a global blockchain) to trust the ordering of data recorded on Solana’s blockchain.