1
0
mirror of https://github.com/bitcoin/bips.git synced 2025-08-18 13:26:23 +00:00

Merge pull request #1865 from achow101/383-fix-scripts

383: Fix output scripts and reword minimal encoding explanation
This commit is contained in:
Jon Atack 2025-06-05 13:32:51 -07:00 committed by GitHub
commit dbb9617e5f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -43,15 +43,14 @@ When used at the top level, there can only be at most 3 keys.
When used inside of a <tt>sh()</tt> expression, there can only be most 15 compressed public keys (this is limited by the P2SH script limit). When used inside of a <tt>sh()</tt> expression, there can only be most 15 compressed public keys (this is limited by the P2SH script limit).
Otherwise the maximum number of keys is 20. Otherwise the maximum number of keys is 20.
The output script produced also depends on the value of <tt>k</tt>. If <tt>k</tt> is less than or equal to 16: The output script produced will be
<pre> <pre>
OP_k KEY_1 KEY_2 ... KEY_n OP_CHECKMULTISIG k KEY_1 KEY_2 ... KEY_n n OP_CHECKMULTISIG
</pre> </pre>
if <tt>k</tt> is greater than 16: The values <tt>k</tt> and <tt>n</tt> must be minimally encoded integers.
<pre> For values less than or equal to 16, they must be encoded using <tt>OP_0</tt> through <tt>OP_16</tt>.
k KEY_1 KEY_2 ... KEY_n OP_CHECKMULTISIG For values greater than 16, they must be a push of the signed little endian encoded value without padding.
</pre>
===<tt>sortedmulti()</tt>=== ===<tt>sortedmulti()</tt>===