Counterfactual is a general framework for building state channel applications.
-
Generalized: Counterfactual makes no assumptions about your application, the type of state being passed around, the number of parties in the channel, the type of asset being stored, or the structure of your application. It is fully generalized to support any number of state channel applications for n-party channels with zero on-chain transactions for installing or uninstalling applications.
-
Modular: Write your application logic without concerning yourself with the details of the state channel dispute process, timeout periods, or for edge case attack scenarios. Counterfactual aims to seperate the state channel logistics from your application logistics. Applications themselves, despite being secured through the same on-chain multisignature wallet, are completely isolated from each other.
-
Maximally Off-Chain: The only on-chain component for a state channel in Counterfactual is a multisignature wallet. Everything else is supported through the technique of counterfactual instantiation (i.e., generating deterministic references to off-chain contract code).
The main purpose of this repository is to continue to evolve Counterfactual's contracts layer, iterating towards improving it for production use. Development of Counterfactual happens in the open on GitHub, and we are grateful to the community for contributing bugfixes and improvements.
- Install node v8.x or v10.x
yarn
To run the tests:
- Run
yarn ganache
in a separate terminal yarn test
Counterfactual is MIT licensed.