Skip to main content
QUICK REVIEW

[Paper Review] Resources: A Safe Language Abstraction for Money

Sam Blackshear, David L. Dill|arXiv (Cornell University)|Apr 10, 2020
Blockchain Technology Applications and SecurityComputer Science19 references6 citations
TL;DR

This paper introduces resources—a safe, linear type abstraction in the Move language that prevents duplication and loss of digital assets by enforcing resource safety at the bytecode level. It formalizes resource safety as a conservation property analogous to mass conservation, proving that Move programs preserve total asset supply even under untrusted execution, thus enabling secure smart contract programming for financial applications.

ABSTRACT

Smart contracts are programs that implement potentially sophisticated transactions on modern blockchain platforms. In the rapidly evolving blockchain environment, smart contract programming languages must allow users to write expressive programs that manage and transfer assets, yet provide strong protection against sophisticated attacks. Addressing this need, we present flexible and reliable abstractions for programming with digital currency in the Move language [Blackshear et al. 2019]. Move uses novel linear [Girard 1987] resource types with semantics drawing on C++11 [Stroustrup 2013] and Rust [Matsakis and Klock 2014]: when a resource value is assigned to a new memory location, the location previously holding it must be invalidated. In addition, a resource type can only be created or destroyed by procedures inside its declaring module. We present an executable bytecode language with resources and prove that it enjoys resource safety, a conservation property for program values that is analogous to conservation of mass in the physical world.

Motivation & Objective

  • To address the critical need for strong safety guarantees in smart contract programming, especially for financial assets that must not be duplicated or lost.
  • To formalize a resource safety property ensuring conservation of digital assets, analogous to physical conservation laws, in a blockchain execution model.
  • To design and verify a bytecode-level language abstraction (Move) that enforces resource safety through linear types and module-level control over resource creation/destruction.
  • To demonstrate that source-level linearity alone is insufficient for security, requiring enforcement at the executable level to prevent attacks via untrusted code.
  • To provide a formal foundation for Move’s resource model, enabling secure, expressive financial smart contracts on blockchains like Libra.

Proposed method

  • Introduces resource types as linear types that cannot be copied or implicitly dropped, ensuring each value has a unique, immutable ownership path.
  • Designs a Move bytecode language with explicit semantics for resource operations, including creation, transfer, and destruction within module-defined boundaries.
  • Defines resource safety as a conservation property: the total number of resources in a program remains constant across all valid executions.
  • Proves resource safety using formal semantics, showing that all successful executions preserve resource invariants regardless of untrusted interactions.
  • Integrates the Move virtual machine with the Libra blockchain, demonstrating real-world deployment and compatibility with production systems.
  • Uses formal verification techniques to ensure that resource safety holds across all possible program executions, even when interacting with untrusted code.

Experimental results

Research questions

  • RQ1How can a programming language enforce the conservation of digital assets, such as money or financial instruments, in a way that prevents duplication or unintended loss?
  • RQ2What formal semantics and type system guarantees are necessary to ensure resource safety in a blockchain environment where untrusted code may be executed?
  • RQ3Why is source-level linearity insufficient for securing financial smart contracts, and how can executable-level enforcement improve security?
  • RQ4How can a language abstraction support both expressiveness and safety for diverse financial assets beyond native currency?
  • RQ5What is the role of module-level encapsulation in controlling resource creation and destruction to maintain system-wide invariants?

Key findings

  • The Move bytecode language enforces resource safety, ensuring that the total number of resources in a system remains constant across all valid executions.
  • Resource safety is formally proven using a conservative semantic model, demonstrating that no resource can be duplicated or lost during program execution.
  • The use of linear types in Move prevents common vulnerabilities such as double-spending and resource leaks, even when interacting with untrusted code.
  • The approach enables secure, expressive financial smart contracts that can model complex assets like escrow agreements, derivatives, and cross-border payments.
  • The Move virtual machine has been successfully integrated into the Libra blockchain, validating the practicality and robustness of the design in production environments.
  • The formal model shows that resource safety is preserved even when contracts interact with arbitrary, untrusted code, making it suitable for open, decentralized systems.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.