-
Notifications
You must be signed in to change notification settings - Fork 90
Description
It is likely that this has happened a few rare times in Veil's history, where a basecoin utxo has been unable to be spent normally.
I am writing this up in order to document the process, and potentially to help a dev in future to identify the exact cause.
This write-up is specific to this instance of the bug. In the other cases it might not be known the exact circumstances that caused it.
The problem: A basecoin UTXO has failed to be able to be spent, in this case, to a stealth address.
Background:
This UTXO was received from a RingCT input from the Veil Discord faucet when I tested claiming from the faucet to a basecoin address, after having been asked to test the faucet. People normally receive their faucet payouts to their Veil stealth address, so this may never have been done before, but also, it may have been. Either way, no such error has been reported by other people, in that many transactions from RingCT to basecoin have definitely been done without incident, as until NonKYC exchange all exchanges generated basecoin addresses for deposits rather than stealth addresses.
Symptoms and signs:
The GUI Overview screen claimed that it (a UTXO of 10 Veil) was received on bv1qjx2g5rnhx8wa92sy3fem2a030wt64x0ttrxu3n, an address that was neither in my address book, nor owned by my wallet at all. The address found in the Overview page of the GUI Qt Veil Core wallet when checking getaddressinfo bv1qjx2g5rnhx8wa92sy3fem2a030wt64x0ttrxu3n validates, but shows as not mine.
The block explorer, and gettransaction both show that it was received on the intended basecoin address, which has been used before and after this amount for some years. Yes, address reuse is frowned upon in crypto, but this address is actually a monthly salary-receiving address, so it doesn't change, and spends from the address do go to fresh addresses each time, as is the nature of spending to a Stealth address.
listunspent and Coin Control did not show this UTXO (evidently because the GUI wallet thought it was received on an address that is not owned by my wallet. However, the 10 Veil in basecoin did show in getbalances, in the Total Balance (in the GUI) as well as in the basecoin entry in the Zerocoin Minting page of the GUI.
It was not possible to test if a zerocoin could be minted from this UTXO, because being exactly 10 Veil, there was not enough for the minting fee on top of the minimum zerocoin denomination of 10 Veil.
The TXID of the received UTXO was 924efad1aa3a5...2e0fc38be6acf9c6 which when checking on the block explorer and with gettransaction 924efad1aa3a5...2e0fc38be6acf9c6 confirm that it was received on the intended basecoin address bv1...fkylvw6ws4slkyy0mv....
The process of unsticking the stuck basecoin (involving scantxoutset):
(first used as early as 2021 or earlier by one of our OG developers)
TXID = 924efad1aa3a5...2e0fc38be6acf9c6
gettransaction 924efad1aa3a5...2e0fc38be6acf9c6
shows
"details": [
{
"address": "bv1...fkylvw6ws4slkyy0mv...",
"category": "receive",
"amount": 10.00000000,
"label": "",
"vout": 2
}
and "vout": [
... {
"type": "basecoin",
"sent_to": "bv1...fkylvw6ws4slkyy0mv...",
"amount": "10.00",
"is_mine": true,
"has_tx_rec": false
}
Step 1.
getnewbasecoinaddress "fixStuckUTXO"
bv1qagx…v63hnu6l5g
Step 2.
scantxoutset start '[ "addr(stuck-bv-address-here)", {"desc": "addr(stuck -bv-address-here)","range": 100000}]'
-->
scantxoutset start '[ "addr(bv1...fkylvw6ws4slkyy0mv...)", {"desc": "addr(bv1...fkylvw6ws4slkyy0mv...)","range": 100000}]'
{
"success": true,
"searched_items": 4023687,
"unspents": [
{
"txid": "924efad1aa3a5...2e0fc38be6acf9c6",
"vout": 2,
"scriptPubKey": "0014441115...87ec423f6c",
"amount": 10.00000000,
"height": 345xxxx
}
],
"total_amount": 10.00000000
}
Step 3.
createrawtransaction ''' [{"txid": "txid-here","vout": 'vout-id' } ] ''' ''' {"new-bv-address-here": amount }''' for the amount, take amount from scantxoutset "amount": 199.99990757, and subtract 0.01 ie. amount = 199.98990757
-->
createrawtransaction ''' [{"txid": "924efad1aa3a5...2e0fc38be6acf9c6","vout": '2' } ] ''' ''' {"bv1qagx…v63hnu6l5g": 9.99 }'''
0200000000000001c6f9ace68bc30f2e27a1...e920200000000ffffffff0101c0878b3b00000000160014ea0d5a461efd99fcb68f236a733e3177fc666a37
Step 4. Take the output of step 3 signrawtransactionwithwallet output-step-3
signrawtransactionwithwallet 0200000000000001c6f9ace68bc30f2e27a1...e920200000000ffffffff0101c0878b3b00000000160014ea0d5a461efd99fcb68f236a733e3177fc666a37
{
"hex": "0200010000000001c6f9ace68bc30f2e27a1daddfdd03b5364f9e964f61616e2415a3aaad1fa4e920200000000ffffffff0101c0878b3b00000000160014ea0d5a461efd99fcb68f236a733e317...0daed61fbb4c2b9b96b7fe7e5dff46d6f6defa00aea84dc5d33b155db8022036d1f16bbe200221f5feabec2777a5fe3cbdfa16a76b3a3128d6ab4372e995810121027e8c8001aecc7a64e0de7c42d596ce6325227a72e8d21ed29b47ac856e6ed617",
"complete": true
}
Step 5. sendrawtransaction output-step-4
sendrawtransaction 0200010000000001c6f9ace68bc30f2e27a1daddfdd03b5364f9e964f61616e2415a3aaad1fa4e920200000000ffffffff0101c0878b3b00000000160014ea0d5a461efd99fcb68f236a733e317...0daed61fbb4c2b9b96b7fe7e5dff46d6f6defa00aea84dc5d33b155db8022036d1f16bbe200221f5feabec2777a5fe3cbdfa16a76b3a3128d6ab4372e995810121027e8c8001aecc7a64e0de7c42d596ce6325227a72e8d21ed29b47ac856e6ed617
177ebf4e6fc70c0f94…7e8a0163a25b23405
Now the 10 Veil in basecoin has been replaced by 9.99 Veil in basecoin (in the new address, of course.)
Step 6. Wait for some confirmations and send it to stealth.
sendbasecointostealth sv1qqp8w…jphdul7haaluej676pqzqqqh8994n 9.99 "" "" true
b306480...f7e9ac8a4c2e5204
Step 7. Send it to RingCT. (Maybe wait until nothing else is in Stealth (CT) so that using Coin Control is not necessary. Otherwise, use Coin Control to send this UTXO along with other UTXOs from CT to RingCT.