Question about BIP: 387

2 replies 490 views
GigaGangFull Member
Posts: 26 · Reputation: 285
#1Jun 10, 2023, 12:15 PM
So, about this BIP, there are two ways to set up threshold signatures based on the number "k" (the minimum signatures needed to approve). If we take K=16, we go with "OP_16", which is 0x60. But what if K=17? Should we use 0x61 (which is 97) or 0x11 (which is 17)? Since k is 17, what’s the correct number? Thanks, angelo
4 Reply Quote Share
im_apeHero Member
Posts: 629 · Reputation: 3824
#2Jun 10, 2023, 06:14 PM
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 0x02e703 (note the little endian order of 999). BTW 0x61 is OP_NOP and can't be used.
1 Reply Quote Share
GigaGangFull Member
Posts: 26 · Reputation: 285
#3Jun 12, 2023, 04:14 AM
Thanks angelo
4 Reply Quote Share

Related topics