how to analyse a stuck transaction using free, online tools

Today, i’m writing a short tutorial on how to analyse a stuck transaction using blockchain.info‘s block explorer. Blockchain.info’s explorer isn’t the best one out there, from time to time it has some bugs, but it’s one of the most used block explorers, so that’s why i chose this one to write up a short tutorial.

How to find out the reason why your transaction is stuck

  • find the transaction id from your stuck transaction… How to do this depends on your specific kind of wallet.
  • surf to blockchain.info, enter your transaction id in the search window (right top corner) and hit enter. A shortcut is to just enter https://blockchain.info/tx/{your tx id} in the address bar of your browser and hit enter.
  • Click on “Show scripts & coinbase”
blockchain.info Show scripts & coinbase
blockchain.info Show scripts & coinbase
  1. you can enter the txid directly in your browser’s address bar and hit enter
  2. click on “Show scripts & coinbase”
  • after you’ve clicked on “Show scripts & coinbase”, you should see a screen like this one:
blockchain.info detailed view
blockchain.info detailed view

Possible problems

  1. If you see a red [u] next to the input, it means there’s an unconfirmed parent… This is bad, since your transaction will only be able to confirm after the parent has been confirmed. This might be the reason why your transaction doesn’t confirm 😉
  2. if you see a red (spent) after (one of) the output(s), it means the output of your (unconfirmed) transaction has already been used for a new transaction. Needless to say, this new transaction will not be confirmed before your transaction is. This can’t be the reason why your transaction didn’t confirm… It is, however, the reason why the next person’s transaction didn’t confirm (yet).
  3. look at the size of the outputs… If there are outputs smaller than 0.000025, this might be considered as a dust output by some nodes, so it has a higher chance of being rejected. If it’s rejected by more nodes, it might not have propagated completely, so less miners might know about your transaction, lowering the chance for a confirmation.
  4. here you can see if your transaction is confirmed or not
  5. here you can see the fee per byte… Look at bitcoinfees.21.co to find out if your fee was/is high enough at this moment. If you used a substandard fee, this might be the reason why your transaction is stuck

other things that can go wrong: double spending the inputs of the unconfirmed transaction

double spent input
double spent input
  1. this transaction is labelled as a double spent, here you find the blockchain.info id of the transaction that spends the same inputs. If this other transaction has a higher fee/byte, your chance of getting a confirmation are slim. If the other transaction is already confirmed, your chances of being confirmed are allmost 0 (it would take an orphaned block and a lot of luck to solve this problem… If the double spend has 3+ confirmations, there is 0.0000000% chance of getting your transaction into a block)
  2. once again, a textual warning of a double spent transaction

How to create, sign and broadcast transactions using coinb.in

Intro

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.

The steps

  • 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
coinb.in main screen
coinb.in main screen
download coinb.in's sourcecode
download coinb.in’s sourcecode
  • unzip the sourcecode
  • open ./coinbin-master/index.html
open coinb.in locally
open coinb.in locally
  • left top corner => +New => Transaction
coinb.in new transaction
coinb.in new transaction
  • paste your address into the box saying “Address, WIF key or Multisig Redeem Script”
  • click “load”
coinb.in load unspent outputs for your address
coinb.in load unspent outputs for your address
  • 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 😉
coinb.in adding new outputs
coinb.in adding new outputs
  • 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”
mocacinno.com estimating an appropriate fee for your transaction
mocacinno.com estimating an appropriate fee for your transaction
  • 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…
picking the right fee for your transaction is important
picking the right fee for your transaction is important
  • 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…
adjust the amounts to leave an appropriate fee
adjust the amounts to leave an appropriate fee
  • 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 😉
coinb.in high fee warning
coinb.in high fee warning
  • copy the resulting transaction, paste it into a text editor and save.
unsigned, raw transaction
unsigned, raw transaction
online decoding of a raw, unsigned transaction
online decoding of a raw, unsigned transaction
  • 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

The enduserguide to creating, depositing to and sweeping paper wallets

Intro

A couple days ago, i tried to help a user with his paper wallet questions on bitcointalk but ended up giving a big, technical explanation… A different user , correctly, pointed out that this was a nightmare for the standard user. That’s why today, i’m writing a small article on ONE of the ways to create, deposit to and sweep a paper wallet safely…

