In the last tech point article, we looked at the definitions of CounterFactual state channel and concluded with some of its main features, including equivalence, fairness, and consistency. In this article, we will continue to analyze the three criteria in its definition and talk about its application boundary.

Analyze the three criteria of CF state channel

The first criterion is equivalence. Since equivalence must be two-way, the smart contract execution environment in the state channel must be applicable to both the state channels and the blockchain, which requires:

1. All input information of operation X in the state channel can only come from operation X itself.

The smart contract can only rely on the state of the smart contract itself and not on any information from the blockchain (for example, block height and block time).

In addition, relevant information must be initialized when creating and initializing the CF state channel. Since the CF state channel is independent of the blockchain and the state of smart contract on the blockchain is subject to constant change, unlike on-chain transactions, the CF state channel cannot anchor and access any on-chain data and can only access the unchangeable data in the on-chain state.

2. The way operation X is carried out on the blockchain and in the CF state channel must be consistent.

This is particularly true for software engineering. Since smart contract platforms may have flaws and the history of blockchain software cannot be tampered with, blockchain platforms can only upgrade its software through forking, which will cause some trouble for the CF state channel. Great care must be taken during software upgrade on blockchain platforms or shutting down the CF state channel instantly to ensure the equivalence in the CF state channel and on the chain.

the second criterion is fairness. State update caused by each operation in the CF state channel must be viewable and verifiable to all participants. The participants in the CF state channel are fixed and the number is rather limited. Therefore, the CF state channel does not realize the trustless feature through the permissionless validation of a majority of nodes on the blockchain. Instead, it is achieved by each participant validating the state update of each operation itself.

This criterion requires all participants in the CF state channel to run state channel validation themselves, which is a higher demand than for participants on the blockchain. However, smart contracts in the state channel generally require very little computation and can be done through improving the blockchain client.

The third criterion is consistency and finality. All operations in the CF state channel must be consistent and instantly finalized. In the CF state channel design, any user behavior that violates the protocol can be penalized, so any state update in the state channel need to be co-signed by all participants to achieve instant finality. This requires all participants to remain online to maintain the operation of the state channel. This will not have much impact on simple applications or short-term applications, but for complex applications involving more participants or long-running applications, you will have to run in a similar way as proxy nodes or guardian nodes.

Although we only scratched the surface of the definition of the CF state channel, we can summarize the requirements for the smart contract it runs and its participants. Based on this, blockchain application developers can decide whether their applications are more suitable for the off-chain operation of the CF state channel.

What CF state channel can bring?

Not only that, although the CF state channel is an off-chain scaling solution, what we should really learn is its designing. First, from the CF state channel protocol, we can clearly see the crypto-economics system design elements. More importantly, CounterFactual allows us to see a new way of applying cryptography. To put it more broadly, each blockchain can be considered as a CF state channel in the real world. All participants on the blockchain lock up assets in the real world and participate in the construction and validation of the blockchain network. From a smaller perspective, how do you design blockchain applications to better integrate blockchain and business needs? and could there be even a new business model based on CounterFactual’s designing? Those are all the possibilities CF could offer.

Afterword

CF state channel is a very inspiring design and offers a new method of designing blockchain systems. In future tech point articles, we will further explain the philosophy behind CounterFactual and discuss what it can bring to other blockchain designs.