The Village Chat: Meet Move – the language powering the Libra BlockchainPosted almost 5 years ago by Client Server

Facebook’s new cryptocurrency blockchain Libra uses a new bespoke programming language called “Move”.

Libra positions Move as an executable bytecode language that will implement custom transactions and smart contracts. It will be able to define custom resource types with semantics inspired by linear logic.

In Libra’s own words, “Move is designed to prevent assets from being cloned. It enables resource types that constrain digital assets to the same properties as physical assets: a resource has a single owner, it can only be spent once, and the creation of new resources is restricted.”

What are some of the key components of the language?

Facebook’s research team has published a whitepaper that explores Move in depth . So far, the team has designed and implemented four key components:

  • A programming model suitable for blockchain execution
  • A bytecode language that fits the programming model
  • A module system for implementing libraries with both strong data abstraction and access control
  • A virtual machine consisting of a serialiser/deserialiser, bytecode verifier, and bytecode interpreter

Libra says the goal of Move will be to allow programmers to define global blockchain state and implement secure operations for updating it.

Move’s modules consist of:

  • A name
  • Struct declarations
  • Procedure declarations

Modules give Move programmers “the flexibility to define rich access control policies for resources”. For example, a module can define a resource type that can only be destroyed when its f field is zero, or a resource that can only be published under certain account addresses.

The language also supports primitive types and structs, including:

  • Booleans
  • 64-bit unsigned integers
  • 256-bit account addresses
  • Fixed-sized byte arrays

And on top of that, Move also supports reference values. These differ from other Move values because they are transient. Because the bytecode verifier doesn’t allow fields of reference type, a reference must be created during the execution of a transaction script and released before the end of that script.

Libra plans to use Move to implement core functionality in the Libra Blockchain, add parametric polymorphism, collections and events, and improve the Move IR making it more “ergonomic”.

Click here to read the full whitepaper , where Libra’s team explain the complete details of how Move will power Libra’s Blockchain.