Creating a paper wallet

  • Make sure your PC is clean, make sure you have your latest OS updates, virus scanner, malware scanner, firewall,… Make sure your PC isn’t acting weird
  • Close all applications exept a clean browser
  • Download the latest sourcecode of bitaddress.org from github
  • DISCONNECT your PC from the internet, do no RECONNECT untill this tutorial explicitly says so!!!
  • Unpack the zipfile you got from github, you can use any trusted application you want for this.
  • browse the unpacked files, open bitaddress.org.html using your browser
  • It’s possible your browser will block the javascript used on this page, in internet explorer you’ll probably have to “allow blocked content”
  • move around your mouse on this page, or type some random characters into the textbox that will be shown on the page
  • once you generated enough entropy by moving your mouse/typing (the counter on the page will go to 100%), the bitaddress.org menu will appear
  • Click on the “paper wallet”-tab
  • chose the number of address and addresses per page… It’s up to you how many paper wallets you want to generate. You’re free to use Art or not, technically it doesn’t make any difference at all, If you disable art, you’ll have a dry, white paper containing all data, if you enable art, your paper wallet will look nice
  • Enable the checkbox BIP38 Encrypt? And chose a STRONG password. If you chose a strong password, your paper wallet will be allmost impossible to hack with the current state of technology. I’ve read a nice article on bitcointalk about this here. As you can read here, a paper wallet which private key was bip38 encrypted with a 5 letter password remained uncracked for over 2 years, eventough the encrypted private key and the length of the password was leaked.
  • Click on generate and wait (this step can take a couple of minutes)
  • At this point, you’ll be shown your paper wallet.
  • There are several options now: if you have a local printer, directly connected to your offline PC, you can print your paper wallets by clicking on the print-button. If you don’t have a printer directly connected to your PC, i suggest clicking the print-button and printing to a PDF-file. Worst case scenario, you can take a print-screen (Ctrl-print Screen), and paste this print-screen in your image editor (Ctrl-V). Make sure your image or pdf file are saved onto a usb stick.
  • Remove the usb-stick (in case you didn’t already print your paper wallet), close all windows and RESTART your computer
  • you can now go back online
  • It would be best to find an offline printer that can print images or pdf’s directly from your usb stick, so your paper wallet is never found on any online device
  • Restart your printer after printing your paper wallet
  • It would be wise to make at least 1 copy, since losing this paper wallet would mean losing all your funds! Laminating and storing in a cool, dry, safe place also works!!!

Depositing to a paper wallet

This one is relatively easy: the left side of your newly created paper wallet should contain the QR code of your address. Your address should also be printed clearly on your paper wallet (your address is the shortest of the 2 codes that are printed on your paper wallet, and it’s the one started with the number 1).

If you have a QR code scanner, you can scan the QR code. If you don’t have a code scanner, you can copy the address by hand… Make sure you double check this address (Capitalisation is important). I advice you to use my address validator just to be sure.

Once you have the address copied and validated, you can use this address to deposit money to… Either as a withdrawal address from an exchange or casino, or as a “pay to” address in about any wallet software you can think off.

Sweeping your paper wallet

I’m going to explain how to sweep your wallet using electrum, since i personally use either electrum or bitcoin-cli (the command line interface of bitcoin core). Since this is an enduser tutorial, i guess there is no need to explain how to use the command line to sweep a wallet, so i’ll stick to the electrum explanation 😉

  • make sure you have the unzipped sourcecode of bitaddress.org on your pc (look at the first part of this tutorial)
  • disconnect from the internet
  • open bitaddress.org.html
  • click on wallet details
  • copy the bip38 encrypted private key from your paper wallet into the box saying “enter private key”
  • click on “view details”
  • enter the password you used when you created your paper wallet
  • click on “decrypt BIP38”
  • copy the Private Key WIF (51 characters base58, starts with a 5) into a text document, save and reboot your pc
  • If you don’t already have electrum, download it here. It’s allways a good idear to check the SSL certificate AND the signature of any binary you download (especially a bitcoin wallet), but that’s a completely different tutorial.
  • If you’re new to electrum: install electrum, open electrum and follow the wizard to create a new wallet. Write down your seed words AND chose a VERY strong password
  • Once you’re done following the wizard (or when you already owned an electrum wallet), make sure you open the wallet.
  • Go to wallet => private keys => sweep
  • Copy the private key you saved in a text document into the box “enter private keys”, and click on “sweep”
  • Follow the wizard, and you’re done 🙂 your paper wallet is now swept into your electrum wallet
  • Take a black, permanent market, and clearly mark your paper wallet as being used!!!  Keep the paper wallet, but never ever deposit any funds onto it ever again!!!

Is bitcoin mining Equal to free money printing?

Intro

I’ve been a member of the bitcoin community since a couple of years, and every couple of weeks a “newbie” comes along who thinks he can turn his PC into a magic money printing machine.
From time to time, this “newbie” already realises he has to buy an ASIC to “make money”, but it’s very rare to find a newbie that actually realises it’s pretty hard to make a living running a bitcoin mine.

This article is written as a future reference to show new users the pitfalls and dangers of bitcoin mining, so they can at least figure out if they could potentially have a shot at mining.

Do realise that this article is written on the 16th of may 2017. Everything told in this article is true at this point in time, but the total network hashrate fluctuates, because of this, the difficulty gets adjusted every ~2 weeks (actually, it’s every 2016 blocks, but this should average out to ~2 weeks). Because the difficulty changes, and the fluctuating price, this article might be obsolete in a couple of weeks/months, but i truely believe that the basic concepts will stay exactly the same.

I’m not going to get into detail why mining is important for the bitcoin network, i’m not even going to explain what mining exactly does… Do realise that mining is important, and even if you cannot make a profit while mining, buying an old ASIC and mining at a loss might be a great way to learn about the bitcoin protocol AND help to decentralise the network… Just don’t expect a positive profit at the end of the day 😉

In detail

There are 3 different questions that pop up regularly (in many variations):

  1. How to CPU mine
  2. How to mine using a GPU
  3. How to mine with an ASIC

1 – How to cpu mine

Short answer: Don’t!!!
Why? A Xeon E5-2690 (dual) hashes at 66 Mh/s [1] (Megahash per second) while consuming 270 Watt. The fastest process in the current benchmarks is the Xeon Phi 5100 which hashes at 140 Mh/s[1] (unknown power consumption). Altough this processor is already a couple years old, i highly doubt your desktop processor will perform better than this 60 core beast[2].
As a matter of fact, an i7 hashes at 23.9 Mh/s [1] (unknown power consumption).

When we use a mining calculator, not accounting for any power costs, nor for a pool fee, the Xeon Phi 5100 will mine 0.00002295 BTC/year at current difficulty level[3]… So, if you don’t have to pay for your power, don’t have to pay for a server equipped with a Xeon Phi 5100, mine on a 0% fee pool 24/7 for a full year, you’ll make a whopping 4 cents (at current difficulty and BTC price).

If you mine with your i7, and you DO have to pay for hardware and power, you can clearly understand that your profit will be negative…

I actually did the math: an optimal setup with an i7, paying 1 cent/Kwu on a 0.5% fee pool, not paying for hardware and not accounting for the power consumed by the rest of your hardware, CPU mining will give you a negative profit of $11/year[4]. In reality, you’ll have to pay for your hardware, you’ll pay more than 1 cent/Kwu, you won’t find a 0.5% pool,… So you’ll lose even more money each second your CPU mine.

2 – How to miner using a GPU

Same answer as how to CPU mine: Don’t
Your losses won’t be as dramatic as mining on a CPU, however, at current difficulty, it’s not really possible to make a net profit.

The “best” single GPU seems to be the AMD ATI 6990[1]. It is benchmarked at 865 Mh/s while consuming 860 Watt.
If you don’t take any power costs or hardware costs into account, mining on a 0% fee pool at current diff and btc price, such a setup can potentially net you a whopping 0.00014178 BTC/year… That’s right, a whopping 25 cents…[5].
Offcourse, as soon as you need to pay for hardware, or power, or if you need to pay a fee, this “profit” turns negative in the blink of an eye…

3 – How to mine with an ASIC

Asic mining is the only real option you currently have if you want to mine profitably.

In order to know if a certain ASIC can be mined profitably at this point in time, you need to find an asic you’d like to buy… Look up it’s specs on https://en.bitcoin.it/wiki/List_of_Bitcoin_mining_ASICs
Once you have the hashrate and power consumption notted down, visit a mining calculator like http://www.coinwarz.com/calculators/bitcoin-mining-calculator/ and enter those details, as well as the price you’ll have to pay for your hardware, the power price you’ll have to pay and at least 1% pool fee. The calculator will then tell you How long it’ll take you to break even at current difficulty and bitcoin price.

Don’t let this number fool you… The difficulty is constantly rising, the price fluctuates, and it’s very well possible you won’t be able to run 24/7 without any downtime… Personally, i wouldn’t start mining if i wouldn’t break even in 4-5 months (offcourse, if you’re a risktaker, you can be happy with a much longer break even point).

Some extra info about the ASIC’s price… Don’t be fooled, the price is much higher than the amount of money you’ll pay the ASIC’s seller… The total price is the sum of:

  • The purchase cost (the price you’ll pay your seller)
  • The extra hidden cost when buying something (paypal fee, visa fee, bitcoin’s miner fee,…)
  • The shipping and handling
  • The insurance
  • The customs charge (don’t forget about this one!!!)
  • extra cabling (ASIC’s draw a lot of electricity, you might need to check your wiring and circuit breakers out with a certified electrician)
  • networking (your ASIC will need to be able to connect to an online pool)
  • maybe a controller (for example, most avalon miners need a seperate controller, you might also need your own node if you want to solo mine)
  • shelving
  • cooling (1Kw of mining equipment will produce 1Kw of heat… You need to keep your mining room cool… Either natural cooling, or by installing power hungry A/C equipment)

