Repository navigation
Conversation
For finished transactions, this allows the inspection of when and to whom the transaction was sent as well as when/if it was echoed from the network. Co-authored-by: Vasil Dimov <[email protected]>
Extend p2p_private_broadcast_then_public.py with a second case (if the wallet is compiled): a wallet transaction is sent via private broadcast, comes back from the network into the mempool and the wallet of the originator, and is then announced to all peers by the periodic resend of the wallet.
With -privatebroadcast, sendrawtransaction sends the transaction only via short-lived private broadcast connections and does not add it to the mempool. However, other code paths can later add the same transaction to the mempool and announce it to all peers, which links the transaction to this node: - the submitpackage RPC - the wallet, on commit and on its periodic resend (e.g. after the transaction came back from the network and was picked up by the wallet) - the GUI PSBT broadcast - ReattemptInitialBroadcast(), for transactions in the unbroadcast set All of these end up in PeerManager::InitiateTxBroadcastToAll(), which is also used to relay transactions received from peers. Add a reason parameter to it (RELAY or REQUESTED). If the reason is not RELAY and the transaction is known to the private broadcast storage, then do not announce it, remove it from the mempool's unbroadcast set, so that it is not retried, and log that. Relaying a privately broadcast transaction after it was received back from the network is not affected: at that point the node behaves like any other node that received the transaction. Extend p2p_private_broadcast_then_public.py to check that re-sending a privately broadcast transaction via submitpackage or via the periodic resend of the wallet does not reach a public peer, while another transaction sent the same way does.
optout21
force-pushed
the
2610-privbcast-guard
branch
from
October 22, 2026 12:07
4e095b8 to
a100dde
Compare
Owner
Author
|
--> bitcoin#36607 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation: Reduce the risk of accidental privacy leak happening when broadcasting non-privately a requested transaction that had been previously broadcast privately.
Background: During the initial phase of private broadcast implementation there were unforeseen instances when a private transaction could get broadcast non-privately (see bitcoin#36277 bitcoin#36330 bitcoin#36309).
Currently known pathways:
submitpackageNote that these are being addressed, but other, currently non-identified pathways cannot be excluded.
Change summary: Add a general, extra safeguard: whenever there is a transaction broadcast request, check if the given transaction has been previously broadcast privately, and if so, refuse to broadcast non-privately.
Transaction relay is not affected, as it should not be affected by private broadcast. When we receive a previously private-broadcast transaction for the first time (it's not yet in our mempool), we relay it as any other relayed transaction. Behavior is unchanged in this regard.
Notes:
abortprivatebroadcastwill be forgotten.