Merge pull request from achow101/389-no-dupes

389: Explicitly disallow duplicate multipath
This commit is contained in:
Jon Atack 2024-07-10 19:03:56 +00:00 committed by GitHub
commit 0c0ae07b81
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -48,6 +48,7 @@ This is modified to state:
When a <tt>/<NUM;NUM;...;NUM></tt> is encountered, parsers should account for a presence of multiple descriptors where the first descriptor uses the first <tt>NUM</tt>, and a second descriptor uses the second <tt>NUM</tt>, and so on, until each <tt>NUM</tt> is accounted for in the production of public keys, scripts, and addresses, as well as descriptor import and export operations.
Descriptors that contain multiple Key Expressions that each have a <tt>/<NUM;NUM;...;NUM></tt> must have tuples of exactly the same length so that they are derived in lockstep in the same way that <tt>/*</tt> paths in multiple Key expressions are handled.
Duplicate <tt>NUM</tt>s within a tuple are not allowed.
The common use case for this is to represent descriptors for producing receiving and change addresses.
When interpreting for this use case, wallets should use the first descriptor for producing receiving addresses, and the second descriptor for producing change addresses.