-
Notifications
You must be signed in to change notification settings - Fork 145
Field report: CardCoins rbf and batching #582
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
bitschmidty
wants to merge
9
commits into
bitcoinops:master
from
bitschmidty:2021-06-field-report-rbf-batching
Closed
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
4e12d0b
Blog: add CardCoins RBF batching post
bitschmidty 5f17eda
cardcoins blog suggestions
bitschmidty dec42f2
CardCoins blog: minor updates
jnewbery 3a4b19f
CardCoins blog harding fixups
bitschmidty 16728bf
CardCoins blog CardCoins fixups
bitschmidty 1d2af46
CardCoins blog date change
bitschmidty 17fa4c5
CardCoins blog urlchange
bitschmidty 2b75c8b
CardCoins blog summary addition
bitschmidty 8966f6d
CardCoins blog: minor changes
jnewbery File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| {:.post-meta} | ||
| *by [CardCoins][]* | ||
|
|
||
| _"Additive batching" is a scheme in which additional outputs are | ||
| added to unconfirmed transactions in the mempool. This field report outlines | ||
| efforts [CardCoins][] has taken in introducing a reorg- and DoS-safe implementation | ||
| of such a scheme in its customer payout workflow._ | ||
|
|
||
| [Replace By Fee][topic rbf] (RBF, BIP125) and [batching][payment batching] are | ||
| two important tools for any enterprises directly interacting with Bitcoin's | ||
| mempool. Fees go up, fees go down, but the business must always fight for fee efficiency. | ||
|
|
||
| Each tool, while powerful, has its own complexities and nuances. For example, | ||
| batching customer withdrawals may save on fees for the enterprise, but will likely make | ||
| [child pays for parent][topic cpfp] (CPFP) uneconomical for a customer who wishes to speed up the transaction. | ||
| Similarly, RBF is useful for an enterprise who takes a fee-underbidding strategy | ||
| (their initial transaction broadcast starts at a low fee, and is slowly bid | ||
| upwards), but it exposes their customers to [potential confusion][rbf blog] as their | ||
| withdrawal transaction updates in their wallet. It would also be messy for the | ||
| customer to spend from this transaction while it remains unconfirmed, as the | ||
| enterprise will have to pay for this child spend when attempting to replace | ||
| the parent. Even worse, the enterprise may have a withdrawal [pinned][pinning] by another | ||
| service which received the customer's withdrawal. | ||
|
|
||
| When combining these two tools, a service provider unlocks new functionality but | ||
| is similarly exposed to novel forms of complexity. In the base case, combining | ||
| RBF and a single, static batch carries a simple combination of the complexities | ||
| that RBF and batching carry discretely. However, when you combine RBF and | ||
| "additive batching," emergent edge cases and dangerous failure scenarios present | ||
| themselves. | ||
|
|
||
| In additive RBF batching, the service provider introduces new outputs (and | ||
| confirmed inputs) to a transaction in the mempool to incorporate new customer | ||
| withdrawals into an unconfirmed transaction. This enables the service provider | ||
| to give | ||
| users the experience of an instantaneous withdrawal while still retaining much | ||
| of the fee savings from doing large batches of customer withdrawals at once. As | ||
| each customer requests a withdrawal, an output is added to the transaction in | ||
| the mempool. This transaction continues to be updated until it confirms or | ||
| reaches some other local optimum. | ||
|
|
||
| There are many strategies to this type of additive RBF batching. At [CardCoins][] we | ||
| took a safety-first approach to our implementation (with the help of [Matthew | ||
| Zipkin][]), the details of which we described in a blog post, [RBF | ||
| Batching at CardCoins: Diving into the Mempool's Dark Reorg Forest][cardcoins | ||
| rbf blog]. | ||
|
|
||
| {% include references.md %} | ||
| [CardCoins]: https://www.cardcoins.co/ | ||
| [payment batching]: /en/payment-batching/ | ||
| [rbf blog]: /en/rbf-in-the-wild/#some-usability-examples | ||
| [pinning]: /en/topics/transaction-pinning/ | ||
| [Matthew Zipkin]: https://twitter.com/MatthewZipkin | ||
| [cardcoins rbf blog]: https://blog.cardcoins.co/rbf-batching-at-cardcoins-diving-into-the-mempool-s-dark-reorg-forest | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| --- | ||
| title: 'Field Report: Using RBF and Additive Batching' | ||
| permalink: /en/cardcoins-rbf-batching/ | ||
| name: 2021-06-16-cardcoins-rbf-batching | ||
| slug: 2021-06-16-cardcoins-rbf-batching | ||
| type: posts | ||
| layout: post | ||
| lang: en | ||
| version: 1 | ||
| excerpt: > | ||
| "Additive batching" is a scheme whereby additional outputs are | ||
| included to unconfirmed transactions in the mempool. This field report outlines | ||
| efforts CardCoins has taken in introducing a reorg and DoS safe implementation | ||
| of such a scheme in its customer payout workflow. | ||
|
|
||
| --- | ||
| {% include articles/cardcoins-rbf-batching.md %} |
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.
Uh oh!
There was an error while loading. Please reload this page.