<p>There is currently no real need for an <code>OP_PUSHDATA4</code>, which would allow pushing up to 4GB onto the stack. It was in the original script definition and simply was not disabled when the 520 byte limit was introduced. The only possibility for it to appear in today's scripts is as a <a href="https://github.com/bitcoin/bips/blob/master/bip-0062.mediawiki#Push_operators" rel="noreferrer">non-minimal push</a> and may be caused by a custom client or transaction malleability.</p>

CC BY-SA 3.0
2017-09-24T14:31:17.527Z
Is there any chance that `OP_PUSHDATA4` could be reclaimed / redefined for some other use in the future?
Jonathan Cross
CC BY-SA 3.0
2017-09-24T17:35:26.393Z
Unlikely, since we need to keep compatibility with existing clients. Clients that did not reclaim would attempt to push huge elements on stack and fail to do so. The good news is that with segwit the scripts are versioned and can redefine all opcodes.
cdecker
CC BY-SA 3.0
2016-04-12T13:33:14.993Z
2016-04-12T13:33:14.993Z
cdecker
<p>Any data push greater than 520 bytes in a Bitcoin transaction is not allowed (<a href="https://github.com/bitcoin/bitcoin/blob/v0.10.0rc3/src/script/script.h#L18">https://github.com/bitcoin/bitcoin/blob/v0.10.0rc3/src/script/script.h#L18</a>).</p>

<p>The opcode OP_PUSHDATA4 specifies, that the next four bytes contain the number of following bytes to be pushed onto the stack. The smallest number using four bytes is 0x10000000=268435456. </p>

<p>But due to the 520 bytes limit and since 520=0x208, we only need at most two bytes to represent the number 520. </p>

<p>So for example, if I want to push any 520 bytes of data I can do: OP_PUSHDATA2 0208 [520-bytes-of-data]. Right?</p>

<p>In that case, what is the PUSHDATA4 used for?</p>

<script>
PUSHDATA4 unnecessary?
Bjarne Magnussen
# PUSHDATA4 unnecessary?

(Asked by: username_0 on 2016-04-11)

Any data push greater than 520 bytes in a Bitcoin transaction is not allowed (<https://github.com/bitcoin/bitcoin/blob/v0.10.0rc3/src/script/script.h#L18>).

The opcode OP\_PUSHDATA4 specifies, that the next four bytes contain the number of following bytes to be pushed onto the stack. The smallest number using four bytes is 0x10000000=268435456.

But due to the 520 bytes limit and since 520=0x208, we only need at most two bytes to represent the number 520.

So for example, if I want to push any 520 bytes of data I can do: OP\_PUSHDATA2 0208 [520-bytes-of-data]. Right?

In that case, what is the PUSHDATA4 used for?

**Tags:** script


---

## 1 answers

### Answer by username_1 on 2016-04-12. Score: 9 | Accepted answer

There is currently no real need for an `OP_PUSHDATA4`, which would allow pushing up to 4GB onto the stack. It was in the original script definition and simply was not disabled when the 520 byte limit was introduced. The only possibility for it to appear in today's scripts is as a [non-minimal push](https://github.com/bitcoin/bips/blob/master/bip-0062.mediawiki#Push_operators) and may be caused by a custom client or transaction malleability.

> **Comments:**
> **username_2**: Is there any chance that `OP_PUSHDATA4` could be reclaimed / redefined for some other use in the future?  
> **username_1**: Unlikely, since we need to keep compatibility with existing clients. Clients that did not reclaim would attempt to push huge elements on stack and fail to do so. The good news is that with segwit the scripts are versioned and can redefine all opcodes.  

---

