-
Cryptocurrencies
-
Exchanges
-
Media
All languages
Cryptocurrencies
Exchanges
Media
The goal of Harmony is to create a shard-based blockchain with full scalability and security. It has studied many blockchain solutions on the market and proposed its own engineering implementation plan. This is where Harmony deserves everyone's attention.
This is a very high goal. First of all, it has complete scalability. Harmony's sharding includes not only transaction confirmation, network communication, but also blockchain state sharding. Second, we must ensure the security of fragmentation. Harmony's sharding is based on the DRG (Distributed Random Generation) process, which makes it unpredictable, fair, verifiable, and scalable. In addition, Harmony adopts the PoS mechanism instead of the PoW mechanism to select validators, and it has its own optimization for the PBFT consensus mechanism. PoS has a certain threshold, not only to ensure that small stakers can participate in the network and earn income, but also to prevent malicious attackers from gaining control over a single shard. Harmony implements information dissemination within a shard and across a shard network by using the Adaptive Information Dispersal Algorithm. Harmony also uses Kademlia routing to realize cross-shard transactions that scale logarithmically as the number of shards increases. With sharding, the consistency of cross-shard transactions must also be maintained. Harmony also supports cross-shard transactions, supports direct communication between shards, and ensures the consistency of cross-shard transactions through an atomic locking mechanism.
All in all, Harmony tries to provide a scalable, secure and decentralized blockchain by optimizing the protocol layer and network layer, which can support more mainstream decentralized application scenarios, including Games, decentralized exchanges, IoT, etc. This is an ambitious vision.
At present, many new blockchain projects are trying to increase transaction processing speed (throughput), but new solutions like dPoS in EOS and TRON, Rootchain in Quarkchain, etc. must sacrifice some key elements, For example, decentralization and security can significantly improve performance.
Although such a system runs very quickly, it can only be regarded as a semi-centralized system, which loses the core concept of blockchain - decentralization.
As a solution for blockchain expansion, sharding can significantly improve network performance without compromising security and decentralization.
Harmony solves the problem of blockchain expansion by introducing state sharding into the blockchain—since each node only needs to run and store a part of the blockchain data to complete the transaction, the workload of transaction processing is shared by This greatly improves the scalability of the block itself.
Scaling is one of the most talked about issues in the blockchain industry right now. Whoever solves this problem first will become the leader in the industry. Of course, the premise here is that under the premise of taking into account the two attributes of security and decentralization, if a breakthrough is achieved by sacrificing these two key attributes, this is only a low-level breakthrough, or it is moving towards a different development path.
Under the premise of taking security and decentralization into account, sharding is one of the most important paths for blockchain expansion. This is the focus of Harmony's exploration. Although there are other sharding blockchain projects, including Ethereum 2.0, there are also cross-chain projects. If Harmony can explore sharding, it can be more solid than other projects. Then it has a chance to get a head start on the competition.
Of course, the Harmony team chose a difficult road, which requires a lot of effort and has very strong competitors. According to the Harmony team's introduction to Blue Fox Notes, the project has completed 18 million US dollars in financing, and investors have funds from Silicon Valley, Australia, Hong Kong, and Singapore, and it has made a good start.
From Harmony's white paper, it can be seen that the team has clear technical thinking, and has thought deeply about the problems to be faced in the implementation of sharding projects. The team is mainly composed of R&D personnel, mainly from the background of Microsoft, Google, and Apple .
Scalable FBFT consensus mechanism
Harmony does not adopt PoW, but PoS mechanism, users obtain the rights and rewards of producing blocks by staking tokens. At the same time, Harmony uses the FBPT mechanism in the block production and verification process. Before explaining what is FBFT, we know that PBFT is practical Byzantine fault tolerance. Since PBFT has a mechanism that verifiers need to broadcast their votes to other verifiers, this greatly increases the communication complexity of PBFT, making it difficult to expand the blockchain if the system has hundreds or thousands of nodes.
For the problem that PBFT is difficult to expand, FBFT has been optimized, and FBFT can achieve linear expansion in terms of communication complexity. Specifically, how to achieve it? In the FBFT mechanism, it also has the roles of leader and verifier, and does not require all verifiers to broadcast their votes. The leader runs a multi-signature signature process to collect the votes of the verifiers. The size of this multi-signature is O(1 ), and then broadcast the vote. This means that each validator only needs to receive one multisignature, reducing the communication complexity from O(n^2) to O(n).
The Schnorr signature mechanism can achieve constant size multi-signature aggregation and form a multicast tree among verifiers to facilitate message delivery, but schnorr multi-signature requires secret commitment rounds, which will lead to the problem of two round trips for a single multi-signature , FBFT uses the BLS (Boneh-Lynn-Shacham) multi-signature scheme to optimize this problem, and only one round trip is required to achieve it. Therefore, FBFT is 50% faster than BFT using the Schonorr signature mechanism. Finally, Harmony also employs the RaptorQ fountain code to speed up the block broadcasting process.
One thing to note is that all Harmony consensus verifiers are selected based on the PoS mechanism. Validators with more voting shares have more votes than everyone else, rather than signing one vote at a time. This also means that what the leader is waiting for is not the signature of 2f+1 verifiers, but the voting shares of 2f+1 verifiers.
Random algorithm integrating VRF and VDF
For the blockchain, it needs to be expanded quickly. For example, the above-mentioned FBFT can achieve faster transaction confirmation, but safety is always the most important of. In the process of validating blocks, maintaining randomness is a top priority for security.
A good random algorithm must be unpredictable, verifiable, non-discriminatory, and scalable at the same time. Some protocols can be unpredictable, non-discriminatory, and verifiable, but the scalability is weak, such as the RandHound protocol. They have their own advantages and disadvantages.
Harmony proposes a random generation algorithm which combines VRF and VDF technologies. VRF is a Verifiable Random Function, and VDF is a Verifiable Delay Function. Algorand uses cryptographic classification based on VRF (Verifiable Random Function) to select a consensus verification group; Ethereum 2.0 proposes VDF (Verifiable Delay Function) to delay the reveal of the actual random number and prevent the attack of the last revealer.
Due to VDF, the leader cannot know the actual final random number until pRnd is submitted to the blockchain. Since the VDF is used to calculate Rnd, pRnd has already been committed in the previous block, so the leader cannot manipulate it. If the leader does not submit pRnd to stop the protocol, FBFT has a timeout mechanism to switch the leader and restart the protocol. In addition, the complexity of the DRG protocol adopted by Harmony is O(n), which is at least an order of magnitude faster than some projects.
PoS-based sharding
Both PoW and PoS must prevent Sybil attacks. The PoW chain uses computing power to prove its identity, and thus obtains the right to produce blocks. Harmony adopts the PoS mechanism, and PoS uses the validator's equity token pledge to prove it. To become a validator of Harmony, you must first stake certain tokens. The more tokens staked, the more validator voting shares you can get. Each voting share corresponds to one vote for the BFT consensus.
Staking stakers get voting shares proportional to the tokens they stake. The voting shares are randomly assigned to shards. Stakeholders who become shard validators get corresponding voting rights in the shard.
In Harmony's consensus and sharding process, there is a concept of cycles (Epochs). Periods are predetermined time intervals during which the shard structure is fixed and each shard continuously runs consensus with the same set of validators.
At the beginning of each cycle, a random number will be generated by the DRG protocol, and the fragmentation structure will be determined based on the random number. Validators must stake their tokens in the previous period if they want to validate transactions during a certain period. The deadline for stake pledge is before the random number preimage pRnd is submitted to the blockchain.
At the beginning of each new validation cycle, the new validator's voting shares are randomly assigned to the shards. New validators join a shard and their voting shares are distributed. Shard consensus requires block signatures with at least 2f+1 voting shares.
In order to ensure the security of a single shard, Harmony adopts an adaptive threshold PoS, which adjusts the price of voting shares through algorithms in an adaptive manner, and assigns individual voting shares to shards instead of a single verification By.
In order to prevent large-scale pledged token attacks, Harmony does not shard through verifiers, but shards through voting shares to prevent a large number of coin-holding verifiers from occupying a single shard. A single validator can be assigned to multiple shards if it has voting shares assigned to different shards. The leader of a shard is determined to be the validator with the first voting share in a certain group.
At the same time, the voting shares are so small that malicious attackers cannot gather power in a single shard. After calculation, Harmony believes that once more than 600 voting shares, the high security of sharding can be guaranteed.
Considering economic benefits, validators with more staked tokens have more chances to be elected as leaders. In the event of malicious behavior, validators who have staked tokens fear that their interests will be diminished, thereby ensuring the security of the network.
In addition to the above mechanisms, Harmony also adopts a reshuffled sharding scheme to improve its security. Because if the shards remain structured, malicious attackers still have the opportunity to carry out their attacks. Such as the implementation of static cycle attack, slow adaptation attack or full adaptation attack and so on. Harmony uses a resharding mechanism based on Cuckoo rules to solve these problems. At the end of a validation cycle in which validators who withdraw their stake are expelled from the network, those who keep their stake stay.
Fast state synchronization
The first block of an epoch contains a hash link to the first block of the previous epoch. This allows the state of new nodes to be quickly synchronized, where they can rely on gray blocks to quickly verify the current state.
If you need to download the entire blockchain history to verify shard transactions, then the time is too long. If you have synchronized the Ethereum blockchain history, you will know that it may take several days. Harmony only has to download the current state within a cycle time window.
In Harmony, new validators joining a shard first download the current state tries for that shard. New nodes download historical block headers and verify the block headers by checking their signatures. The shard state is valid as long as there are cryptographic traces from the current state back to the genesis block, such as hash pointers and signatures.
At the same time, in order to reduce the cost and time cost of signature verification calculation, the first block of each cycle of Harmony contains an additional hash pointer pointing to the first block of the previous cycle. In this way, a new node can skip other blocks in a cycle when tracking its hash pointer to the genesis block, thereby speeding up the verification of the current blockchain state. Finally, to further optimize the state synchronization process, Harmony will keep the blockchain state itself as small as possible.
Related links:
https://www.qukuaiwang.com.cn/szhb/3285.html###