Post
Topic
Board Development & Technical Discussion
Merits 4 from 4 users
Re: Why don't we have bitcoin smart contract?
by
pooya87
on 03/12/2019, 11:36:57 UTC
⭐ Merited by buwaytress (1) ,TechPriest (1) ,RapTarX (1) ,d5000 (1)
There is definitely one smart contract I'd like for Bitcoin: escrow.

Code:
OP_2 OP_3 OP_CHECKMULTISIGVERIFY
This "smart contract" has existed in bitcoin for a very long time! you can also add additional conditions to it such as time with a locktime (OP_CHECKLOCKTIMEVERIFY)

is there anything specific you have in mind?

Or for inheritance (if I don't sign my wallet for 7 years, it releases to an heir, for example).
Code:
OP_DUP OP_HASH160 OP_EQUAL
OP_IF
    OP_CheckSig
OP_ELSE
    OP_CheckLocktimeVerify OP_DROP OP_DUP OP_HASH160
   OP_EQUALVERIFY OP_CheckSig
OP_ENDIF

if "you" wanted to spend it, you simply provide a using your own private key. if your heir wanted to claim this they have to first wait for the locktime to be reached then provide their own .