Skip to content

kotlin-sdk: shieldedFundFromAssetLock coin selection only reaches one account (CoinJoin/other-account funds unspendable) #4073

Description

@bfoss765

Live on Android wallet (Galaxy S22, testnet): a wallet with total balance 1.534 DASH (SDK get_balance == dashj, exact parity confirmed by a continuous parity harness) failed to shield with:

Coin selection error: Insufficient funds: available 8999527, required 20000000

Available for the asset lock = 0.09 DASH; the ~1.44 DASH gap is the wallet's previously-mixed CoinJoin-derivation-path funds. shieldedFundFromAssetLock's asset-lock builder selects only from the standard BIP44 account, so funds counted in the wallet balance but held on the CoinJoin (or any non-default) account cannot be shielded.

Requests:

  1. Asset-lock coin selection should span all spendable accounts (including the DIP-9 CoinJoin account) — or document the account-0-only scope explicitly.
  2. Expose a per-account "spendable-for-asset-lock" balance so integrators can validate the requested amount and show the correct available figure (the total balance overstates what's shieldable).
  3. Surface a typed InsufficientFunds error carrying available/required, instead of a WalletOperation with the reason in the message string — integrators currently message-match to classify it as safely-pre-broadcast and to show the amount (relates to the ErrorUnknown(99) classification issue).

cc @QuantumExplorer

Context: dashpay/dash-wallet#1507 Phase 4 shielded funding. 🤖 Filed with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions