Bitcoin Stack Exchange is a question and answer site for Bitcoin crypto-currency enthusiasts. It only takes a minute to sign up.
Sign up to join this communityAnybody can ask a question
Anybody can answer
The best answers are voted up and rise to the top
OP_EQUALVERIFY
has two possible outcomes:
- In case the last two items on the stack are different, it aborts script execution.
- In case the last two items on the stack are equal, both are removed. Nothing is put back on the stack.
For a script execution to be treated as successful, it must end with a non-empty stack whose top element is not 0. In your case, the stack is empty after execution, and thus the script execution is treated as failed.
You probably want to use OP_EQUAL
instead, which puts 0 or 1 on the stack (rather than aborting or doing nothing).
Andreas Antonopoulos discusses the VERIFY suffix here.
Anything that has VERIFY will only continue execution of the Script if the outcome of the conditional operator is TRUE in which case it will not push that TRUE back to the stack, it will simply continue execution.
This StackExchange post may also be of interest.
The code for OP_EQUALVERIFY in the Bitcoin Core codebase is here.
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