python-bitcoinlib icon indicating copy to clipboard operation
python-bitcoinlib copied to clipboard

Treat OP_1NEGATE as a small integer

Open petertodd opened this issue 1 year ago • 1 comments

Similar to Bitcoin Core's https://github.com/bitcoin/bitcoin/pull/29589

This is technically a breaking change, so would require a major version bump.

petertodd avatar Mar 12 '24 16:03 petertodd

I voiced my concerns about changing the behavior of encode_op_n/decode_op_n in the Core's issue linked in the first message, but here I want to mention that if you proceed with this change of behavior, you will also need to fix is_witness_scriptpubkey() that uses is_small_int() to check that the witness version is in bounds. OP_1NEGATE is not allowed as witness version.

dgpv avatar Mar 14 '24 08:03 dgpv