mirror of
https://github.com/bitcoin/bitcoin
synced 2026-12-04 10:44:38 +00:00
descriptor: fix InferScript creates invalid descriptors for invalid pubkeys #37018
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!37018
Loading…
Reference in a new issue
No description provided.
Delete branch "2026-fix-inferpubkey"
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?
InferScriptcreates descriptors that are rejected by the descriptor parsing process when supplied with scripts containing invalid pubkeys. This PR fixes this by checking that pubkeys are on the curve during inference and adds a functional test.Adding this curve point check to InferPubkey slows down AvailableCoins by 100% because it has to infer the descriptor for every txo in the wallet for size estimation. Fix this by creating the txo with the inferred descriptor and using that desc during size estimation; see
wallet_create_txbenchmark results below: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.
A summary of reviews will appear here.
Conflicts
Reviewers, this pull request conflicts with the following ones:
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.
LLM Linter (✨ experimental)
Possible places where named args for integral literals may be used (e.g.
func(x, /*named_arg=*/0)in C++, andfunc(x, named_arg=0)in Python):src/wallet/spend.cpp:MaxInputWeight(desc, CTxIn{outpoint}, coin_control, true, can_grind_r)src/wallet/spend.cpp:GetVirtualTransactionSize(*weight, 0, 0)2026-12-02 06:57:14
🟠 Minor · Off-curve keys make spendable mixed-key multisig inputs unsolvable for funding
Without
input_weights, spendable mixed-key1-of-2multisig inputs now fail funding size estimation and wallet coins reportsolvable=false; no current production caller funding such scripts was found.Location:
src/script/descriptor.cpp:2273(head).🔵 Suggestion · Eager descriptor caching adds work and storage for spent wallet history
The cache avoids repeated inference in
AvailableCoins, but eagerly computes and retains a separate descriptor for every owned historical output, including spent outputs that its only consumer skips.Location:
src/wallet/wallet.cpp:3746(head).🔵 Suggestion ·
AvailableCoinsstill copies solving providers for non-P2SH coinsSizing now uses the descriptor cached on
WalletTXO, so fetching a solving provider for every candidate adds unnecessary lookup and copy work outside the P2SH branch.Location:
src/wallet/spend.cpp:453(head).Review coverage was incomplete.
Reviewed:
274028917e90· Review report · Previous reportspermalink