Skip to content

Latest commit

 

History

History
52 lines (33 loc) · 3.46 KB

programmable_state_channels.md

File metadata and controls

52 lines (33 loc) · 3.46 KB

WARNING

this is an old expired version of the documentation.

Please use the new documentation instead.

Here is the main page for the new documentation: https://github.com/zack-bitcoin/amoveo-docs

And here is the link for the newest version of the page you are currently looking at

Programmable State Channels

A programmable state channel is a mechanism invented by Zack Hess that allows the blockchain to enforce a smart contract without storing any of the code that makes up the smart contract.

For example, if we play a card game enforced by smart contract, the blockchain wouldn't know that you played cards. Still, the blockchain can enforce that the winner of the card game gets their money.

Contracts inside of programmable state channels are called "off-chain". Contracts that store state on the blockchain are called "on-chain". When state is "on the blockchain", that means that every full node has to download and store the state, and every light node is able to verify a merkle proof of the state from headers.

The advantages of off-chain contracts are similar to the advantages of channel payments over on-chain payments:

  • The smart contract can be updated instantly. You don't have to wait for any confirmations.
  • You don't have to pay a miner fee.
  • The smart contract stays off-chain and private, your channel partner can't prove the channel state, even if they wanted to.

These are some common misconceptions about programmable state channels:

Discuss this on Reddit

This is the VM for state channel smart contracts in Amoveo https://github.com/zack-bitcoin/chalang

It has a couple compilers.

You can see a market for derivatives being run completely off-chain in state channels here: http://159.89.87.58:8080/explorer.html It is being used as futarchy to decide how to upgrade Amoveo. It matches trades in single-price batches.

Almost all state channel smart contracts will need to be integrated into markets like these. The only exceptions are perfectly symmetrical contracts. If a contract isn’t symmetric, then you need a market to determine the price of participating in the contract.