btcd
btcd copied to clipboard
Add OP_TXHASH and OP_CHECKTXHASHVERIFY opcodes
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.