Skip to content

[bitcoin-wallet-snap] bug: wallet balance drops to zero during pending transactions (unconfirmed change UTXOs not displayed) #28

Description

@cloudonshore

Description

When a user spends part of their BTC balance (e.g. via a bridge or swap), the wallet UI shows their entire BTC balance dropping to 0 until the transaction confirms. The unspent portion of the funds only reappears once the transaction is mined (~10 minutes).

This is a known UX issue with the UTXO model. When a UTXO is consumed as a transaction input, the "change output" sent back to the user is unconfirmed until the transaction is mined. If the wallet only counts confirmed UTXOs in the displayed balance, the balance appears to be zero even though the change funds are safe in the mempool.

Steps to reproduce

  1. Have a single UTXO in your Bitcoin wallet (e.g. 0.00282 BTC)
  2. Bridge or swap a portion of your balance (e.g. 0.001 BTC)
  3. Observe that the wallet balance drops to 0 BTC instead of showing ~0.00182 BTC
  4. Wait for the transaction to confirm (~10 min) and the change balance reappears

Expected behavior

The wallet should display the unconfirmed change output as part of the user's balance, ideally with a "pending" indicator. The balance should not drop to zero.

How other wallets handle this

Most Bitcoin wallets treat unconfirmed change from the user's own transactions as "trusted" and include it in the displayed balance:

  • Bitcoin Core - includes unconfirmed change from own transactions in available balance by default
  • BlueWallet - shows balance including unconfirmed change immediately with a pending indicator
  • Electrum - shows separate "Confirmed" and "Unconfirmed" balances
  • Sparrow - shows total balance including unconfirmed change, with per-UTXO confirmation status
  • Trust Wallet / Coinbase Wallet - optimistic display, balance reflects expected outcome with "Pending" label

The industry standard approach is optimistic balance display - showing unconfirmed change as available since the user created the transaction themselves.

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Fields

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions