Examples of payment channel projects are the Raiden Network and the Bitcoin Lightning network.

Next there were app-specific state channels…

State Channels

State channels are just like the payment channels above — except they are built not just for currencies, but can be built for anything that requires state on a blockchain — basically any transaction that is stored on the blockchain.

For example: the moves in a chess game. Instead of each turn being sent to a record keeper as it is taken, the turns are instead collected in the channel, then submitted as one large report at the end of the game. Just like payment channels, state channels allow groups of users to transact multiple times, over minutes or even years, agreeing at each step on what has happened, and then — when everyone is done — commit the entire record of transactions to the blockchain in one giant commit. State channels are fast and cheap, yet still trustless and final.

One item to note: state channels are built specifically for each individual application, and work only for that specific application and its specific state. This has been a strong discourager for development teams — building a new state channel for an app is expensive and time consuming.

And now, finally, we get to Counterfactual, and their concept of generalized state channels …

Counterfactual and Generalized State Channels

Generalized State Channels are like the above app-specific state channels, except they are a generic framework. Generalized State Channels allow any state of any application to be combined into one, single state channel, all at the same time. (Similar to state channels, Generalized State Channels only work for the agreed upon participants.)

So you could play chess, sell coffee, play checkers, send MKR tokens, and more, all on the same state channel, all with no fees, no delay, and no blockchain transactions.

Not only that, but (and this may be the most impressive feature) Generalized State Channels allow you, at any time, to add new apps and states to your channel, and move funds between all your apps, all with no extra work, no fees, no delay, and no transactions sent to the blockchain.

Hey — I know I’ve been using this channel to pay you back for lunches, but want to start up a chess game on that channel, too?

Counterfactual — and Generalized State Channels — are a way to get apps all working together on the blockchain, and make them cheap and fast. And they are a framework that development teams can use to put state channels in their app with minimal work.

That’s the overall idea, and it’s a big one. The whitepaper is packed full of details around threat models, implementation, comparison to other ways of taking transactions off-chain, and more. We’ll cover a few of those below.