Skip to content

[feature]/sweeeper: add P2A + Ephemeral Dust awareness to BumpFee command #9778

@Roasbeef

Description

@Roasbeef

Is your feature request related to a problem? Please describe.

With the latest version of bitcoind, developers have gained some new tools that can be used to have more flexibility w.r.t fee paymetn for transactions, while also mitigating some of the common transaction pinning/recycling vectors:

  • P2A:
    • A new standard script template type of: OP_1 <0x4e73>. Can be spent with an empty witness. Meant as a "standard" anchor template. It's small as there's no witness needed to spend it.
  • Ephemeral dust:
    • You can have a very dust output (can even be zero value) if the transaction creating the output is actually zero fee. This also MUST be spent by a child to be included within a block. Also only a single child is allowed.
  • TRUC:
    • Modified version of BIP 125 (RBF), adds additional restrictinos to protect against unwarranted adversarial transaction replacement.

Many higher-level protocols, including LN want to use some or all of the features above to simplify fee payment. The most common case is having a transaction with zero fee, then using P2A (and others) pay for the fee purely via CPFP.

Today we don't have an easy way of allowing developers to access the above. lnd's sweeping capabilities are rather sophisticated, so it'd be great if we also allowed developers to submit zero fee transactions to be swept.

Adding this capability would also be a stepping stone to enable the new V3 zero fee commitment transaction format as well. In that case, every force close would actually do BumpFee under the scenes.

Describe the solution you'd like

We should extend BumpFee to support this hybrid broadcast and fee bumping concept:

  • A new argument that passes in the serialized parent transaction should be added.
  • During bumping, if we have this transaction and it has a P2A output (or zero value or below dust), then we assume that the parent transaction is zero fee (we can add an arg for that too if needed):
    • In this case, we'd add it as an input, but with the extra dependancy that each time we broadcast a sweep, we should also broadcast the parent before that.
      • If the backend supports it (may need to require it), then we can use the new submitpackage calls.
      • testmempoolaccept has some cursory support for this type of package, but AFAIK, it isn't a first class feature.
    • We'd then add a new witness type for this output variant, which just uses an empty witness if it's P2A.
    • As an added restriction, we may want to make this an exclusive group (txn too), just so we don't inadvertently violate any of the new policy rules (which don't have great documentation as is, outside of the bitcoind code and integration tests).

We may also need a very basic internal package representation as well, though for now there can only be one parent and one child.

Metadata

Metadata

Assignees

No one assigned

    Labels

    chain handlingenhancementImprovements to existing features / behaviourfeesRelated to the fees paid for transactions (both LN and funding/commitment transactions)utxo sweeping

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions