The most successful and well-known blockchain-based brainy contract verhoging, Ethereum , is a stateful one. What this means is that within each block on the Ethereum blockchain, there is information regarding the entire state of it. This information includes all account balances, contract storage, contract code, etc. This contrasts with the UTXO specimen found ter Bitcoin .
However, this information takes up space meaning that knots are coerced to store large amounts of gegevens. This state information is often not relevant to the final outcome of the blockchain, for example:
If person A and B have a business relation, they can often times send each other tokens. Lets say that personA has 100 Ethers and person B has 50 Ethers. Now, within a month, personA sent personB Ten transactions of Five ETH each and personB sent personA Two transactions of Ten ETH each. The final outcome after a month will be that personA will have sent 30 ETH to the personB, which means personA will now have 70 ETH and personB will have 80 ETH.
Te a stateful network, thesis transactions will each count spil an individual transaction (15 ter total), taking up space on the blockchain. However, thanks to state channels, only the final outcome needs to be included ter the form of one single transaction.
What are State Channels
State channels are basically two-way pathways opened inbetween two users that want to communicate with each other ter the form of transactions. Each participant te the channel signs thesis transactions with his private key to ensure that they are undeniably true and authorized.
Thesis channels are off-chain and private, known only to its participants, which means they permit for instant and anonymous transactions within them. Thesis channels also have a limited lifespan which is predetermined based on time or amount of transactions carried out. Participants can also close their channel by providing the last updated state of transactions to the blockchain.
Once a channel closes, the transaction history within it can be uploaded into the blockchain ter order for the final outcome to become official. Te the personA/personB example above, the final outcome would be that personA sent 30 ETH to the personB, which means personA will now have 70 ETH and personB will have 80 ETH. This information is uploaded onto the blockchain, sparing it the back and forward transactions ter the channel that led to the final outcome.
Participants can also close their channel by providing the last updated state of transactions to the blockchain. If the other participant agrees that the state provided is indeed the final one, he lets the channel close. If not, he can upload his version of the most latest state and since all transactions are signed and timestamped, the dispute will always be won by the fair party.
Other than keeping the information knots need to store much smaller, state channels also provide extra advantages like private and instant transactions with lower fees.
However, they are not ideal for every case. For example, a clever contract that need to be aware of the state of numerous people at all times can not be run through state channels. An example of such wise contract is a DAO.
Presently, there are projects that are building on top of this technology to provide a more scalable and efficient clever contract podium that performs better on certain use cases, including the ?ternity project.