Provider refusals
write_verifier: Provider declined the request because of a cybersecurity restriction. Experiments remain incomplete; static verification can continue.
1 major finding · 3 minor findings · 9 suggestions
Earlier concerns neither republished nor resolved: 3 suggestions. See the Run archive for their assessments.
Findings
[major] · Rejected parses crash both descriptor fuzz targets
Both descriptor fuzz targets dereference a null Parse result on ordinary rejected inputs, preventing them from exercising rejection paths.
Location: src/test/fuzz/descriptor_parse.cpp:123 (head).
Details and suggested fix
Parse now returns a null pointer on checksum or syntax failure, but both targets immediately call GetMultipathExpansion(). In descriptor_parse, the first pass requires a checksum, so even raw(51) reaches the null dereference before the checksum-optional pass. The mocked converter only substitutes keys and copies other characters verbatim, so it also admits strings that fail parsing. Base safely skipped these failures by iterating an empty vector. Add if (!desc) continue; in the checksum loop and if (!desc) return; in the mocked target. Also assert that reconstruction returned a non-null mp before calling mp->ToString(), so a reconstruction failure becomes an explicit invariant failure. Update the Parse return-value documentation from an empty vector to a null pointer.
[minor] · Repeated branches produce invalid or shortened reconstructions
Repeated branch inputs can produce an unparsable descriptor or silently reduce its branch count; no production caller of reconstruction was found at this head.
Location: src/script/descriptor.cpp:710 (head).
Details and suggested fix
After the first differing relative appends an index, p contains multiple indexes. Equality then compares that accumulated vector with each later singleton, so base wpkh(X/0/*) and relatives wpkh(X/1/*), wpkh(X/1/*) produce <0;1;1>, which Parse rejects. Conversely, 0,0,1 skips the initially equal relative and produces only <0;1>; wholly identical inputs return a single-path descriptor. An already-multipath relative contributes only Index(0). The MuSig aggregate-path loop has the same mechanism, and the final cross-key length check does not validate input cardinality. Validate the original single-path inputs before mutation, require distinct child numbers at each varying position, and require the reconstructed branch count to equal relatives.size() + 1 when relatives are supplied. Reject already-multipath relatives and add repeated, identical and reordered-duplicate negative cases for both path implementations.
[minor] · getdescriptorinfo help still promises the first multipath branch
The descriptor result now preserves the full multipath expression, but its RPC help still describes the former first-expansion result.
Location: src/rpc/output_script.cpp:214 (head).
Details and suggested fix
For multipath input, descriptor now comes from the combined object's ToString() rather than descs.at(0)->ToString(). The changed functional assertion confirms this intended behavior. The result therefore contains multipath syntax and a different embedded checksum, contrary to the unchanged help. Describe the field as the full public descriptor with multipath elements preserved, direct callers needing individual branches to multipath_expansion, and add a release note for the changed output.
[minor] · Mixed hardened markers change Miniscript compatibility hashes
For Miniscript keys mixing apostrophe and h markers, per-element PUBLIC serialization changes the supposedly stable compatibility hash used for new SPKM IDs.
Location: src/script/descriptor.cpp:590 (head).
Details and suggested fix
Miniscript's COMPAT serialization deliberately requests PUBLIC key strings, so preserving each element's marker also changes compatibility serialization. For example, a Miniscript key suffix X/0'/1h previously serialized uniformly as X/0h/1h, but now retains X/0'/1h. The old parser also shared the final marker between origin and inner-key serialization, so mixed origin/suffix spellings are affected. These changed bytes alter CompatDescriptorHash for new imports despite its documented stability. Existing wallets load using their stored IDs, and canonical duplicate matching remains in place, so this does not establish a load failure. Preserve the historical uniform-marker spelling specifically on the Miniscript COMPAT path, including the marker selected after origin and suffix parsing, and add a mixed-marker test vector with a fixed compatibility hash.
Optional improvements
[suggestion] · Expansion-string round-trip checks the wrong private serialization
The final round-trip rechecks an earlier reconstruction, leaving private serialization of the descriptor reconstructed from expansion strings untested.
Location: src/test/descriptor_tests.cpp:624 (head).
Details and suggested fix
exp_recon_pub comes from independently parsed expansion strings, but the final private-string call targets recon_pub, and the equality assertion compares its earlier recon_pub_privs output. A private-serialization regression confined to the expansion-string route could therefore pass these assertions. Call exp_recon_pub->ToPrivateString(prov, exp_recon_pub_privs) and compare exp_recon_pub_privs with prv. Also use mp_prv.at(0) as the base for the private round-trip, although Parse neuters xprvs, making that distinction small. Use fatal BOOST_REQUIRE_MESSAGE checks for parse and reconstruction prerequisites before dereferencing their results.
[suggestion] · Range evaluation repeatedly clones the same descriptor expansion
Ranged descriptor RPCs clone branches at every index, preventing aggregate-then-derive MuSig descriptors from reusing their cached aggregate.
Location: src/rpc/util.cpp:1367 (head).
Details and suggested fix
GetMultipathExpansion() sits inside the derivation-range loop, so the default inclusive range [0,1000] constructs and destroys the cloned expansion 1,001 times, including for single-path ranged descriptors. Base reused the parsed branches. Each MuSig clone also starts without m_aggregate_provider, causing fixed-participant aggregation to be recomputed at each index. Store const auto expansions = desc->GetMultipathExpansion(); before the outer loop and iterate those branches inside it, using a name that does not shadow desc. This preserves script ordering, shared-provider updates and ExpandPrivate behavior while retaining useful aggregation state. The redundant operation count follows from the source; runtime impact is unmeasured.
[suggestion] · The SPKM fuzzer stores unresolved multipath descriptors
The scriptpubkeyman harness now constructs wallet descriptors that production import splits into branches and database loading refuses to reload.
Location: src/wallet/test/fuzz/scriptpubkeyman.cpp:80 (head).
Details and suggested fix
CreateWalletDescriptor previously selected the first parsed expansion, but now wraps the entire Parse result. The mocked converter preserves <, ; and >, so multipath inputs can pass the successful-Expand check and reach AddWalletDescriptor unchanged. That check derives branch 0 without making the stored object single-path. The resulting stored string still describes every branch and would be rejected by WalletDescriptor::FromStream, unlike descriptors created by production import. Select one GetMultipathExpansion() entry before both the Expand check and WalletDescriptor construction. Choosing the first preserves base behavior and avoids exercising this harness-only wallet state.
[suggestion] · The standalone-expansion lifetime check now exercises the parent
Returning the multipath parent leaves use of an expanded descriptor after parent destruction untested.
Location: src/test/descriptor_tests.cpp:568 (head).
Details and suggested fix
The comment promises to retain one path descriptor after destroying the others, but the lambda now returns parsed itself. Consequently, the following ToString and Expand calls never exercise an expansion. Other expansion checks destroy temporary siblings while keeping their parsed parents alive, so they would not catch a child retaining references into its parent. Inside this lambda, obtain parsed->GetMultipathExpansion() and move one entry out as the return value. The parent and remaining expansions will then be destroyed before the existing operations run.
[suggestion] · Multipath descriptors silently enter single-path operations
An unexpanded multipath Descriptor derives branch 0 while retaining all alternatives in origin data, so single-path operations currently rely on caller discipline.
Location: src/script/descriptor.cpp:531 (head).
Details and suggested fix
ChildNumber() and IsHardened() default to alternative zero, but GetPubKey copies the complete multipath path into KeyOriginInfo. Its serialization then writes only the first alternative. When successful hardened normalization moves a prefix containing a multipath element into the origin, it can also emit origin syntax that Parse rejects. No production caller supplying an unexpanded multipath object to these operations was found; current production callers expand or reject it first. Enforce that contract in Expand, ExpandFromCache and ToNormalizedString by checking !IsMultipath() and returning false before producing output. This keeps ordinary expanded-descriptor behavior unchanged and makes missed expansion explicit at the API boundary.
[suggestion] · Multipath-capable origins add an allocation for every path step
Using vector-backed KeyPathElement for origins adds per-step allocations and permits multipath state that the origin wire format silently truncates.
Location: src/util/bip32.h:64 (head).
Details and suggested fix
KeyOriginInfo::path now stores a vector-backed KeyPathElement for every former uint32_t step. Each scalar element owns a separate heap block, and copying an origin deep-copies those blocks. This affects ordinary PSBT deserialization and by-value SerializeKeyOrigin calls, not just multipath descriptors. Origins represent one derivation path, while their serializer deliberately writes only alternative zero. No production caller creating multipath origins was found, so truncation remains conditional on an unexpanded descriptor reaching origin generation. Keep origin paths single-path, for example as std::vector<SingleKeyPathElement>, and convert resolved descriptor paths at that boundary. This preserves hardened spelling and wire serialization without allocating an alternatives vector for every origin step. The allocation pattern is established from source; its runtime magnitude is unmeasured.
[suggestion] · Slash-only forms now parse as empty HD paths
ParseHDKeypath now accepts '/' and 'm//' as empty paths where the previous parser rejected their empty elements.
Location: src/util/bip32.cpp:86 (head).
Details and suggested fix
Removing an optional m/ prefix and then one trailing slash makes both / and m// empty before the success check. The old parser rejected their empty path element. derivehdkey still requires a hardened step, and legacy key metadata still requires three steps, so these callers reject the inputs later with different errors rather than accepting a derivation. Preserve the accepted empty-root spellings "", m and m/ explicitly, guard trailing-slash trimming against an empty span, and reject malformed forms made empty by slash removal. Add / and m// negative parser cases.
[suggestion] · ParseScript retains an unused result variable
The direct-return rewrite leaves a null result variable that no branch uses.
Location: src/script/descriptor.cpp:2610 (head).
Details and suggested fix
ParseScript no longer accumulates descriptors into ret: every success path returns a constructed descriptor directly, and failures return {}. The remaining std::unique_ptr<DescriptorImpl> ret; is never assigned or read. Remove the declaration to match the new control flow.
[suggestion] · The parser rewrite leaves two stale includes
The last sstream use in bip32.cpp disappeared, and descriptor.cpp's unordered_set use moved into bip32.cpp.
Location: src/util/bip32.cpp:15 (head).
Details and suggested fix
The span-based parser no longer uses <sstream> in util/bip32.cpp. Moving duplicate-index detection into that file also removed script/descriptor.cpp's only <unordered_set> use. Remove those two stale includes, while retaining <unordered_set> in bip32.cpp for its duplicate check.
Earlier concerns
Earlier reports raised these, with the titles and severities shown there. This review neither republished nor resolved them.
- [suggestion]: Update
Parse's documented failure return - [suggestion]: Avoid copying every multipath alternative for every branch
- [suggestion]: Remove the unused
Indexesaccessor