<p>Bitcoin Core standardness rules require data pushes to be minimal, i.e. where multiple ways exist to push the same byte vector, the shortest one must be used. (<a href="https://opcodeexplained.com/script/push.html#minimal-push-operations" rel="nofollow noreferrer">See explanation at Opcode Explained.</a>)</p>
<p>In two cases you're pushing a single byte with OP_PUSHBYTES_1 that you should push with a dedicated opcode, namely <code>08</code> and <code>01</code>. Use OP_8 (<code>0x58</code>) and OP_1 (<code>0x51</code>) respectively instead.</p>

CC BY-SA 4.0
2024-06-02T13:36:35.007Z
2024-06-02T13:36:35.007Z
Vojtěch Strnad
<p>I have sent to a P2WSH but I can't spend from this address because I get this error;
Code: -26, Error: non-mandatory-script-verify-flag (Data push larger than necessary)&quot;</p>
<p>This is the script that was hashed to make the P2WSH address:
Raw hex:
930108870063036f7264010109696d6167652f706e67004d080289504e470d0a1a0a0000000d494844520000004b000000640103000000f47a5f4a000000017352474200aece1ce90000000467414d410000b18f0bfc610500000006504c5445000000ffffffa5d99fdd000000097048597300000ec400000ec401952b0e1b000001bb4944415438cb7d933d2f436114c7cfedad6aeaad8410f1528bd818c5a211a38184cdd0dd6a61d03bfa06d686854af808bd9385cd2cadb704154d8918aedee39cd3e79ea7a4f1a4b7fde577fff77f4e9316009c35e453218c9d283e6e28de6d19747e651b8a8ecd9e56d5de5a7bffacb643ad17bbfc60f46487a13c62830387bbc9cea8611d1c832f4f823e675701f28c097067043dde6c13600731cbd3ce0002ac156407803abe8a5df0dd23bc95692b696aab67f85b9cc5c0c5371e01d4e0e020079229207bc2127ab264a7057b0b845719b1d4524f732f24093fa6781ac429fb709163eca2ab9ae47dc1a56983fdd2d047d9e325c131d093901230657306077cc819a469bec114389ec16170416d22c24918017ef1be7e26b2e35e540013fcd4bc603c4e6fe9a69dd37586ec66a3169bb13f275a9b5694fe2e4f6f2d5b8c59ecf8f550fb2a88b7b52d986adbd0627b2c76b7f46615f7adddb618da45dfadfdb693d17c3a39909f259dd90ae0b7d03029c4b0582c9650d09cb6f8e92bd68c6d68a064b35f74058cc13f652dd8883028a9cd6b20aca93db08f056f8a9f58ce301bac856563cb78838b82215de7a54233b0f755be164b7f36c46ae50752e785b8f36ef2c30000000049454e44ae42608268</p>
<p>Script with comments;
93 - op_add
01 - OP_PUSHBYTES_1
08
87 - op_equal
00 - OP_0
63 - OP_IF ?
03 - OP_PUSHBYTES_3
6f7264 - &quot;ord&quot;
01 - OP_PUSHBYTES_1
01
09 - OP_PUSHBYTES_9 ?
696d6167652f706e67 - &quot;image/png&quot;
00 - OP_0
4d0802 - OP_PUSHDATA2, 520 bytes
89504e470d0a1a0a0000000d494844520000004b000000640103000000f47a5f4a000000017352474200aece1ce90000000467414d410000b18f0bfc610500000006504c5445000000ffffffa5d99fdd000000097048597300000ec400000ec401952b0e1b000001bb4944415438cb7d933d2f436114c7cfedad6aeaad8410f1528bd818c5a211a38184cdd0dd6a61d03bfa06d686854af808bd9385cd2cadb704154d8918aedee39cd3e79ea7a4f1a4b7fde577fff77f4e9316009c35e453218c9d283e6e28de6d19747e651b8a8ecd9e56d5de5a7bffacb643ad17bbfc60f46487a13c62830387bbc9cea8611d1c832f4f823e675701f28c097067043dde6c13600731cbd3ce0002ac156407803abe8a5df0dd23bc95692b696aab67f85b9cc5c0c5371e01d4e0e020079229207bc2127ab264a7057b0b845719b1d4524f732f24093fa6781ac429fb709163eca2ab9ae47dc1a56983fdd2d047d9e325c131d093901230657306077cc819a469bec114389ec16170416d22c24918017ef1be7e26b2e35e540013fcd4bc603c4e6fe9a69dd37586ec66a3169bb13f275a9b5694fe2e4f6f2d5b8c59ecf8f550fb2a88b7b52d986adbd0627b2c76b7f46615f7adddb618da45dfadfdb693d17c3a39909f259dd90ae0b7d03029c4b0582c9650d09cb6f8e92bd68c6d68a064b35f74058cc13f652dd8883028a9cd6b20aca93db08f056f8a9f58ce
30 - OP_PUSHBYTES48
1bac856563cb78838b82215de7a54233b0f755be164b7f36c46ae50752e785b8f36ef2c30000000049454e44ae426082
68 - OP_ENDIF ?</p>
<p>As you can tell it should be spendable by just pushing two 4s onto the stack in the wittness.</p>
<p>Any help much apprecisted</p>

CC BY-SA 4.0
2024-06-03T13:45:53.473Z
Please fix the formatting, this is very hard to read
Murch
<p2wsh><ordinals><op-pushdata>
Code: -26, Error: non-mandatory-script-verify-flag (Data push larger than necessary)" when trying to spend from P2WSH
Adam
# Code: -26, Error: non-mandatory-script-verify-flag (Data push larger than necessary)" when trying to spend from P2WSH

(Asked by: username_0 on 2024-06-02)

I have sent to a P2WSH but I can't spend from this address because I get this error;
Code: -26, Error: non-mandatory-script-verify-flag (Data push larger than necessary)"

This is the script that was hashed to make the P2WSH address:
Raw hex:
930108870063036f7264010109696d6167652f706e67004d080289504e470d0a1a0a0000000d494844520000004b000000640103000000f47a5f4a000000017352474200aece1ce90000000467414d410000b18f0bfc610500000006504c5445000000ffffffa5d99fdd000000097048597300000ec400000ec401952b0e1b000001bb4944415438cb7d933d2f436114c7cfedad6aeaad8410f1528bd818c5a211a38184cdd0dd6a61d03bfa06d686854af808bd9385cd2cadb704154d8918aedee39cd3e79ea7a4f1a4b7fde577fff77f4e9316009c35e453218c9d283e6e28de6d19747e651b8a8ecd9e56d5de5a7bffacb643ad17bbfc60f46487a13c62830387bbc9cea8611d1c832f4f823e675701f28c097067043dde6c13600731cbd3ce0002ac156407803abe8a5df0dd23bc95692b696aab67f85b9cc5c0c5371e01d4e0e020079229207bc2127ab264a7057b0b845719b1d4524f732f24093fa6781ac429fb709163eca2ab9ae47dc1a56983fdd2d047d9e325c131d093901230657306077cc819a469bec114389ec16170416d22c24918017ef1be7e26b2e35e540013fcd4bc603c4e6fe9a69dd37586ec66a3169bb13f275a9b5694fe2e4f6f2d5b8c59ecf8f550fb2a88b7b52d986adbd0627b2c76b7f46615f7adddb618da45dfadfdb693d17c3a39909f259dd90ae0b7d03029c4b0582c9650d09cb6f8e92bd68c6d68a064b35f74058cc13f652dd8883028a9cd6b20aca93db08f056f8a9f58ce301bac856563cb78838b82215de7a54233b0f755be164b7f36c46ae50752e785b8f36ef2c30000000049454e44ae42608268

Script with comments;
93 - op\_add
01 - OP\_PUSHBYTES\_1
08
87 - op\_equal
00 - OP\_0
63 - OP\_IF ?
03 - OP\_PUSHBYTES\_3
6f7264 - "ord"
01 - OP\_PUSHBYTES\_1
01
09 - OP\_PUSHBYTES\_9 ?
696d6167652f706e67 - "image/png"
00 - OP\_0
4d0802 - OP\_PUSHDATA2, 520 bytes
89504e470d0a1a0a0000000d494844520000004b000000640103000000f47a5f4a000000017352474200aece1ce90000000467414d410000b18f0bfc610500000006504c5445000000ffffffa5d99fdd000000097048597300000ec400000ec401952b0e1b000001bb4944415438cb7d933d2f436114c7cfedad6aeaad8410f1528bd818c5a211a38184cdd0dd6a61d03bfa06d686854af808bd9385cd2cadb704154d8918aedee39cd3e79ea7a4f1a4b7fde577fff77f4e9316009c35e453218c9d283e6e28de6d19747e651b8a8ecd9e56d5de5a7bffacb643ad17bbfc60f46487a13c62830387bbc9cea8611d1c832f4f823e675701f28c097067043dde6c13600731cbd3ce0002ac156407803abe8a5df0dd23bc95692b696aab67f85b9cc5c0c5371e01d4e0e020079229207bc2127ab264a7057b0b845719b1d4524f732f24093fa6781ac429fb709163eca2ab9ae47dc1a56983fdd2d047d9e325c131d093901230657306077cc819a469bec114389ec16170416d22c24918017ef1be7e26b2e35e540013fcd4bc603c4e6fe9a69dd37586ec66a3169bb13f275a9b5694fe2e4f6f2d5b8c59ecf8f550fb2a88b7b52d986adbd0627b2c76b7f46615f7adddb618da45dfadfdb693d17c3a39909f259dd90ae0b7d03029c4b0582c9650d09cb6f8e92bd68c6d68a064b35f74058cc13f652dd8883028a9cd6b20aca93db08f056f8a9f58ce
30 - OP\_PUSHBYTES48
1bac856563cb78838b82215de7a54233b0f755be164b7f36c46ae50752e785b8f36ef2c30000000049454e44ae426082
68 - OP\_ENDIF ?

As you can tell it should be spendable by just pushing two 4s onto the stack in the wittness.

Any help much apprecisted

**Tags:** p2wsh, ordinals, op-pushdata

> **Comments:**
> **username_1**: Please fix the formatting, this is very hard to read  

---

## 1 answers

### Answer by username_2 on 2024-06-02. Score: 3

Bitcoin Core standardness rules require data pushes to be minimal, i.e. where multiple ways exist to push the same byte vector, the shortest one must be used. ([See explanation at Opcode Explained.](https://opcodeexplained.com/script/push.html#minimal-push-operations))

In two cases you're pushing a single byte with OP\_PUSHBYTES\_1 that you should push with a dedicated opcode, namely `08` and `01`. Use OP\_8 (`0x58`) and OP\_1 (`0x51`) respectively instead.


---

