Conversation
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.
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_callwith the new messageTokenReceiverMessage::Rbf { pending_tx_id, output }. The bridgeconstructs an RBF replacement of the stuck tx, routing the subsidy
entirely into gas fee. Invariants enforced:
actual_received_amountunchanged.gas_feegrows by exactly the subsidy amount.Emits a new
SubsidizeRbfevent.Zcash version is
unimplemented!for now.Migration notes
OriginalStategains a new fieldsubsidize_amount: u128. Existingpending infos are migrated on upgrade via
migrate_btc_pending_infos_to_currentinlegacy.rs, defaultingsubsidize_amount = 0for pre-existing entries. No off-chain actionrequired; integrators only need to be aware of the new
Rbfmessagevariant and the
SubsidizeRbfevent.