Post
Topic
Board Development & Technical Discussion
Merits 8 from 3 users
Re: Question about BIP: 387
by
pooya87
on 04/04/2025, 16:50:25 UTC
⭐ Merited by NeuroticFish (4) ,ABCbits (3) ,Cricktor (1)
Let’s say that K=16, then we use “OP_16” which is equal to 0x60
If K=17 what number should we use? Is it 0x61=97 or 0x11=17?
Because k is 17
https://github.com/bitcoin/bitcoin/pull/24043/files#diff-a1732fc4dc1526b294a41db3f2d3d5e863ec76e68ee3f73449618551f7a469ebR101

If I understood the code correctly, the limit on number of pubkeys will be increased to 999 and in order to push bigger numbers, we'd do it like any other time but with "minimal push" enforced. Meaning for 0 to 16 the equivalent OP codes will be used (OP_0 to OP_16) and any other number will be pushed in its shortest way possible so 17 will be 0x0111 (0x01 is telling the interpreter to push 1 byte to the stack and then 0x11 is on the stack which is equal to 17) and 999 will be 0x0203e7

BTW 0x61 is OP_NOP and can't be used.