MENU

Want to learn blockchains? Build a miner!

December 8, 2016
1527
0

Introduction

One of the best ways to learn something new is to jump right in a get your hands dirty. It’s uncomfortable initially, but after the mud settles, you start to understand concepts that once got your knickers in a twist.

I had always wanted to build a crypto currency miner. Not for profit but to learn how blockchain technology works.

Step 1: Ask Google!

How to build an Ethereum miner. The blogs made the process seem so easy!

It took about a week to figure out how to build a computer and all the acronyms that go with it! This was my first attempt.

2016-12-01-20-27-19

Step 2: Ethereum Software

The first time I saw the Ethereum github repository I literally ran the other way. I couldn’t make sense of pyethapp, go-ethereum, meteor-dapp-wallet, mist, ethereumj, solidity, cpp-ethereum, the list goes on. Check it out for yourself here.

This time I was more focused. All I needed was an Ethereum wallet and some mining software.

Ethereum Wallet

This was fairly simple. I had 3 choices.

  • Mist: A user friendly graphically wallet + browser
  • Geth: A command line interface for programmers. (go)
  • Eth: A command line interface for programmers. (c++)

These are termed the “official” wallets but there are of course many others out there also. Here is a good link to read for more info. For beginners or non programmers I would highly recommend Mist.

Ethereum Mining Software

There are also a few options here.

  • Ethminer
  • Claymore
  • AlethZero (to be phased out)

One of the reasons why it is so confusing is for example AlethZero, the mining software is contained within the cpp-ethereum client, which is an Ethereum client but is now renamed to webthree-umbrella and there is a link to v1.2.9 called “The Village Idiot” but it’s dated June 14 2016. ie old but usable. Did you get all of that?

Step 3: Show me the Ether

I really wanted was to see this thing in action. I therefore had to do the following:

  • Create an address to received the Ether
  • Join a pool
  • Wait

hashingethpool-mining-chart

Above you can see the mining software command line output and the graphical mining results of a pool. Below you can see my mist wallet with 0.22 ether that was mined in ~ 2 days. At the current price of ~$8USD, I may have made $1.6USD but also spent $2USD in electricity!

ether-account

What I learnt about blockchains?

  • How to set up a wallet and create an address. All blockchains need this.
  • The Proof of Work consensus mining algorithm called Ethash.
  • What a DAG is.

Don’t be deceived. Each bullet point is half a days worth of reading, understanding and doing.

Where to from here?

Now with some real Ether, I might go ahead and retry some basic smart contract dapps and building an actual application.