Unconfirmed transaction, or Return cryptocurrency from nonexistence

    By the will of fate, I had the opportunity to deal with cryptocurrencies. Not that I would work closely with them, but sometimes I will either send coins or receive them. Let's just say a little bit of probing a new sphere from the inside.

    And then one day the trouble happened. I sent crypto coins, but they did not reach the recipient. Actually, a post on how funds were returned. Well, thoughts and advice on the situation for dessert. I note right away that the following does not apply to any particular currency, but to most forks (if not all).

    To begin with, the post is sometimes riddled with conjectures about what is happening. Somewhere I could be wrong. Objective corrections and additions are only welcome.

    A little bit about terminology.
    • I will call wallet the wallet.dat file.
    • At times, it is also more convenient to call a public key (the address to which funds are transferred, for example) a wallet, but to avoid confusion, let it be just an account number.
    • Commission - Transaction Fee. Calling this thing a commission, I think, is not entirely correct, but this is the most familiar and non-cutting option, so let it be a commission.
    • Transaction size - the size of the data block that contains all the information about the transaction.

    I initially approached all this cryptocurrency kitchen as a typical user - not really delving into the system. Installed, launched, works - and okay. Sometimes, when trying to send funds somewhere, the client gave a message like “ The transaction size is too large, you can’t just take and send it. But you can add a commission of N, and then everything will be fine ”- I agreed with the addition of the commission, and everything was really good.

    It would seem that if I am asked to pay extra when it is needed, then I will pay when they ask (if the commission is satisfied). This was the main mistake.

    I am making another transfer in the amount significantly larger than usual. Funds are being withdrawn from the account, there was no offer to pay a commission and ... Nothing. Funds do not reach the recipient, transaction status is “0 / Not Confirmed”. And I watched this picture for more than a week, simultaneously googling and re-reading the Internet in search of information to solve a similar problem. And I was looking for a specific cryptocurrency, and in general for everyone - there are a lot of problems, there is no solution.

    And, actually, what kind of commission is this? The idea is that transactions can take place without a commission, but only if certain conditions are met:
    • The transaction size should be no more than a certain amount.
    • The transferred amount must be greater than a certain threshold.
    • A transaction must have sufficient priority.

    If the first two points are more or less clear (I didn’t give specific values, I think they can vary from fork to fork), then in the third the whole snag. Roughly speaking, transactions at creation are queued, sorted by priority. When generating the next block, it includes transactions with a commission (which goes as a reward to the one who found the block), as well as transactions without a commission with the highest priority.

    The priority itself directly depends on the amount of funds transferred and on the number of confirmations (the longer this money has been in your account, the more priority should be, in fact) and inversely depends on the size of the transaction. Thus, in the event of an unsuccessful combination of circumstances, a transaction without commission may end up in a frozen, unconfirmed state, which I encountered.

    The search for a solution showed that this is a relatively common problem for cryptocurrencies. Unfortunately, all the advice came down to the following and often did not help:
    • Wait a day or two, your transaction will be included in the next block.
    • Wait a day or two, the client program will get tired of waiting, and she herself will cancel the transaction.
    • Reload the entire block chain.
    • Start the client with some magic key (-rescan / -reindex / -salvagewallet).

    I waited more than a week. The transaction was not included in any block. Even after resending via sendrawtransaction. Blockchain said that it knew nothing about that transaction, and the very funds were on the account, they hadn’t gone anywhere. And only the client stood his ground: “I sent the transaction, then as you want. I won’t let you manage the money already spent. ”

    So what is the essence of the problem? The transaction did not fall into the block and will no longer fall. The wallet stores information that the transaction was in general, so the funds that should have been sent with it are not available for use. Perhaps after some time the transaction will be canceled, I have several assumptions about this:
    • Depends on the currency, somewhere quickly canceled, somewhere you need to wait a long time.
    • Bug of a specific client.
    • Cancellation information is incorrect.

    In any case, a week is a fairly long time. If this time has not passed by itself, then there is reason to believe that it will not pass.

    As a normal person, after everything had already broken, I finally went to read the manuals. An attempt to repeat the transaction with the inclusion of the commission failed. But endless jumping on links between forums (there was nothing worth finding in Google’s issuance) brought me to a certain post, where a practical clue was found. Unfortunately, now I can’t find this post, I don’t even know what the forum was. I believe a certain bitcoin coin.

    I will describe the solution using the example of the client most common for forks known as Satoshi Client. As far as I understand, it applies to other customers, but, perhaps, with its own nuances.

    Despite the simplicity and obviousness of the solution, few people come to it, judging by the multi-page forum threads. Funds on the account are blocked by the wallet, and all that is required is to access the account outside the current wallet.

    So, if the transaction is frozen and has no confirmations:
    1. Be patient. Do not immediately panic. Wait a couple of days, suddenly the truth will pass by itself.
    2. Make sure the transaction is frozen. Go to Block Explorer (usually google on request “blockchain% cryptocurrency name%”) and check that they don’t know anything about the suspended transaction, but there really is money on the account.
    3. Go to the debug console (Help - Debug window - Console)
    4. If the wallet is encrypted (is it encrypted?), Then first you need to access using the walletpassphrase command.
    5. Now you need to get the private key from the desired account. dumpprivkey
      . Instead
      you need to substitute the public account number on which the blocked funds lie. In response, get the private key of this account. It needs to be copied somewhere, it will still be needed. If the funds for the transaction were taken from several accounts, then you need to import all of them. And yes, never store private keys in an accessible place for anyone. Knowing the key gives full access to the corresponding account.
      Also note that every command in the debug console receives a response. It may be empty, but it is always there. Later it will be clear what I mean.
    6. Close the client and delete the wallet. The location of the wallet (wallet.dat) depends on the specific client and OS. Naturally, you should not completely delete it, it is better to rename or move it to a safe place.
    7. Launch the client again. A new wallet will be created. It is necessary to import the key (keys) received earlier. Go to the debug console and write importprivkey. Import can take a long time. Let it end - wait for a response to the command.
    8. In the new wallet, an account with its real state should appear. For reliability, you can restart the client with the -rescan switch, but, I believe, this is already superfluous. Previously blocked funds are again available for sending, send them again, this time do not forget to include a commission. ( there are important additions to this item in upd3 )
    9. If other used and important accounts remain on the old wallet, you can return to it again.

    In such a simple way, they managed to return the crypto coins. Although I already started to think that they are completely lost. In general, do not hope for a miracle, before using a new client, make sure that the commission is always on. The recommended size of the commission, I think, is better to look for on resources dedicated to the cryptocurrency used.

    Upd: The need for the described operation depends on the client used (and since many cryptocurrencies have one client, then the currencies used). It seems that in some cases, transaction information is not written to the wallet file, but only to the local block chain. In this situation, deleting an existing chain or starting a client with keys can help.

    Upd2:Significantly simplify the described process of transferring accounts to a new wallet can key -salwagewallet, already mentioned earlier. When the client starts with this key, a new wallet.dat is created, into which all accounts from the old one are imported, and the transaction history for it is taken from the block chain (thanks for the description grich ). Unfortunately, launching with this key is not implemented in all clients.

    Upd3: If after importing you don’t transfer the entire amount available on the account, part of the funds (change from the used outputs) will be transferred to another account of the new wallet. Keep this in mind if you plan to return to your old wallet:
    • Having imported the account into a new wallet, transfer all funds from it to your other account, return to the old wallet and then dispose of the returned funds.
    • After making a transaction from a new wallet, determine to which account the change fell and import this account into the old wallet.

    Also popular now: