taproot – How is tapscript totally different than P2PKH utilizing opcodes from a developer perspective? – CoinNewsTrend

taproot – How is tapscript totally different than P2PKH utilizing opcodes from a developer perspective?

[ad_1]

I’ll use ordinals for example as a result of they illustrate my query essentially the most successfully. My understanding is that ordinals are created by writing opcodes into the transaction identical to you’d with a non-taproot transaction. If I did a typical P2PKH transaction I might put

"scriptPubKey": "OP_DUP OP_HASH160 HASH_OF_PUBKEY_IN_HEX OP_EQUALVERIFY OP_CHECKSIG"

as my locking script, however If I wished to do an ordinal I imagine I might simply make my locking script

"scriptPubKey": "OP_DUP OP_HASH160 HASH_OF_PUBKEY_IN_HEX OP_EQUALVERIFY OP_CHECKSIG OP_FALSE OP_IF OP_PUSH "ord" OP_PUSH 1 OP_PUSH "textual content/plain;charset=utf-8" OP_PUSH 0 OP_PUSH "Hey, world!" OP_ENDIF"

It feels like which means that I may do an ordinal in a non-taproot handle bitcoin transaction. So I may mint an ordinal with a P2PKH handle.

So what does tapscript really try this P2PKH would not?

[ad_2]

Supply hyperlink