<p>The <a href="https://github.com/bitcoin/bitcoin/blob/10b22e3141a603ec891d2cfc7100c29c7409aabe/src/script/script.h#L22" rel="nofollow noreferrer">maximum number of bytes pushable to the stack is set to 520 bytes</a>, so that would be the maximum plain-text data of a secret (if you want to be able to redeem the output afterwards).</p>

<p>Another question discussing about this limit can be found <a href="https://bitcoin.stackexchange.com/questions/38937/what-was-the-original-rationale-for-limiting-the-maximum-push-size">here</a>.</p>

CC BY-SA 3.0
2017-07-20T07:47:20.553Z
2017-07-20T07:47:20.553Z
cpsola
<p>What is the limit in bits for the plain-text data of a secret (the data that it is actually hashed and used in a script) in a hash locked contract?</p>

<blockchain><script><p2sh>
Is there a limit in bits for the data hashed in hash-locked script?
skydanc3r
# Is there a limit in bits for the data hashed in hash-locked script?

(Asked by: username_0 on 2017-07-19)

What is the limit in bits for the plain-text data of a secret (the data that it is actually hashed and used in a script) in a hash locked contract?

**Tags:** blockchain, script, p2sh


---

## 1 answers

### Answer by username_1 on 2017-07-20. Score: 1 | Accepted answer

The [maximum number of bytes pushable to the stack is set to 520 bytes](https://github.com/bitcoin/bitcoin/blob/10b22e3141a603ec891d2cfc7100c29c7409aabe/src/script/script.h#L22), so that would be the maximum plain-text data of a secret (if you want to be able to redeem the output afterwards).

Another question discussing about this limit can be found [here](https://bitcoin.stackexchange.com/questions/38937/what-was-the-original-rationale-for-limiting-the-maximum-push-size).


---

