1 major finding · 2 suggestions
Earlier concerns neither republished nor resolved: 1 major finding. See the Run archive for their assessments.
Findings
[major] · Previously imported parity-twin descriptors prevent wallet loading
A wallet containing a previously imported Tapscript parity-twin descriptor cannot be opened after this change, even if that descriptor is inactive.
Location: src/script/descriptor.cpp:2315 (head).
Details and suggested fix
Before this change, a user could import a checksummed public tr(K,or_i(pk(02X),pk(03X))) with active=false and no range into a wallet with private keys disabled. Explicit compressed-key providers preserve both prefixes in ToString(), and the import path persists that descriptor without rewriting it. WalletDescriptor::FromStream() now reparses the stored text through this comparator. The resulting sanity failure becomes UNKNOWN_DESCRIPTOR, which aborts loading the entire wallet, including unrelated descriptors. The data remains intact and the outputs remain consensus-valid, but reopening the wallet requires older software. The PR provides neither a legacy-load exception nor a release note warning about this upgrade incompatibility. Keep strict rejection for new imports, but add a load-only compatibility path that preserves stored scripts and descriptor identities without presenting these descriptors as sane for new use. Cover it with an upgrade test using a base-created wallet record. No in-tree caller that automatically creates these descriptors was found; affected production wallets remain unconfirmed.
Optional improvements
[suggestion] · The WIF case checks only the public parse's diagnostic
The WIF test can pass on an unrelated private-key parsing failure because CheckUnparsable checks only the diagnostic from the public form, which already contains identical keys.
Location: src/test/descriptor_tests.cpp:1135 (head).
Details and suggested fix
CheckUnparsable passes one error string to both parses and checks it only after the public parse. Here that public form contains pk(X),pk(X), with both keys parsed as 02X, so even the base comparator produces the expected duplicate-key diagnostic. The private parse_priv.empty() assertion can still catch a comparator regression if the WIF derives 03X, but it also passes for a malformed WIF or another private-key parsing error. For this case, parse the WIF form separately and assert its duplicate-key diagnostic before parsing the public form. Also assert the intended 03X public key so the fixture explicitly establishes that it exercises opposite-parity equivalence.
[suggestion] · The Miniscript helper's x-only comparison lacks regression coverage
No assertion in miniscript_tests.cpp depends on the new helper treating opposite-parity keys as duplicates, so reverting that branch would leave this behavior unchecked.
Location: src/test/miniscript_tests.cpp:138 (head).
Details and suggested fix
The explicit duplicate-key assertions all use wsh_converter. General tests also run with tap_converter, but they check type properties and script round-trips rather than expected duplicate classification; satisfaction tests use IsSane() only as a guard. The fixtures do not put opposite-parity versions of one key into a Tapscript node, and generated keys come from private scalars 1 through 255 without negation pairs. The new descriptor tests exercise the separate production KeyParser comparator. Add a targeted or_i(pk(02X),pk(03X)) case using a valid X, such as the coordinate in the new descriptor tests. Assert !CheckDuplicateKey() and !IsSane() with tap_converter, and assert both properties are true with wsh_converter. This needs no signing data and directly protects the helper's context-dependent equivalence rule.
Earlier concerns
Earlier reports raised these, with the titles and severities shown there. This review neither republished nor resolved them.
- [major]: Duplicate checking misses later multipath expansions