What are the characteristics of the consensus mechanism behind Solana's high throughput?
Author: Cookies Research
Translator: Block unicorn
The consensus mechanism of blockchain is responsible for verifying the validity of transactions and adding them to the blockchain in the correct order. Depending on the chosen consensus mechanism, the efficiency of the verification and ordering process varies, leading to different levels of throughput. In the blockchain field, Solana is a high-performance chain with a block time of 400 milliseconds, an average transactions per second (TPS) ranging from 2,000 to 3,000, and a theoretical peak TPS of 65,000 (for reference, Ethereum's 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 Proof of History (PoH) mechanism.
1. Traditional Consensus Mechanism
Let's start by understanding a key bottleneck of blockchain: scalability.
In a distributed blockchain network, each node has its own internal clock that runs according to this local system clock. When transactions occur, nodes add timestamps to the transactions based on this local system clock.
The following image shows the internal clocks of the nodes:
The final confirmation or rejection of the transaction's timestamp is also based on this local system clock. 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 their local clocks to ensure a consistent understanding of time when processing transactions. Communication between nodes helps establish a common time reference to ensure a consistent network-wide understanding of time, thereby coordinating the order and confirmation of transactions.
For a distributed blockchain, with thousands of nodes distributed globally, differences in local system clocks between nodes are inevitable, leading to inconsistent timestamps for transactions across different nodes. When nodes need to achieve consensus on which transactions have occurred and the order of these transactions in a block, this becomes a problem. This is known as the timestamp synchronization problem, which becomes more severe and complex as the network enhances decentralization by increasing the number of nodes.
Ultimately, this creates a potential path for malicious attacks. Time differences allow malicious actors to broadcast false transactions with timestamps similar to real ones, attempting to control the network. To prevent manipulation of transactions, significant time and processing power are required to verify the accuracy of timestamps. This could lead to delays in block confirmation or even block rejection (because nodes may vote that the block is invalid due to different timestamps).
2. What is Proof of History (PoH)
Proof of History (PoH) in Solana is used to prove that transactions are correctly ordered, which can be easily verified by validators in the network.
In contrast to the situation where each node has its own independent clock mentioned in the first section, PoH can be seen as a global clock that all nodes use to verify the passage of time between two events. Through this global clock, nodes view the same transaction history, eliminating any potential disagreements about the order of transactions. This allows consensus to be quickly reached, greatly reducing the time for transactions to be verified and added to the blockchain.
PoH relies on a cryptographic method to create a continuous, time-ordered record of transactions. Let's delve deeper into this.
3. In-depth Technical Discussion of PoH
Each transaction undergoes SHA-256 processing, which is 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 for the next transaction's hash. This process establishes the inherent order of transactions in the hash output, forming a long and continuous chain.
PoH (Proof of History) leverages Verifiable Delay Functions (VDF), which are crucial in verifying the passage of time in a blockchain. VDF is a computationally intensive function that depends not only on previous hashes but also includes the time elapsed. This mechanism allows Solana to cryptographically demonstrate that real time has passed, generating a continuous output. As a result, there is a clear, verifiable transaction order, ensuring a consistent event timeline. Validators can easily verify how much time has elapsed, further enhancing the network's trustworthiness.
The use of PoH (Proof of History) in Solana adds a powerful layer of security and integrity. Tampering with any part of the hash chain would require recalculating all subsequent hashes, which is a labor-intensive effort that protects the network from tampering.
PoH (Proof of History) significantly reduces the amount of information that validators need to process for each block. By using the hashed version of the most recent state of transactions, block confirmation time is greatly reduced. When validators (or replica nodes) receive a block, the PoH (Proof of History) sequence provides them with a cryptographically reliable transaction order that they can trust without the need for re-verification. This efficiency is crucial for accelerating the consensus mechanism, as the network can quickly select and transition to the next validator for block validation.
4. Delegated Proof of Stake (DPoS)
With a better understanding of PoH, this section explains how PoH is applied in Solana's consensus mechanism (DPoS).
In DPoS, every validator who stakes $SOL can participate in network governance—voting on the validity of blocks and deciding whether to add them to the blockchain. $SOL holders who do not wish to directly participate in the proof of stake process (including you and me) can delegate their tokens to other validators, effectively making them delegates. This delegation process allocates the voting power of the delegator (proportional to the amount of $SOL they hold) to these validators. As a reward for staking $SOL, delegators receive a portion of the block rewards.
The operation principle of the DPoS system is that nodes with larger stakes are more likely to be selected to validate transactions and add them to the blockchain, and the opportunity to receive block rewards encourages nodes to maintain high levels of performance and integrity.
After understanding both DPoS and PoH, let's combine this knowledge and outline what a typical block confirmation looks like on Solana.
5. High-level Overview of Solana's Consensus Mechanism
Selection of leader nodes: Leader nodes are responsible for generating the PoH sequence (historical proof ordering of transactions) and creating blocks.
This selection process is based on the weight of the node's stake, which increases through tokens delegated to them by token holders. The leadership role rotates among validators.
Adding timestamps to transactions: Leader nodes receive transactions and use PoH to add timestamps to them, establishing the order of transactions.
Block creation: Using the sequence from PoH, leader nodes then begin creating a block.
Block propagation: The newly created block is sent to replica nodes (other validators in the distributed network).
Validation of transaction validity, replica nodes verify the following two components:
a. Transaction order: Verify if transactions are correctly ordered using the PoH sequence. This verification does not require round-trip communication between nodes, unlike common consensus mechanisms such as PoW and PoS, as it is a global clock.
b. Transaction validity: Check if transactions comply with network rules and are valid.
Finalization of the block: After validating the order and validity of transactions, the block is added to the blockchain. Then the next leader node is selected, and the entire process starts again.
Conclusion
Solana has been tirelessly improving its blockchain architecture, with recent developments including QUIC, stake-weighted QoS, and a localized fee market. Additionally, the ecosystem is looking forward to significant efficiency improvements through the introduction of Firedancer. Notably, Solana's unique architecture—OPOS (Only on Solana)—may bring new use cases.
免责声明:本文章仅代表作者个人观点,不代表本平台的立场和观点。本文章仅供信息分享,不构成对任何人的任何投资建议。用户与作者之间的任何争议,与本平台无关。如网页中刊载的文章或图片涉及侵权,请提供相关的权利证明和身份证明发送邮件到support@aicoin.com,本平台相关工作人员将会进行核查。