I am trying to implement a bitcoin script interpreter and today I stumbled upon a nonstandard transaction in tx_valid.json
which gave me a lot of headaches. The transaction in question has the following prevout script public key:
DUP HASH160 0x14 0x5b6462475454710f3c22f5fdf0b40704c92f25c3 EQUALVERIFY CHECKSIGVERIFY 1 0x47 0x3044022067288ea50aa799543a536ff9306f8e1cba05b9c6b10951175b924f96732555ed022026d7b5265f38d21541519e4a1e55044d5b9e17e15cdbaf29ae3792e99e883e7a01
and has the CLEANSTACK flag set.
If we disregard the signature present in the script, which is nonstandard, the script is successful (it is the previous test in tx_valid.json
)
Now if we add the signature to the script, at the end of execution there will be two values on the stack, 1 and 0x3044022067288ea50aa799543a536ff9306f8e1cba05b9c6b10951175b924f96732555ed022026d7b5265f38d21541519e4a1e55044d5b9e17e15cdbaf29ae3792e99e883e7a01. Because of the CLEANSTACK flag, which requires only one value on the stack, I think that the script should fail.
One idea I had is that FindAndDelete deletes all the other signatures in the script public key, so now we have only 1 on the stack. However I am not sure about this because from what I have read FindAndDelete only deletes values in the subScript when verifying OP_CHECKSIG and OP_CHECKMULTISIG, and does not modify the actual script.
So where am I wrong?
You can get bonuses upto $100 FREE BONUS when you:
π° Install these recommended apps:
π² SocialGood - 100% Crypto Back on Everyday Shopping
π² xPortal - The DeFi For The Next Billion
π² CryptoTab Browser - Lightweight, fast, and ready to mine!
π° Register on these recommended exchanges:
π‘ Binanceπ‘ Bitfinexπ‘ Bitmartπ‘ Bittrexπ‘ Bitget
π‘ CoinExπ‘ Crypto.comπ‘ Gate.ioπ‘ Huobiπ‘ Kucoin.
Comments