<p>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.</p>

<p>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").</p>

<p>See <a href="https://github.com/kallewoof/btcdeb/blob/master/doc/mock-values.md" rel="nofollow noreferrer">https://github.com/kallewoof/btcdeb/blob/master/doc/mock-values.md</a></p>

CC BY-SA 4.0
2020-01-20T02:42:09.793Z
Added note about the new mock signature feature in btcdeb.
Kalle
CC BY-SA 4.0
2020-01-17T02:19:50.453Z
2020-01-20T02:41:54.870Z
2020-01-20T02:41:54.870Z
Kalle
<p>I'm using <a href="https://github.com/kallewoof/btcdeb" rel="nofollow noreferrer">btcdeb</a> 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.</p>

<p>Than I Want to try with btcdeb and it works only if add flag </p>

<blockquote>
  <p>--modify-flags=-NULLFAIL</p>
</blockquote>

<p>I expect the True at the end, instead I get 0x.
Now, I did some research on <a href="https://github.com/bitcoin/bips/blob/master/bip-0146.mediawiki" rel="nofollow noreferrer">NULLFAIL</a>, but I don't understand the Problem. 
Before BIP 0146 the script could return false? </p>

<script><signature>
OP_CHECKSIG NULLFAIL with btcdeb
monkeyUser
# OP_CHECKSIG NULLFAIL with btcdeb

(Asked by: username_0 on 2019-03-05)

I'm using [btcdeb](https://github.com/kallewoof/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](https://github.com/bitcoin/bips/blob/master/bip-0146.mediawiki), but I don't understand the Problem.
Before BIP 0146 the script could return false?

**Tags:** script, signature


---

## 1 answers

### Answer by username_1 on 2020-01-17. Score: 1 | Accepted answer

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>

> **Comments:**
> **username_1**: Added note about the new mock signature feature in btcdeb.  

---

