smart-contract-languages
smart-contract-languages copied to clipboard
A curated collection of resources on smart contract programming languages
Overview
This is a curated collection of resources on specialized programming languages executed by decentralized peer-to-peer networks, also known as blockchains.
Let us define a smart contract, or simply contract, as a piece of code created by a blockchain user and executed by a blockchain node. A smart contract language (SCL) is a programming language that is either used to write a smart contract directly, or is compiled to it.
Programming languages differ on multiple dimensions, such as paradigm and type system. Due to a very unusual execution environment, SCLs have a different set of trade-offs compared to earlier languages. This spawned multiple attempts at creating secure and expressive SCLs.
Pre-Bitcoin
- A formal language for analyzing contracts - an essay by Nick Szabo
- E - referenced by Szabo
Bitcoin
- Bitcoin Script - a stack-based non Turing complete Forth-like language used to write script that determine whether a UTXO can be spent.
- Ivy - a non Turing complete higher-level language that compiles to Bitcoin Script (announcement)
- Simplicity - a typed functional programming language utilizing combinators blog post, another one
- BitML - a process calculus based language, compiles to Bitcoin script (article)
- BALZaC - a high-level language based on the formal model proposed in [AB+18FC]
-
Miniscript - a language for writing (a subset of) Bitcoin Scripts in a structured way, enabling analysis, composition, generic signing and more
- Policy Language - nicer language that compiles to Miniscript
- Sapio
- Minsc - a high-level scripting language for expressing Bitcoin Script spending conditions based on Miniscript Policy
Ethereum
Active:
- Ethereum bytecode - a Turing complete stack-based language executed by the Ethereum virtual machine (EVM)
- Solidity - a high-level imperative statically typed language compiled to EVM. Docs
- Vyper - a high-level language compiled to EVM (announcement of formal tools from RV). Docs
- Fe - a language inspired by Vyper aiming to achieve its goals. Docs
- eWASM - a restricted subset of WebAssembly for Ethereum contracts. Docs
- Idris - a pure functional language with dependent types. Docs
- Flint - a type-safe, contract-oriented programming language specifically designed for writing robust smart contracts on Ethereum
- Formality - an efficient programming language featuring formal proofs
- Huff - an efficient low-level language with macros
- Lira - a declarative domain-specific language for defining simple yet highly complex financial contracts for EVM
- Zinc - a language to write zero-knowledge circuits and ZKP-based smart contracts. Docs
- Sway - a Rust-based Smart Contract Language
No updates after 2018:
- Bamboo - a high-level "formal-verification-friendly" language compiled to EVM
- Pyramid - An EVM backend for SICP Scheme
- Lolisa - subset of Solidity
- Logikon - an experimental language for smart contracts
No updates after 2017:
- LLL - a "low-level Lisp-like language" compiled to EVM bytecode (discontinued)
- functional-solidity-language - pretty much self-descriptive :)
- Serpent - a Python-like high-level language compiled to EVM (deprecated due to security issues with the compiler)
- Babbage - "a mechanical smart contract language"
- SolidityX - a typed-superset of Solidity
No updates after 2016:
- L4 - a language "based on deontic modal logic", presented at Devcon 2 (Sep 2016)
- Mutan - a C-like language compiled to EVM (deprecated)
IRs
- Yul (ex JULIA, ex IULIA) - an intermediate language that can be compiled to bytecode for different backends.
- Yul+ - a low-level, highly efficient extension to Yul
- SlithIR - an intermediate representation that is used by Slither to enable high-precision analysis via a simple API. It supports taint and value tracking to enable detection of complex patterns.
- Elle - The Elle source language, also known as Elle-Core, captures structured programming abstractions and enables their translation to Ethereum EVM bytecode through a verified compiler.
DSLs
- Alacrity - a DSL for simple, formally-verified DApps
- Ergo - Domain specific language for smart legal contracts
- Sandcastle - a SQL Ethereum smart contract language
- FSolidM - framework for visual programming of Finite State Machines
- Findel - a non Turing complete financial DSL inspired by a S.P.Jones' work
- the language from the paper by Egelund-Müller et al
- Chorus - a financial contractual markup language by Firmo network
- ADICO - a domain-specific language to support the contract modeling process
- ink! - an embedded DSL for writing WebAssembly based smart contracts using the Rust programming language and targeting Substrate blockchains. Documentation
- Reach - a DSL for trustworthy DApps that enables junior developers without years of experience. Documentation
Other blockchains
- Move - a safe and flexible programming language for the Libra Blockchain
- Michelson - a stack based and strongly typed domain-specific language (Tezos)
- Liquidity - a high-level typed smart-contract language that strictly complies to Michelson security restrictions (Tezos)
- fi (Tezos)
- LIGO (Tezos)
- Plutus - a pure functional language with user-defined data types and polymorphism (Cardano); compiles to Plutus Core (video)
- Marlowe - a domain-specific language for smart contract language embedded in Plutus (Cardano)
- Rholang - a reflective higher-order process calculus language (RChain)
- Obsidian - a state-oriented language with linear types
- DAML - a smart contract language of Digital Asset
- Simvolio (Apla blockchain platform)
- RIDE - a non Turing complete language infulenced by Scala and F# (Waves)
- Scilla - an intermediate level language for verified smart contracts (Zilliqa)
- TxVM (Chain)
- IELE - a variant of LLVM specialized to execute smart contracts on the blockchain
- Pact - a smart contract language with a Lisp syntax but Haskell-like types (Kadena)
- Ledger Design Language - a modeling language for describing public ledgers
- Sigma-State (Ergo)
- Sophia - a strongly typed language in the ML family (Æternity)
- Varna - a non Turing complete high-level language (Æternity)
- Fift - a stack-based general purpose programming language optimized for TON Blockchain smart contracts (TON)
- Clarity (Blockstack)
- Ethermint (Cosmos)
- Secure EcmaScript (Cosmos)
- Kadenamint (Cosmos)
- Rell (Chromia)
- Solang - a new Solidity compiler written in rust which uses llvm as the compiler backend. Solang targets Substrate, Solana, ewasm, and Sawtooth. It is source compatible with Solidity 0.7
Other links
- https://github.com/pirapira/fp-ethereum - a collection of links related to function programming for Ethereum
- Smart Contract Languages Development to Follow - a post by Matt Suiche, Comae (Dec 2017)