Open-sourcing the Pact Smart Contract Language

We’re extremely excited to announce that we are releasing our smart-contract language Pact as open-source today.

Pact is a new way to write smart contracts on a blockchain, with a level of assurance not possible with other smart-contract languages. Pact is an expressive, easy-to-learn, and productive language to code in, with excellent tooling. Try it today, download a build or build and hack on it yourself.

The power of open source

Open-sourcing is all about empowering users, which is what motivates Pact as well: empowering users to enact meaningful events on a blockchain, safely and quickly. Open-sourcing amplifies this further.

For developers

If you are a developer writing smart contracts, an open-source language means you’re not dependent on out-of-date docs to educate you since you can always look at the code, and if there’s a problem you want to fix now, you simply fork and fix it.

For business users

If you are a business user, open-source means you can develop your business logic in Pact to run on a fast blockchain like ScalableBFT knowing that your code is your own, and is not encumbered by NDAs or licenses.

For us!

It even empowers us at Kadena, by leveraging the amazing ecosystem for software development. Pact is hosted on Github, is automatically built on every commit by Travis-CI, which we further leverage to make builds for multiple OSs on our downloads page. Our docs are hosted on readthedocs.org.

All of these amazing resources work together seamlessly and for free – if your project is open-source. It’s an excellent example of alternate incentivization schemes to encourage contributions to the public. And of course, we couldn’t even develop the technology without the peerless open-source language Haskell and all of the unbelievable community libraries available for it.

Pact Features

Headline features of Pact are:

Easy-to-use database metaphor

Pact puts the power of a flexible, fast key-value versioned database in your hands, making it easy to quickly model assets or other entities.

Simple module system

Pact allows for great factoring of smart-contract solutions. Modules hold related functions and constants, and also have the ability to “guard” tables. Re-using and factoring code is safe and easy.

Durable, safe code

Pact code is Turing-incomplete – unbounded looping is impossible, and recursion is detected when smart-contract modules are loaded into the blockchain. Pact code can only be a DAG (directed acyclic graph), which means also that any referenced code is inlined at load time, making for blazing performance, but also insuring that your code will not be harmed if an imported module is later re-defined.

Public-key authorization schemes, with external verification

Inspired by Bitcoin scripts, Pact is designed with access control in mind from the ground-up. The concept of keysets ensures that any resource can be controlled by one or more public keys. Modules, tables and even rows in the database can all be governed by separate keyset rules. The key verification itself is handled by the blockchain running the contract: a developer never need worry about faulty crypto.

Confidential multi-phase transactions with “pacts”

Confidentiality on-chain demands new approaches to business logic, as the “one database to rule them all” of Bitcoin and public chains no longer applies. “Pacts” offer a way to ensure that while you cannot see your counterparty’s code, you can ensure they are acting in lock-step with you to complete a multi-phase transaction, like debit -> credit, or RFQ -> quote -> purchase -> deliver -> settle.

Go forth and transact!

Finally there’s an alternative for creating smart contracts. We’re very excited to see what developers and business users can create with this technology. Once you’re ready to run them on the fastest blockchain, send us a note.