Tutorial · Vaults · Testnet

Take Your Coins Back: reclaimvaultfunds

The owner pulls coins out of a vault with IronDivi, divi-cli, the Divi Desktop debug console and BoxWallet, including receiver_pays, sweep_funds and metadata, and the IronDivi owner-wallet limitation.

About 15 minutes · Checked 2026-10-21

1What reclaimvaultfunds does

The owner key can spend vault coins at any time; reclaimvaultfunds is the command for it. You give a destination address and an amount. The wallet picks vault outputs it owns, sends the amount to the destination, and sends the remainder of those outputs to a plain change address in your wallet, not back into the vault. So reclaiming 5 from a single 30-coin vault output empties that vault: 5 goes where you asked, 25 lands in your ordinary balance, and the manager stops staking all 30.

Reclaim versus debit

If you want the rest to stay in the vault, use debitvaultbyname on Divi Core: it spends from one named vault and returns the change to that same vault. reclaimvaultfunds is for getting out.

The manager does not take part and does not need to be online. The manager's wallet simply sees the output disappear.

2IronDivi: reclaimvaultfunds

IronDivi 0.2.6: an owner-only wallet cannot reclaim

An IronDivi wallet that holds the owner key but not the manager key shows the vault with balance 0 once the funding transaction confirms, and reclaimvaultfunds answers No vault funds available to reclaim no matter the amount or option. Rescanning does not help. The coins are safe; the wallet just does not recognise them as its own. Two ways out:

  1. Load the same owner key (same recovery phrase) into a Divi Core wallet and reclaim there with step 3.
  2. For practice, use a self-managed vault (owner:owner): IronDivi holds both keys and reclaim works.

With a self-managed vault, the command and output look like this:

irondivi-cli --testnet getcoinavailability
{ "Spendable": 759.99982, "Stakable": 759.99982, "Vaulted": 30.0, "total_vaults": 2, "vaults": [ …, { "balance": 30.0, "manager": "yC9j…RVF4", "owner": "yC9j…RVF4" } ] }

irondivi-cli --testnet reclaimvaultfunds y1pWoPjW2qo64wN2Lc61mGSQpRsbJUpa4H 5
{
  "amount": 5.0,
  "fee": 0.00003,
  "txid": "b7604ad290c9b668cf5ba7a6fd38897d7c957c669fafff4f0d745ae83bd3068a"
}

irondivi-cli --testnet getcoinavailability
{ "Spendable": 784.99979, "Stakable": 784.99979, "Vaulted": 0.0, … }

Spendable went up by 24.99997 (the 30 minus 5 minus the 0.00003 fee) and Vaulted dropped to 0, which is the behaviour described in step 1. The decoded transaction has two outputs: 5.0 to the destination and 24.99997 to a plain pubkeyhash change address.

IronDivi accepts a third argument but ignores it: receiver_pays produced the same transaction as no option (the receiver got the full 5.0 and the fee came out of the change). Divi Core's sweep_funds and metadata options have no effect on IronDivi either.

# argument errors
irondivi-cli --testnet reclaimvaultfunds
error code: -1: Missing required parameter: diviaddress
irondivi-cli --testnet reclaimvaultfunds bad 1
error code: -1: Invalid destination address: address not found: Invalid address length: 3
irondivi-cli --testnet reclaimvaultfunds y1pWoPjW2qo64wN2Lc61mGSQpRsbJUpa4H
error code: -1: Missing required parameter: amount

3divi-cli: reclaimvaultfunds and its options

The owner wallet on Divi Core sees its vaults under Vaulted (use true to list them):

divi-cli -testnet getcoinavailability true
{ "Vaulted" : { "AllVaults" : [ { "vault" : "y8PL…5Aj:yF5g…dssc", "value" : 5.00000000, "txids" : [ "a7d724bf…553d" ] } ], … } }

divi-cli -testnet reclaimvaultfunds y1pWoPjW2qo64wN2Lc61mGSQpRsbJUpa4H 5
6b9620e33488088e10265a6e7d0bbecf60c8b667dcf78a518b5227d8282fc73d

Divi Core prints only the txid. The amount is drawn from any of your vaults, so if you hold several, use debitvaultbyname to pick one.

Options

A third argument changes who pays the fee or how the inputs are chosen. It is the same set that sendtoaddress takes.

FormEffectTestnet txid
reclaimvaultfunds DEST 5Receiver gets 5; fee comes out of the change6b9620e3…c73d
reclaimvaultfunds DEST 5 receiver_paysReceiver gets 5 minus the feee624d54c…a0af
reclaimvaultfunds DEST 1 sweep_fundsAmount is ignored; every selected vault input is sent to DEST minus the fee, no change output08f6832f…7530
reclaimvaultfunds DEST 5 metadata "comment" "to"Normal send with a wallet-side comment (not stored on the chain)b44c1b82…c55f

The sweep transaction above had one input and a single 0.9999766 output to the destination, which confirms the "no change" behaviour. The source for this is SweepFundsCoinSelectionAlgorithm in wallet.cpp.

Errors

bad destination        → -5 Invalid DIVI address
unknown option         → -8 Unknown option for reclaiming vault funds
more than you have     → -6 Insufficient funds: 10000000000000(total requested) is greater than 500000000(total available)
no amount              → -1 (help text)
vault output unconfirmed, or already being spent by an earlier command in the same block
                       → -4 Insufficient funds to meet coin selection algorithm requirements.

That last one caught us: running reclaimvaultfunds … receiver_pays straight after a successful reclaim, before the next block, fails because the only remaining vault output was already spent in the mempool. Wait a block and repeat.

4Divi Desktop debug console

Switch to testnet (Settings → Advanced mode → Network → Testnet → Save), open the Debug Console, unlock, and type the Divi Core command without the prefix:

reclaimvaultfunds y1pWoPjW2qo64wN2Lc61mGSQpRsbJUpa4H 5

The reclaimed coins appear in Divi Desktop's normal balance after one confirmation.

5BoxWallet

~/.boxwallet/divi-cli -testnet reclaimvaultfunds y1pWoPjW2qo64wN2Lc61mGSQpRsbJUpa4H 5

6What the manager sees afterwards

Nothing is sent to the manager. After the reclaim confirms, the manager's getcoinavailability simply shows less:

divi-cli -testnet getcoinavailability   # Divi Core manager, before and after a 20-coin reclaim
"Stakable" : 189.99990080   →   "Stakable" : 169.99990080

The manager can then run removevault to tidy up, but it is optional.

Trouble

You seeMeansDo
No vault funds available to reclaim (IronDivi)This wallet holds no vault it recognises, usually the owner-only case aboveReclaim from Divi Core with the same owner key
Insufficient funds to meet coin selection algorithm requirements. (-4)Vault outputs not yet confirmed, or spent by a previous command this blockWait one block
Insufficient funds when the amount is the whole vault balance (Divi Core)The fee is paid from the same vault coins, so the full balance plus the fee is more than the vault holdsAdd sweep_funds or receiver_pays, or ask for the balance minus a small fee
Insufficient funds: … greater than 0(total available)This wallet owns no vault coins (for example it is the manager)Only the owner can reclaim
The vault emptied when I only asked for partExpected: change goes to a plain addressUse debitvaultbyname, or fund the vault again

Still stuck? Ask the Divi chatbot.