By the will of fate, I happened to deal with cryptocurrencies. Not that I work closely with them, but sometimes I send coins and get them. Let's just say, gradually probing a new sphere from the inside.
Then one day misfortune happened. I sent the kryptomonetki, and they did not reach the recipient. Actually, a post about how the funds returned. Well, reflections and tips on the current situation for dessert. Immediately, I note that the following does not apply to any particular currency, but to most forks (if not all).
To begin with, the post is riddled with guesses about what is happening. Somewhere I might be wrong. Objective corrections and additions are welcome.
')
A little about the terminology.
- I will call the wallet file wallet.dat.
- The public key (the address to which funds are transferred, for example) is sometimes more convenient to call the wallet, but, in order to avoid confusion, let it be just an account number.
- Commission - Transaction Fee. I think that it’s not quite correct to call this thing a commission, but this is the most familiar and non-hearing option, so let it be a commission.
- Transaction size - the size of the data block, which contains all the information about the transaction.
I initially approached this cryptocurrency kitchen as a typical user - without really delving into the system. Installed, launched, works - and all right. Sometimes when trying to send funds somewhere, a client would give a message like “
The transaction size is too large, you can’t just take it and send it. But you can add a commission in the amount 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 asked (if the commission will arrange). This was the main mistake.
I make another transfer for an amount much larger than usual. The funds go off the account, there were no offers to pay the commission and ... Nothing. The funds are not received by the beneficiary, the transaction status is “0 / Not confirmed”. And I observed such a picture for more than a week, passing along the way and re-reading the Internet in search of information on solving a similar problem. And I looked for a specific cryptocurrency, and in general for all - a lot of problems, there is no solution.
And, actually, what is this commission? The idea is that transactions can take place without commission, but only if certain conditions are met:
- The size of the transaction must not exceed a certain value.
- The transferred amount must be greater than a certain threshold.
- The transaction must have sufficient priority.
If the first two points are more or less clear (I didn’t give specific values, I suppose they can vary from fork to fork), then in the third one there is a snag. Roughly speaking, when creating a transaction enters the queue, sorted by priority. When generating the next block, it includes transactions with a commission (which is 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 their confirmations (the longer this money was in your account, the greater should be the priority, in fact) and vice versa depends on the size of the transaction. Thus, in the case of an unsuccessful set of circumstances, a transaction without a commission can be in a frozen unconfirmed state, which I encountered.
The search for a solution showed that this is a relatively frequent problem for cryptocurrencies. Unfortunately, all the tips were reduced 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.
- Download the entire block chain again.
- Run the client with some magic key (-rescan / -reindex / -salvagewallet).
I waited more than a week. No transaction was included in any block. Even after repeated shipments via sendrawtransaction. The blockchain said that he knew nothing about that transaction, and those funds were on the bill, they had not gone anywhere. And only the client stood his ground: “I sent the transaction, then as you wish. I will not allow to dispose of the money already spent. ”
So what is the essence of the problem? The transaction did not fall into the block and no longer falls. The purse stores information that the transaction was in general, therefore, the funds that should have been sent with it are not available for use. Perhaps, after some time, the transaction will be canceled, on this account I have several assumptions:
- Depends on the currency, somewhere quickly canceled, somewhere you need to wait a long time.
- Bug specific client.
- Cancellation information is incorrect.
In any case, a week is quite a long time. If during this time did not pass 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 manuals. Attempting to repeat the transaction with the inclusion of the commission has failed. But endless jumps on the links between the forums (there was nothing worthwhile in issuing Google) brought me to a certain post, where a practical hint was found. Unfortunately, now I can’t find this post, I don’t even know what the forum was. I guess some okolobitkunovy.
The solution will be described by the example of the client most common for forks, known as the Satoshi Client. As far as I understand, it is applicable to other clients, but, perhaps, with its own nuances.
Despite the simplicity and obviousness of the decision, very few people come to it, judging by the multipage branches of the forums. Funds in 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 confirmation:
- Be patient. Do not immediately raise a panic. Wait a couple of days, and suddenly the truth itself will pass.
- Make sure the transaction is frozen. Go to Block Explorer (usually googled by the query “blockchain% namecryptocurrency%”) and check that they know nothing about the frozen transaction, but there is actually money in the account.
- Go to the debug console (Help - Debug Window - Console)
- If the wallet is encrypted (is it encrypted?), Then you first need to get access using the walletpassphrase <passphrase> command.
- Now you need to get a private key from the desired account. dumpprivkey <address> . Instead of <address>, you need to substitute the public account number on which the blocked funds lie. In response, get the private key of the account. It needs to be copied somewhere, it is still needed. If funds for a transaction were taken from several accounts, then you need to import them all. And yes, never keep private keys in a place accessible to anyone. Knowing the key gives you full access to the corresponding account.
Also note that each command in the debugging console is answered. It may be empty, but it is always there. Later it will be clear what I mean. - Close the client and delete the wallet. The location of the wallet (wallet.dat) depends on the specific client and OS. Naturally, you shouldn’t delete it completely, it is better to rename or move it to a safe place.
- Start the client again. A new wallet will be created. It is necessary to import the previously obtained key (s) into it. Go to the debug console and write importprivkey <privkey> . Imports can be made long enough. Allow it to complete - wait for the response to the command.
- In the new wallet there should be an account with its real state. For reliability, you can restart the client with the -rescan key, but I guess this is already superfluous. Previously blocked funds are again available for sending, send them again, this time do not forget to include the commission. ( there are important additions to this item in upd3 )
- If other used and important accounts remain on the old wallet, you can return to it again.
In such a simple way, it was possible to return cryptomonettes. Although I already began to think that they are completely lost. In general, do not expect a miracle, before using a new client, make sure that the commission is always included. The recommended commission size, 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, it depends on the currencies used). It seems that in some cases the transaction information is not written to the wallet file, but only to the local block chain. In this situation, deleting an existing chain or launching a client with keys can help.
Upd2: To significantly simplify the described process of transferring accounts to a new wallet, use the -salwagewallet switch, already mentioned earlier. When you start a client 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 chain of blocks (thanks for the description thanks to
grich ). Unfortunately, the launch with this key is not implemented in all clients.
Upd3: If, after importing, you don’t transfer the entire amount on the account, then a part of the funds (change from the used outlets) 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 another account, return to the old wallet and then dispose of the returned funds.
- After completing the transaction from the new wallet, determine to which account the change fell, and import this account into the old wallet.