Safer smart contract programming with Scilla

I Sergey, V Nagaraj, J Johannsen, A Kumar… - Proceedings of the …, 2019 - dl.acm.org
I Sergey, V Nagaraj, J Johannsen, A Kumar, A Trunov, KCG Hao
Proceedings of the ACM on Programming Languages, 2019dl.acm.org
The rise of programmable open distributed consensus platforms based on the blockchain
technology has aroused a lot of interest in replicated stateful computations, aka smart
contracts. As blockchains are used predominantly in financial applications, smart contracts
frequently manage millions of dollars worth of virtual coins. Since smart contracts cannot be
updated once deployed, the ability to reason about their correctness becomes a critical task.
Yet, the de facto implementation standard, pioneered by the Ethereum platform, dictates …
The rise of programmable open distributed consensus platforms based on the blockchain technology has aroused a lot of interest in replicated stateful computations, aka smart contracts. As blockchains are used predominantly in financial applications, smart contracts frequently manage millions of dollars worth of virtual coins. Since smart contracts cannot be updated once deployed, the ability to reason about their correctness becomes a critical task. Yet, the de facto implementation standard, pioneered by the Ethereum platform, dictates smart contracts to be deployed in a low-level language, which renders independent audit and formal verification of deployed code infeasible in practice.
We report an ongoing experiment held with an industrial blockchain vendor on designing, evaluating, and deploying Scilla, a new programming language for safe smart contracts. Scilla is positioned as an intermediate-level language, suitable to serve as a compilation target and also as an independent programming framework. Taking System F as a foundational calculus, Scilla offers strong safety guarantees by means of type soundness. It provides a clean separation between pure computational, state-manipulating, and communication aspects of smart contracts, avoiding many known pitfalls due to execution in a byzantine environment. We describe the motivation, design principles, and semantics of Scilla, and we report on Scilla use cases provided by the developer community. Finally, we present a framework for lightweight verification of Scilla programs, and showcase it with two domain-specific analyses on a suite of real-world use cases.
ACM Digital Library