btcd icon indicating copy to clipboard operation
btcd copied to clipboard

Add OP_TXHASH and OP_CHECKTXHASHVERIFY opcodes

Open sputn1ck opened this issue 1 year ago • 1 comments

Implementation of OP_TXHASH and OP_CHECKTXHASHVERIFY, as per https://github.com/bitcoin/bips/pull/1500.

I mainly did this to learn about the BIP, maybe others might find this interesting and useful.

The code passes all testvectors specified in the BIP, I also added an example of restricting a transaction to be only spent to specified outputs.

I also added a rudimentary cache with a benchmark.

sputn1ck avatar Dec 24 '23 12:12 sputn1ck