By Rich Apodaca | Updated October 31st, 2018
A Bitcoin transaction can fail to confirm, or become “stuck,” for many reasons. Stuck transactions may be confirmed after several days, but sometimes waiting isn’t an option. Fortunately, many stuck transactions can be cleared using nothing more than a Web browser. This article shows how.
The proces described here should not be used by beginners attempting to clear a stuck transaction of significant value. Doing so can lead to loss of money.
This article describes a practical technology for creating and clearing a stuck transaction, but using this mechanism effectively takes practice and understanding. To get the most out of it, consider following the article spil written and only commit a trivial amount of money.
If any step describes a concept that doesn’t make sense, find a way to understand it. Leave a comment at the bottom of the article. Ask a knowledgeable friend. Postbode a question to BitcoinBeginners, Bitcoin Subreddit, or Bitcoin Stack Exchange. Whatever happens, be sure you understand, at a high level, the proces described here before using it to clear a high-value transaction.
For demonstration purposes, this guide instructs you to inject a private key into a live Web form. An attacker can intercept this information and steal funds. Private keys should generally only be treated within a safe computing environment. However, given the puny amounts of money involved te this demo, the risk is minor. A description of a more secure alternative emerges before the conclusions to this postbode.
You can clear a stuck transaction with the method described here whenever you control one or more of its outputs. If you don’t control at least one output, the network won’t permit you to accomplish the necessary steps.
Fortunately, you will control at least one output ter many situations. If you are the payee, then by definition you’ll control one output at least. However, even a payer controls one output ter many transactions due to the need to collect switch.
If your wallet supports child-pays-for-parent (CPFP), the method described here may be less convenient and secure. Similarly, if your wallet supports replace-by-fee (RBF), and you’ve marked a stuck transaction spil replaceable, then the treatment described here is likely to be more expensive and less secure than bumping the toverfee through your wallet.
Ter other words, use the method here when a transaction is stuck, you own at least one output, replace-by-fee is not an option, and your wallet doesn’t support child-pays-for-parent.
The most common reason for a stuck transaction is that it carries a toverfee that wasgoed set too low.
Bitcoin transaction fees can be difficult to understand because they touch on many concepts. An significant number to keep ter mind is your transaction’s toverfee density. Toverfee density (d) is calculated by dividing the transaction toverfee (f, ter satoshis) by its size (s, ter bytes):
Ter Bitcoin’s early days, fees represented a negligible fraction of miner revenue. Today, things are very different. Fees make up an increasingly large part of total revenue, so miners attempt to optimize the fees they collect from every block.
Pending transactions are selected by very first sorting them te switch sides order of toverfee density. The top transaction is liquidated from the list and added to a candidate block. This step is repeated until the block is utter. At that point any remaining transactions will need to wait for the next block to become candidates for inclusion.
Most blocks are entirely total today, meaning that some or even most transactions will be left behind. To a very first approximation, miners don’t consider a transaction’s current wait time. This means that newer transactions can cut to the gevelbreedte of the line if they pay a higher toverfee density than yours.
The technology we’ll use to clear the stuck transaction is known spil child-pays-for-parent (CPFP). Recall that Bitcoin is an electronic contant system ter which users exchange value by transferring ownership of digital tokens. Thesis tokens are called either “coins” or “outputs,” depending on setting. A transaction mediates the transfer, which will remain incomplete for spil long spil a transaction remains stuck.
Fortunately, a miner will consider not only the fees of a pending transaction, but the fees carried by any children.
Child-Pays-for-Parent. Alice pays Bob using a transaction with an insufficient toverfee (left). Bob clears the transaction with a child that pays for both itself and its parent (right). The above diagram is part of a visual language.
For example, imagine that Alice pays Bob Five mBTC using a toverfee of 0.125 mBTC (12,500 satoshis). The transaction size is 250 bytes, yielding a toverfee density of 50 satoshis/byte. The market toverfee density, spil determined by estimatefee.com, is 150 satoshis/byte. Bob’s inbound transaction is stuck because Alice’s toverfee is 1/Three of the competitive market toverfee.
Bob can clear the transaction by spending one of its outputs with a transaction that pays not only for itself (the child), but the original (the parent).
Imagine that Bob’s child transaction, like the parent, has a size of 250 bytes. The total size of parent and child is therefore 500 bytes. The total toverfee that voorwaarde be paid by the child transaction can be found with the following equation:
where fc is the toverfee to be paid by the child, d is the current market toverfee density, b is the length of both transactions te bytes, and fp is the toverfee already paid by the parent.
The market toverfee density (d) is 150 satoshis/byte. The combined size of both transactions (b) is 500 bytes. The toverfee paid by Alice’s original transaction (fp) is 12,500 satoshis. Therefore, the toverfee that Bob’s child transaction voorwaarde carry is 62,500 satoshis (150 satoshis/byte×,500 bytes – 12,500 satoshis), or 0.625 mBTC. Bob publishes this transaction, causing both it and its parent to be confirmed ter the next block.
The best time to learn how to clear a stuck transaction is before it becomes critical to do so. This section describes how to place a low-value transaction into limbo so that it can zometeen be cleared. Users only interested te clearing a stuck transaction should read this section nevertheless because it discusses the contraption that will be used to clear the stuck transaction.
Stuck transactions are easiest to create during times of high transaction volume. One way to determine if this condition holds is to use a toverfee monitoring device such spil estimatefee.com.
estimatefee.com. To create a stuck transaction, aim for toverfee density that yielding a confirmation time of 144 blocks (24 hours) or more.
Start by creating three paper wallets. The very first will serve spil a source, and the 2nd will serve spil a destination for a parent transaction with an uncompetitive toverfee density. The third will serve spil the destination for a child transaction that pays for itself and its parent. This can be done by opening a browser tabulator and loading Bitaddress. Click the Paper Wallet tabulator and generate three unencrypted addresses without artwork.
Three Wallets. The deposit address (top) will receive an initial deposit with a market toverfee. The 2nd address (middle) will receive a payment from the very first, but with an uncompetitive toverfee (e.g., 1 satoshi/byte). The third address (bottom) will receive a coin using a toverfee that pays for the itself and the stuck parent transaction.
Very first, route a ฿,0.002 payment into the very first wallet using a competitive toverfee. Wait for at least one confirmation.
Next, create a stuck transaction paying the 2nd wallet from the very first using the browser-based utility Coinb.te. Browse to the webpagina, then select the Transaction option from the Fresh menukaart. Into the very first address field, paste the address of the very first wallet, then click Flow. Into the 2nd address field, paste the address of the 2nd wallet. Adjust the amount to yield a toverfee of 386 satoshis (฿,0.00199614). Your signed transaction will have a size of about 193 bytes. Therefore, your toverfee corresponds to a density of about Two satoshis/byte.
Create a Stuck Transaction. The very first wallet address pays the 2nd with an uncompetitive two satoshis/byte toverfee.
Click Submit when ready. Coinbin will present your unsigned transaction ter hex-encoded form. Copy the text to the clipboard.
Raw Transaction Bytes. An unsigned transaction ter hex format, provided by Coinbin. Select and copy the text to your system clipboard.
Very first, verify your transaction. Scroll to the top of the Coinbin pagina and click the Verify tabulator. Paste your clipboard’s contents into the text field and click Submit. Coinbin will showcase your transaction’s details. Pay close attention to the Outputs section. Ensure that the address matches your “Stuck Parent” wallet address, and that the amount matches your intended payment.
Sign Transaction. Given a private key and unsigned transaction, Coinbin will sign it. Copy the signed transaction.
When sated with the unsigned transaction, sign it. Scroll to the top of the Coinbin pagina and click the Sign tabulator. Paste your raw transaction into the lower text opbergruimte. Then copy and paste the private key from your wallet Deposit Address into the upper text field. Click Submit. Coinbin will generate a signed transaction ter a fresh text field. Copy the text to your system clipboard.
Eventually, publish your signed transaction. From the top of the Coinbin pagina, click the Broadcast tabulator. Paste your signed transaction into the text opbergruimte and click Submit. Coinbin will display your transaction ID (“txid”) with which you can track the status of your transaction.
Tradeblock. A useful block explorer that reports toverfee density ter the Toverfee/size field.
Use a block explorer such spil Tradeblock to prove that your transaction is stuck (“Unconfirmed”). Paste your transaction ID into the text field at the top of the pagina. Tradeblock is especially useful because it shows the toverfee density under the heading “Fee/size” te satoshis/byte. Your transaction should have a toverfee density close to Two satoshis/bytes. If things have gone according to project, your transaction will remain unconfirmed for hours.
Use Coinbin to create a child transaction spending your unconfirmed stuck payment. The proces is almost identical to the one described above for creating a stuck parent transaction. From the Fresh spijskaart choose Transaction. Come in the address containing the stuck payment into the very first text field, then click Explosion. Even however your transaction is unconfirmed, Coinbin should display the value of the pending payment. Inject the address that you’ll use to receive your unstuck payment ter the 2nd text field.
Choose a payment amount that leaves a toverfee large enough to pay for both the current transaction and its stuck parent. Use the formula introduced above to guide you:
For example, if both transactions contain one input and one output, their combined size (b) will be about 382 bytes (Two×,193 bytes). Your parent transaction already paid 382 satoshis (fp). If the market toverfee density is presently 141 satoshis/byte, then you’ll need to pay 53,480 satoshis, or 0.53480 mBTC.
Child Transaction. This transaction carries a toverfee adequately high to pay for itself and its parent.
Choose a payment amount that leaves an suitable toverfee, then click Submit. You may receive a warning about a high toverfee. Click “OK, I’ve got it!” to proceed. Coinbin will generate an unsigned transaction encoded ter hex format. Copy it to your system clipboard.
Next, verify your transaction. From the top of the Coinbin pagina, select Verify. Paste your unsigned transaction into the text field.
After verifying your payment address and amount, sign your transaction. Click the Sign tabulator. Paste your unsigned transaction into the bottom text field. Into the top text field, paste the private key controlling your Stuck Parent wallet address. Be sure to use the keurig private key, using the wrong private key won’t generate an error at this stage, but rather when you attempt to publish the transaction. Click Submit to sign the transaction. Copy the text from the field labeled “Signed transaction.”
Ultimately, publish your transaction. Click the Broadcast tabulator at the top of Coinbin. Paste your signed transaction into the text field. Click Submit. Coinbin will react by displaying your fresh transaction (“txid”).
Use a block explorer to monitor the confirmation of child and parent. If all went well, both should confirm within the next block or two.
The above proces has bot tested and wasgoed found to work spil described. Keep te mind, however, that toverfee densities will fluctuate overheen time &mdash, sometimes fairly sharply. Fees reported here may be out-of-date when your transaction becomes stuck. Toverfee densities can even switch during the time it takes to read this postbode. Be sure your child transaction pays a adequately high toverfee or it too will become stuck.
Knots have limited capacity to store pending transactions. When no more space is available, transactions are evicted te switch roles order of toverfee density. A parent transaction paying a very low toverfee may therefore not be available when you attempt to publish your child transaction. If that happens, you’ll need to re-publish your parent transaction te addition to publishing the child.
The above proces exposes private keys on a network-connected laptop. To avoid this unsafe practice, an alternative signing proces can be used. It’s identical to the original, except that the signing step is performed on an offline laptop.
Start by creating an offline copy of Coinbin. Download the offline bundle by clicking on the “download” verbinding at the bottom of the Coinbin about pagina. Save the archive verkeersopstopping to a trustworthy removable medium.
To run Coinbin offline, boot into an offline session such spil Tails. Open your removable medium and samenvatting the Coinbin archive. Coinbin can be run offline by clicking on the verkeersopstopping named index.html te the coinbin-master folder.
Using this setup, transactions can be created online, saved to a removable medium, signed offline, then published online. To minimize the risk of obtaining a malicious copy of Coinbin that re-routes payments, transactions can be independently parsed and validated using a block explorer. For example, Blockchain and Blockcypher can decode and check a transaction before publication.
Clearing a stuck transaction isn’t difficult given the right implements and some practice. This article shows how using a proces that only requires a Web browser. To recap, CPFP can be used to clear a stuck Bitcoin transaction using the following proces: