Original title: "From the "Diem" system to see the next generation public chain paradigm"
Original source: X Research Dao
The public chain infrastructure has always been the narrative center of the encryption industry. Especially in terms of technology, the public chain has always made breakthroughs in consensus mechanism, programmability, and scalability. Even so, there are still development bottlenecks in the public chain, for example, the performance cannot match the Web2 infrastructure, and the demand for ecological applications is insufficient. This year's new public chain has proposed its own solutions to the above problems. In the first half of 2022, with the Cosmos network as the main body, a group of new public chains with "modularization" and "cross-chain" as the topic points will be led. In the second half of the year, the hotly discussed new public chains are the three public chains derived from the "Diem" series: Aptos, Sui, and Linera. This article takes these three public chains as the starting point, and discusses the innovation and advantages of the new public chain of the "Diem" series in terms of technology and ecology, mainly from five aspects:
Three major features and advantages of the new Move language;
Parallelization solutions;
Innovation and difficulty of the consensus mechanism;
Tokens The exploratory development of the economic model;
The possible development trend of the dedicated public chain.
Through the analysis, we can conclude that (1) the smart contract programming language plays an extremely important role in security, parallelization and developers; (2) Parallelization is the correct path for future public chain determinism; (3) The consensus mechanism is mostly transformed based on BFT, but the room for improvement may have reached the ceiling level; (4) The token economic model has always been a boost to the development of the public chain How to balance the relationship between the network, users, verifiers, and developers is a problem that the new public chain needs to pay attention to; (5) The dedicated public chain needs to develop technology based on application scenarios and improve user experience. From the above conclusions, we can get a glimpse of the next-generation public chain paradigm, especially on parallelization and virtual machines. For the unsolved problems of the "Diem" system, we can continue to pay attention to their new developments in technology, token economy, and ecology.
Public chain as the core infrastructure of the encryption industry , and its every move has a great influence on the entire industry. The technical development of the public chain is the main narrative of the first three rounds of the bull market, and it is also the inevitable result driven by capital and demand. The breakthrough technology of the public chain is mainly manifested in three aspects: 1. Consensus mechanism; 2. Programmability; 3. Scalability.
In terms of consensus mechanism, we have witnessed the glorious period of the PoW chain headed by the Bitcoin network, and the new era of the PoS chain after the Ethereum merge. For Bitcoin and Ethereum, the PoW mechanism can guarantee a certain degree of decentralization, but it also brings problems such as waste of resources and low processing efficiency. The PoS mechanism, which was born in 2012, solves the problem of excessive energy consumption of PoW through equity accounting. The PoS mechanism is also the consensus mechanism adopted by most new public chains. In addition to PoS, in order to improve the efficiency of block generation and maintain the security of the network, other innovative consensus mechanisms have also been born, such as Solana's PoH and Avalanche's avalanche consensus.
Programmability refers to building the application layer of the blockchain with smart contracts. Since the scripting language of the Bitcoin network is not Turing-complete, it cannot build complex applications. Ethereum implements smart contracts using a virtual machine and the Solidity programming language. This is also one of the fundamental reasons for the last bull market. However, because Solidity does not support concurrency and has low security defects, many blockchains have begun to use Rust or build new programming languages, such as Move, to provide a more secure, friendly, and scalable development language.
In terms of scalability, blockchain has always been constrained by the impossible triangle problem. The key to solving this problem is modularity. Modularity is the tool for decomposing a system into individual submodules that can be stripped and reassembled at will. The modularization here includes two concepts: the modular framework and tools of the public chain, and the modular public chain. The three-layer framework model of the blockchain has a settlement layer, an execution layer, and a data availability layer. Based on the modular framework, some teams have completed the research and development of these modular tools and components and have been widely used in the construction and development of existing public chains, including Cosmos and Polkadot ecology. There are three main ways to implement modular separation:
(1) Shared security;
(2) Layer2 execution layer;
(3) Data Separation of availability layers. These are also the mainstream directions of the current public chain expansion technology.
Although public chain technology has been developing continuously, but The main problem of the current public chain is insufficient performance, and there is still a certain gap with the infrastructure of web2. Insufficient public chain performance will bring about two serious problems: 1. Limit the upper limit of ecological application development; 2. Bring poor user experience, which is mainly reflected in the short-term congestion and high handling fees of some public chains. Insufficient performance is reflected in the execution layer that EVM can only be serialized, and cannot implement concurrent execution of multiple transactions, which directly limits the data throughput on the chain. The solution is parallel computing. Parallel computing is already a very mature technology in web2, but it has just started in the blockchain field. In addition to parallel computing, Ethereum handed over some functions of the execution layer to Layer2.
The performance in the consensus layer is reflected in the efficiency, economy and security of consensus, which is mainly determined by the algorithm. At present, most public chains choose PoS consensus, so efficiency mainly refers to the number of communications between nodes and the time to reach finality. Reaching consensus in a distributed system is a classic topic, far earlier than the birth of blockchain, so its development has achieved many results, such as PBFT, HotStuff, DUMBO, Algorand, which can theoretically achieve relatively high TPS . Innovative consensus mechanisms and final deterministic algorithms are very challenging tasks for the construction of public chains. It is difficult to surpass the predecessors, and it is still unclear whether improvements made on them can achieve exponential performance improvements.
The data layer includes data storage, account and transaction implementation and security functions. Each node of the Bitcoin network is a full node, which stores all block data and is currently the safest and most decentralized blockchain network. The compromise brought about by this is that only 7 transactions can be processed per second, and the block size is 1M. However, Ethereum has a contract layer and an application layer, and its blocks require more space. This is the thorny problem Ethereum is currently facing. Although the Rollup solution of Layer 2 can achieve data compression, as the application scale increases, the amount of data to be uploaded also increases. There are currently two solutions that are discussed more: 1. Partial functions of the data layer are stripped to other public chains, for example, data availability is solved in Celestia; 2. To achieve on-chain expansion, that is, sharding, the difficulty of implementing sharding technology very big.
In addition, subject to the constraints of the blockchain impossible triangle, while developing performance, security will be threatened. There are two main aspects to the security of the public chain: 1. Nodes; 2. Smart contracts. If the number of nodes is insufficient and the degree of decentralization is insufficient, the network is vulnerable to attack. The security of smart contracts also involves the bottom layer of the blockchain, and programming languages and virtual machines need to be considered.
In terms of ecological applications, most public chains have not formed their own unique applications or monopoly. Users also switch back and forth between different chains based on the amount of rewards. The only users who actually rely on the application itself are Ethereum. This phenomenon is particularly obvious in the bull-bear transition, and the funds in the bear market phase are more inclined to stay on the Ethereum network. The advantages of the remaining other public chains are that they have complete ecological applications and lower on-chain handling fees.
Innovative technology adopted by the new public chain to improve performance Almost all start from the three aspects of consensus mechanism, programmability and scalability. The new public chain projects that have received the most attention are undoubtedly the new projects born from the broken project Diem: Aptos, Sui and Linera. They have made corresponding innovations in programming languages, consensus algorithms, modular architectures, and transaction parallelization ideas, trying to improve performance and security. Studying these three new public chains, we can also get a glimpse of the new generation of public chain paradigms in the future.
In the blockchain world, programming language is defined as The formal language of computer programs is the basic carrier to realize all the functions and goals of the system. Following the Solidity and Rust languages, Move, a new generation of programming language bred from Diem, has returned to the spotlight due to the strong debut of the ultra-new public chain projects Aptos and Sui, and was once hailed as the most suitable language for the blockchain. The reappearance of Move seems to imply that the narrative of the new language is becoming a new battlefield for public chain competition. The figure below briefly compares the characteristics of the three programming languages. We also elaborated on the innovations of the Move language in terms of safety, parallelism, and developer friendliness.
(1) Security
Move performs better than previous programming languages in terms of asset security, largely because it Standing on the shoulders of predecessors, targeted improvements have been made. In the previous report "Move: innovations and opportunities" of Huobi Research Institute, we had a special discussion on these security features, and here we only summarize the key points.
Move provides a full range of security guarantees for smart contracts from the aspects of language design, virtual machine, contract calling method and contract specific execution. Assets define a new resource type to distinguish it from other data, and combine the strong data abstraction features of Module to ensure that assets will not be created out of thin air, copied arbitrarily or implicitly discarded, which greatly improves security; at the same time, the Move language is designed In order to only support static calls, all contract execution paths can be determined at compile time, and fully analyzed and verified, so as to expose some security holes in advance and reduce the probability of system downtime when the system is running; finally, it also introduces formal Verification tools greatly reduce the cost of manual code security audits.
(2) Parallel processing
As we all know, solidity language does not support concurrent processing, and Move strives to make this feature from the bottom layer Change. Since it has made a special definition for digital assets, it can be distinguished from ordinary values in terms of data types. By defining different attributes for various resources, it can effectively help identify "independent" transactions, combined with multi-threaded execution The engine enables transaction data to be run and processed at the same time, which greatly improves the operating efficiency of the system.
(3) Development friendliness
From the current market feedback, Move is very friendly to developers, and its purpose is to reduce development The security threshold of developers allows contract developers to focus on business logic; at the same time, Move evolved from Rust and Solidity, discarding unnecessary "dross" in the design of the two, and the complexity is relatively low, so the overall development The cost of migration is not high. According to Move practitioners, for developers with Rust and Solidity programming experience, it only takes 1-2 days to get started with Move; for developers without smart contract programming foundation, learning Move from scratch is also roughly It only takes 1–2 weeks.
Both Aptos and Sui inherit the core features of Move. However, there are some improvements based on their respective characteristics, but they all retain the security and flexibility of Move, but optimize the storage and address mechanisms, thereby improving network performance and reducing transaction confirmation time. The details are as follows:
3.1.1 The icing on the cake: introduce the adapter layer and lay the foundation for parallelization
Let's take data ownership as an example. Aptos' data is stored in the owner's account, that is, the owner has full control, and the account is the basic storage space. This is undoubtedly a direct application of Move's native ownership system, which well reflects that the essence of user transactions is the transfer of asset ownership.
In addition, Aptos has also made some special designs according to its own project characteristics. It introduces the concept of an adapter layer (adapter layer) to expand the additional functions of the core MoveVM, including parallelism through Block-STM, which can execute transactions concurrently without user input, for large-scale storage in accounts, storage The key table and the decoupled fine grained storage (fine grained storage) data volume in the account will affect the Gas Fee for transactions related to the account.
3.1.2 Unique: Remove global storage and reduce transaction delay
Move public chain The other twin star is Sui. Compared with Aptos' inheritance of Move, Sui has made some modifications to the core functions of Move, especially in terms of global storage operators and key ablility. The specific differences are reflected in the following points:
(1) Remove the global storage operator
(2) Set the ID for the object
The object in Move can be added index ( key) attribute, which is stored in the data structure in the form of key value. However, since Sui removed the global storage feature, it made a slight adjustment for objects with key properties. When an object can be indexed, it must have a key field - ID. ID includes two aspects, object ID and sequence number. By creating an ID to the content of the current transaction and recording how many objects are created by the transaction, an anti-collision hash function is used to create it to ensure the uniqueness of the asset.
(3) Build different object types
Sui has three object types for parallelization and The consensus mechanism provides preparations:
can be read, written, transmitted, destroyed; (shared object) this object involves smart contracts
can only be read/written (single owner object), similar to a simple transfer.
Can only read (immutable objects)
3.2 The inevitable way of parallelization
Most of the current mainstream blockchains use EVM as the execution engine. When processing a transaction, the EVM executes one transaction at a time and suspends all other transactions until the transaction is executed, updates the blockchain state, and then executes the next transaction in sequence. This in-order execution is one of the main bottlenecks in network throughput.
How to solve this problem? In addition to using more advanced hardware to speed up execution, the main method is parallel computing. A similar phenomenon occurred during the development of modern computers. 20 years ago, most computer CPUs had only 1 core, but now CPUs with 4 cores, 8 cores or even more cores can be seen everywhere. Through more cores for parallel computing, the processing power of the computer has been continuously improved.
Parallel computing refers to decomposing an application into multiple subtasks on a parallel machine and assigning them to different processors. Cooperate with each other and execute subtasks in parallel, so as to speed up the solution or solve larger-scale problems. In the blockchain, parallel execution of transactions is to break the paradigm of sequential execution of transactions, and to simultaneously execute unrelated transactions by simplifying the operation, ordering, and dependencies of transactions to improve the throughput of the system. The parallel machine is the verifier/node of the blockchain.
In addition to improving performance, parallel computing can also reduce the cost of nodes, thereby improving the degree of decentralization of the system. Because if you want to achieve the same performance without parallel computing, you need to use a single-core CPU with stronger performance. This route costs more and does not conform to the laws of computer science development. Both Aptos and Sui borrow ideas from parallel computing.
Aptos is designed to separate unrelated transactions and rely on advanced execution engines and hardware to execute them simultaneously. This idea is closer to the current blockchain operation mode. The specific methods mainly include the following three methods:
The simplest case: in different threads at the same time Execute transactions without overlapping conflicts on data and accounts. For example, Alice transfers 100 XYZ tokens to Bob and Charles transfers 50 UVW tokens to Edward at the same time.
Slightly more complex situation: If there are operations on the same data or account at the same time, first execute the transaction in parallel, and then settle in the correct order, which may cause conflicts Behavioral delta writes of state changes to ensure deterministic results. For example, if Alice continuously transfers the same token to Bob and Charles, first perform two transfers in parallel, and then check whether the overall changes in Alice's account are reasonable. If the balance is insufficient, re-execute the previous transaction.
Advanced operations: Transactions can be reordered across one or more blocks to optimize execution concurrency. For example, a certain address continuously receives money or transfers, and these transfers can be distributed in multiple blocks. This may delay the confirmation of some users' transactions, but on the whole, it allows other transactions to achieve maximum concurrency and improves the overall performance of the network.
Aptos uses the Block-STM (Software Transactional Memory) parallel execution engine to execute transactions. It simultaneously executes unrelated transactions on different cores on the same CPU, and maximizes parallelism by implementing multiple instruction streams and multiple data streams for transactions.
The Aptos white paper shows the performance test of Block-STM concurrency control. It can be seen that in the case of 10k account competition, 32 threads can reach 160,000 TPS, the advantages of parallel execution are reflected when a large number of accounts compete for trading space.
In addition, let's compare the similarities and differences of Aptos, Ethereum, and Solana in parallel execution. The main points are quoted from The Anti-Ape's article "Ethereum -> Solana -> Aptos: the high-performance competition is on". This article will be expressed in more popular language.
Ethereum Virtual Machine (EVM) is single-threaded, without parallel processing, it can only utilize one CPU core to process transactions sequentially. Be careful not to confuse the CPU core of the EVM with the Ethereum graphics card (GPU) mining machine. The CPU of the EVM processes user transactions, such as transfers and smart contract calls; the GPU of the mining machine processes the encrypted operation of ETHASH to compete for POW Accounting rights for mining.
In order to pursue faster performance, Solana uses 4096 GPU cores to process transactions. This design allows Solana to achieve very high throughput when transactions are weakly correlated. However, it has a hidden danger. For transactions that are logically sequential, it will lose the ability to execute in parallel. For example, the transaction of minting NFT cannot be carried out on 4096 cores at the same time. Because the total number of NFTs is limited, each NFT also has its own number, and simultaneous casting will cause duplication, so they must be processed in order. This makes Solana's more than 4,000 GPUs useless and unable to take advantage of parallel execution; and the performance of GPUs is weaker than that of CPUs, which seriously degrades network performance and even causes Solana network interruption.
Aptos combines the ideas of the two, using 8-core 16-thread CPU to achieve parallel computing, which not only improves the concurrency of transactions through multi-threading, but also uses performance Higher CPU for transactions executed sequentially.
Can Ethereum achieve parallel processing by improving the CPU configuration, for example, using a 16-thread CPU? Unfortunately, no. Because the CPU has only one thread in the design of the EVM, only by improving the EVM can the computing power of the CPU with more threads be brought into play. The dream of Ethereum is sharding + layer2, which can also achieve high performance. Aptos also has the idea of introducing sharding in the future. If it can be realized smoothly, it is not impossible to realize Alipay's ultra-high throughput of 500,000 transactions per second during the peak period of Double 11.
Sui is similar to Aptos in terms of parallel computing ideas, but Sui has more detailed improvements to support data parallel processing. First of all, it abandons the traditional chain structure of blockchain and adopts the data structure of DAG (Directed Acyclic Graph). And DAG inherently has the characteristics of high concurrency. Secondly, based on the resource attributes of the Move language, Sui subdivides resources into different objects, and performs parallel processing centered on objects. The combination of these two points allows Sui to achieve high concurrency and high performance.
In Sui's improved Move language, objects can be understood as assets like banknotes. Each object has a list of properties including its owner's address (or shared ownership properties), read/write properties, transferability properties, functionality within dapps/games, etc. Most simple transfers only need to change the owner attribute of a specific object. For example, Alice transfers 100 USDT to Bob, and only needs to change the owner of the 100 USDT from Alice to Bob. These unrelated transactions can all be processed concurrently. Their order will naturally appear in the data structure of DAG, and there is a total order globally.
DAG data structure can allow many branch chains to appear in the network at the same time, not just a single chain. As long as the ins and outs of the objects corresponding to each branch are clearly stated (verified), the nodes only need to verify the transaction, and there is no need for multiple rounds of communication to vote on a certain transaction. In this way, more concurrent transactions can be realized per unit time, and the burden on the verifier in the consensus process can also be reduced.
Sui performed equally well during the testing phase. In March of this year, an unoptimized single-core run of a Sui Authority node running on a Macbook Pro (8-core M1 chip) reached 120,000 TPS. If you increase the number of CPU cores, TPS can also increase linearly.
Parallelization of Aptos and Sui What is the difference in the design of the processing? Let's take an example to compare the similarities and differences of Ethereum, Aptos and Sui in parallelization. Suppose each network is a city with 8 tourist attractions. The user submitting the transaction is like coming to the city by plane, and the transaction is confirmed when the passenger arrives at the destination from the airport.
Ethereum’s approach is to use a bus to load passengers until the car is full. The bus will circle around these 8 scenic spots and drop off all the passengers one by one.
Sui’s method is to set up a lot of taxis for passengers, and the taxi will depart directly after passengers get on the taxi, saving even the time of waiting for the bus to be full before departing Lost. Many taxis running together are of course faster, but there are also negative effects. All transactions in Sui still require signatures from a sufficient number of validators to be written to the ledger. Compared to Aptos, Sui's leader validator needs to collect other validators' signatures for each transaction, which brings extra workload; while Aptos' leader validator only collects signatures of proposed blocks. Sui's additional workload may negate some of the throughput and latency benefits.
Both ideas of Aptos and Sui are feasible, and their advantages and disadvantages are briefly compared below.
As for these two methods are better and more promising in the future, there is no need to judge at present. The first is because they are still in the testnet stage (if the Aptos mainnet is launched during the writing of this article, it will be launched soon), and it is necessary to let the network run for a longer period of time and obtain more actual data before making an evaluation. The second reason is that the overall activities on the chain are very deserted now, and the processing power they claim is completely sufficient to cope with it. If there are no frequent downtime accidents, they are all better than the current high-performance public chains.
Finally, we have to pay attention to one point: parallel computing does not mean that there are multiple cores, and all problems can be solved by processing transactions in different categories. Aptos, Sui and other public chains in the future are not just a payment network, they also run many dApps and smart contracts. Existing smart contracts are only suitable for serial execution, such as AMM, NFT casting. In order to exert the power of parallel computing in the future, smart contracts need to be more in line with the characteristics of parallel computing in terms of algorithms. Developers need to modify existing smart contracts, or rewrite a batch of new ones. It contains a huge workload, and more importantly, the transformation of thinking. We need to wait for a while to see the full rise of the parallel computing public chain. Once this happens, it may greatly promote the development of the industry and bring about a complete paradigm shift.
Innovation in consensus algorithm is actually very difficult of. The earliest is the BFT consensus. BFT is suitable for how to reach a consensus in a distributed system, especially when nodes may fail and do evil. The earliest discussion about BFT was in 1982. The problem with BFT is that multiple rounds of communication are required, and the communication overhead is proportional to the square of the number of nodes. The Bitcoin network adopts the Nakamoto Consensus, which has two characteristics: (1) limit the number of proposals in the network through proof of work (calculation time + cost); (2) the longest chain principle guarantees the final certainty in probability and security (economic game constraints attackers). The Satoshi Nakamoto consensus requires extremely high costs, mining machine performance, and keeping nodes online to maintain network operation.
In the consensus mechanism, there are three innovative projects worth mentioning. The first is Solana's PoH (Proof of History) consensus. This consensus establishes a consistent clock for the entire network, and transaction events can be sorted according to its own clock to ensure the consistency of the ledger. The PoH consensus has indeed brought a breakthrough to the performance of Solana, and its TPS can reach 2000–3000. But PoH is slightly less secure because hackers can predict and therefore attack the next block producer. The second is the avalanche consensus of Avalanche, and the test network can reach the performance of 4500TPS. Avalanche consensus is a type of BFT, but it does not have a Leader node, and the status of nodes is equal. Each node randomly samples surrounding nodes to form its own results, and finally the entire system will reach a consensus in a very short time. The third is the Tendermint consensus, which is also an improved version of BFT. It is suitable for partially synchronous networks. It has two-stage voting, and each round of voting will have a timeout. time. It can be seen that most of the current popular consensus algorithms evolve on the basis of BFT, such as HotStaff and Polkadot's GRANDPA.
To judge the quality of a consensus protocol, three indicators can be used: safety, liveness, and responsiveness. These three indicators are explained here:
Security: All honest validators will confirm the proposal and execution. For example, the Bitcoin network uses algorithms to ensure that the network is not vulnerable to attack.
Liveness: Proposals are always being generated in the network. This part includes how to switch the Leader node, how to define the timeout period, etc.
Responsiveness: The confirmation time of the block is only related to the network delay, and the nodes will always respond to the consensus. For example, the Tendermint consensus needs to wait for a fixed time to generate blocks, even if the network status is good, so its responsiveness is not very good.
The consensus of Diem is created based on the HotStuff consensus, which is a three-stage voting BFT consensus. Nodes submit their voting results. The DiemBFT consensus has made many detailed improvements, one of which is the addition of a memory pool, which is equivalent to adding an actual storage layer, which is similar to Solana. This change greatly improved the performance of the system. This is also carried over in Aptos and Sui. On the basis of DiemBFT, Sui created two mechanisms, Narwhal and Tusk, so that the system can quickly reach a consensus in an asynchronous network environment. The following is an analysis of these two consensuses.
The Aptos consensus mechanism continues directly DiemBFT. DiemBFT has reconfigured the voting power of consensus nodes. The voting power of each validator is not equal and needs to be weighted according to the rights and interests, which is proportional to the number of pledged tokens. At the same time, DiemBFT shares transaction information with each other through the shared memory pool protocol, and then votes in rounds, which is similar to HotStuff.
The consensus process and content of Aptos are somewhat different from those of general blockchains. Its transaction propagation is separated from the consensus phase, and validators only need to reach a consensus on the transaction metadata. This means that Aptos blocks only have transaction metadata, not actual transaction data. This is very different from the traditional block structure, as shown in the figure below.
Let's take a look at how to reach a consensus.
After the verifier collects the transaction and verifies it by itself, it packs a certain number of transactions or a period of time into a batch, and continuously transmits them to each other in the verifier network Such batches. After the verifier distributes the transaction batch, it cannot be tampered with. Other verifiers accept and store this batch, and at the same time sign the digest of the batch and send the signature back to it. The system generates a Proof of Availability (PoAv) when 2f+1 (weighted calculation, f is the weight of the wrong validator) validators sign on the batch digest. PoAv guarantees honest verification of at least f+1 (assuming f wrong verifiers submitted signatures in the previous step, but they later deleted these transactions, then at least f+1 honest verifiers still retain transactions) weights The verifier has stored this batch of transactions, so all honest validators can retrieve it before execution, so the actual transaction does not need to be included in the block. A node proposing a block only needs to sort and pack a few batches of metadata, plus their PoAv, to form a block. After other validators have verified the PoAv and block metadata criteria (such as proposal timestamp, block expiration time), they can vote to determine whether the block is legal.
Aptos evenly distributes the demand for bandwidth in the consensus phase to a longer period of time, and can perform consensus at a very low bandwidth (because the consensus process needs to transmit data Small amount, only block metadata and PoAv), so as to achieve high transaction throughput and minimize delay. The consensus speed of DiemBFT V4 is very fast. The general consensus only needs two network round trips, and the round trip time of the whole network is usually less than 300 milliseconds. Since 2019, DiemBFTv4 has been extensively tested by dozens of operator nodes and multi-wallet ecosystems in multiple iterations, and has been tested by Aptos for a total of 3 testnets. Its stability should also be guaranteed.
Sui’s consensus mechanism as its The biggest bright spot is the breakthrough in innovation and solving performance problems. Although both Aptos and Sui are variants of HotStuff BFT, Sui transformed the transaction memory pool in DiemBFT, allowing transaction broadcasting to be performed directly in the memory pool. At the same time, a global random coin called Tusk is adopted to achieve asynchronous consensus. Consensus enables Sui to have faster transaction speed, low latency, and better scalability. Consensus innovations allow Sui to outperform Aptos in terms of performance.
(1) Concurrency advantage of DAG structure
Sui has no concept of blocks, but It is a transaction, and the node votes on the "vertex" of the transaction. The "vertex" is similar to the root of the Merkle tree and contains references to previous related transactions. Sui combines the advantages of object type classification and DAG to create faster transaction confirmation. Nodes do not need to reach a consensus in DAG, but in order to prevent double spending, the network also requires nodes to participate in the verification and signing of transactions, which needs to be completed in combination with some simple consensus mechanisms. DAG has two advantages here:
Create conditions for parallelization: DAG, as a type of data structure, can be combined with blockchain to solve efficiency problems. Because of the chain structure, only one chain can exist in the entire network, resulting in the block cannot be executed concurrently. After the DAG structure is introduced, multiple blocks can be packaged in parallel in the network.
Causal order speeds up the consensus process: In Sui, the causal order of transactions is a very important feature, which is similar to the Merkle Root in the block and is a DAG The backbone of the structure is also the proof of reference for consensus voting.
(2)When DAG encounters BFT
Sui adopts PoS mechanism, Sui’s consensus mechanism Around the above three objects, it is a hybrid protocol, namely DAG+BFT. A number of companies have begun to implement this consensus, including Aptos, Celo, and Somelier, but the specific implementations are different. Sui adopts DAG+BFT consensus broadcast for single-owner objects, and directly delegates the link of transaction confirmation to the transaction itself, which does not require the verifier to sort and package blocks. Ordinary DAG needs a total order. The node can verify the dependency path of the object in the local memory pool, that is, find all the events related to the object, including signature, timestamp and hash value for verification. .
For shared objects, Sui uses a variant of BFT as Narwhal+Tusk, Narwhal builds a memory pool, Tusk is a random coin algorithm for selecting leader nodes, this Similar to Alogrand's verifiable random number, in order to make Sui work under an asynchronous network, this algorithm will not be described too much here. Sui uses the DAG structure to perform causal sorting in the memory pool and perform reliable propagation. The node submits the highest-level "vertex" to the leader node and conducts BFT consensus.
(3) Consensus process
There are two types of roles in Sui’s consensus mechanism: Client and Authorities. Clients are equivalent to full nodes that do not participate in the consensus. They collect transaction feedback to the master node, and form transaction certificates and final effect certificates according to the consensus. The role of Authorities is to participate in the consensus nodes, which need to verify and sign the transaction. The signed transaction will be returned to the client, and the client collects the signed transaction and forms a transaction certificate (DAG process). Client is equivalent to a full-node client, and its completed transaction certificate will be sent back to Authorities. If the transaction involves shared objects, BFT consensus is required. Authorities are validator nodes, which need to reach a consensus on transactions. For single-owner object transactions that do not require consensus, Authorities also need to sign the transaction. Transaction processing for shared objects is slightly more complicated. Nodes need to order this object and objects related to it, then execute the transaction and aggregate the signatures, forming the certificate of execution. Once the number of signatures of the consensus nodes reaches the quorum (2/3), the finality is reached, and the client can collect execution certificates and create effect certificates.
(4) The memory pool built by Narwhal
DiemBFT has made many changes to Hotstuff, among which One is to add a memory pool, and Hotstuff has no storage. Narwhal's memory pool is different from DiemBFT. Diem's memory pool is only used for transaction pool sharing and periodic sending. And Narwhal puts the broadcast of transactions in the memory pool, which is equivalent to separating the network communication layer from the consensus logic. Nodes only sort and vote on proposal hashes. This brings two benefits:
l can make the consensus layer complete the consensus work faster, the broadcast work does not occupy the consensus communication channel, memory The pool directly completes the block broadcast;
l realizes linear expansion, nodes can increase hardware to improve performance, and Narwhal can linearly improve performance (similar to Fragmentation). Each validator can scale itself horizontally and increase its transaction throughput by adding more computing power.
From the two new Diem public chains of Aptos and Sui, it can be seen that the current research on the consensus mechanism has achieved good results, and its innovation is still in the works Completed on the basis of the classic consensus, there are mainly two directions: 1. Change the block structure and content format to make it more lightweight to participate in the consensus process; 2. Use various methods to promote parallelization, especially in the transaction Sort and broadcast on. In the future, the evolution of the consensus mechanism is likely to be based on HotStuff, after all, its mechanism is mature. The other is the memory pool, which serves as a transaction buffer waiting to be executed, and its function will be further improved.
Token economic model in blockchain The position in the project is becoming more and more important, and a good token economy can bring bonuses to projects with great technical advantages. The setting and modification of every parameter of the token economy will have great influence on the project and the community. For a public chain, there are two main aspects to measure the quality of the token economic model: (1) whether it can capture more economic value; (2) whether it can balance the network, users, developers and verifiers ( miners) the relationship between the four. It is very difficult to do a good job in these two aspects. Many mature projects have either not issued tokens for a long time or have been improving their own token economy.
Among the new public chains of the Diem system, only Sui has given his own token economy. In fact, it is more about the discussion of the economic model. In Sui’s token economy, the gas fee includes transaction fees and storage fees. It has two characteristics: (1) inherits the advantages of the Ethereum economic model; (2) proposes a new storage fee solution.
(1)gas fee
Similar to Ethereum, users need to set the gas limit before payment, which is the maximum gas budget. Execution will run until the budget is reached, and will abort if the budget is exhausted. In addition, Sui also adopts the EIP1559 scheme. The protocol will formulate a basic fee (denominated in the gas unit of each $Sui), and the fee will be adjusted in the critical period of each epoch (at the beginning of each epoch, the verifier is required to Submit the lowest price they are willing to process the transaction, and the agreement will set 2/3 of the price as the reference gas price for each epoch. Validators who submit low prices and process transactions at low prices will get higher rewards, and corresponding also has a penalty), the transaction sender can also include an optional tip (in $Sui)
Gas fee=(GasUsed * BaseFee)+Tip
p>
Gas fee includes computing power and storage fees. Gas price should be relatively low in Sui network. When validators submit gas prices, two key forces influence their bids: Computation rules incentivize validators to comply with bids submitted during gas surveys, and distribution rules incentivize validators to submit low gas prices.
(2) Storage fees
Users also need to calculate and pay storage fees in advance. This method is similar to gas fee, and it is also to prevent network congestion and potential attacks caused by some invalid storage transactions. Users must pay for current execution and future storage. However, the cost model is difficult to calculate, the demand for storage cannot be estimated, and the cost becomes unstable.
To solve this problem, Sui introduced the concept of a storage fund, which is used to redistribute past transaction fees to future validators. When on-chain demand is high, the storage fund can be used as a subsidy to validators. Three characteristics of the storage fund:
1. The fund is paid by past transactions;
2. The storage fund will be put into the treasury , generate income, and the income is used to reward verifiers. The fund's income method is that the verifier can borrow the storage fund, and the fund can obtain the client's income;
3. The mechanism of the storage fund encourages users to choose to delete the previously stored data to obtain a storage fee discount;
p>
4. The storage fund is not owned by the client.
The economic model of storage costs is a new attempt after filecoin, which requires users to find suitable miners to store data. Although Sui still has some problems, for example, operating nodes may try to delete old data driven by interests, and it is impossible to determine whether nodes will actually store data according to the agreement. But follow-up officials should make adjustments according to network conditions.
Sui's token economy is mainly on the construction of the gas fee model, as well as the pledge rewards of the validators, how to carry out on-chain governance, and how to motivate the agreement And developers are very important aspects, we can expect Aptos and Sui to improve these mechanisms. As a general-purpose public chain, the storage function on the chain has certain existence value. Establishing a reasonable storage fee mechanism can solve two problems: 1. Improve the ability to capture the token economy; 2. Ease the storage pressure on the chain. The development direction of the token economy of the future public chain is also similar: 1. Provide a sustainable business model for verifiers/miners; 2. Governance can flexibly participate in on-chain activities and capture the value of the protocol; 3. More rigorous Gas fee model; 4. Endow tokens with more application scenarios, including linking with on-chain algorithmic stablecoins.
With Cosmos and Avalanche multi-chain With the development of the ecological network, more and more public chains choose dedicated roads, or an application with enough users directly creates a public chain. Such as dydx, WAX, etc. Although the dedicated public chain does not require high performance, it pays more attention to its application scenarios and user growth.
Among the Diem public chains, Linera prefers the development of dedicated public chains. The main application scenario of Linera is payment, which connects the real world and the web3 world. It may truly inherit Facebook Diem's payment dream and technical essence. Based on such scenarios, Linera needs to meet technically:
(1) Low latency
Linera founder Mathieu believes that the market has a strong demand for low-latency blockchains, and more and more Dapps need low-latency to respond to user operations instantly, such as: retail payments, micropayments for game applications , self-operated transactions, and connections between blockchains, etc.
Confirmation times in current blockchains still typically take seconds due to memory pool consumption and complex coordination between validators. Unlike Aptos and Sui, in order to meet the hard requirements of low latency, Linera completely removes the memory pool and minimizes the interaction between validators, which can greatly speed up simple operations such as payments. The Linera blockchain expects most account-based operations to be confirmed within a fraction of a second.
(2) Linear Scale (linear expansion)
Linear Scale comes from Web2 Technical thinking, around 2000, the Internet industry appeared "linear expansion" horizontal expansion, dynamically providing database resources according to real-time throughput, dynamically adding more processing nodes (hardware), so that enterprises do not have to worry about the high concurrency of the website Downtime, or idle resources during normal times.
Current blockchains prioritize a "sequential" execution model, allowing user accounts and smart contracts to interact arbitrarily in a series of transactions, but sequential execution hinders (Vertical) linear expansion. The Linera project will develop and promote a new execution model suitable for linear scaling, where operations on different user accounts will run concurrently in different execution threads. In this way, it is always possible to scale the execution by adding new processing units to each validator.
Inherited from the FastPay and Zef protocols, Linera is likely to become a low-latency, high-transaction confirmation payment chain comparable to Web2 Internet payment, and very It may also inherit the anonymous payment feature of the Zef protocol. While FastPay can be deployed in a variety of environments, it can be used in an independent manner as a settlement layer for native tokens and cryptocurrencies; or as a side chain for another cryptocurrency, or as a part of an established real-time gross settlement system (RTGS) A high-performance settlement layer on the side to settle fiat retail payments. In the future, Linera can not only be used as a payment chain, but may also be used as a payment side chain of other public chains, or embedded in other Web2 Internet products to provide decentralized instant payment services.
Special-purpose public chains can often obtain better interactive experience and higher security than general-purpose public chains. Choose to develop a new chain based on the Cosmos SDK, and Rollup may be able to meet dYdX’s high requirements for transaction fluency as a futures trading DEX in the near future. One block space, enjoying a dedicated blockchain alone can make the transaction experience better, and there are many ways to improve the security of the block. In the future, Linera will be a dedicated public chain, with fewer application projects on the chain, and transactions in the block are mainly payment orders. In such a simple and dedicated environment, Linera is likely to have lower transaction latency than Aptos and Sui , higher transaction confirmation and a higher level of security.
From the above, Diem is a new public chain From the analysis of the chain, it can be seen that the innovation of public chain technology is the main narrative subject. In terms of ecology, after research, the ecological development of the new public chain of the Diem system mainly starts from two aspects: 1. Lower the threshold for users to use, which can be seen from the wallet application, users can register directly by email; 2. Attract developers Or, based on the Move language, it is convenient for developers to create various tools and frameworks for applications. The Diem public chain has brought a new atmosphere to the infrastructure of the blockchain: (1) greater competition pressure on the public chain, which is reflected in technology and performance. It depends on the technical team and background; (2) technology and operation are parallel, which can be seen from Aptos, from the favor of capital to the rapid support of ecological applications. But there are still some problems that have not been resolved, such as the public chain moat problem, how to truly provide demand for decentralized users.
Starting from the Diem public chain, we can see the development form of the next generation public chain:
(1) Parallelization is the future The new paradigm of the public chain
Parallel computing only slightly increases the hardware requirements. Miners/verifiers can fully accept this cost increase without seriously affecting the degree of decentralization. However, parallel computing will greatly improve the overall performance of the blockchain and the stability of the system, increasing the area of the impossible triangle. At the same time, consensus-based innovation can be difficult. The performance of the new public chain within 4 years should be benchmarked with Aptos and Sui, and it is almost difficult to surpass them. In terms of ecological applications, the parallel upgrade of AMM and NFT casting may be a necessary condition for the next round of bull market. AMM is the foundation of DeFi, and NFT may play a role in more usage scenarios. The advent of a bull market will inevitably be accompanied by the prosperity of transactions and various other applications, and their performance cannot be a stuck point.
(2) Evolution of virtual machine
EVM is an isolated and determinable sandbox environment created by chain nodes for smart contracts , multiple contract programs run in different virtual machine sandboxes within the same process. This means that calls between Ethereum contracts are calls between different smart contract virtual machines in the same process, and security depends on the isolation between smart contract virtual machines.
< /p>
The Move virtual machine supports parallel execution. The calls between contracts are centrally placed in a sandbox. Under this architecture, the security of the state of the contract is mainly isolated through the internal security of the programming language, that is, every asset based on Move has native scarcity. It is unique and has corresponding access control attributes, rather than relying on virtual machines for isolation.
< /p>
(3) Attempts of a dedicated public chain
Currently some applications with enough users still have the idea of establishing a new chain. Such as financial dydx. Some dedicated public chains may also solve some technical problems. For example, celestia provides a Layer 2 data availability layer. Most of these new paradigms start from a technical perspective, but technology cannot be separated from the development of the entire infrastructure, and there is a certain period of time. In addition, whether the macro economy supports capital to continue to be the development of the underlying technology of the blockchain industry is also a major factor limiting the public chain. The strict supervision of the encryption industry in various countries is also a threat to developers, nodes, and privacy public chains, and it is also a reason that will affect the future form of public chains.
1. Ethereum -> Solana -> Aptos: the high-performance competition is on p>
2.Announcing Sui, https://medium.com/mysten-labs/announcing-sui-1f339fa0af08
3. https://www.defidaonews.com/article/6775866
4.Built for Speed: Under the Hoods of Aptos and Sui, https://medium.com/amber-group/built-for-speed-under-the-hoods-of-aptos-and-sui-3f0ae5410f6d
< p>5.How Sui Move differs from Core Move, https: //docs.sui.io/learn/sui-move-diffs6. Move on Aptos, https://aptos.dev/guides/move-guides/move-on-aptos/
< p>7.Move: A Language With Programmable Resources, https://diem-developers-components.netlify.app/papers/diem-move-a-language-with-programmable-resources/2020- 05-26.pdf8. https://jolestar.com/why-move-1/
9.Linera, https://linera.io/
10.LibraBFT, https://tokens-economy.gitbook.io/consensus/chain-based- pbft-and-bft-based-proof-of-stake/librabft
11. FastPay: High-Performance Byzantine Fault Tolerant Settlement, https://arxiv.org/pdf/2003.11506.pdf
12.Introducing Linera: Bringing web2 performance and reliability to web3, https://medium.com/ @linera/introducing-linera-bdb809735552
13.Zef: Low-latency, Scalable, Private Payments, https://static1.squarespace.com/static/62d6e9b8bf6051136f9 34527/t/630b0ec13ee5da4defbb6b8c/1661669058381/zef.pdf
14.Narwhal and Tusk: A DAG-based Mempool and Efficient BFT Consensus, https://arxiv.org/pdf/2105.11827.pdf
15.DAG Meets BFT—The Next Generation of BFT Consensus, https://decentralizedthoughts.github.io/2022-06-28- DAG-meets-BFT/
16.Sui whitepaper, https://github.com/MystenLabs/sui/blob/main/doc/paper/sui.pdf
17. Sui tokenomics, https://github .com/MystenLabs/sui/blob/main/doc/paper/tokenomics.pdf
About X Research DAO
X Research DAO is a community-based research DAO backed by Huobi Research.It aims at being one of the most valuable decentralized blockchain-analysis initituions in the world.X research DAO focuses on analyzing web3 projects, early stage public-chains, gamefis and NFTs.X Research DAO welcomes all web3 ent husiasts , let's build the best research DAO and learn together!
Join us:
Website:https://www.xresearchdao.xyz
Twitter:https://twitter.com/XResearchDao
Telegramm:https://t.me/xresearchdao
Discord:https://discord.gg/S52jJT9NSp
Youtube:https://www.youtube.com/channel/UCHBeMdxOnoU6zo3mbVd1MKg/featured
Notion:https://bit.ly/3AjGNlq
Mirror:https://mirror.xyz/0x9045237C0248AA32A758635f9E5d8A47f1460702/
Welcome to join the official BlockBeats community:
Telegram Subscription Group: https://t.me/theblockbeats
Telegram Discussion Group: https://t.me/BlockBeats_App
Official Twitter Account: https://twitter.com/BlockBeatsAsia