I'm trying to figure out the limitations that scripts have regarding their size, limits that would make a script invalid (ignoring standardness). According to this question and also these lines of code in bitcoin core's source code 1 2 3 it appears that the following rules are in place:
Maximum script size = 10,000 Maximum data size to be pushed to the stack = 520
To test these rules I made a bunch of transactions on TestNet, all of which breaking some rule and were included in blocks (all sent from
As you can see the length of the script is already 10,005 > 10,000 and the first data push is 10,001 > 520. In other words I broke both rules.
Also as far as I know the "consensus" rules are exactly the same on TestNet (with one exception: difficulty adjustment), is that correct? So how is this transactions valid?