Post
Topic
Board Development & Technical Discussion
Merits 1 from 1 user
Re: Why don't we have bitcoin smart contract?
by
TechPriest
on 09/12/2019, 12:25:10 UTC
⭐ Merited by pooya87 (1)
additionally the script i posted was not P2PKH, it can't be since it is not OP_DUP HASH160 <> EQUALVERIFY CHECKSIG! it is a "scriptpub".


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

Maybe i get something wrong, because i'm not very good in english.

Edit: I have understood what you're talking about. You're right, but i'm right too: such script will not be mined with very high probability.

and finally there is no "must" in scripts, you can provide whatever you like.

Yes, but if other nodes will not retranslate it (transaction) and miners will not mine it - there is no much sense to "provide whatever i want". And my message was about that.
In theory, you can add to ScriptPubKey whatever you want (i'm about active Op codes). But in practice, we have something like that:

B peaлизaции пpoвepки нa cтaндapтнocть чёткo oпpeдeлён шaблoн cкpиптa P2PKH:

https://github.com/bitcoin/bitcoin/blob/master/src/script/standard.cpp#L60
https://github.com/bitcoin/bitcoin/blob/master/src/script/standard.cpp#L138

If transaction doesn't match this standards when it's "nonstandard" with all it problems.