Post
Topic
Board Development & Technical Discussion
Re: Port EVM Livetree #Collective smart contracts to Bitcoin network -
by
garlonicon
on 25/12/2022, 14:05:57 UTC
Quote
Quote
And then, you can have this N-of-N "everyone agrees" signature as a base for any Turing-complete contract you want.
Can you give us an example?
Well, N-of-N multisig means that "everyone agrees" on everything what happened on some second layer. Then, Bitcoin Script can be as complex as it is needed, because it can be splitted into many transactions. It is just a matter of cost. We have opcodes like OP_NOT, OP_TRUE, OP_FALSE and OP_EQUAL. There are also more complex opcodes, but it is possible to express any loops and other operations as a sequence of opcodes, repeated the maximum times it can execute (the more complex it will be, the more bytes it will take, for example "OP_2DUP OP_ADD OP_2DUP OP_ADD ..." will produce Fibonacci sequence). And then, you just need two things: one is the chain of Script operations, that will move all coins into fees, and another is the final transaction that takes the end of that chain (the last coins before being converted to fees), and the coins of all participants.

Then, all participants have a choice: execute everything off-chain, and reach agreement (the cheapest and the most private option), or execute everything on-chain (that is costly, it requires revealing parts that are signed upfront (to protect Script from being stopped or altered in the middle by some third party), and requires taking TapScript path, that pushes the whole chain of transactions, to execute for example "SHA-3(something)==hash".

So, yes, Bitcoin can be Turing-complete even today, but then you have to be ready for spending for example 100 BTC for executing some contract on-chain. Or you can try it on regtest or testnet3 to be convinced. But in general, it is better to reach off-chain agreement, or propose a soft-fork to add OP_SOMETHING, than to use that costly method to do it today.