Development Update #3 — Counterfactual Playground Release

Today we’re excited to release an alpha version of the Counterfactual Playground. The Playground is a live demonstration (on Kovan) of generalized state channels built using Counterfactual, including a demo environment and multiple demo applications. You can try it out right now — go play!

We built the Playground for developers. Its primary goal is to serve as a learning tool for the ethereum development community. It’s a demo, with very simple apps, that shows you how the whole stack fits together, and how you can use the framework to build your own scalable Ethereum applications.

The Playground is also a showcase for the power of generalized state channels and the Counterfactual framework. Once users open a channel by creating an account, they can install, use, and uninstall multiple applications inside that channel without any on-chain fees or block confirmations.

When we started Counterfactual, we said we would do the following:

  • Make writing state channel apps easy without being an expert.
  • Make it possible to have multiple parallel operations inside of a single channel that do not interfere with each other.
  • Design general purpose state channels that do not reduce, and in many cases increase, privacy.
  • Support deploying or upgrading channel designs without requiring the user to make a single on-chain operation.

The framework we’ve built — and which you can try out yourself right now — accomplishes these goals. The entire framework is open source, and you can find it on our GitHub here.

Counterfactual isn’t finished — it is an open source project built by multiple teams that will continue to be actively developed. But it is now at a state where developers can start playing with it, building on it, and helping us understand how to expand and improve it.

making it rain, all off-chain

The vision we’re building towards

In the near future, state channels will not just be one-off solutions for individual blockchain applications.

Rather, channels are a broad, general layer 2 scaling solution that will make a wide range of Ethereum use-cases scalable and user-friendly. Let’s look forward and imagine how state channels will be used once basic infrastructure is built and adopted across the Ethereum ecosystem.

In the near future, many wallets and dapp browsers will support Counterfactual or other compatible state channel frameworks. This means that if a user wants to interact with an app that uses state channels, their wallet understands how to do this — it can “speak” the relevant protocol.

There will be many “channelized” applications available to users. Developers will be able to use Counterfactual to more easily build apps that take advantage of channels, without having to build their own custom stack like most projects today. Many wallets will include a default “channel payments” app, which offers free & instant transactions on Ethereum to any account that also supports channels. Other apps — like games, or privacy tools — will also make use of channels.

The power of generalized state channels means that a user can do all of this inside a single channel. Once a user opens a channel — maybe this is part of a default account creation process in their wallet or dapp browser — they can install, uninstall, and use any compatible channelized application without any on-chain transactions. Users have access to free, instant, safe and final blockchain transactions and applications “out of the box”.

This means that channels start to benefit from network effects. Today, each channel application on Ethereum exists in its own separate world. If you want to use 3 channel apps, you need to open 3 separate channels. But generalized channels means you can have one single channel, and run multiple compatible apps inside of it.

Once there are more apps and protocols that use Counterfactual, channels stop being a barrier to adoption and start being a benefit. So long as a user already uses other channel applications, they can expect to install and use new apps instantly and for free.

Once we have this core infrastructure set up — open-source frameworks & standards like Counterfactual, integration into major wallets, hubs and channel networks— state channels become an easy, default way of making payments with any Ethereum-based asset or interacting with blockchain applications.

Onwards!

Over the next few weeks, we’ll be rolling out more documentation and content targeted at developers, which will be useful if you’re getting started using Counterfactual to build your own application. Keep an eye on this space for regular updates.

Counterfactual is made possible through collaboration between many different organizations. Critical to our work has been close collaboration with other channel teams like Celer, Raiden, Perun, Connext, PISA, Magmo, and the regular state channel researcher calls.

Building something useful for developers can’t happen in a vacuum. We’ve spent significant time talking to a wide variety of development teams to get early feedback and understand how Counterfactual can solve problems for them. We’re thankful for the conversations we’ve had with Grid+, Horizon Games, Radar Relay, FOAM, UMA, MetaMask, and many other teams over the last several months.

And as always, we’re thankful for the support of the Ethereum Foundation for making this critical work possible.

If you’re interested in learning more or getting involved in the project, you can find all our code on GitHub or talk to us on Discord.