User:5tu: Difference between revisions

From Bitcoin Wiki
Jump to navigation Jump to search
5tu (talk | contribs)
No edit summary
5tu (talk | contribs)
 
(7 intermediate revisions by the same user not shown)
Line 35: Line 35:
|-
|-
| Armoury || <span style="color:red">No</span> || <span style="color:green">Yes</span>  || <span style="color:orange">Unknown</span> || ?
| Armoury || <span style="color:red">No</span> || <span style="color:green">Yes</span>  || <span style="color:orange">Unknown</span> || ?
|-
| [https://github.com/bitcoin-wallet/bitcoin-wallet Bitcoin Wallet(Android)] || <span style="color:green">Yes</span> || <span style="color:red">No</span>  || <span style="color:orange">Unknown</span> || ?
|-
|-
| Bitcoind GUI || <span style="color:red">No</span> || <span style="color:yellow">Coming Soon</span>  || <span style="color:orange">Unknown</span> || ?
| Bitcoind GUI || <span style="color:red">No</span> || <span style="color:yellow">Coming Soon</span>  || <span style="color:orange">Unknown</span> || ?
Line 40: Line 43:
| [http://https://breadwallet.com/ BreadWallet (iOS)] || <span style="color:green">Yes</span> || <span style="color:red">No</span>  || <span style="color:orange">Unknown</span> || ?
| [http://https://breadwallet.com/ BreadWallet (iOS)] || <span style="color:green">Yes</span> || <span style="color:red">No</span>  || <span style="color:orange">Unknown</span> || ?
|-
|-
| CoPay (iOS) || <span style="color:red">No</span> || <span style="color:red">No</span>  || <span style="color:orange">Unknown</span> || ?
| [https://copay.io/ (CoPay/Bitpay)] || <span style="color:green">Yes</span> || <span style="color:red">No</span>  || <span style="color:orange">Unknown</span> || ?
|-
|-
| Electrum || <span style="color:red">No</span> || <span style="color:green">Yes</span>  || <span style="color:orange">Unknown</span> || ?
| Electrum || <span style="color:red">No</span> || <span style="color:green">Yes</span>  || <span style="color:orange">Unknown</span> || ?
Line 78: Line 81:




==== CPFP Using BreadWallet ====
BreadWallet allows for CPFP via a tap of the button.
If you have a compatible HD wallet (e.g. Multibit Standard, Hive), you can install BreadWallet and type your master seed in there to use their functionality. 
[https://onedrive.live.com/view.aspx?resid=584F122BA17116EE!313&app=Excel Compatibility Excel Chart]


==== CPFP Electrum ====
==== CPFP Electrum ====
Line 87: Line 94:
# Click Button to sign and check transaction. (There should be no error, as it is not being sent)
# Click Button to sign and check transaction. (There should be no error, as it is not being sent)
# On the check transaction window, Click save. Then save the file somewhere.
# On the check transaction window, Click save. Then save the file somewhere.
# Open the file, and find the looooong string of hex characters between quotes.
# Open the file, and find the long string of hex characters between quotes.
# Copy the string (like 01000000bef39df829...00000000)
# Copy the string (like 01000000bef16df829...00000000)
# Paste it into http://eligius.st/~wizkid057/newstats/pushtxn.php but wait on clicking the button.
# Paste it into http://eligius.st/~wizkid057/newstats/pushtxn.php but wait on clicking the button.
# Click "Broadcast" on the Electrum transaction checking window.
# Click "Broadcast" on the Electrum transaction checking window.
Line 94: Line 101:
# Click "OK" on the website to push the transaction.
# Click "OK" on the website to push the transaction.


You may need to use the console
 
If you want to use CPFP, you need to use Electrum console commands, specifically createrawtx
==== CPFP Copay ====
# Check the box in settings to spend unconfirmed.
# Put the fee rate on priority.
# Send all of your Bitcoin back to yourself.

Latest revision as of 10:29, 2 December 2016

THIS IS WORK IN PROGRESS AND NOT ACCURATE YET

Purpose

When submitting a transaction from your wallet to the bitcoin network you broadcast a transaction to one of the thousands of bitcoin nodes making up the network.

If the transaction is considered valid by this node, the transaction is next put in the nodes waiting area (mempool) and is shared to this node's neighbours where they now check if they believe it is valid and forward it on to their neighbours and so on to propagating your transaction around the bitcoin network until everyone has seen it.

Eventually when a miner finds a solution to the next block they would have included your transaction in that block so becomes part of the blockchain. Once this happens the transaction is eventually removed from the mempool waiting area. The other nodes will now see this new valid block and remove the transaction from their mempool.

A common problem that happens in a transaction is the fee paid is too low based on the network demand. This can lead to transactions being stuck for hours or even days. Keep in mind that if you have a source transaction of say 0.5btc and sent only 0.1btc somewhere, the 0.4btc change (less fee) is also being sent in the transaction so your full 0.5btc is tied up until the transaction is confirmed or discarded.

Transactions are typically only discarded from mempool when the machine is restarted or times out. Also when a machine is restarted it syncs with it's neighbours again meaning even a restart may not clear it. The timeout is very subjective and is typically days with many wallets not handling this very elegantly.


Unsticking a transaction

To cancel the transaction there are a few approaches

  • Child pays for parent (CPFP). - This approach is to construct another follow on transaction that pays a larger fee which covers the required fee for both the current and previous transaction. This is typically the best approach if possible since it doesn't invalidate your original transaction.
  • Double spend (RBF) - This approach is to simply spend the same money again but this time apply a larger fee. Most nodes will ignore double spend requests unless the RBF (Replace By Fee) option was originally set in the transaction. To know if this is possible you need to know if your wallet constructs transactions with this RBF flag. (Most don't as of writing this)

https://github.com/petertodd/replace-by-fee-tools

  • Time out - This approach is to simply wait it out until the transaction is eventually removed from mempools of the network.


Wallet support

TODO

Wallet CPFP RBF Export Private Key Dynamic Fees
Armoury No Yes Unknown ?
Bitcoin Wallet(Android) Yes No Unknown ?
Bitcoind GUI No Coming Soon Unknown ?
BreadWallet (iOS) Yes No Unknown ?
(CoPay/Bitpay) Yes No Unknown ?
Electrum No Yes Unknown ?
GreenAddress No No Unknown ?
Jaxx (iOS) No No Unknown ?
Multibit No No Unknown ?
MyCelium No No Unknown ?
Trezor No No Unknown ?

Walkthrough manually unsticking a transaction

(TODO) If you know the private keys of the original transaction you can manually construct a transaction using coinb.in or on the bitcoin-cli commandline.

Publish New Transaction Manually

Bitcoin-cli

You can use "createrawtransaction" to manually add inputs and mark the "nsequence" field to a value less than 0xffffffff. If you would like to replace the first transaction created this way. You will have to dump the transaction to free the UTXOs for use again using the "abandontransaction" command.

Once you've dumped the first transaction. You should be able to repeat the process above then increment the "nsequence" field. This new transaction when broadcasted should then be accepted by any node that supports full RBF.


CPFP General

This is the general principle of CPFP, and it may not be entirely correct.

Step 1: Find the txid of your unconfirmed transaction Step 2: Calculate the fee for the unconfirmed transaction with a fee of 0.0001 BTC/Kb Step 3: Create a transaction that spends the unconfirmed transaction to another Bitcoin address. Include in its fee the recommended fee and the fee you calculated in step 2. (e.g. fee of 0.0001 BTC for both transactions means 0.0002 BTC fee in this new one) Step 4: Sign the new transaction. Step 5: Push the transaction to the network. It is recommended to use http://eligius.st/~wizkid057/newstats/pushtxn.php because the mining pool Eligius is one of the only pools to implement CPFP. This will push straight to them and the rest of the network. Step 6: Wait for someone, probably Eligius, to mine a block and include both of your transactions. This could take a couple hours since Eligius has a small percentage of the hashrate of the network.


CPFP Using BreadWallet

BreadWallet allows for CPFP via a tap of the button. If you have a compatible HD wallet (e.g. Multibit Standard, Hive), you can install BreadWallet and type your master seed in there to use their functionality. Compatibility Excel Chart

CPFP Electrum

  1. In the "Addresses" tab click the arrow next to "Change" to show your change addresses.
  2. Find the Address in your change addresses which contains the change from your MOST RECENT UNCONFIRMED TRANSACTION. (Find this by right clicking the transaction and checking the details window and look at the addresses and amounts of BTC at the bottom window to find your change address)
  3. Right click the change address in your "Addresses" tab, and click "Send From." This will take you to the send tab.
  4. Set the Fee box to y that we calculated. The unit is BTC.
  5. Send the remainder of the bitcoins in that address to another address of yours.
  6. Click Button to sign and check transaction. (There should be no error, as it is not being sent)
  7. On the check transaction window, Click save. Then save the file somewhere.
  8. Open the file, and find the long string of hex characters between quotes.
  9. Copy the string (like 01000000bef16df829...00000000)
  10. Paste it into http://eligius.st/~wizkid057/newstats/pushtxn.php but wait on clicking the button.
  11. Click "Broadcast" on the Electrum transaction checking window.
  12. Wait about 20 seconds. (or if an error message pops up in Electrum, just go straight to the next step)
  13. Click "OK" on the website to push the transaction.


CPFP Copay

  1. Check the box in settings to spend unconfirmed.
  2. Put the fee rate on priority.
  3. Send all of your Bitcoin back to yourself.