On a couple of occasions, i’ve been asked, in private, to give assistance in creating, signing and broadcasting transactions to users that have their address and know how to decode/export/get their private key (in WIF format).
This might be handy for people wanting to sweep their paper wallets, as well as people wanting to double spend the inputs of stuck, unconfirmed, transactions using a waaay to low fee.
- make sure you have potential access to both your address and your WIF, unencrypted private key (don’t decrypt/export your private key yet)
- surf to http://www.coinb.in
- find the link to download the sourcecode from github (currently https://github.com/OutCast3k/coinbin/archive/master.zip)
- download the sourcecode
- unzip the sourcecode
- open ./coinbin-master/index.html
- left top corner => +New => Transaction
- paste your address into the box saying “Address, WIF key or Multisig Redeem Script”
- click “load”
- you’ll now see 2 tabs, one labelled Outputs (0.00000000) and one labelled Inputs (your balance). These tabs controll which unspent outputs you’ll use as an input for your new transaction (tab INPUTS), and which new outputs will be generated by your new transaction (tab OUTPUTS)
- first check the tab inputs. Here is a list of all inputs that will be used by your transaction. If you don’t want to empty out your paper wallet, but just pay somebody a certain amount of BTC, you could remove some inputs untill the sum of the amounts of the inputs is slightly more than the amount you wish to transfer
- go to the tab “outputs”
- add all addresses you wish to send funds to, enter the amount you wish to send, enter my address 1MocACiWLM8bYn8pCrYjy6uHq4U3CkxLaa if you want to send a tip for this tutorial 😉
- now comes the puzzle. (sum of all inputs ) – (sum of all ouputs) = fee. If you added all receiving addresses, and the fee is still rather large, you’ll need to add a change address to (a chance address is either your old adress, or a newly generated address if you value your anonimity).
- count the number of output addresses, and the number of input transactions. Surf to http://www.mocacinno.com/page/feeestimate . Use option 2 => Nb of inputs = number of transactions, Nb of outputs = number of receiving addresses (including your change address if you need one)
- click “estimate”
- in the next screen, you’ll see an estimation of the fee your transaction will need… It’s up to you if you want to pick the highest estimated fee, or round it down a bit… However, i strongly discourage you from using a fee that is lower than the fee i estimated for getting you into the next 24 blocks…
- with this knowledge, revisit the puzzle (sum of all inputs) – (sum of all outputs, including the output to the change address) =~ fee.
- in my example, i want to empty out my wallet, but i want to send all funds to myself (dumb thing to do), so i don’t remove any inputs, i now have 2 inputs), i create one output (i’m not going to add a change address), and my estimated fee for 2 inputs and one output was ~0.001 BTC. I adjusted the amounts sent to my own address to make sure the transaction fee was 0.001…
- in coinb.in now click on submit
- coinb.in has a warning for a high fee, but the “good” fee amount hasn’t been updated for a long time. Lately the fees rose significantly, so coinb.in will probably warn you about a very high fee… Ignore this 😉
- copy the resulting transaction, paste it into a text editor and save.
- go to http://www.mocacinno.com/page/rawdecode and paste your transaction from the previous step, and fill in the captcha
- examine the decoded transaction, look at all the vin’s… Those are the unspent outputs you’ll be using as an input for the new transaction. The Vout section lists all outputs that will be generated by your new transaction… Look at the addresses, and see if there is nothing suspicious. If you don’t trust my site, there are other online transaction decoders (use google to find them)
Here ends my screenshot-tutorial… i’m not going to export my own private key to simulate the next steps, so everything that happens from here on out comes from my memory, without screenshots
- disconnect from the internet
- go back to the local copy of coinb.in’s index.html
- click on “sign” (top menu, middle of the page)
- paste your transaction in the big box
- decrypt/export/get your private key, make sure it’s the WIF compressed private key, 52 characters, starting with a “K”
- click on submit
- you should be given your signed transaction… Save it in a text file, save it, reboot your computer.
- reconnect to the internet
- You can use my site (http://www.mocacinno.com/page/rawdecode) to decode the saved signed transaction, and see which inputs and outputs are used/generated
- If everything is ok, you can open coinb.in again, click on “broadcast”, paste the signed transaction, and click “submit”. you can also use my site for this purpose: http://www.mocacinno.com/page/txpusher