login

{
"title": "OP_SETBMD",
"related":["/bignum.md", "/op_setbmd.md", "/op_bignum2bin.md", "/op_bin2bignum.md"]
}

*Sets the BigNum modulo divisor*

*D* **OP_SETBMD** => ^{?}

*D*: The modulo divisor

OP_SETBMD is defined as the single byte 0xeb.

This instruction sets the BigNum modulo to the top element on the stack (*D*). The script fails if *D* is not a BigNum or a little-endian sign-magnitude encoded integer that is greater than 0 and less than or equal to 2^4096 (**R.O1**). Note that this limit is one larger than the largest possible BigNum, but can be pushed onto the stack as data in little-endian sign-magnitude encoded integer format.

Efficient implementations may want to internally use 0 to denote a BMD of 2^4096.