Understanding Ethereum Mining and the Need for a Stake/Proof of Work Hybrid Model

By Laura Desmond

Understanding Ethereum Mining and the Need for Proof of Stake.  Mining is the lifeblood of all POW based cryptocurrencies. When miners “mine” to form new blocks to add to the blockchain. Miners use heavy duty computational power to solve cryptographical puzzles to satisfy a difficulty level.

Understanding Ethereum Mining and the Need for a Stake/Proof of Work Hybrid Model

This is one of the most path-breaking mechanisms in blockchain technology. Earlier decentralized peer-to-peer digital currency systems used to fail because of something called the “Byzantine General’s Problem”. The proof-of-work consensus system finally provided a solution to this problem.

 

What is the Byzantine General’s Problem?

 

Ok so imagine that there is a group of Byzantine generals and they want to attack a city. They are facing two very distinct problems:

 

  • The generals and their armies are very far apart so centralized authority is impossible, which makes coordinated attack very tough.

 

  • The city has a huge army and the only way that they can win is if they all attack at once.

 

In order to make successful coordination, the armies on the left of the castle send a messenger to the armies on the right of the castle with a message that says “ATTACK WEDNESDAY.” However, suppose the armies on the right are not prepared for the attack and say, “NO. ATTACK FRIDAY” and send back the messenger through the city back to the armies on the left. This is where we face a problem. A number of things can happen to the poor messenger. He could get captured, compromised, killed and replaced with another messenger by the city. This would lead to the armies getting tampered with information which may result in an uncoordinated attack and defeat.

This has clear references to blockchain as well. The chain is a huge network; how can you possibly trust them? If you were sending someone 4 Ether from your wallet, how would you know for sure that someone in the network isn’t going to tamper with it and change 4 to 40 Ether?

Satoshi Nakamoto was able to bypass the Byzantine General’s problem by inventing the proof of work protocol. This is how it works. Suppose the army on the left want to send a message called “ATTACK MONDAY” to the army on the right, they are going to follow certain steps.

 

  • Firstly, they will append a “nonce” to the original text. The nonce can be any random hexadecimal value.

 

  • After that, they hash the text appended with a nonce and see the result. Suppose, hypothetically speaking, the armies have decided to only share messages which, on hashing, gives a result which starts with 5 zeroes.

 

  • If the hash conditions are satisfied, they will send the messenger with the hash of the message. If not, then they will keep on changing the value of the nonce randomly until they get the desired result. This action is extremely tedious and time-consuming and takes a lot of computation power.

 

  • If the messenger does get caught by the city and the message is tampered with, according to hash function properties, the hash itself will get drastically changed. If the generals on the right side, see that the hashed message is not starting with the required amount of 0s then they can simply call off the attack.

 

However, there is a possible loophole.

No hash function is 100% collision-free. So what if the city gets the message, tampers with it and then accordingly change the nonce until they get the desired result which has the required number of 0s? This will be extremely time consuming but it is still possible. To counter this, the generals are going to use strength in numbers.

Suppose, instead of just one general on the left sending messages to one general on the right, there are 3 generals on the left who have to send a message to the ones on the right. In order to do that, they can make their own message and then hash the cumulative message and then append a nonce to the resulting hash and hash it again. This time, they want a message which starts with six 0s.

Obviously, this is going to be extremely time consuming, but this time, if the messenger does get caught by the city, the amount of time that they will take to tamper the cumulative message and then find the corresponding nonce for the hash will be infinitely more. It may even take years. So, eg. if instead of one messenger, the generals send multiple messengers, by the time the city is even halfway through the computation process they will get attacked and destroyed.

The generals on the right have it pretty easy. All they have to do is to append the message with the correct nonce that will be given to them, hash them, and see whether the hash matches or not. Hashing a string is very easy to do. That, in essence, is the process behind proof-of-work.

 

  • The process behind finding the nonce for the appropriate hash target should be extremely difficult and time-consuming.

 

  • However, the process of checking the result to see if no malpractice has been committed should be very simple.

 

