April 19, 2024

Accelerate the blockchain to 710,000 transactions per second: review of the Proof of History algorithm

Sponsorship

One of the problems with cryptocurrencies is node synchronization. Toexecute transactions, nodes must write a block to the blockchain. To do this, they communicate and reach consensus.

This process takes time. Bitcoin throughput - 4 transactions per second (TPS), EOS blockchain - less than 50 TPS. At the same time, the Visa payment system processes 65,000 TPS.

During tests, Solana showed 60,000 TPS. According to developers, the theoretical network bandwidth can reach 710,000 TPS. The project achieved such indicators thanks to its own solutions: Proof of History, Tower Byzantine Fault Tolerance (TBFT), Turbine, Gulfstream, Sealevel, Pipeline, Cloudbreak and Archivers.

We talk about how Proof of History works and why blockchain throughput is important.

About Solana

Solana is an American project developing a scalable blockchain protocol for creating decentralized applications and smart contracts.

The Solana team includes former Qualcomm lead developer Anatoly Yakovenko, BREW OS developer Greg Fitzgerald, and PhD in particle physics Eric Williams.

The project was founded in 2017. In 2018, the team launched the alpha version of the test network; in 2019, it received $ 20 million in venture capital investments.

Solana uses the SOL utility token to reward hosts that support the network.

The project announced a Dutch auction of SOL tokens. It will take place on March 24 at 08:00 (Moscow time) on the Coinlist platform. The initial price of the SOL token is $4. You can place bets from March 17th.

You can register for bidding on the auction page. Users can return tokens under warranty within 12 months. In this case, Solana will redeem them for 90% of the total auction price.

What is Proof of History

Proof of History (PoH) is a blockchain synchronization algorithm. It has an internal clock that shows the same time on all nodes.

Network nodes operate according to a schedule. Thanks to synchronization, they can check the time between transactions on the blockchain.

What is node synchronization for?

In order to reach a consensus, the nodes must exchange information - synchronize. This can take up to 40 seconds depending on the data rate between nodes.

The speed of synchronization affects the throughput of the blockchain. The faster it is, the more transactions per second the network processes.

Imagine: you command the ground forces and in turn give the order to the generals, they inform his soldiers. If you can shout to the generals, then synchronization is fast. But if you send orders to pigeons, synchronization will be slow. While the tank troops wait for the pigeon, the cavalry will fulfill the order.

This is what happens in cryptocurrency:

  • a node finds a new block and informs another node about it;
  • together they send news about the found block to the other two nodes, which transmit it to the rest.

Miners who do not know about the found block continue mining. As a result, miners can mine two blocks at the same time. One of the blocks will become rejected (orphan block).

Orphan blocks divide the blockchain into two branches. This gives a chance to spend double spending and other attacks.

In Bitcoin, nodes search for a block of 10 minutes andsynced in 15 seconds. Orphan blocks appear rarely - once every 10,000 blocks. If you speed up block mining without affecting synchronization time, orphan blocks will appear more often.

Ethereum developers have increased the block mining speed to 13 seconds, and miners regularly mine rejected blocks.

Timing Problem

To use time synchronization, you need a clock. Cryptocurrencies have their own clock and internal time - timestamp. It is not accurate because there is no central clock to consult.

The node cannot trust the timestamp, so it averages this value:

  1. Requests local time from other nodes.
  2. Counts the median of the time sample.
  3. Adjusts its time based on this median.

Such synchronization is not ideal: if you focus on timestamp, a new block may appear earlier than the previous one.

But time does not have to be counted in seconds.To do this, you can use any intervals like falling drops of water. The main thing is that the time is the same on all watches. If a soldier's clock is fast, he will go on the attack before the rest of the soldiers.

To solve the time synchronization problem, Solana invented a decentralized clock - the Proof of History protocol.

How Proof of History Works

Proof of History works like an hourglass. The grains of sand in the watch are tied with a thread, like beads. Sand flows from the upper bowl to the lower.

The grains of sand fall at different speeds, but we can calculate the number of grains of sand in the lower bowl:

  1. Let's paint one grain of sand green, the other red, and we won't paint the rest.
  2. First, a green grain of sand will fall, then several colorless ones and a red one.
  3. We do not know the interval of grains of sand falling in seconds, but we know how many colorless grains of sand fell between green and red. We can say: the red grain of sand fell through N grains of sand after the green.
  4. If we rewind the chain of grains of sand along the thread to the beginning, we will find out that the green grain of sand is X in the count. Red grain of sand - X + N.

