0

I'm using btcdeb to understand script. I pick a old random P2PKH transaction form mainnet, and paste unlocking script e locking script inside. I know that this script is ok, because I can check on blockchain.

Than I Want to try with btcdeb and it works only if add flag

--modify-flags=-NULLFAIL

I expect the True at the end, instead I get 0x. Now, I did some research on NULLFAIL, but I don't understand the Problem. Before BIP 0146 the script could return false?

1 Answer 1

1

In order to verify signatures, you need to feed btcdeb the two transactions (the relevant input transaction and the transaction spending the input) for it to be able to calculate the signature hash.

Edit: as of January 18 2020, you can now feed it the signature and pubkey as a pair instead. You can also replace the signature and pubkey in the script with mock values (e.g. "mysig" and "mypubkey").

See https://github.com/kallewoof/btcdeb/blob/master/doc/mock-values.md

1
  • 1
    Added note about the new mock signature feature in btcdeb.
    – Kalle
    Commented Jan 20, 2020 at 2:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.