Repository navigation
Conversation
parse_pubkey() splits at the first comma, which cannot handle key expressions that themselves contain commas. No behavior change for valid descriptors.
Move the derivation path checks into _check_bip388_deriv_path() and the suffix serialization into _get_bip388_deriv_suffix(), so key expression types with a different placeholder prefix can reuse them. No behavior change.
Introduce get_derivation_providers() and route the existing key collection and derive() through it, preserving repeated keys and traversal order.
Cover repeated key expressions with different suffixes and assign one BIP 388 key-information entry and placeholder index to each key. Keep derivation traversal separate so every occurrence is still derived.
Registered descriptor policies may contain Miniscript expressions in P2WSH. Parse their structure so keys land in the BIP 388 key information vector and the same policy validation applies as for other descriptors. Miniscript type checking remains the responsibility of the device.
Factor the existing taproot internal-key parsing and index advancement into _parse_key_expr(), without accepting additional key expression types.
Parse musig() key expressions as specified in BIP 390, checked against its test vectors. Participants may carry derivation paths only when the aggregate key has none; in that case derivation happens on the participant keys before aggregation. Aggregate key derivation must be unhardened and requires extended public key participants. The aggregate key carries the derivation path suffix, so derivation-related callers use the new get_derivation_providers(), while get_pubkey_providers() returns the participant keys, matching the BIP 388 Key information vector. BIP 388 does not allow derivation before aggregation, so get_bip388_placeholder() rejects it.
Move suffix parsing into a shared helper without changing how valid or malformed paths are interpreted.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Based on and split off from #852.