Bitcoin

Bitcoin Core – Understanding numeric encoding in scripts, CScriptNum

What is a brief explanation of CScriptNum, the numeric encoding used for arithmetic opcodes in Bitcoin Script?

What would an illustrative pseudocode/Python example look like?

What should be the encoding of the following decimal point (hexadecimal)?

  • 42
  • 88
  • 257
  • 17000
  • 8589934592

When is it not 4 bytes?


See also:

Why are arithmetic script opcodes limited to 4-byte operands?

Bitcoin arithmetic operations (OP_ADD, etc.)

compressed integer in script

Related Articles

Back to top button