Skip to content

Subsidize RBF#11

Open
olga24912 wants to merge 16 commits into
omni-mainfrom
sub_rbf
Open

Subsidize RBF#11
olga24912 wants to merge 16 commits into
omni-mainfrom
sub_rbf

Conversation

@olga24912
Copy link
Copy Markdown

@olga24912 olga24912 commented Oct 2, 2025

Summary

Adds a Subsidize RBF flow so the protocol (or any account) can push
through a stuck BTC withdrawal by topping up its gas fee with extra nBTC.
The user still receives the same BTC amount — only the miner fee grows.

Motivated by UX: when an operator sees that a user's withdrawal is not
confirming, they can subsidize an RBF replacement instead of waiting.

How it works

The subsidizer calls ft_transfer_call with the new message
TokenReceiverMessage::Rbf { pending_tx_id, output }. The bridge
constructs an RBF replacement of the stuck tx, routing the subsidy
entirely into gas fee. Invariants enforced:

  • actual_received_amount unchanged.
  • gas_fee grows by exactly the subsidy amount.

Emits a new SubsidizeRbf event.

Zcash version is unimplemented! for now.

Migration notes

OriginalState gains a new field subsidize_amount: u128. Existing
pending infos are migrated on upgrade via
migrate_btc_pending_infos_to_current in legacy.rs, defaulting
subsidize_amount = 0 for pre-existing entries. No off-chain action
required; integrators only need to be aware of the new Rbf message
variant and the SubsidizeRbf event.

@olga24912 olga24912 linked an issue Oct 2, 2025 that may be closed by this pull request
@olga24912 olga24912 changed the title Subsidize RBF PoC Subsidize RBF Oct 6, 2025
@olga24912 olga24912 requested a review from karim-en October 6, 2025 12:22
@olga24912 olga24912 marked this pull request as ready for review October 20, 2025 12:14
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.

Subsidize BTC gas if needed

1 participant