In the future world, cross-chain technology will assume the responsibility of interconnection and breaking “information islands”, but it also faces difficulties such as information authenticity, transaction atomicity, and transaction consistency.
Written by: Dove
Since the development of blockchain technology, transaction volume has shown exponential growth, and network congestion has become more and more serious. Since recent years, capacity expansion has become a hot topic in the community and the focus of public chain considerations. In the first layer (Layer 1) expansion technology, there are solutions such as consensus mechanism, sharding, DAG, segregated witness and expanding block capacity; and in the second (Layer 2) expansion technology, state channels have also been developed , Plasma, side chain/cross chain, etc.
In addition, this year’s cross-chain leader Polkadot’s boom has also triggered further expectations in the market for side-chain and cross-chain technology, but many people have also discovered that although cross-chain is no longer a mirror image, how to double-satisfy cross-chain And high performance is still difficult. This article will explain the origin of side chain/cross-chain technology, and analyze the technical implementation methods and advantages and disadvantages of side chain, and combine the representative projects that adopt side chain/cross-chain in the market (such as Polkadot, aelf, Dfinity, etc.) In order to find out which underestimated projects are worthy of attention in the current development context.
Side chain/cross-chain development and technical characteristics comparison
Side chain is the first cross-chain technology to have a greater impact. The side chain aims to achieve two-way anchoring, allowing a certain cryptocurrency to “transfer” between the main chain and the side chain. Initially the main chain usually refers to the Bitcoin blockchain, but now the main chain can be any blockchain. It is the technical basis for realizing the side chain. The two-way anchoring technology can temporarily lock the digital assets in the main chain while releasing the equivalent digital assets in the side chain, and vice versa. However, the protocol modification needs to be compatible with the existing main chain, that is, it cannot affect the work of the existing main chain, which is the difficulty of the two-way anchoring technology.
In essence, cross-chain means that assets originally stored on a specific blockchain can be converted into assets on another chain, thereby realizing the circulation of value. The side chain is a concept relative to the main chain. It mainly serves the main chain and provides the transfer of assets and functions to the main chain. The difference between the two can be attributed to the difference in service subject and scope, but they are roughly the same in technology.
Mainstream across link technology can be divided into several categories characteristics: 1, notary mechanism (Notary schemes); 2, side chains / relay (Sidechains / relays); 3, the locking hash (Hash-locking); 4, Distributed private key control (Distributedprivate key control).
Notary mechanism : By electing one or more organizations as notaries, the events of chain A will be monitored automatically or on request, and corresponding actions will be executed on chain B after the specified event occurs to realize the response to the event. The notary group uses a specific consensus algorithm to reach a consensus on whether the event occurs;
Side chain/relay : The side chain/relay is based on the light client verification technology, that is, execute a smart contract similar to the blockchain light client function on chain B, and verify the encrypted hash tree of chain A ( Cryptographic Hash Tree) and block header (Block Header) to verify whether a specific transaction, event or status information of chain A has occurred;
Hash lock : By running specific smart contracts on two chains, cross-chain transactions and information interaction are realized. User A generates a random number s, calculates the hash value of the random number h=hash(s) and sends it to user B; A and B lock their respective assets through the smart contract; if B receives the correct one within X time s, the smart contract will be automatically executed and the assets of B will be transferred to A, otherwise it will be returned to B; if A receives the random number s within 2X time, the assets of A will be automatically transferred to B, otherwise it will be returned to A.
Distributed private key control : Based on cryptographic multi-party calculation and threshold key sharing technology, the private key is divided into N shares and distributed to N participants at the same time. Only when the distribution of K private keys is collected can one be recovered Only the complete private key can unlock the assets in the private key. Through private key generation and control technology, the encrypted currency assets are mapped to the chain based on the built-in asset template of the blockchain protocol, and new smart contracts are deployed based on the cross-chain transaction information to create new encrypted currency assets.
In general, cross-chain technology has developed rapidly in the past few years. Among the existing cross-chain related projects, projects based on the sidechain/relay model account for the highest proportion; since the Hash-locked Lightning Network’s autonomous network went online, the number of nodes, channels, and network capacity have continued to increase, and technical feasibility has also been achieved Better verification. After the explosion of DeFi, the cross-chain projects derived from Ethereum have emerged in endlessly, but cross-chain technology is currently facing many complex problems. In view of the lack of interoperability features in most blockchain systems at the beginning of their birth, cross-chain technology In the design and implementation, it is necessary to focus on how to adapt to various blockchains and ensure the high efficiency and high security of cross-chain operations.
Comparison of mainstream sidechain/cross-chain solutions
In the current mainstream sidechain/cross-chain scheme, it can be roughly divided into Bitcoin sidechain and non-bitcoin sidechain. The more well-known Bitcoin sidechains include BTC Relay, RSK and BlockStream Elements, and non-bitcoin sidechains. Such as Polkadot, aelf, Dfinity, etc. Since the scope of application of Bitcoin sidechain projects is relatively small, this article will focus on several major non-bitcoin sidechain projects based on the four major aspects of cross-chain logic, performance, economic model and developer support.
Cross-chain solutions: relay chain mode and decentralized cross-chain mode
Currently, public chains such as Polkadot belong to the category of side chains/relays in technology. Polkadot implements cross-chain through the mechanism of relay and parachain, and defines the different blockchains to be accommodated as parachains; but also like aelf, etc. Part of the project innovation introduced a more decentralized way to complete the cross-chain. The nodes of aelf are divided according to the type row, and specialized accounting nodes (full nodes) can run on server clusters to improve the performance of the entire blockchain network. aelf also adopts a “main chain + multiple side chains” structure to effectively realize resource isolation and “one chain, one scene”.
Polkadot is mainly composed of three role chains: relay chain, parachain and transit bridge. The relay chain mainly provides a unified consensus and security guarantee for the entire system; the parachain is responsible for specific business scenarios, and the parachains can communicate with each other through ICMP, and they will also be verified by the validator assigned to it. ; The transfer bridge is responsible for connecting the blockchains of different systems. Polkadot itself is built on Substrate, which is the implementation of Polkadot’s operating environment. If the new blockchain is built based on the Substrate framework, it can be directly connected to the Polkadot network and become Parachain. The chain connecting Polkadot needs to meet two standards: (1) It can prove the validity of its transaction, such as the final confirmation of the block state through a light client, the UTXO containing Bitcoin or the log information of Ethereum; (2) It must have Ways to authorize transactions, such as threshold signature schemes or smart contracts that can construct logic for multi-signature conditions. After Parachain is connected to RelayChain, Parachain can share security with RelayChain, and the chain connected by the transit bridge needs to be secured by itself.
The security of cross-chain exchanges between Polkadot’s parachains mainly comes from the characteristics of shared security. Shared security makes cross-chain transactions and ordinary transactions happen synchronously, so there is no cross-chain data such as double flowers in other cross-chain scenarios. Inconsistency issues. Secondly, the special state verification method introduced in Polkadot is convenient for the relay chain to verify the validity of cross-chain messages.
The established public chain aelf adopts a cross-chain model that favors decentralization. On December 10, 2020, the aelf mainnet was officially launched, and the first sidechain was also deployed on the aelf mainnet on December 25. In the cross-chain process, aelf uses the “index” method to achieve inter-chain communication. Index refers to the transmission of data from one chain to other chains according to a defined structure. Cross-chain index is the prerequisite for any cross-chain function. aelf implements cross-chain through two-step indexing: 1. Main chain index side chain, that is, the main chain first requests data from the side chain that needs to be indexed, and the side chain transmits data information to the main chain; 2. Side chain index main chain, main chain After the information verification process is completed, the side chain then requests data from the main chain to index the main chain, and the main chain transmits the data to the side chain. It is not only the main chain and the side chain that index each other, but the multi-level sub-chains of the side chain can also index each other.
In terms of data verification, aelf uses the Merkel tree data structure, and the Merkel tree structure can be used to efficiently complete the data existence proof, thereby achieving cross-chain verification. In aelf, the parent chain and the child chain can be mutually verified, the child chains (sibling chains) of the same level can be mutually verified, and the chains of other relationships cannot be mutually verified.
In addition, aelf divides its side chains into internal side chains and external side chains. The internal side chain is the side chain created by aelf through joint mining, and the external side chain is other blockchain systems that can join aelf in this form, such as public chains such as Bitcoin and Ethereum.
Among the mainstream public chains that focus on cross-chain, Dfinity and aelf are recognized as the two major performance kings. Dfinity uses threshold relay technology, and aelf chooses the AEDPOS consensus mechanism.
Compared with Ethereum, Dfinity aims to provide unlimited scalability. Dfinity focuses on performance and scalability. In terms of performance, DIFINITY uses threshold relay technology to quickly generate blocks and greatly increase transaction throughput. In terms of scalability, Dfinity expands the network “nearly infinite” by dividing consensus, verification, and storage into different levels of architecture. The consensus layer does not have transaction blocks, and the storage layer is divided into multiple chains. The verification layer combines the hashes of all the shards so that the global state hash is stored in the block of the top chain.
aelf uses the processing of “chain parallel + parallel transaction within the chain”. Each chain has independent computing resources, and different scenarios can be applied to different side chains and interact through the parent chain. In addition, aelf also puts non-conflicting transactions into a group to ensure that transactions between groups can be executed in parallel. Aelf’s historical TPS data has reached a maximum of 14,968 transactions per second, which is 149 times that of Ethereum’s EVM. At present, the operating efficiency of aelf’s cross-chain solution is comparable to the performance of the central server. Through its unique parallel processing, scalable cluster nodes and database separation technology, it provides suitable performance support for enterprise-level commercial applications.
The aelf main chain adopts the AEDPOS consensus. Compared with the PoW and PoS mechanisms, this consensus reduces the hash collision links, and includes more links such as elections, production node scheduling, and elections. Election means that token holders need to be able to vote on nodes they trust; production node scheduling is the order in which these elected production nodes produce blocks, and how this order is determined; due to the elected district The number of votes of block production nodes is constantly changing, there must be a time node, and the current block production node may be replaced by other nodes. Based on the original AEDPos consensus mechanism and election mechanism, 17 production nodes (with a 7-day term) set at the price of aelf creation stage were selected through elections, and community users participated in voting. Production nodes need to participate in network parameter setting adjustments, network resource cost adjustments and other matters while assuming the responsibility for block production.
Next, let’s take a look at the token distribution methods and economic models of the major public chains.
According to Polkadot’s original plan, the initial total issuance of DOT is 10 million, but its total supply is not fixed and there is no upper limit. The maximum issuance of DOT is “10 million initial issuance + inflation”. According to the description of Polkadot Wiki, DOT uses an inflation model to issue new tokens to validators and nominators for rewards. The model assumes that the supply of DOT will gradually increase every year to reasonably guide the number of token pledges and achieve consensus security and token liquidity.
Specifically, DOT’s Nomination Proof of Stake (NPoS) consensus algorithm is a consensus algorithm designed by Polkadot based on the PoS algorithm. The validator runs the node to participate in the production and confirmation of the block, and the nominator can pledge tokens to obtain the right to nominate and nominate their trust. Of validators, get rewards. And this part of the reward comes from the additional issuance of DOT tokens, which is the main source of inflation for DOT. The inflation rate in the first year was 10%. The inflation rate of validator node token generation is related to the pledge rate, and the rest will flow to the Treasury. The initial goal of the Web 3 Foundation is to pledge about 50% of DOT tokens to the nominated proof-of-stake NPoS consensus system.
The use of funds from the Ministry of Finance is ultimately controlled by DOT holders through a referendum. The way the Ministry of Finance raises funds is through the transfer of some validator rewards (from inflationary issuance), a small amount of transaction fees and slash penalties (fines paid by malicious or incompetent validators). These funds are used for the smooth operation of the system and the broader ecosystem (marketing, community activities, and cooperation).
In the design of aelf, tokens are divided into 4 categories. The first is the mainnet coin ELF, with a total of 1 billion issued. It is mainly used for transaction fees, side chain index fees, deposits for production nodes, and block rewards for production nodes. The second is the resource token, which is mainly used for resource consumption during the developer’s payment chain or DApp runtime. Including CPU resources, RAM resources, DISK resources, NET resources, READ resources, WRITE resources, STORAGE resources, and TRAFFIC resources, each with a total of 500 million issued. The third is the Token created by developers. Developers can create Tokens on the aelf platform and build their own Token model and incentive mechanism. The fourth is the node election voting certificate, that is, the user will get voting income when voting for the production node. After voting, the user will return the same amount of voting certificate. The voting certificate can be used to redeem the vote.
aelf introduces multiple destruction mechanisms, and implements different destruction strategies according to different behaviors on the chain. When users conduct on-chain transactions, 10% of the on-chain transaction renewal fee will be burned; 50% of the purchased resource Token renewal fee will be burned; if the production node has not produced blocks for 72 hours in the current session , The mortgaged ELF will be destroyed; when all nodes have not been re-elected, 10% of the re-election dividend pool will be destroyed. Since ELF will no longer be issued after the issuance, aelf’s multiple destruction mechanism ensures that ELF can stay in a long-term deflationary economic model.
ICP is Dfinity’s native governance token, and there is no token distribution yet. According to official sources, Dfinity expects to release ICP tokens to holders in the first quarter of this year. Once the operating conditions of “Genesis” are triggered, in the first quarter of 2021, more than 50,000 ICP token holders will begin to participate in network governance. In addition, Dfinity founder and chief scientist Dominic Williams and community operations director Michael Hunte stated in October 2020 that Dfinity strategic round investment will have a lock-up period of no less than 1 year, while seed-round token investment has no lock-up period. For market health considerations, the ICP may be gradually unlocked after it goes online.
Summary and outlook
In summary, in the mainstream public chain that focuses on cross-chain, Polkadot can do cross-chain asset transfer, focusing on cross-chain infrastructure, and aelf focuses on performance and cross-chain verification; Dfinity’s mainnet Alpha phase has been officially released and will pass ” Renewing the existing network in the form of “unlimited expansion”, it can be said that each has its own highlights and specialization directions. In the future world, cross-chain technology will assume the responsibility of interconnection and breaking “information islands”, but it also faces difficulties such as information authenticity, transaction atomicity, and transaction consistency.
In addition, the two public chains that also focus on cross-chains can see a large gap in the comparison of the market value dimension. The current market value of DOT is close to 15 billion U.S. dollars, while the market value of ELF is less than 100 million U.S. dollars. It can be seen that the development of ELF is still in the stage of being far underestimated.
The scenarios faced by cross-chain technology are complex, and whether or not the global blockchain can eventually be widely interconnected needs to be handed over to major project parties for continuous exploration and practice. However, it is foreseeable that with the deepening of cross-chain technology research and the popularization of applications, the development of these major cross-chain public chains is very worth looking forward to.