From 19d6e7f204dba63c5c3f36a999c00c7dd3c24448 Mon Sep 17 00:00:00 2001 From: Oli Date: Thu, 6 Aug 2026 10:57:06 +0200 Subject: [PATCH] bip383: specify more precise script size limit The "15 compressed public keys" rule is not very precise and doesn't mention uncompressed ones. Core implements this differently as well: https://github.com/bitcoin/bitcoin/blob/master/src/script/descriptor.cpp#L2425 So we make the definition more precise. --- bip-0383.mediawiki | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bip-0383.mediawiki b/bip-0383.mediawiki index d19a9915..2ff792cd 100644 --- a/bip-0383.mediawiki +++ b/bip-0383.mediawiki @@ -39,7 +39,11 @@ Depending on the higher level descriptors, there may be restrictions on the type Depending on the higher level descriptors, there are also restrictions on the number of keys that can be present, i.e. the maximum value of n. When used at the top level, there can only be at most 3 keys. -When used inside of a sh() expression, there can only be at most 15 compressed public keys (this is limited by the P2SH script limit). +When used inside of a sh() expression, the output script produced is the redeem script, +which is pushed as a single element in the spending scriptSig and must therefore not exceed the +520 byte limit on the size of a script element. +This allows at most 15 compressed public keys, or at most 7 uncompressed ones, as an uncompressed +key takes 66 bytes of the script rather than 34. Otherwise the maximum number of keys is 20. The output script produced will be