The Simple Truth: Basic Opcodes (OP_TRUE, OP_FALSE, OP_NOP)
The Simple Truth: Basic Opcodes (OP_TRUE, OP_FALSE, OP_NOP)
Not every instruction in a script is complex. Some are the "Building Blocks of Truth." These are the Basic Opcodes. They allow a script to declare a result or "Do Nothing" while waiting for the next step. Understanding these is the first step toward mastering the "Logic of the Vault."
For the Sovereign Architect, the Basic Opcodes are the "Foundational Axioms." They are the proof that even the most complex contract starts with a simple "Yes" or "No."
Analyzing the Axioms: The Core Constants
In the source code, we see how the node handles the simplest possible results.
/**
* PEDAGOGICAL ANALYSIS: THE CONSTANTS OF TRUTH
* This logic defines how the node handles the most basic
* values in the Script language.
*/
switch (opcode) {
case OP_0: // Same as OP_FALSE
// 1. Push an "Empty Vector" onto the stack.
// 2. This is interpreted as FALSE.
stack.push_back(std::vector<unsigned char>());
break;
case OP_1: // Same as OP_TRUE
// 1. Push a "1" onto the stack.
// 2. This is interpreted as TRUE.
stack.push_back(vchTrue);
break;
case OP_NOP:
// 1. Do nothing.
// 2. Just move to the next opcode.
break;
}
Explaining the Axioms: The Binary World
-
OP_FALSE(The Zero): In Bitcoin Script, "False" is represented by an "Empty Piece of Data." If a script ends with this on the top of the stack, the payment fails. It is the Rejection of the Sovereign. -
OP_TRUE(The One): "True" is represented by the byte0x01. If this is on the stack, the payment succeeds. It is the Approval of the Machine. -
OP_NOP(The Placeholder): "NOP" stands for "No Operation." It is a command to "Do Nothing." Why does this exist? It allows for "Future Upgrades." A "NOP" can be changed into a new command in a Soft Fork (Chapter 10) without breaking old nodes. It is the Flexibility of the Protocol. -
"The Numerical Aliases": Opcodes like
OP_1throughOP_16are "Shortcuts." Instead of writing "Push the number 1," you just writeOP_1. This saves space in the blockchain. It is the Efficiency of the Core.
The Sovereignty of the Axioms
The Basic Opcodes are the "Alphabet of the Code." They ensure that the node has a clear way to express "The Absolute State of the Money." As a Sovereign Architect, you know that "Complexity is built on Simplicity." By mastering the basic constants of the Script VM, you are laying the foundation for your understanding of the "Global Financial Language." You are the "Master of the Axioms."
TeachMeBitcoin is an ad-free, open-source educational repository curated by a passionate team of Bitcoin researchers and educators for public benefit. If you found our articles helpful, please consider supporting our hosting and ongoing content updates with a clean donation: