Skip to content

key-wallet: asset locks are capped at the regular 500-input limit, not 100 — a drain over more than 100 UTXOs builds a transaction Core refuses as non-standard #1190

Done

Description

@romchornyi

Expected Behavior

An asset lock built by key-wallet is always relayable: at most 100 inputs and at most 20 480 bytes, the limits Dash Core (v23.1.7+ and v24) applies to asset locks (and Platform applies in consensus). A drain over a larger account locks what fits and leaves the rest for a later transfer; an exact-amount build that cannot be funded within the cap fails with a typed error before anything is signed or reserved.

Current Behavior

In drain mode the builder spends every final UTXO of the funding account. The only input-count check is the generic MAX_STANDARD_TX_INPUTS = 500. That limit is right for a regular transaction, but an asset lock may have at most 100 inputs. The same 500-input cap applies to exact-amount asset-lock builds.

With a CoinJoin account holding 104 UTXOs, every CoinJoin → Shielded attempt builds a 104-input asset lock (~15.4 KB):

asset lock built txid=<txid> type=Asset Lock Transaction inputs=104 outputs=["<amount>:6a00"] size=15397 drain=true sources=[CoinJoin]
Broadcast <txid> to 2/3 peers (1 withheld for acceptance detection)
Broadcast <txid> outcome uncertain: no acceptance signal within 60s

Peers drop it without a reject (Dash P2P sends none), so the wallet only ever sees Uncertain. Submitting the same transaction through DAPI returns Core's verdict:

Transaction is rejected: assetlocktx-too-many-inputs

Seven attempts over a month all ended this way. The inputs are valid and unspent, and every signature verifies.

Possible Solution

Root cause: Dash Core IsStandardSpecialTx (src/evo/specialtxman.cpp, dashpay/dash commit 9ad2afb91, backported to v23.1.7 and v23.1.8, which most mainnet nodes run, and on the v24 line) treats an asset lock as non-standard if it has more than MAX_STANDARD_ASSET_LOCK_INPUTS{100} inputs (assetlocktx-too-many-inputs) or is larger than 20 480 bytes (assetlocktx-too-big). Platform enforces the same 100-input cap in consensus (max_asset_lock_transaction_inputs, dashpay/platform#3491), so even a mined lock with more inputs could not be used on Platform.

The builder applies only the regular-transaction cap to asset locks:

Fix direction:

  1. A per-build input cap: 500 for regular transactions, 100 for any build that carries an asset-lock payload. The 100 is a public constant mirroring Core's policy, so platform-wallet can reference it. Exact-amount builds keep returning BuilderError::TooManyInputs { count, max }, now with max: 100.
  2. A bounded drain: when more than 100 final UTXOs are available, take the 100 largest and lock their sum minus the fee. The rest stays in the account. With ≤100 UTXOs the behaviour is unchanged.
  3. Exact-amount coin selection stays within the cap.
  4. A final check on the signed transaction (inputs ≤100, size ≤20 480). On violation, release the reservation through the owner-guarded path and return a typed error.

Steps to Reproduce

  1. A wallet whose CoinJoin account (or BIP44 account for an exact/drain Core → Shielded build) holds more than 100 final UTXOs.
  2. Build a drain asset lock from it (CoinJoin → Shielded in the iOS wallet).
  3. Broadcast and observe: no acceptance, no InstantSend lock. testmempoolaccept on any v24 node returns assetlocktx-too-many-inputs.

A unit test is enough: fund an account with 101 UTXOs and assert that the drain build has 101 inputs.

Context

Your Environment

  • Dash Wallet iOS 9.1.0 → 9.1.4 (TestFlight), mainnet.
  • rust-dashcore e4208c9078, d2367cff, edc4d430 (all reproduce). Code cited at dev d35a8d6.
  • Dash Core v23.1.7+ peers / DAPI.

Activity

  1. added
    bug
    on Oct 16, 2026
  2. changed the title [-]key-wallet: asset locks are capped at the regular 500-input limit, not 100 — a drain over more than 100 UTXOs builds a transaction Core v24 refuses as non-standard[/-] [+]key-wallet: asset locks are capped at the regular 500-input limit, not 100 — a drain over more than 100 UTXOs builds a transaction Core refuses as non-standard[/+] on Oct 16, 2026
  3. added a commit that references this issue on Nov 28, 2026
    5fe8723
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions