August 26, 2022 - 6 min read
In January 2022, Silvergate Bank announced paying nearly $200 million for Meta’s Diem blockchain IP, including the proprietary programming language Move. It is likely that the Diem (formerly Libra) project took longer than most expected in development due to the creation of Move as a novel smart contracts language for the blockchain project.
Though it is young, several projects are now connected to MoveLang besides Diem, like Sui and Aptos blockchains. Since it is quickly rising in popularity, it is useful to gather an understanding of what makes writing code in Move so exciting for developers. This article will thus summarize the highlights of Move, its applications as a virtual machine (VM), and the reasons to expect its use to proliferate in deploying smart contract protocols.
First of all, Move is a stack-based language, and essentially works by making stack operations push and pop as computations are performed. According to its execution model, accounts are to have zero or more modules, and one or more resource types, but can only have one resource within a particular resource type. If needed, custom resource types containing multiple resource instances of the same type could be created. The customization of resource types is one of the primary reasons that Move is quickly becoming such a powerful addition to a developer’s skillset.
According to Diem’s whitepaper, the executable format of Move is “bytecode that is higher-level than assembly yet lower-level than a source language. The bytecode is checked on-chain for resource, type, and memory safety by a bytecode verifier and then executed directly by a bytecode interpreter.” It was designed to maximize safety without adding the cost of compilation to transactions, and thus minimizing transaction fees compared with existing networks.
Move also comes with a lot of built-in functions that allows developers to reference resource values or even destroy resources. The built-ins, however, can only be used on resources declared in a current module. Thus, if a developer forgot to declare procedures to reference resource values using built-ins, then viewing or altering that resource would subsequently be unavailable.
The following demonstrates the primary components of the Move language:
Move distinguishes itself from other smart contract programming languages via its use of resources, which is derived from linear logic. Linear logic formulas are treated as fundamental resources that may only be used once. With MoveLang, resources are never copied or discarded, but moved between program storage locations. In other words, there is an element of ‘air-tightness’ to the code which is inherently more secure via custom ‘first class’ resource types.
This is further enabled by Move’s static type system, meaning created variables must be defined as specific types. In Move, this system protects the first-class nature of resources since the code will be compiled before execution, preventing the delivery of failed programs. Nevertheless, resources in Move are still used similarly to other, less-protected elements, and are stored in data structures, or passed as arguments to procedures.
Fundamentally, Move’s resources possess advantages in terms of both expressivity as well as security guarantees. Since resources are guarded within the code by design, but can also be used freely for all sorts of operations, MoveLang is aimed at tackling the two aspects of the blockchain trilemma in which it can affect: security and scalability.
As mentioned, Diem’s engineering team found issues with existing blockchain languages, particularly Bitcoin’s Script and Ethereum’s Solidity, noting several problems. First, other programming languages often represent elements as integers, making the programs awkward and error-prone, leading MoveLang’s designers to represent digital assets as first-class resources instead. This provides a strong foundation from the language level which protects the scarcity of any created digital assets using MoveLang.
Aside from the digital assets themselves, MoveLang allows other elements and levels of access to be easily customized. That is, that access control is embedded into the language itself. Assets written in Move are therefore more sophisticated by default, giving developers functionality with which to work. Move’s customizability regarding its use of resources and modules arguably makes it more scalable than comparable smart contract languages, though it remains to be seen.
MoveLang makes a tradeoff of speed and performance in return for its high security guarantees. That is, Move’s code is evaluated at runtime and shouldn’t suffer from compiler bugs as can be the case with Solidity and other languages. Other potential downsides include:
Finally, since it’s a rather new language, some of its shortcomings may yet to be discovered. Once it has been in use for several years and has been battle-tested like its counterparts, it will have a track record with which we can gauge its proliferation and popularity amongst Web3 devs. Move has already demonstrated plenty of promise, and has a lot of developers buzzing to work with it. Expect to see and hear a lot more content about Move over the next few years.
Related Articles
Learn More
RECENT POSTS
뉴스, 업데이트, 업계 인사이트 등 다양한 정보를 받으시려면 Supra 뉴스레터에 가입하세요.
©2024 Supra | Entropy Foundation (스위스: CHE.383.364.961). 판권 소유