Development Update #0 — 11.12.2018

What have we been up to?

⚙️ Building

Since publishing our paper in June, we have been heads-down developing the Counterfactual framework.

All of our contract code has been open-source and available on github since August 1, and last week at DevconIV we open-sourced a monorepo containing all of our code, and released a set of specifications. Keep reading below for more information about the different components of the Counterfactual stack we’re building.

Oh, and we have a shiny new website, too.

👯‍ Collaborating

Designing the Counterfactual framework to be suitably general and un-opinionated has required close collaboration with other teams.

The L4 team has been working closely with Prototypal, Celer, and Magmo, and speaking frequently with Perun, Kyokan, Pisa, Funfair, Connext and many other state channel researchers & developers.

This community has started doing regular state channel researcher calls, which you can watch on youtube here.

🏗️ Open-source community building

Counterfactual is an open-source project, and we’re thrilled to be growing the community of people building it.

Alongside teams from L4 (Jeff Coleman, Liam Horne, Xuanji Li, Nima Vaziri, and Mitchell Van Der Hoeff) and Prototypal (Erik Bryn, Patience Tema Baron, and Joel Alejandro Villarreal Bertoldi), we’re happy to be working with independent contributors like Armani Ferrante, Alex Xiong, Patrick McCorry, and Chris Buckland.

Getting the Counterfactual project up and running has required an initial amount of concentrated effort with tight feedback loops among core contributors.

We are very excited to be entering a new phase: the basic foundation of Counterfactual has been built, and the project is ready for a broader community to start contributing.

If you want to work with us, reach out! You can find us in our chatroom here, or email us at

What is Counterfactual?

Counterfactual is an open-source project to make state-channel applications easy to build on ethereum.

State channels are a secure technique for moving blockchain applications “off-chain” to achieve much higher performance and scalability. You can read a general description of state channels here, read some of our earlier posts for context, or dive into our paper here which explains our approach to state channels in great detail.

In the near future, “off chain” applications will be the default. Developers sitting down to build an ethereum dapp for the first time won’t build an on-chain application — they will use an existing framework, like Counterfactual, to quickly and easily build scalable applications on ethereum.

Counterfactual’s mission is to make that future a reality. We are building an open-source, un-opinionated, interoperable framework for state channels that aims to be as simple & developer-friendly as possible.

What are you building, specifically?

Counterfactual is built around 3 pieces of new core infrastructure for off-chain applications. An application library that makes it easy for developers to build “channelized” dapps, a protocol for state channels that is used by wallets & browsers to interact with state channels, and a minimalist contracts layer that handles the necessary on-chain components.

1. Minimalist Contracts layer

  • Our contracts layer is built to support everything: unidirectional & bidirectional payment channels, n-party channels, hub-and-spoke channels, plasma-compliant channels, and any type of on-chain asset (ERC20, ERC721, etc.)
  • The contracts layer includes on-chain libraries for conditional transactions, an n-of-n multisignature wallet, and a framework for defining and signing commitments for any conditional transaction
  • A generalized state channel adjudicator contract, designed to support arbitrary state machines
  • All the code is here →

2. Protocol layer

  • The protocol layer is a set of generic software that clients (wallets, browsers) use to interact with state channels and channelized applications
  • Designed to be portable and easy to add to wallets like MetaMask
  • We’ve optimized for practical network considerations. For example, we achieve economic finality with one round trip regardless of the complexity of an interaction.
  • More info here →

3. Application library

  • Think of this as analogous to Web3.js — but instead of eth_sendTransaction you do cf_update
  • A client-side API designed to communicate with wallets that can speak the protocol described above
  • Built for developers to use to define how their web or mobile web applications send and receive state updates and countersign based on decisions by the user
  • All the code is here →

What’s next?

For our next release, we’re working towards a full end-to-end implementation of all parts of the Counterfactual stack, which will include demo applications & a demo environment.

We think the best way to teach developers how to use the Counterfactual framework is to show them. The goal of the next release is to demonstrate to the ethereum dev community how to use Counterfactual to build fast, scalable applications.

As always, we’re thankful to the Ethereum Foundation for supporting our work. We believe that building free, open-source, interoperable layer 2 infrastructure is critical for ethereum’s long-term success, and we’re extremely proud to work with many likeminded people who share that vision.

If you’re interested in contributing to Counterfactual, jump in the chat or email us at

More info: