Difference between revisions of "Pushdata Opcodes"

Line 1: Line 1:
The pushdata opcodes push the next bytes of data onto the stack. Opcodes 1-75 simply push the next bytes of data onto the stack without a requirement to specify how many bytes to push.
+
The pushdata opcodes push the next bytes of data onto the stack. Opcodes 1-75 simply push the next bytes of data onto the stack without a requirement to first specify how many bytes to push.
  
 
=== OP_PUSHDATA1 ===
 
=== OP_PUSHDATA1 ===

Revision as of 01:04, 13 January 2020

The pushdata opcodes push the next bytes of data onto the stack. Opcodes 1-75 simply push the next bytes of data onto the stack without a requirement to first specify how many bytes to push.

OP_PUSHDATA1

OP_PUSHDATA1 pushes data of length from 76 to 255 bytes onto the stack.

OP_PUSHDATA2

OP_PUSHDATA2 pushes data of length from 256 bytes up to 63,999 bytes onto the stack.

OP_PUSHDATA4

OP_PUSHDATA4 pushes data of length from 64 KB up to 4.3 GB onto the stack.

Pushdata opcodes unused

Due to the maximum script size being limited to 520 bytes, these opcodes were essentially rendered useless. The Genesis upgrade increases the maximum script size such that these opcodes can be used properly in script.