bitcoin-dev

Smart Contracts Unchained

Smart Contracts Unchained

Original Postby Nadav Kohen

Posted on: April 17, 2019 16:17 UTC

The author of a post on the Bitcoin-dev mailing list has shared their ideas on how to incorporate the benefits of lightning, such as privacy and speed, into smart contracts.

The proposal involves using funds locked up in a lightning channel to create a 2/3 MultiSig output for an escrow scheme. In order to accomplish this, parties would commit to the output on their next commitment transaction and then revoke_and_ack. When the contract is resolved, the output can be removed and the balances updated. If either party is uncooperative, the counter-party can force close the channel and resolve funds on-chain. The proposal also includes the use of single hop smart contracts, which are useful if one party wants to act as a hub matching users wanting to enter smart contracts. In this scenario, parties would irrevocably commit to the same 2/3 MultiSig output on their commitment transaction with the hub. When the contract is resolved, the hub can remove the output and update balances by revealing how to claim funds from the other party. If the hub is uncooperative, the affected counter-party should close the channel and go on-chain with the 2/3 MultiSig transaction. Fully routed smart contracts are also discussed, which involve n possible outcomes in which one party receives money from a contract with another party. However, the author notes that they are not yet sure how to ensure only the intended party can claim the 2/3 MultiSig output. The proposal aims to achieve similar security to federated sidechains and additional benefits to privacy and smart-contract-patching without launching a separate blockchain or sidechain.