Skip to content

Delayed transaction broadcast prototype - #25

Closed
optout21 wants to merge 6 commits into
masterfrom
2610-delayed-broadcast1
Closed

optout21 wants to merge 6 commits into
masterfrom
2610-delayed-broadcast1

Conversation

@optout21

@optout21 optout21 commented Oct 1, 2026 •

Copy link
Copy Markdown
Owner

First minimal implementation for "Delayed Transaction Broadcast" new feature.

Goal: Allow a user to submit a transaction for delayed broadcasting, that will be broadcast only later, at a randomized time. The aim is increased privacy, by making time-correlation-based tracking more difficult.
This fits together with private broadcast: private connection broadcast tries to hide the originator node; randomized delay tries to hide the creation time.

Goals in this PR: Extend the sendrawtransaction RPC with an optional delay_for parameter, and if set, postpone the initial broadcast to that later time, with some extra jitter.

Use case Details, with the limitations of the current changeset:

  • What is a typical delay time? 30 - 90 minutes. (Too long times can get problematic: risk fee increase, node restart.)
  • Delayed broadcast is only supported with private broadcast.
  • Delay option and time is specified per submission (in sendrawtransaction). Alternative: with node level config.
  • For now pending transactions are NOT persisted, so pending transactions will be lost during a node stop/restart/crash.
  • Randomized delay is expressed as a percentage of the requested delay. A hard-coded value of 50% is used.
  • Delay times are capped: requested delay between 0min to 12 hours, randomization range to minimum 5 minutes.
  • Validation happens both at submission and broadcast time.
  • No special handling for sudden fee increase situations.
  • Pending (submitted but not yet submitted) transactions can be inspected via existing getprivatebroadcastinfo RPC.
  • The (pre-existing) abortprivatebroadcast RPC can be used to cancel a pending transaction submission.
  • No special nLockTime handling.
  • No special support from the wallet subsystem. (A submitted but not broadcast transactions is not visible in the wallet.)
  • No Undo/Cancel support at this time (to be added later).

Solution Details:

  • The solution is based on the Private Broadcast implementation.
  • Transactions are stored in the already-existing m_transactions collection.
  • A scheduled periodic check is added to check for transactions that have became due. The implementation is very similar to the existing retry logic (ReattemptPrivateBroadcast).
  • Queue is not persisted currently.

@optout21 optout21 changed the title 2610 delayed broadcast1 Delayed transaction broadcast prototype Oct 1, 2026
@optout21
optout21 force-pushed the 2610-delayed-broadcast1 branch from d66ab8d to e022b78 Compare October 2, 2026 07:56
Core support for delayed private broadcast:
- Add target release time to submitted transactions;
  `release_time` field added to `TxBroadcastInfo` and `TxSendStatus`
- Adapt logic to handle delayed submission (Add, Remove, etc.)
Only send delayed transactions after they are due.
Add constants and the RandomizeDelay() helper to randomize the release
time of a delayed private broadcast, and use it in PeerManager. The
randomized delay is never shorter than requested, and the requested
delay is capped at MAX_DELAY.
If set, and private broadcast is enabled (prerequisite), the submitted
transaction will be delayed.
@optout21
optout21 force-pushed the 2610-delayed-broadcast1 branch from e022b78 to ec12202 Compare October 3, 2026 14:12
@optout21

optout21 commented Oct 5, 2026

Copy link
Copy Markdown
Owner Author

--> bitcoin#36429

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant