Repository navigation
Conversation
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. External sites
ReviewsSee the guideline and AI policy for information on the review process.
If your review is incorrectly listed, please copy-paste ConflictsReviewers, 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.
Possible places where comparison-specific test macros should replace generic comparisons:
2026-12-03 14:42:53 |
|
Concept ACK 03c835d |
5859ac2 to
16f3a0b
Compare
|
🚧 At least one of the CI tasks failed. HintsTry to run the tests locally, according to the documentation. However, a CI failure may still
Leave a comment here, if you need help tracking down a confusing failure. |
16f3a0b to
ecd667c
Compare
ecd667c to
b3e7ab7
Compare
|
I reverted the decision to make
I also slightly adjusted the |
|
Haven't done a full re-review, but is cbc9a4a something we should address in a separate PR? This behavior is a mistake on the user behalf I would imagine, but having the |
|
Reply to #35302 (comment), opened #36962 with the first 2 commits. |
|
Rebased on master now that #36835 is merged. |
Return the bump transaction and its fees in a `BumpTransaction` struct, or the error result and messages in a `BumpError`, instead of through output parameters.
Such an output, like an OP_RETURN, was silently dropped from the bumped transaction and change sent to a new address.
A silent payments address has no fixed scriptPubKey: it is derived from the inputs of the paying transaction, so it does not fit in CTxDestination. Add `PaymentDestination`, which holds either a CTxDestination or a `bip352::SilentPaymentsDestination` and can be parsed from either kind of address. Use it in `validateaddress`, so it accepts silent payments addresses. Co-authored-by: rustaceanrob <[email protected]>
Change `CRecipient::dest` and `CCoinControl::destChange` to hold a `PaymentDestination`, in preparation for sending to silent payments addresses. As before, a `CNoDestination` change destination means a change address is generated. No behavior change. Co-authored-by: rustaceanrob <[email protected]>
…dpsbt Both rpcs parse the outputs into recipients for `FundTransaction`, but also passed them to `ConstructTransaction`, which parsed them again only for the resulting outputs to be cleared. Make the outputs of `ConstructTransaction` optional and pass none from both rpcs. In `walletcreatefundedpsbt`, the sequence/replaceable check now runs before the outputs are parsed.
Make `ParseOutputs` return `PaymentDestination`s and take an `allow_silent_payments` option, which every caller leaves off for now. Use the parsed outputs in `sendall`, which adds them once the inputs are known, and in `bumpfee`, whose `CreateRateBumpTransaction` now takes destinations instead of `CTxOut`s. No behavior change.
Add a silent payments flag to `CCoinControl`, which `MaybeEnableSilentPayments` sets when paying to a silent payments address. Such a transaction must be added to the wallet when it is created, since its outputs are derived from the private keys of its inputs: `send` refuses `psbt=true`, `add_to_wallet=false` and incomplete signing for it. Add `GetDummyTxOut`, to size an output before its script is known, and `GetSilentPaymentsDestinations`. No behavior change, since silent payments addresses are still rejected.
When funding a silent payments transaction, skip coins that cannot be spent in it: outputs of an unknown witness version, which BIP352 receivers skip, and inputs eligible for the shared secret whose private key the wallet does not have, such as external inputs, since the outputs are derived from it. Add `GetPrivKeyForSilentPayments` to get the (tweaked, for taproot) private key of an input. `AvailableCoins` caches the key check per set of ScriptPubKeyMans, since every script of a descriptor is derived from the same keys. Co-authored-by: josibake <[email protected]>
Add `CreateSilentPaymentsOutputs`, which sums the private keys of the eligible selected inputs and derives the taproot outputs of the silent payments destinations. Fail if no selected input is eligible, or if the key of an eligible input is missing, instead of creating outputs the recipient cannot find. `CreateTransactionInternal` uses these outputs for silent payments recipients, and for a silent payments change destination. Until the inputs are selected, `GetDummyTxOut` stands in a P2TR output for size and dust estimation, and taproot change is preferred. Co-authored-by: josibake <[email protected]>
Fee bumping a silent payments tx by adding inputs needs its original recipients to recompute its outputs. Store them in the wallet database (`sprecipients`) when the tx is committed, keep them in sync with malleated variants, and drop them once the tx is replaced. Stop older releases from bumping such a tx by writing a placeholder tag as its `replaced_by_txid`, which also flags it as a silent payments tx on load.
Use the recorded recipients in `bumpfee` to recompute the silent payments outputs. Refuse to bump a silent payments tx whose recipients are missing. Allow sp addresses in the `outputs` of `bumpfee`. `psbtbumpfee` refuses to bump silent payments txs, since a PSBT is not added to the wallet.
Accept silent payments addresses in `send`, `sendmany` and `sendtoaddress`. Paying to one requires an unlocked wallet with private keys and no external signer, since the outputs are derived from the private keys of the inputs. Co-authored-by: josibake <[email protected]>
Accept silent payments addresses in the recipients of `sendall`, and derive their outputs from the inputs. As with `send`, refuse `psbt=true`, `add_to_wallet=false` and incomplete signing for them. Since `sendall` is meant to leave no coin behind, fail if any coin would be skipped because it cannot be spent in a silent payments transaction, and let the user pick the coins with `inputs` instead. The coins picked with `inputs` are checked the same way as those of `send`.
Accept a silent payments address as the `change_address` of `send`. Its output is derived from the inputs like those of the recipients, and it is recorded with them. `fundrawtransaction` and `walletcreatefundedpsbt` refuse it, since their transactions are not added to the wallet.
Older releases do not know the recipients of a silent payments tx, so they must refuse to bump it, which would invalidate its silent payments outputs. Check that they do, and that master can still bump it after upgrading again.
Test sending to silent payments addresses with `sendtoaddress`, `sendmany`, `send` and `sendall`, and check with `scantxforsilentpayments` that the recipients find their outputs. Cover eligible input types, coin selection with eligible and ineligible inputs, wallets and inputs that cannot send silent payments, transactions that must be added to the wallet, fee bumping, and reorgs.

This PR is part of integrating silent payments into Bitcoin Core. It is the second iteration of #28201. Status and tracking for the project is managed in #28536
Prerequisite PRs:
original_change_indexoutput without a destination #36962Sending
Silent Payments logic
Key things to note in this PR:
PaymentDestinationis added to containCTxDestinationorSilentPaymentsDestinationadd_to_wallet=False