What’s wrong with existing smart contract languages?
Solidity and the Ethereum Virtual Machine(EVM) form the dominant smart contract paradigm in Web3. There are dozens of EVM chains in deployment, including networks like Ethereum, Binance Smart Chain, and Avalanche’sC-Chain. The EVM has a strong network effect with the most developer tooling, documentation, and reference code.
Ethereum was the first blockchain to support smart contracts.Therefore, Solidity and the EVM emerged before DeFi, crypto gaming, or any other Web3 application. At that time, Ethereum’s creators had only a vague understanding of how the system would be used. Yet, they were forced to make design decisions that remain in our current system.The Ethereum foundation’s decisions led to a readable and syntactically familiar programming language, but one that is rife with vulnerabilities. For example, the infamous DAO hack in 2016 that led to Ethereum hard-forking was caused by a reentrancy attack.
These attacks can occur when Ethereum contracts call the contract that called them, before the original contract finishes executing. This vulnerability allows a contract’s state to change from interacting with a malicious contract as it is being executed. The DAO hacker used this loophole to bypass the DAO contract’s safety checks, allowing them to steal all of its funds. Years later, we feel these consequences as smart contract exploits plague the industry – often to the tune of over $10M. From first principles, if code is permissionless to interact with, entirely open-source, and can control hundreds of millions of dollars, its language should be centered on ensuring that code’s security. In other words, it should make it easy for developers to close the gap between what they intend, and what the code actually does. To avoid Ethereum’s flaws, some newer blockchains selected a different language – Rust. Rust is a systems-level language designed in 2010 to support a range of traditional computer science applications. Today, Solana, Near, and much of the Cosmos ecosystem all utilize Rust, making it the 2nd largest programming language for smart contract developers. The decision to support Rust over Solidity has helped those blockchains reduce their frequency of exploits by leveraging its strict syntax and memory safety. However, Rust isn’t a native smart contract language. Given the specific requirements of smart contract programming, a better language is possible.
Move
Move is a new programming language developed at Meta for its Diem project. Expert programming language theorists designed the language to solve for maximal safety and expressivity in smart contract programming. The language has important security properties including memory safety and a formal verifier called the Move Prover. Memory safety provides a number of blanket protections to the code from vulnerabilities associated with accessing memory. Formal verification allows developers to mathematically prove that their code operates correctly. Even better, the Move Prover is fast – developers can run tests within minutes to verify their code. Together, these features create a more secure, more efficient programming language for smart contracts.
“Move leverages a ‘second mover’ advantage over early smart contract languages: before we created the language, we intensely studied existing smart contract use-cases and languages to understand what developers wanted to do and where existing languages were not delivering. The key problem we identified is that smart contracts are all about assets and access control, yet early smart contract languages lack type/value representations for both. The Move hypothesis is that if we provide first-class abstractions for these key concepts, we can significantly improve both the safety of smart contracts and the productivity of smart contract programmers. Having the right vocabulary for the task at hand changes everything.” – Sam Blackshear, Creator of Move
So what does this unlock for Web3?
The language also changes how we think about coding smart contracts. Move is centered around digital objects as its key data abstraction. These objects can flow through contracts as arguments and be returned by functions. This is much more intuitive than Solidity’s approach, where objects are kept as entries in hashmaps that are permanently stuck in their smart contract. Move’s design makes it perfect for dynamic NFT projects and crypto gaming, where objects can easily be thrown into a function to create a new object or to modify an existing one.
Who is Using Move?
- Sui and Aptos are the most notable blockchains utilizing Move. The two networks offer extremely high throughput and low latency.
- Sui is built by Mysten Labs. The blockchain supports arbitrary computation, but is especially well-positioned for DeFi and gaming applications. Notably, Sui’s high-performance would not be possible without the Move language; it relies on Move’s data model to support parallel transaction processing.
- Aptos is built by Aptos labs. Like Sui, Aptos is also great for DeFi, gaming, and payments applications.
- Both projects were founded by former research scientists and engineers at Meta working on the Diem project and are poised to make a major impact when they launch in 2022/23.
Looking Forward
Move can help mature the entire industry by bringing safer, more expressive smart contracts. With 2 of the most hyped layer 1 blockchains launching in the next year both utilizing the language, it is poised to seriously challenge Solidity and the EVM to become a new model for smart contracts.
