Expand description
Script number arithmetic with Bitcoin consensus rules. Script number arithmetic with Bitcoin consensus rules.
All numbers on the Bitcoin script stack are encoded as little-endian byte arrays with a sign bit in the most significant bit of the last byte. Numeric opcodes operate on 4-byte integers in [-2^31+1, 2^31-1] but results may overflow and remain valid as long as they are not reinterpreted as numbers.
Structs§
- Script
Number - A script number using big integer arithmetic for overflow safety.
Functions§
- check_
minimal_ data_ encoding - Check that a byte array uses minimal data encoding.
- minimally_
encode - Minimally encode a byte array (used by OP_BIN2NUM).