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 where IronDivi and Divi Core differ.

About 15 minutes · Checked 2026-10-23

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 somewhere. Here the two nodes differ. Divi Core sends the remainder to a plain change address in your wallet, not back into the vault: reclaiming 5 from a single 30-coin vault output empties that vault, 25 lands in your ordinary balance, and the manager stops staking all 30. IronDivi 0.2.6 sends the remainder back into the same vault, so the manager keeps staking the 25 (step 2).

Reclaim versus debit

If you want the rest to stay in the vault, use debitvaultbyname (Divi Core; on IronDivi 0.2.6 reclaimvaultfunds already does this): 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

The owner wallet does not need the manager key: once the funding transaction confirms, IronDivi 0.2.6 lists the vault with its balance and reclaims from it. Here an owner wallet holds two vaults, one of them a 30-coin self-managed vault (owner:owner):

irondivi-cli --testnet getcoinavailability
{ "Spendable": 748.99988, "Stakable": 748.99988, "Vaulted": 239.99994, "total_vaults": 2, … }
irondivi-cli --testnet reclaimvaultfunds y6U6RPYdb3j8CVMt61ScDqzxi3NjPCrg2d 5
{
  "amount": 5.0,
  "fee": 0.00003,
  "txid": "429ebf751080c4787841ad3125a20bf75c5e0874aec5bb1275b21dbc398cce44"
}
irondivi-cli --testnet getcoinavailability
{ "Spendable": 748.99988, "Stakable": 748.99988, "Vaulted": 234.99991, … }

Spendable did not move and Vaulted dropped by 5.00003 (the 5 and the fee). The transaction has two outputs: 5.0 to the destination and 24.99997 back into the vault, where the manager keeps staking it. These outputs are from IronDivi 0.2.6 on regtest, a private test chain.

The third argument works as on Divi Core: receiver_pays gave the receiver 4.99997 and charged the fee to them, and sweep_funds sent every vault output the wallet owns to the destination (234.9998452 after a 0.0000648 fee), ignoring the amount. metadata is accepted; its comments are not kept. An unknown option answers error code: -8: Unknown option for reclaiming vault funds.

# argument errors
irondivi-cli --testnet reclaimvaultfunds
error code: -1: Missing required parameter: diviaddress
irondivi-cli --testnet reclaimvaultfunds bad 1
error code: -5: Invalid DIVI address
irondivi-cli --testnet reclaimvaultfunds y6U6RPYdb3j8CVMt61ScDqzxi3NjPCrg2d
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 owns no confirmed vault output: the funding is not confirmed yet, or the vault is emptyWait a block, then check getcoinavailability
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.