Explicitly forbid repeated key indexes in musig()

This commit is contained in:
Salvatore Ingala 2024-11-08 12:46:16 +00:00
parent e103ddeb1e
commit a4d9938ed2
No known key found for this signature in database
GPG Key ID: 74060FF81B33E4F8

View File

@ -198,6 +198,8 @@ The public keys obtained by deserializing elements of the key information vector
If two <tt>KEY</tt> are <tt>KP/<M;N>/*</tt> and <tt>KP/<P;Q>/*</tt> for the same key placeholder <tt>KP</tt>, then the sets <tt>{M, N}</tt> and <tt>{P, Q}</tt> must be disjoint. Two <tt>musig</tt> key placeholders are the same if they have exactly the same set of key indexes (regardless of the order).
Repeated <tt>KI</tt> expressions are not allowed inside a <tt>musig</tt> placeholder.
The key information vector should be ordered so that placeholder <tt>@i</tt> never appears for the first time before an occurrence of <tt>@j</tt> for some <tt>j < i</tt>; for example, the first placeholder is always <tt>@0</tt>, the next one is <tt>@1</tt>, etc.
=== Descriptor derivation ===