mirror of
https://github.com/bitcoin/bitcoin
synced 2026-12-04 10:08:38 +00:00
rpc, descriptor: warn when multipath expansion clones single-path key expressions #36005
No reviewers
Labels
No labels
Android
Backport
Block storage
Brainstorming
Bug
Build system
CI failed
Consensus
Data corruption
Descriptors
Docs
DrahtBot Guix build requested
Feature
Fuzzing
GUI
Good First Review
IPC
Insufficient Review
Kernel
Linux/Unix
Mempool
Mining
Needs Backport (31.x)
Needs Backport (32.x)
Needs Benchmark
Needs Conceptual Review
Needs backport (30.x)
Needs rebase
Needs release note
Net
P2P
PSBT
Privacy
Private Broadcast
Questions and Help
RPC/REST/ZMQ
Refactoring
Resource usage
Review club
Scripts and tools
Settings
TX fees and policy
Tests
Tracking Issue
UTXO Db and Indexes
Up for grabs
Upstream
Utils/log/libs
Validation
Waiting for author
Wallet
Windows
good first issue
interfaces
macOS
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
bitcoin/bitcoin!36005
Loading…
Reference in a new issue
No description provided.
Delete branch "multipath-clone-warning"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This PR:
PushWarningsin RPC callsimportdescriptorsand by a newwarningsfield ongetdescriptorinfo(which also exposes the existing miniscriptolder()warnings)Cloning internal to musig() is not warned: both
musig(A,B)/<0;1>/*andmusig(A/<1;2>,B)derive a distinct aggregate key per branch, so nothing observable is reused.closes #35985
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
External sites
Reviews
See the guideline and AI policy for information on the review process.
If your review is incorrectly listed, please copy-paste
<!--meta-tag:bot-skip-->into the comment that the bot should ignore.Conflicts
Reviewers, this pull request conflicts with the following ones:
wallet_importdescriptorsto separaterun_test()contents into specific functions by nebula-21)If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.
🚧 At least one of the CI tasks failed.
Task
previous releases: https://github.com/bitcoin/bitcoin/actions/runs/32101345101/job/95602400388LLM reason (✨ experimental): CI failed due to a GCC 12 internal compiler error (segmentation fault) while compiling
src/rpc/blockchain.cpp.Edit: Looks like the ICE was due to a corrupt VM/hardware
tACK
13ef865f84Built and ran the unit tests plus
rpc_getdescriptorinfo.pyandwallet_importdescriptors.py. I dropped each of the fourmultipath_cloned = truelines one at a time and each one fails on a different descriptor in the new unit test, and reverting only thePushWarningsdedup fails both functional tests.nit: this only allows one warning. I hit both with
wsh(and_v(v:pk(A/<0;1>/*),and_v(v:pk(B/0/*),older(65536)))), which nothing covers at the moment. Worth adding one?🐙 This pull request conflicts with the target branch and needs rebase.
Ping @pythcoiner this has been in need of a rebase for a while. Are you still working on this change?
No verified findings are available from this review.
Review coverage was incomplete.
Reviewed:
93673215444a· Full review report · Previous reportspermalink
@sedited, this is still on my todo-list (but not at the top atm tbh)
rebased on master
@jeanpablojp thanks for the review, added your descriptor to the test, and modified the check to count only expected warnings
tACK
9367321544I compared the new warning with key reuse computed outside Core. bip32-descriptors, a library I maintain, expanded 291 multipath descriptors. They cover multi, sortedmulti, multi_a, tr() trees, miniscript and musig(), with ranged, fixed and plain single-path keys. For each expansion it collected the keys in its scripts plus the taproot internal key, at indexes 0 to 2 where the descriptor is ranged. In 272 descriptors two expansions share a key. The warning fires on 270 of them and on none of the other 19. The two it misses clone no single-path key: each shared key comes from two multipath expressions on the same xpub.
deriveaddressesmatches the library's addresses on all 291.importdescriptorswarns exactly wheregetdescriptorinfodoes. With thetr()internal-key flag removed, 17 more descriptors disagree, so the comparison catches a missing flag.Gist: https://gist.github.com/fametrano/7ef458c65cf3d8c4bdab96688745b80d/1d0f3d2371525bda975201f8f987e7bdf54dcf21