深度解读Solana共识机制:委托权益证明和历史证明

avatar
Block unicorn
8 months ago
This article is approximately 1281 words,and reading the entire article takes about 2 minutes
Solana 高吞吐量背后的共识机制有何特点?

Original author: Cookies Research

Original compilation: Block unicorn

The blockchain’s consensus mechanism is responsible for validating transactions and adding them to the blockchain in the correct order. Depending on the consensus mechanism chosen, the validation and ordering processes differ in efficiency, resulting in different levels of throughput. In the blockchain world, Solana is a high-performance chain with a block time of 400 milliseconds, transactions per second (TPS) averaging between 2,000 and 3,000, and a theoretical peak TPS of 65,000 ( For reference, Ethereums TPS is approximately 12).

This article aims to highlight two architectures in Solana that play a key role and contribute to its high throughput, namely its Delegated Proof of Stake (DPoS) consensus mechanism and its Proof of History (PoH) mechanism.

1. Traditional consensus mechanism

Let’s start by understanding a key bottleneck of blockchain: scalability.

Each node in a distributed blockchain network has its own internal clock and it runs according to this local system clock. When a transaction occurs, the node will timestamp the transaction based on this local system clock.

The picture below shows the clock inside the node:

深度解读Solana共识机制:委托权益证明和历史证明

The timestamp of the final confirmation or rejection of the transaction will also be based on this local system block. In traditional consensus mechanisms (such as Proof of Work PoW and Proof of Stake PoS), all nodes need to communicate with each other to coordinate each others local clocks to ensure that they have a consistent understanding of time when processing transactions. Communication between nodes helps establish a common time base to ensure that the entire network has a consistent perception of time, thereby coordinating the order and confirmation of transactions.

深度解读Solana共识机制:委托权益证明和历史证明

For a distributed blockchain, with thousands of nodes distributed around the world, differences in local system clocks between nodes are inevitable, causing the timestamps of transactions to be inconsistent between different nodes. This becomes a problem when nodes need to agree on which transactions occurred and the order in which those transactions occurred in the block. This is known as the timestamp synchronization problem, and it becomes more severe and complex when the network increases decentralization by increasing the number of nodes.

深度解读Solana共识机制:委托权益证明和历史证明

Ultimately, this creates a possible path for malicious attacks. The difference in time allows malicious actors to broadcast fake transactions that resemble real timestamps in an attempt to take over the network. To prevent manipulation of transactions, it takes significant time and processing power to verify the accuracy of the timestamps. This has the potential to cause delays in block confirmation, or even block rejection (as nodes may vote the block to be invalid due to having a different timestamp).

2. What is Proof of History (PoH)?

Proof of History (PoH) is used in Solana to prove that transactions were correctly sequenced, and this can be easily verified by validators in the network.

Contrary to the situation mentioned in Section 1 where each node has its own independent clock, PoH can be considered as a global block that is used by all nodes to verify the passage of time between two events. Through this global clock, nodes look at the same transaction history, discarding any disagreements that might exist about the order of transactions. This allows consensus to be reached quickly, greatly reducing the time it takes for transactions to be verified and added to the blockchain.

PoH relies on a cryptographic method to create a continuous, chronological record of transactions. Let’s take a closer look.

3. In-depth discussion of PoH technology

Each transaction is processed through SHA-256, a cryptographic hash function known for its ability to accept any input and generate a unique, unpredictable output. When a transaction is hashed, its output becomes the input to the next transaction’s hash. This process establishes a built-in order of transactions in the hash output, forming a long, continuous chain.

PoH (Proof of History) utilizes the Verifiable Delay Function (VDF), which verifies the significance of the passage of time in the blockchain. VDFs are computationally intensive functions that rely not only on the previous hash but also on elapsed time. This mechanism allows Solana to cryptographically display the actual time that has passed, generating a continuous output. As a result, there is a clear, verifiable sequence of transactions, ensuring a consistent timeline of events. Validators can therefore easily verify how much time has elapsed, further enhancing the trustworthiness of the network.

Using PoH (Proof of History) in Solana adds a strong layer of security and integrity. Tampering with any part of the hash chain requires recalculation of all subsequent hashes, an effort-intensive effort to protect the network from the changes.

PoH (Proof of History) significantly reduces the amount of information that validators need to process per block. By using a hashed version of the latest state of a transaction, block confirmation time is significantly reduced. When a validator (or replicating node) receives a block, the PoH (Proof of History) sequence provides them with a cryptographically reliable order of transactions that they can trust without re-verification. This efficiency is critical to speeding up the consensus mechanism as the network can quickly select and move on to the next validator for block validation.

4. Delegated Proof of Stake (DPoS)

Based on a better understanding of PoH, this section will explain how PoH is applied in Solanas consensus mechanism (DPoS).

深度解读Solana共识机制:委托权益证明和历史证明

In DPoS, every validator who stakes $SOL is able to participate in network governance - voting on the validity of blocks and deciding whether to add them to the blockchain. $SOL holders (including you and me) who dont want to directly participate in the proof-of-stake process can delegate their tokens to other validators, effectively making them delegators. This delegation process distributes delegators’ voting power (proportional to the amount of $SOL they own) to these validators. In return for staking $SOL, delegators will receive a portion of the block reward.

The DPoS system operates on the principle that nodes with greater stake are more likely to be selected to validate transactions and add them to the blockchain, and the opportunity to earn block rewards encourages nodes to maintain high levels of performance and integrity.

Now that we understand both DPoS and PoH, lets combine this knowledge to provide an overview of what a typical block confirmation looks like on Solana.

5. High-level overview of Solana consensus mechanism

1. Selection of leader nodes: Leader nodes are responsible for generating PoH sequences (Proof of History Ordering Transactions) and creating blocks.

This selection process is based on the node’s stake weight, which is increased by token holders delegating to them. Leadership roles will rotate among validators.

2. Add timestamps to transactions: The leader node will receive transactions and timestamp them using PoH to form a transaction sequence.

3. Block creation: Through the sequence from the PoH, the leader node then starts creating a block.

4. Block propagation: Newly created blocks will be sent to replica nodes (other validators in the distributed network).

5. Transaction validity verification, the replica node will verify the following two components:

a. Transaction sequence: Use PoH sequence to verify whether transactions are arranged in the correct order. Since it is a global clock, this verification does not require round-trip communication between nodes (unlike common consensus mechanisms such as PoW and PoS).

b. Transaction validity: Check whether the transaction complies with network rules and is valid.

6. Block finalization: After verifying the transaction order and validity, the block will be added to the blockchain. Then the next leader node will be selected and the whole process starts over.

in conclusion

Solana has been working tirelessly to improve its blockchain architecture, with recent developments including QUIC, stake-weighted QoS and localized fee markets. Additionally, the ecosystem is looking forward to significantly increasing its efficiency with the launch of Firedancer. It’s worth noting that Solana’s unique architecture, OPOS (Solana only), may bring new use cases.

Original article, author:Block unicorn。Reprint/Content Collaboration/For Reporting, Please Contact report@odaily.email;Illegal reprinting must be punished by law.

ODAILY reminds readers to establish correct monetary and investment concepts, rationally view blockchain, and effectively improve risk awareness; We can actively report and report any illegal or criminal clues discovered to relevant departments.

Recommended Reading
Editor’s Picks