A case has arisen, maybe two or three times in Veil history, where amounts in a basecoin address have been unspendable using ordinary commands, as if there was an insufficient balance in the basecoin category.


I will discuss firstly what might be suspected as the cause, and then will give the solution.

  • A wallet originally encrypted at the time an address was created, is then restored by seed words, and either not reencrypted (password protected) or encrypted with a different passphrase. (This is not proven to be the cause, but is suspected. Wallets with changed passphrase should have no problem spending from old addresses.)
  • Data corruption in the wallet.dat, especially when using an external USB drive.


When the Veil user tries to spend basecoin, maybe basecoin to another basecoin address in the first case, with `sendtoaddress bvAddress Amount` it fails with an error number four, "insufficient funds". After this, no sending transactions works, whether to stealth (CT) using the svAddress, or by attempting to mint zerocoins.


Another way to test or identify this problem is to check Coin Control, which can be found via the GUI/Qt wallet's spending page. When opening Coin Control and you have some available balance showing in the basecoin category, you should see one or more unspent transaction output in the basecoin category that can be selected for spending.




The example doesn't show any basecoin amounts in my wallet, because I keep my balances in RingCT, and in zerocoins that were minted from RingCT unspent transaction outputs. However, for the user whose wallet says they have a basecoin spendable balance, but where none is found in Coin Control like this, then that indicates the type of intervention is needed, that I am writing about in this article.


The solution is in a small number of quick commands that ordinary users would never normally use.


Spending the unspendable coins (UTXOs)

0. Preparation. 

Create a new, fresh basecoin address to receive the previously unspendable basecoin unspend transaction outputs (UTXOs). (Give it any name you like.)

getnewbasecoinaddress "Grandma's Flower Shoppe 20220902"

example output: bv1qy688w8hfll96kADDRESSxglx792qj


Take note of the address where your "unspendable" funds are.

example: bv1q9sjze9w8zx69g2pADDRESS3pue20


1. Identify the specific unspent outputs. (These commands are on a single line.)

scantxoutset start '[ "addr(bv1q9sjze9w8zx69g2pADDRESS3pue20)", {"desc": "bv1q9sjze9w8zx69g2pADDRESS3pue20)"}]'

The output is like this:

{
  "success": true,
  "searched_items": 2387106,
  "unspents": [
    {
      "txid": "2a141644b1f59ba05SomeRandomTXID5131c4ec78ad0364419e539",
      "vout": 1,
      "scriptPubKey": "00142c242c95cAScriptPublicKey212d4d8ce39",
      "amount": 4234.00000000,
      "height": 1800000
    },
    {
      "txid": "859188194b214fb4AnotherRandomTXIDc68d7032c3a57f745",
      "vout": 1,
      "scriptPubKey": "00142c242c9AnotherScriptPublicKey2d4d8ce39",
      "amount": 6251.00000000,
      "height": 1800180
    }
  ],
  "total_amount": 10485.00000000
}

2. Create a raw transaction with an output amount 0.001 less than the input, to allow for a fee.

createrawtransaction ''' [{"txid": "2a141644b1f59ba05SomeRandomTXID5131c4ec78ad0364419e539","vout": '1' } ] ''' ''' {"bv1q9sjze9w8zx69g2pADDRESS3pue20": 4233.99900000 }'''

The output will be like this:

020000000000000139e5194436d08ac74cdc4e1c1385fc74d8e08695cf2f8750a09bf5b14416142a0100000000ffffffff010160c3999462000000160014268e771ee9ffcbab5d578a3e2345f53d97de191f

3. Sign the raw transaction with your wallet.

signrawtransactionwithwallet 020000000000000139e5194436d08ac74cdc4e1c1385fc74d8e08695cf2f8750a09bf5b14416142a0100000000ffffffff010160c3999462000000160014268e771ee9ffcbab5d578a3e2345f53d97de191f

The output will be like this:

{
  "hex": "020001000000000139e5194436d08ac74cdc4e1c1385fc74d8e08695cf2f8750a09bf5b14416142a0100000000ffffffff010160c3999462000000160014268e771ee9ffcbab5d578a3e2345f53d97de191f0247304402207354e50f1566e546a583c698e85151e5362ee62a54531b9bb43f2545cde3065802200baaa9533a4d8592ac439fc43c8bf46d0a5dc07ba822820944048c872c7d7c0601210256190340425d58cf4f4ff5afb86b1dbdd05564343ff5b87bc09bf6e3b35386ab",
  "complete": true
}


4. Take the "hex" output, the signed raw transaction from the signing command and send (broadcast) it. If you check `help sendrawtransaction` you can see that using dandelion is by default turned off when sending a raw transaction, so the following command will broadcast immediately.

sendrawtransaction 020001000000000139e5194436d08ac74cdc4e1c1385fc74d8e08695cf2f8750a09bf5b14416142a0100000000ffffffff010160c3999462000000160014268e771ee9ffcbab5d578a3e2345f53d97de191f0247304402207354e50f1566e546a583c698e85151e5362ee62a54531b9bb43f2545cde3065802200baaa9533a4d8592ac439fc43c8bf46d0a5dc07ba822820944048c872c7d7c0601210256190340425d58cf4f4ff5afb86b1dbdd05564343ff5b87bc09bf6e3b35386ab

The result is simply the transaction ID for this transaction:

56022934919057b476835afATXID2e3eca6dbf4c6bd17d55cfc9c01b

5. Repeat for any remaining unspent outputs that were identified by that basecoin address at step one.


You will see your transactions confirm just like all other transactions. These will be spendable in the normal basecoin ways; sendtoaddress, sendbasecointostealth, or mintzerocoin Amount true.