Ok, so now you know what the fundamental principle behind mining is. Now let’s look at how it actually happens.

 

The Different Types of Mining

  • CPU Mining: This is the most basic form of mining. The idea behind CPU mining is simple. Anyone, anywhere can use their computer to mine. While this method is not that applicable anymore, it’s a good entry point

 

  • GPU Mining: Up next we have GPU mining. The GPU, or graphics processing unit, is a part of the video rendering system of a computer. The typical function of a GPU is to assist with the rendering of 3D graphics and visual effects so that the CPU doesn’t have to.The GPUs offer a far more stronger system for mining than the CPU. Some ASIC resistant coins like Monero are mined via GPU.Bitcoin/Ethereum used to be originally mined like this, however this became more and more difficult, as the difficulty increased. We will talk more about difficulty later on in the guide.

 

  • FPGA Mining: FPGA or Field-Programmable Gate Array Mining is the next step from GPU mining. According to this article by Free Learner, FPGA “is a device that has a series of gate arrays (obviously) that create truth tables to calculate inputs from a data stream, and output a desired result. In industry you can use this to optimize an industry process, such as cutting 2x4s from a log, provide machine learning or even to perform DNA sequencing. FPGA’s excel at any task that can be done in a parallel process, such as a mining hash to create an output resulting in a successful hash, and if you’re lucky a successful block.”

 

  • ASIC Mining: ASIC stands for Application-Specific Integrated Circuit and it was created for the specific purpose of mining Bitcoin and Litecoin. The idea of having machinery specifically designed for mining was ahead of its time, so much so that when KNCMiner launched their pre-orders for ASICs they received $25 million in orders in the first 5 hours. Bitcoin and Litecoin is now exclusively mined through ASICs. Bitmain recently released ASICs for Ethereum.

 

How to Build an Ethereum Mining Rig

Alright, now that we have gone through the different types of mining, Let’s set up your Ethereum mining rig!

Before we continue a HUGE shoutout to this article by Antonio Madeira for Crypto Compare.

You will need the following pieces of hardware.

 

  • Motherboard.
  • GPU.
  • Hard Drive.
  • RAM.
  • Power Supply Unit.

 

Motherboard

The motherboard is the base of the mining rig. The amount of GPUs that you can use is directly related to the number of GPU slots that your motherboard has. The more GPUs you can attach to your motherboard the more your hash rate i.e. the rate at which you are computing hashes.

Some examples of good mining Motherboards are:

GPU

Before getting GPUs you need to ask yourself two questions:

  • How powerful do you want your rig to be?
  • How much do you want to spend?

Make sure to get efficient GPUs.

 

Hard Drive

Now, you will need something to store your OS and mining software. For that, you need a hard drive. For this a standard SSD (solid state drive) hard drive will do.

So, how big should your hard drive be? If you are planning to download the whole blockchain, then you should have enough space to compensate for future growth.

 

RAM

RAM or Random Access Memory is required for fast calculation and information computation. A 4GB RAM should be more than enough.

 

Power Supply Unit

The size of the Power Supply Unit (PSU) depends on how many GPUs you are using. So firstly you need to sum up the power consumption of your GPUs and all other components to make sure the capacity of the PSU is more than the sum of your GPUs. So, if you are using 2 220 Watts GPUs and other components are consuming 250 Watts then your PSU must have more than (2*220 + 250) 690 Watts.

 

Software for Mining

Firstly, obviously, you will need to have an operating system.

You can download ethOS which is a specifically designed APP for Ethereum Mining. It is a 64-bit linux distro that mines Ethereum out-of-the-box, allowing you to control all your rigs from a single location, and drill down to specific GPUs where necessary. ethOS supports eth-proxy/stratum immediately upon installation

Comments

comments