Contractum: smart-contract language
Contractum is a functional declarative programming language designed for developing smart contracts which run on Bitcoin and Lightning network using RGB technology.
Last updated
Contractum is a functional declarative programming language designed for developing smart contracts which run on Bitcoin and Lightning network using RGB technology.
Last updated
Contractum differs from other smart contract programming languages in a fact that as functional as Haskell and nearly as close to the bare metal as Rust at the same time, filling in the space which was not accessible for the smart contracts before:
Contractum is the language to write RGB contracts. RGB is a technology which allows creation of arbitrary-complex ("Turing-complete") smart contracts that run on bitcoin and, most imporangly, Lightning network. RGB contracts are confidential, scalable (up to the speed of the Lightning transactions, with small data footprint) and robust.
Contracts written with Contractum are verified with client-side-validation, which does not adds data to a bitcoin blockchain and may be thought as a sharding technology, enhanced with zero-knowledge. Client-side-validation also breaks transaction graphs, unlinking contract evolution from blockchain transactions, making chain analysis impossible.
The contractum is a work in progress: the language design is under active development at the LNP/BP Association. Everyone is welcome to join the effort; a good starting point can be reading and writing to the language design discussions group in GitHub.
To understand and participate in contractum design it is important to learn more about technologies which are used by RGB smart contracts:
If you'd like to get a feel of the language, here is a sample contract written in Contractum:
Contractum development is managed by a non-profit LNP/BP Standards Association. The language design and compiler implementation is lead by Dr Maxim Orlovsky.
Learn more about RGB smart contracts on the website.
No blockchain footprint
No chainanalysis possible: contract breaks transaction graphs
Extensive use of zero-knowledge (confidential transactions, bulletproofs)
No transaction size increase, no block space usage
Sharded: data kept by contract parties and not each node
Operate with the speed of Lightning Network
Arbitrary complex business logic
#BiFi: bitcoin finance, which is much more robust and reliable than DeF
No tokens or gas required; bitcoin is the native currency
Client-side-validation relies on a deterministic commitment history named single-use-seals
Contractum runs code on AluVM virtual machine: functional registry-based RISC machine
RGB contracts uses special deterministic portable binary data type system and encoding
Define contract state and operations in a simple declarative form, which is easy to write and understand
State and contract operations take only known structured types
Leverage interfaces, type libraries, schemata and schema hierarchy for code-reuse and reducing risks of mistakes