
Original author: asmp
In 2019, Meta (formerly Facebook) launched the cryptocurrency project Libra, which attracted the attention of the entire financial market, but then Libra was forced to transform into Diem due to regulatory restrictions. At the end of January this year, Diem was sold by Meta for about $182 million. Meta's Libra and Diem plans seem to have ended without a problem, but they have left a valuable legacy to the encryption industry - the Move programming language that makes up for the shortcomings of Solidity and EVM, and the derived public chain teams, such as the most representative Aptos, Sui and Linera.
Since the Move programming language was first launched, it has been hailed by many developers as the most suitable language for the blockchain. With the recent strong appearance of ultra-new public chains such as Aptos and Sui, the Move language has also been widely discussed, and has been compared with Solidity and Rust. In this article, we discuss the financial attributes of the Move language, the security, flexibility, and composability of smart contracts, as well as the connection and comparison of the Move language with Solidity and Rust, and track the new public chains built on the Move language. Progress.
1. Two advantages of Move
At present, the most mainstream smart contract language is Solidity. Compared with it, the biggest feature of Move is security. Move provides comprehensive security guarantees for smart contracts from the aspects of language, virtual machine, contract call, and contract operation. In addition, it is composable On the other hand, Move also provides a better solution. The two biggest advantages of Move will be introduced below.
1. Ensure the security of smart contracts from the bottom
According to a previous report by SlowMist, blockchain security incidents in 2021 will cause losses of more than $9.8 billion. As an emerging programming language, the Move language has also made breakthroughs and innovations at different levels in terms of security.
Just as the true meaning of First-class Resources is "digital assets are first-class citizens", Move is a smart contract language for operating digital assets.
Compared with other languages, Move handles Token assets more natively and at the bottom. The Move language specifically defines assets as a kind of Resource, which is distinguished from other data. In the context of the blockchain, tokens are a kind of Resource. At the same time, Resource data must be stored under the account. During the transaction, assets must flow to one place, either transferred to another address, or destroyed. Tokens May not be copied or "dual-used".
image description
Move code example
Verify the bytes first, then execute the contract
Unlike Solidity, which uses a compiler, as an executable bytecode language, Move has built-in safety algorithms and bytecode verifiers (Bytecode verifier), which can prevent many common errors. Before the Move contract code can be executed, it must first be verified, which makes the contract immune to potential compiler failures and possible attacks.
Move has been committed to establishing a culture of norms from the beginning, and each Move module has a standard library. The Move development team has initially developed a special verifier, Move Prover, for contract verification. The verifier is now much faster, allowing developers to run tests in minutes, enabling them to iterate on their code quickly.
The DAO incident that caused the hard fork of Ethereum in 2016 was because hackers exploited the re-entrance (Re-Entrance) attack vulnerability, which is a classic attack in smart contracts. With the Resource model and byte validation, this attack cannot occur.
image description
In languages such as Solidity, the security of smart contracts depends on the isolation between smart contract virtual machines
image description
Move isolates the state of the smart contract through the security inside the programming language
Static calls reduce contract call vulnerabilities
Contract calling methods can be divided into static calling and dynamic calling. If the target of the program call must be determined at runtime, the call is called a dynamic call; on the contrary, the called target can be determined before running, and the target cannot be changed at runtime, then the call is called a static call .
Dynamic call allows many functions, procedures or subroutines to be written in the program, which is a flexible language mechanism. But flexibility also means that problems are more likely to occur. Dynamic calls are not conducive to program reasoning, and are not conducive to formal verification (Formal verification). They are also more likely to cause security problems. For example, malicious users create malicious contracts through cyclic calls, causing losses to multiple parties. .
The Move language uses static calls, and all contract execution paths can be determined at compile time, and then can be fully analyzed and verified. Developers expose problems in the contract compilation stage, rather than the runtime stage, reducing the probability of downtime during runtime. Compared with the Ethereum EVM platform, the Move module system does not support cyclic calls, which perfectly solves the contract reentry vulnerability.
2. Module-based composability: higher efficiency and more flexibility
The composability of smart contracts is another important feature for building a programming language ecosystem. The combination of smart contracts in language ecology such as Solidity is basically based on the combination of interfaces through message passing. In Move, it is based on the combination of Modules and interacts through the transfer of resources.
On Ethereum, when we want to extend some new behaviors or do some implementation optimizations, we need to redefine the previous interfaces, which will also affect the old methods.
In Move, the combination of contracts only needs to upgrade and optimize the Module, and all other contracts that have used this Module will automatically use the latest version. Move's Module functions like a contract in Ethereum, but more like a bank using object-oriented programming. Module is equivalent to providing a unified compatible space for smart contracts. Smart contracts are like various parts of Lego toys, which can generate new products through arbitrary combinations.
According to the explanation of Flex, the founder of 3NJOY Lab, if we take the construction of an automobile factory as an example, Solidity’s approach is to define the production standards and processes of this factory. factories, and then cars can be created. The way of Move is that there is only one factory, and those who want to build cars can use this factory to make cars that everyone recognizes.
Move through the combination of Modules, on the one hand, saves the block space occupied by the contract, and on the other hand, makes the upgrade easier. At the same time, since the Module system follows linear logic, it can package and encapsulate the concept of digital assets very well, and very clearly split the definition of resources and resource-related behaviors. The expressiveness brought by this resource-oriented programming And extensibility is not brought by other languages.
2. The relationship and comparison between Move and Solidity, Rust
Compared with Solidity, which was released as early as 2014, Move is still a very young development language in the field of blockchain development. It needs more time to prove that it is a blockchain development that is safe enough and not easy to report errors. technology options.
The main difference between Move and Solidity
1. In terms of financial attributes, Move regards assets as a kind of Resource, and performs more original and low-level processing on the core Token assets of the blockchain.
2. In terms of contract flexibility, Move can create one-time instructions.
Modules in the Move language are similar to Ethereum smart contracts, but not exactly the same: for example, in Libra written based on Move, modules contain code, while data is in Resources. From a goal-oriented point of view, any Solidity-based Ethereum smart contract is like a singleton object published under a single account address. In the Move environment, a single module acts as a recipe for creating resources, but any single module can be used to create any number of resources that can be published under different account addresses, which also reflects the modular flexibility of Move.
3. In terms of security, Move VM adopts language-level isolation instead of virtual machine isolation.
image description
Move's Module property
4. In terms of performance, as Move is an interpreted language, each line of code needs to be evaluated separately during operation.
Because Move code needs to be evaluated on the fly, Move performance may not be as good as Solidity and other compiled languages. However, this also avoids common bugs in Solidity and is a compromise strategy for security reasons. At present, the blockchain ecosystem built entirely based on Move is still very limited, and smart contracts created with Move cannot be transplanted to other existing blockchains for the time being. Nevertheless, developers can replace legacy programs by running most applications in the EVM and making the corresponding necessary modifications in Move.
The connection between Move and Rust
In addition, when we compare Move and Solidity, we also need to mention Rust, which is very close to Move, or more precisely, Move is a new language based on Rust, but different from Rust. Rust was first released in 2011, earlier than Solidity, and unlike Solidity, which often has security issues, Rust was born with both security and performance in mind. From the perspective of code syntax, Rust is close to the traditional programming language C++, so It has efficient running performance, but provides security for memory. Rust is a must-learn language for Solana ecosystem developers. During the development process, bugs in the Rust environment can be found and eliminated when the program is assembled, which is similar to the fact that when developing with Move, the code is evaluated line by line during operation to avoid bugs. Moreover, the modules and resources in Move are also similar to the built-in dependency manager Cargo in the Rust environment. Because of the close connection between Move and Rust, many developers who are proficient in using the Rust language in the Solana ecosystem have begun to migrate to emerging blockchain ecosystems based on Move such as Aptos and Sui.
3. New public chain construction under MOVE ecology
Aptos, Sui, Linera, Starcoin and other public chains have been deployed in the Move ecosystem, and they have all made their own expansions on the basis of the Move language. This chapter will introduce Aptos, Sui, Starcoin.
Aptos
Project Description
Aptos started in early February of this year. The developers of the team include Diem's founding team members and core developers. The team's vision for Aptos is highly related to the vision for Diem. The development of Aptos is to a certain extent a continuation of the development of Diem. Aptos focuses on the parallel execution of transactions on Layer 1 and high performance, trying to use one chain to solve the "impossible triangle" of decentralization, security, and high performance. Currently, the network can process more than 10,000 transactions per second. Ideally, the Aptos main network can process 160,000 transactions per second. Aptos has previously received an investment of 350 million US dollars, and is now the fastest-growing of the Move public chains.
Move Language on Aptos
development progress
development progress
In March this year, Aptos launched the developer testnet. In May, Aptos launched the incentive testnet registration, and divided the incentive testnet into 4 rounds: "decentralized launch", "staking", "governance and upgrade" and "dynamic verification". device topology". At present, its test network has reached more than 20,000 nodes, making it the largest known proof-of-stake node community today.
The third round of Aptos incentive test network activity AIT-3 will be officially launched on August 30, and the test will end on September 9. The Aptos main network will be launched this autumn.
ecological development
At the end of June this year, Aptos launched a $200 million ecosystem funding program, attracting more than 100 projects to build on Aptos. From the perspective of ecological layout, Aptos still focuses on infrastructure construction. The deployment scenarios are mostly products such as wallets, DEX, and lending agreements. Those worthy of attention include ultra-parallel CLOB protocol Econia, mobile multi-signature wallet hive, and integrated applications. The encrypted wallet Martian, the lending agreement NjordFinance, the transaction aggregator Hippo Labs, the AMM transaction application Pontem Network, etc.
Sui
Project Description
Founded by Mysten Labs, founded by former Meta engineers, Sui introduced immutable state in an attempt to implement a UTXO-like programming model in Move. Sui focuses on high TPS and low latency, does not set a TPS upper limit, has good expansion capabilities, and reduces user transaction costs. In the test in March this year, Sui's TPS reached 120,000. Sui is closing a Series B round of at least $200 million at a $2 billion valuation.
project characteristics
On-chain storage and its scalability. There is no global storage in Sui Move, storage only happens inside Sui storage, not Move storage. Sui's storage is low-cost and horizontally scalable, enabling developers to define complex assets with rich properties.
High Performance & High Scalability: Sui scales out to meet application demands. According to Mysten Labs, Sui authorities (nodes) can theoretically effectively scale network throughput infinitely to meet the needs of builders and creators. As of March 19, 2022, an unoptimized single-worker Sui authority running on an 8-core M1 Macbook Pro can execute and submit 120,000 token transfer transactions per second (TPS).
Development-friendly: Mysten Labs will also release the Sui Developer Kit, an open-source toolkit that allows developers to spend less time debugging smart contracts, waiting for reviews, or building basic technology stack elements. The three building blocks of the Sui Developer Kit include the Game SDK, the Bootstrapping Community SDK, and the Handshake SDK.
Move language on Sui
development progress
development progress
Sui launched on Devnet in May, allowing developers to use the Sui network. As of July, more than 5,000 nodes have been running on Devnet.
This month, Sui will launch the incentivized testnet, and registrations for the incentivized testnet have already been launched. The test network will be divided into different stages: network, pledge, upgrade, etc.
ecological progress
At present, there are 8 projects with public information, covering wallets, NFTs, blockchain games, Metaverse, etc. Judging from the current project layout and the solutions provided by Sui for games, NFT and chain games are expected to become more distinctive sectors of its ecology.
Starcoin
Project Description
development progress
development progress
Starcoin's main network will be launched in May 2021, and the Starcoin main network has been running stably for more than a year. Starcoin Layer 2 will provide a test network in September this year.
ecological development
The Starcoin ecology includes seven categories including wallet, CEX, DEX, mining pool, stable currency, NFT, chain games, etc. It mainly revolves around STC mining and trading.
Token
STC is Starcoin's native token, with a total issuance of 3,185,136,000 STC and a constant total. The main uses are 1. Payment of gas fees for transactions 2. Payment of state space fees 3. Used for on-chain governance voting.
epilogue
epilogue
Overall, Move's financial-oriented smart contract framework makes it a natural fit for the deployment of decentralized financial applications. The innovation of the Move language in terms of security, composability, and flexibility of smart contracts provides multi-faceted support and guarantees for its ecological development and the security of decentralized assets such as DeFi and NFT.
Original link