Prisma : A Tierless Language for Enforcing Contract-client Protocols in Decentralized Applications
-
Published:2023-09-23
Issue:3
Volume:45
Page:1-41
-
ISSN:0164-0925
-
Container-title:ACM Transactions on Programming Languages and Systems
-
language:en
-
Short-container-title:ACM Trans. Program. Lang. Syst.
Author:
Richter David1ORCID,
Kretzler David1ORCID,
Weisenburger Pascal2ORCID,
Salvaneschi Guido2ORCID,
Faust Sebastian1ORCID,
Mezini Mira1ORCID
Affiliation:
1. Technical University of Darmstadt, Germany
2. University of St. Gallen, Switzerland
Abstract
Decentralized applications (dApps) consist of smart contracts that run on blockchains and clients that model collaborating parties. dApps are used to model financial and legal business functionality. Today, contracts and clients are written as separate programs—in different programming languages—communicating via send and receive operations. This makes distributed program flow awkward to express and reason about, increasing the potential for mismatches in the client-contract interface, which can be exploited by malicious clients, potentially leading to huge financial losses.
In this article, we present
Prisma
, a language for tierless decentralized applications, where the contract and its clients are defined in one unit and pairs of send and receive actions that “belong together” are encapsulated into a single direct-style operation, which is executed differently by sending and receiving parties. This enables expressing distributed program flow via standard control flow and renders mismatching communication impossible. We prove formally that our compiler preserves program behavior in presence of an attacker controlling the client code. We systematically compare
Prisma
with mainstream and advanced programming models for dApps and provide empirical evidence for its expressiveness and performance.
Funder
German Federal Ministry of Education and Research BMBF iBlockchain
German Research Foundation DFG
Hessian Ministry of Higher Education, Research, Science and the Arts
National Research Center for Applied Cybersecurity ATHENE
Hessian LOEWE initiative LOEWE
Swiss National Science Foundation SNSF
University of St. Gallen unisig
Publisher
Association for Computing Machinery (ACM)
Reference94 articles.
1. Gavin Wood. 2022. Ethereum Yellow Paper. Retrieved from https://ethereum.github.io/yellowpaper/paper.pdf
2. Simon Marlow. 2010. Haskell 2010: Language Report. Expressions. Do Expressions. Retrieved 14-11-2020 from https://www.haskell.org/onlinereport/haskell2010/haskellch3.html#x8-470003.14
3. Evan Saulpaugh. 2018. Headlong (GitHub Repository). Retrieved from https://github.com/esaulpaugh/headlong
4. Ethereum Foundation. 2015. Solidity Documentation. Retrieved 14-11-2020 from https://docs.soliditylang.org/en/v0.8.1/
5. Edwin Brady. 2007. The Idris Tutorial. Interfaces. Monads and do-notation. !-notation. Retrieved 14-11-2020 from http://docs.idris-lang.org/en/latest/tutorial/interfaces.html#notation