Skip to content

Add CPFP/RBF detection for single-address wallets #246

@schjonhaug

Description

@schjonhaug

Problem

Single-address wallets (address watch) currently don't support CPFP or RBF detection. Descriptor wallets have full CPFP chain detection and RBF conflict tracking, but address-based wallets only track transaction confirmation status.

Root cause

Single-address wallets use Electrum's script_get_history which only returns (txid, height) pairs — not the full transaction data (inputs/outputs) needed to:

  • RBF detection: Identify conflicting transactions that share inputs
  • CPFP detection: Identify parent-child spending relationships between unconfirmed transactions

Proposed solution

For unconfirmed transactions in address watch wallets, fetch full transaction data via Electrum's transaction_get to enable:

  1. CPFP detection — check if any unconfirmed tx spends outputs from another unconfirmed tx
  2. RBF detection — check if any transactions share inputs (double-spend conflicts)

Considerations

  • Each transaction_get call is an additional Electrum round-trip, so this should only be done for unconfirmed transactions to limit overhead
  • Could batch-fetch all unconfirmed tx details in one pass, then run the same detection logic used for descriptor wallets
  • The existing detect_cpfp_relationships and RBF detection code could potentially be refactored to work with a generic transaction representation rather than BDK-specific types

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions