Unconfirmed transaction, or returning cryptocurrency from oblivion. What to do if you have an unconfirmed Bitcoin transaction Why the transaction is not confirmed

The bitcoin network is growing, the rate is growing, and more and more often bitcoin users are faced with a problem when a bitcoin transaction "freezes". Those. Bitcoins seem to have been sent, but they reach the addressee in a few days at best. And most often it happens that the transaction "walks" on the network and returns to the wallet. By the way, this is also one of the positive scenarios for the development of events.

As I have already noted, the growth in the number of transactions in the bitcoin network has led to the fact that a lot of transactions "hang" unconfirmed for several days. Moreover, even an increased commission will not guarantee that your transaction will be processed within the stated few hours. The number of unconfirmed transactions on the network can reach up to 200,000.

The main reasons for this situation are considered: an attack on the Bitcoin network and a low transaction fee, and then manners simply do not take it into processing.

Before sending a payment, I advise you to take a look at the network load. This can be done and. There you can also see the recommended price per byte.

But you wouldn't have gotten to this article if you hadn't asked the question that I made the headline. So what if the transaction gets stuck? There is a special service for "pushing stuck" transactions.

To do this, you need to get the HASH of your transaction (below I give an example of how to do this on the blockchain):

I deliberately did not rewrite, but copied the information from the forum. There, and so everything is described in a fairly accessible form. If you have any questions - ask them in the comments, we will figure it out.

DRAFT - DRAFT (The article is under revision)

Recently, the load on the ether network has grown. In addition, ICOs are often held, which can increase the load on the network by almost three times.

The increased load on the network can lead to a situation where your transaction is in the pending state for a very long time.

The fact is that miners first of all try to take the most expensive transactions for processing. Therefore, transactions with a higher gas price have a higher chance of being processed. When the load on the network increases, transactions with low gas costs can wait for their turn for several days or even weeks.

At the time of this writing, under normal network load, the number of pending transactions is from 2,000 to 4,000 thousand. When someone starts ICO the number of transactions in pending may grow up to 8-11 thousand ... The image just shows such a sharp jump.

When a transaction is pending for a very long time, the user tries to send the same transaction but with a lot of gas, then again and again. In the hope that at least one of them will pass. And all these transactions remain pending.

The fact is that transactions from the address are usually processed in the order of the queue. Therefore, the very first has not yet been processed - locking transaction, the rest will be waiting.

Why does the pending transaction appear and then disappear and the waiting time is reset to zero?

When a transaction enters the pending state, it means that the node has taken your transaction to itself for processing. And now he is looking for a block. However, the block can be found faster by another node that does not contain your transaction. In this case, the node that took your transaction "spits it out" and now another node can take your transaction for processing. In this case, the time is reset.

How to push or delete a locking transaction

It is worth noting that waiting for a transaction for 2-3 hours, although not normal, is still acceptable.

Transactions in the block have their own unique numbers - nonce... If you send two transactions to the network with the same nonce, then only one of them will be processed. And the other will be considered incorrect. Therefore, it is enough for us to repeat the transaction with the same nonce but increase the cost of gas. In this case, the node will take the transaction with the highest cost for processing, and reject the locking one as invalid. And we will solve our problem.

How to do it?

So, if you just want to delete the locking transaction, then it is enough to send an empty transaction with a high gas price. There is no possibility to set the gas price in the mist or ethereum wallet. Therefore, we will use MyEtherWallet.

  1. Find the locking transaction. To do this, go to etherscan.io and enter in the field address the address from which the transactions were sent and click the button go.
  2. A list of all transactions from your account will appear, click on the link "pending Txns"
  3. You will see a list of all transactions in the pending state, as well as the gas price. As a rule, the locking transaction is the very first one. So it is, we see that in the first transaction the price of gas is 1 Gwei. And the next one in the queue, although it has a gas price of 21 Gwei, will not be processed until the locking transaction is processed. Click on the hash link of the locking transaction to view the details.
  4. Copy the number in detail none and address from(in fact, this is the address of the account from which you sent the transaction)
  5. Now go to https://www.myetherwallet.com/ and select the tab Send Offline(Offline translation).
  6. Now, of all the fields, we need to fill in the following:
  7. Now our task is to unlock the wallet in a convenient way. Do it yourself. After unlocking, the button will be available to you. generate transaction. Click on it. And then click on send transaction.
  8. In the window that appears, click the blue button “Yex, I am sure! Make transaction. "

Your transaction should now be deleted after a while. Open etherscan.io with your address and watch the process. If among the subsequent transactions there are low gas, then for them you also need to do this procedure. In our example, after a transaction with 1 Gwei, there is a transaction with 21 GWei, so we only need to remove the first one.

Many have probably already encountered the problem of stuck cue ball (when sending and receiving).
In most cases, this is due to network spam and small fees to miners (hereinafter the commission).
Before sending cue ball, I would advise you to look at the state of the network and set the commission recommended by these services:
https://btc.com/stats/unconfirmed-tx

If it so happened that you sent a commission less than the recommended one or your tranza is simply stuck in unconfirmed ones and is not included in the block, then use this service to "push":

We take our th (id) transaction:
Example:

And we drive in id here:


Note!

When the network is congested, it is not always possible to drive in bitcoin the first time using this service.

You can get a message like this:

Submissions are beyond limit. Please try later.

Click to Expand ...

You need to drive in until you get the status: Successful.

After that, your tranza will be picked up and drawn into the block for processing.

What if your bitcoin transaction is not confirmed ("frozen")?

At first you can just wait. If several hours (or even days) have passed and you are tired of waiting, then there are several options:

  1. Make doublespend... Features: can only be done by the sender.
  2. Use CPFP. Features: can be done by the recipient and usually the sender.
  3. Use replace-by-fee... Features: only the sender can and if taken care of in advance; not all wallets can.
  4. Use the "accelerator" from viabtc... Features: the recipient and the sender can, but the service is often overloaded and there are restrictions on the transaction.
How do I make a doublespend (double spend)?

We act according to the following algorithm (the algorithm is described for the Bitcoin Core wallet; for other wallets, the actions are similar, but the commands will be different):

SpoilerTarget "> Spoiler: algorithm

1) Make sure that she is waiting for confirmation. To do this, copy the id of your transaction, paste it into the search bar of the blockchain.info service (as well as bitaps.com, blocktrail.com/BTC or similar). Next, we look for the line "unconfirmed transaction" with our eyes. Found it? This means that the transaction is waiting for confirmation.
Note. We do not look at the "Estimated Confirmation Time" on the page with your blockchain.info transaction - it is not known what.

2) Now close the wallet and run it from the command line with the -zapwallettxes parameter and wait until it opens. When the wallet starts, all unconfirmed transactions will disappear from it (but they are still on the network!). For bitcoin core 0.14, you will need to rename or transfer the mempool.dat file before launching (the mempool in this version is saved to the file and the old transaction remains there).
Note. Why not with the -salvagewallet parameter? -zapwallettxes will not affect your key names, and -salvagewallet will remove them. Also, bitcoin core sometimes crashes when launched with - salvagewallet and then your wallet.dat will be corrupted. True, a copy will be created next to it in advance.

3) Now you can create a new transaction without forgetting to set an adequate commission. But! Since your old transaction is still online, it may be unexpectedly confirmed someday. If this does not suit you, then at least one of the inputs of the new transaction must coincide with one of the inputs of the old one. To do this, look at the page of your transaction on the site blocktrail.com/BTC or an analogous column "inputs", memorize the exact size of the entry in cue ball. After that, when creating a transaction in the wallet, click on the "inputs ..." button, find the exact same number in the cue ball in the list and select it (if there are several of them, then select with the same receipt address and time). After that, we select some more inputs so that the total amount is greater than the transaction amount with a future commission; it is better to choose with a margin. Next, fill in all the fields as usual (don't forget about the commission!) And send.


How do I use CPFP? What if I am not the sender, but the recipient of the transaction?

There is such a method and it is suitable for recipients; it will also work for the sender if your transaction had a "change" (it usually does). This method is a little more expensive and how many pools support it is unknown (as of the beginning of 2017, at least two pools support it). You can try using the CPFP (child pays for parent) mechanism. To do this, you must spend one of the outputs of the problem transaction with a commission that is enough for both transactions at once - the new and the old. That is, you simply create a transaction with one input (this should be one of the problematic outputs, for example, change) and send the bitcoins to yourself. Set the commission so that it is enough for both at once: to do this, add up their sizes, multiply by the number from the item "How to choose an adequate commission?", Divide by the size of the new one in kilobytes and enter in the "custom transaction fee" column when sending a transaction. More details for the Bitcoin Core wallet under the spoiler:

SpoilerTarget "> Spoiler

For example, suppose you are the recipient and should receive 0.08500148 btc. In order to use CPFP, in Bitcoin Core, click "Settings" -> "Options" -> "Wallet" ("Settings" -> "Options" -> "Wallet"); put a tick next to "Enable coin control features" and "Spend unconfirmed change" if they are not (then you can remove them); now close the settings window and click "Send", there we click the "Inputs ..." button and put a check mark next to the amount 0.08500148; then "Ok", add your address as the recipient; amount, put 0.08500148 and check the "subtract fee from amount" box; set the commission "selectively" ("custom"), "per kilobyte" ("per kilobyte") and write in terms of 2 transactions according to the formula ((size of the old transaction) / (size of the new transaction) + 1) * (adequate commission for kilobyte or better). You are sending.

Everything. Now you wait. Those pools that "understand" this scheme will gladly accept both transactions at once. Perhaps it will not be fast if there are few such pools.


How do I cancel a transaction? Can a transaction cancel itself?

If the transaction is confirmed (included in the block), it cannot be canceled or canceled. To cancel an unconfirmed transaction, you need to create a competing transaction with it and achieve its inclusion in the block - see paragraph (2) of the answer to the question "What to do if the transaction you sent by you is not confirmed (" stuck ")?" In any case, there is no guarantee of success.

The unconfirmed transaction itself cannot be canceled - the display in your wallet can only change. Next, see the answer to the question "My transaction was unconfirmed for several days, and then it disappeared and the money came back. Now everything is fine and can I just send the money again?"

My transaction hung unconfirmed for several days, and then disappeared and the money came back. Is everything okay now and can I just send the money again?

No! Your old transaction is still online and may be unexpectedly confirmed. To avoid this, see paragraph (2) of the answer to the question "What to do if the Bitcoin transaction you sent is not confirmed (" stuck ")?" (under the spoiler). If you change your mind about doing that translation at all, then you can make the translation yourself.

How to protect yourself from transaction freezes?

  1. Expose an adequate commission.
  2. Enable the replace-by-fee mechanism in the wallet and mark all transactions as replaceable if your wallet supports it (electrum seems to support it). This will allow you to easily increase the commission if a problem arises.

This means more blocks are filled. And since all transactions cannot be immediately included in the blockchain, a nuisance arises, which miners call a "mempool" (a kind of "transaction queue.")

Miners usually select those transactions with higher commissions and include them in the block first. Transactions with lower fees are “sent” to the so-called “commission market” and remain in the miners' mempool until a new block is found. If the transaction is sent again, it will have to wait for the next block again.

This can lead to a suboptimal user experience. Transactions with very low fees may take hours or even days to be confirmed, and in some cases may not be confirmed at all.

And here's what you can do today to prevent your transaction from getting stuck.

Before sending it

During the early years of Bitcoin, most wallets added flat fees to outgoing transactions: typically 0.1 mBTC. Since the miners had enough space in the blocks, they included these transactions in the very first block they managed to mine without any problems. (In fact, transactions with even lower fees, or even no fees at all, were included in blocks just as quickly.)

With the increased competition for a place in the block, the fixed commission of 0.1 mBTC became insufficient for the transaction to be immediately included in the next block; they are outpaced by transactions with higher fees. While a low-commission trade is likely to get confirmed, it can take a long time.

Try to increase your commission

If you want your transactions to be confirmed faster, the obvious solution is to add a higher fee to that transaction. If your wallet (with default settings) does not add enough commission, you can configure this parameter manually, both in the wallet settings and when sending a transaction (or both.)

Sites such as 21.co track the health of the network and suggest what level of commission per byte of transaction will be sufficient, and also show you how much network confirmation rate you can expect for various levels of commissions applied.

If you want a payment to end up in the next block or through a block, you need to pay a relatively high fee. For less urgent payments, you can add a lower commission; it just takes a little longer to confirm.

Check if your wallet supports dynamic fees change

Most wallets these days support dynamic fee changes. Based on the data on the state of the Bitcoin network, these wallets automatically include a commission that will be sufficient to include a transaction in the next block, or at least one of the next blocks.

Some wallets also give you the option to select the priority of the commission. Again, higher fees will allow transactions to be confirmed faster, while transactions with lower fees will take a little longer.

If transactions from your wallet are often delayed during peak hours, and you do not have the option to set a higher commission, then your wallet is most likely out of date. Check if there is an update available or upgrade to a new wallet.

Consider switching to another wallet

When you switch to a new wallet, then of course you need to transfer funds from your old wallet to the new wallet. If you don't mind spending a little, you can transfer funds from the old wallet to the new wallet via the Bitcoin network. They will eventually arrive - even if the commission is low.

Also, some wallets allow you to export your private keys or use the seed of the private key to then import the keys into a new wallet. In this case, you do not need to make transactions on the Bitcoin network. By using the new wallet, you can start transactions immediately.

After you sent it

If you have already sent a transaction and it gets stuck, then this transaction can, in some cases, make a "jump in the queue."

Selective replacement of commissions

The easiest way to get your transaction to jump in the queue is to use an option called Opt-In Replace-by-Fee (Opt-In RBF). It gives you the ability to resend the same transaction, but with higher fees.

In most cases, when the same transaction is sent over the network, but with higher fees, the new transaction is rejected by the network. Bitcoin nodes usually decide that a new transaction is a double-spend attempt, so they don't accept or process it. But when you forward a transaction using the RBF Opt-In option, you are essentially telling the network that you are forwarding the same transaction, only with a higher fee. As a result, most Bitcoin nodes accept the new transaction instead of the old one; allowing a new transaction to jump in the queue.

Whether your new transaction will be included in one of the nearest blocks will depend on the miner who counts the next block: not all miners support Opt-In RBF. However, quite a few miners also support this option, so one way or another your transaction will be included in the coming blocks.

Opt-In RBF is currently supported by two wallets: Electrum and GreenAddress. Depending on the wallet, you may need to enable Opt-In RBF in the menu settings before you send the (first) transaction.

Children pay for their parents

If your wallet doesn't support Opt-In RBF, things get a little more complicated.

Children pay for parent (Child Pays for Parent, CPFP), which can be a gimmick. With CPFP, miners do not necessarily accept the transactions that have the highest fees, but instead they can accept a set of transactions that generally have higher fees.

Without going too deep into the technical details, we can say that most outgoing transactions not only send bitcoins to the recipient, but they also send "change" back to you. You can spend this change in the next transaction.

Some wallets give you the ability to spend this change right away without waiting for confirmation, so you can send that change to yourself in a new transaction. This time, make sure you include enough fees to offset the initial low transaction fees. In this case, the miner will take the entire set of transactions and confirm them all at once.

If the wallet does not allow you to choose which bitcoins were spent - and therefore you cannot confirm where the unconfirmed change is located - you can try to send all the funds in the wallet to yourself; in this case, change will be included.

As with Opt-In RBF, not all miners support CPFP today. But they are enough for you to be sure that your transaction will be confirmed in one of the following blocks.

Or..

If neither Opt-In RBF nor CPFP is available, you can technically still try and transfer the original transaction for higher fees. This is commonly referred to as "full fee replacement" and is accepted by some miners. However, available wallets do not have this option.

Otherwise, you probably just have to wait - for the transaction to be confirmed or for the bitcoins to return to your wallet. It's important to note that until the transaction is confirmed, bitcoins are technically in your wallet - they just aren't available this way. Bitcoins, in the literal sense of the word, do not "get stuck" in the network and cannot get lost in it.

Also, the ViaBTC mining pool began to offer a "transaction accelerator." If your stuck transaction includes a fee of at least 0.1 mBTC per kilobyte, you can send the ID of that transaction to ViaBTC and the pool will give it a higher priority over the rest of the transactions. Since ViaBTC controls about seven percent of the hashing power of the Bitcoin network, there is a good chance that a block with your transaction will be found in a couple of hours. However, this service has a limit of 100 transactions per hour maximum.

For the recipient

Of course, a transaction can get stuck even if you are the recipient of it. If your wallet allows you to spend unconfirmed transactions, in this case you can also use the CPFP method. In much the same way as mentioned above, you can resend incoming unconfirmed bitcoins to yourself by including high enough fees to offset the initial low transaction fees. If the new commission is sufficient, the transaction is usually confirmed in the next blocks.

It also makes sense to ask the sender of the funds if they are able to use the Opt-In RBF option. If so, he can resend the transaction with a higher fee. Of course, the ViaBTC transaction accelerator (which was mentioned above) works for incoming transactions as well.

Want more news?

Transaction is a sequence of data manipulation statements executed as a whole(all or nothing) and translating database from one holistic state to another holistic state.

A transaction has four important properties known as ASID properties :

    (A) Atomicity ... A transaction is executed as an atomic operation - either the entire transaction is executed, or it is not executed entirely.

    (C) Consistency ... A transaction moves a database from one consistent (consistent) state to another consistent (consistent) state. Within a transaction, database consistency can be violated.

    (I) Insulation ... Transactions of different users should not interfere with each other (for example, as if they were executed strictly in turn).

    (E) Durability ... If the transaction is completed, then the results of its work should be saved in the database, even if the next moment the system crashes.

The transaction usually starts automatically from the moment the user connects to the DBMS and continues until one of the following events occurs:

    Command COMMIT WORK issued.

    The ROLLBACK WORK command was issued.

    The user has disconnected from the DBMS.

    There was a failure of the system.

There are two options for completing a transaction... If all operators completed successfully and no software or hardware failures occurred during the transaction, transaction is fixed.

Committing a transaction- it is an action that ensures recording on disk changes in the database that were made during the execution of the transaction.

Until transaction not fixed, acceptable cancellation these changes, restoration Database to the state in which it was at the time of the start of the transaction. Committing a transaction means that all results of the transaction are made constant. They will become visible to other transactions only after the current transaction will be fixed. Up to this point, all data affected by the transaction will be "visible" to the user in the state at the beginning of the current transaction.

If something happens during the execution of a transaction that makes it impossible to complete it normally, database must be returned in its original condition. Rollback transactions are an action that provides cancellation all data changes made by operators SQL in the body of the current pending transaction.

10. Basic approaches to ensuring parallel execution of transactions. Problems of concurrent execution of transactions.

If several users work with the database at the same time, then the DBMS must not only correctly perform individual transactions and restore the consistent state of the database after failures, but it must ensure the correct parallel work of all users on the same data. In theory, each user and each transaction should have the property of isolation, that is, they should be performed as if only one user was working with the database. And the tools of modern DBMS allow you to isolate users from each other in this way. However, in this case, there are problems of slowing down the user experience.

The main problems that arise during the parallel execution of transactions are conditionally divided into 4 types:

    Missing changes.

    Problems in intermediate data.

    Inconsistent data problems.

    Ghost string (ghost string) problems.

Concurrent transaction issues

How can transactions of different users interfere with each other? There are three main concurrency problems:

    The problem of losing update results .

    Uncommitted dependency problem (reading dirty data , sloppy read ).