Proof of History is a hash function withconfirmed lead time. If we loop over PoH and use the result for the next calculation, the output will be a chain of related hashes - a thread with grains of sand.

Accelerate the blockchain to 710,000 transactions per second: review of the Proof of History algorithm 

How does Proof of History work?Validators count PoH and record the results:PoH hash and hashing sequence number - count. From these results, it can be verified that the leader considered each PoH. You can also prove the sequence in which the hashes were obtained: hash Y was obtained after hash X and before hash Z.

Sand grains Proof of History can be painted -write events to them. If you count the hashes from the first PoH value, you can determine the relative time of the event. Validators check the order of the PoH hashes and find out the chronological order of the transactions.

How PoH Increases Blockchain Throughput and Solves Blocked Block Problem

Solana creates a schedule for the Leader Schedule nodes to synchronize their actions. Scheduled time is measured in Proof of History hashes. Here's how it works:

  1. The first validator becomes the leader for the period from 0 to 1000 PoH hashes.
  2. It calculates the Proof of History hash, verifies the transaction and stamps it. It includes the public key, value and sequence number of the PoH hash.
  3. The leader sends the transaction to two validators. They check it and pass it on to other validators.
  4. The leadership period of the next validator is from 1001 to 2000 hashes. The validator counts time in Proof of History and knows when it will become a leader.

Leader rotation algorithm reduces production timeblock up to 0.4 sec and solves the problem of orphan blocks. Validators become leaders on a schedule. Their work shifts (slot) do not overlap: the validator will not create the rejected block into another's shift.

Solana Experience: Scaling Without Sharding

Ethereum developers plan to solve the problem of scaling using sharding: the network is divided into several subnetworks (shards) with a separate blockchain and nodes. This solution has disadvantages:

  • it is easier to conduct a 51% attack using orphan blocks;
  • harder to validate data;
  • it can negatively affect decentralization.

Solana scales without sharding thanks to such developments:

  • Turbine and Gulfstream transaction transfer protocols;
  • distributed storage of data from archivers;
  • Optimization of record of transactions of Cloudbreak.

Turbine and Gulfstream break transactions into batches:

  1. The leader passes parts of the transaction to two random validators. This is faster than passing complete blocks to nodes.
  2. Validators exchange these parts and thus collect the complete transaction.

Accelerate the blockchain to 710,000 transactions per second: review of the Proof of History algorithm 

Exchange of transaction parts

Archivers are individual nodes that record batches from random validators. The archiving protocol distributes the blockchain among archivers.

Cloudbreak optimizes multi-threaded recording to disk: archivers quickly record small pieces of data.

If you break a 1 gigabyte blockchain betweenhundreds of archivers, the total amount of blockchain in the network will be 1.33 GB: 1 gigabyte of blockchain and 0.33 gigabyte of verification codes. In bitcoin, nodes store 1 gigabyte of blockchain, in total - 100 gigabytes.

Why blockchain high bandwidth

During tests, 50 nodes in the Solana network processed 191,000 transactions per second at peak load. The average network bandwidth is 60,000 TPS.

High throughput is needed for resource-intensive systems and applications: exchanges, advertising platforms and file storage.

A practical example is the work of 5G providers. 5G towers have a small range. For towers with a speed of 20 Mbps - less than 200 meters.

Providers need a lot of 5G towers. With the increase in the number of towers, it will become difficult to monitor the verification of subscribers and calculate payments for the Internet.

“Providers will need to process thousandstechnical requests of each new tower. Blockchain will help automate traffic accounting, calculate payments and verify users, ”commented the developer Solana

According to the estimates of the Solana project, smartphone ownerssend towers 50 thousand technical queries per second. Solana will be able to process such a number of transactions and simplify the verification and payment processes for providers. Thanks to this, 5G service will be cheaper, and tariffs more affordable.

findings

If cryptocurrencies want to compete with centralized systems, they need to increase their throughput. And to do this, speed up the synchronization of nodes.

Centralized systems use an internal clock. Google synchronizes databases using atomic clocks, Yandex synchronizes databases using a central NTP server. Proof of History is their decentralized counterpart.

Perhaps future centralized projectsThey will use Proof of History as an easier way to synchronize actions: switching operating modes, backing up databases and distributed calculations.