Last but not least, you need to realise the biggest manufacturer of ASIC machines, bitmain (makes the antminer product line) has a horrible record of customer service.
A lot of bitcoin-related fora are filled with horror stories of people receiving refurbished or already-used ASIC’s when buying new equipment. There are stories of DOA’s that don’t get replaced, there is a standard 3 month guarantee,…

It’s a chinese company, and it seems they have a different warrantee standards as the ones most European and American residents are used to…

Conclusion

Mining is fun, it teaches you about the bitcoin protocol, it’s a great hobby, it helps to decentralise the network… BUT, it can only be done using an ASIC.

Even worse, if you want to make money with mining, you need to buy a latest gen ASIC AND have a super cheap electricity rate… Do all your calculations before even thinking about mining, it will save you from a big hangover afterwards!

References:

[1] https://en.bitcoin.it/wiki/Non-specialized_hardware_comparison
[2]http://ark.intel.com/products/71992/Intel-Xeon-Phi-Coprocessor-5110P-8GB-1_053-GHz-60-core
[3]http://www.coinwarz.com/calculators/bitcoin-mining-calculator/?h=0.14&p=0&pc=0&pf=0.00&d=559970892890.83800000&r=12.50000000&er=1780.43200000&hc=0.00
[4]http://www.coinwarz.com/calculators/bitcoin-mining-calculator/?h=0.02&p=130&pc=0.01&pf=0.5&d=559970892890.83800000&r=12.50000000&er=1780.43200000&hc=0.00
[5]http://www.coinwarz.com/calculators/bitcoin-mining-calculator/?h=0.865&p=860&pc=0.00&pf=0&d=559970892890.83800000&r=12.50000000&er=1780.43200000&hc=0.00

How to sign a message with a BIP38 encrypted paper wallet

Altough not so very common, it might be necessary to sign messages using only a paper wallet… Some people claim it’s impossible to do without compromising your key, and having to sweep your wallet.
However, i found a way to do it with minimal risk and exposure… Here’s how it works:

Preparation:

  • Find your bip38 encrypted paper wallets, place them on your table
  • Download the bitaddress sourcecode from https://github.com/pointbiz/bitaddress.org/archive/master.zip
  • Download the latest working brainwallet.org sourcecode (this is not the head branch) from https://github.com/brainwallet/brainwallet.github.io/archive/f7679dd03f39a04edced641960a7c3df1116fea9.zip
  • create a new textdocument using your favorite editor (gedit, notepad2, nodepad++, wordpad, nano, jed, vi,…), insert the message you want to sign in this textdocument and save
  • Disconnect from the internet (even reboot afterwards, make sure you are disconnected!!!)

Procedure:

  • While being disconnected, unzip the sourcecode of bitaddress.org and brainwallet.org
  • While being disconnected, open the bitaddress.org.html of bitaddress.org using a browser that is relatively safe (a fresh chrome, opera, firefox installation will probably do)
  • While being disconnected, in your browser, click on “wallet details”, manually copy the private key from your paper wallet in the “enter private key”-field, press “view details”
  • While being disconnected, you will see a new input field emerging, enter your bip38 passphrase
  • While being disconnected, open a new tab in which you open the index.html of brainwallet.org
  • While being disconnected, at the top of this page, there is a “sign’-tab => click it
  • While being disconnected, copy the Private Key WIF from the bitaddress.org tab to the brainwallet.org tab’s private key field
  • While being disconnected, copy the message from your textdocument in the message-field, click “sign message”
  • While being disconnected, copy the signed message to your textdocument and save
  • close your browsers, close the text editor
  • REBOOT
  • reconnect to the internet… The saved message can be found in your text document 😉

Ledger Hw.1 review

A while ago, i bought my first hardware wallet: a Ledger HW.1. Since then, the product has been sold out, so it’s allmost impossible to get your hands on one, but i still want to make a quick review for legacy purposes.
The Ledger Hw.1 was one of the cheapest hardware wallets available at the time i purchased one. The total cost was around 25 euro, this included shipping.

Ledger Wallet protects your bitcoins

A couple days after ordering, i received my Hw.1. First thing i noticed was the professionalism of the packaging, the sealed box, the instruction sheet,… Altough the dongle was just a couple mm thick, it did feel quite sturdy, especially considering it’s price. Creating an initialisation distro on USB, getting it to boot and electrum integration were a bit difficult, but ledger’s knowledge base had all the info ever needed. The biggest downside was the fact that the Hw.1’s chip only supports BTC.

Pros

  • cheap
  • professional looking
  • works great
  • works with my electrum wallet

Cons

  • a bit harder to find the init usb image
  • a bit harder to get the Hw.1 to work on linux
  • electrum integration was a bit “hands on”
  • it’s sold out

Ledger Wallet protects your bitcoins