Nowadays, the bank is the one that keeps records of monetary transactions we carry out in our daily life. That is a centralized entity that controls everything relative in our economy.
In the model proposed by Blockchain technology, these financial records are carried out by the whole network, that is, in a decentralized way, a method that provides honesty, transparency, and security.
This network is made up of thousands of nodes – several interconnected computers – whose duty is to verify transactions and add them to the blockchain in a public way, which prevents fraud.
This method of keeping records on which Ethereum, Bitcoin and the rest of the cryptocurrencies are based avoids, among other things, the possibility of making double spending of the same money, a problem that went unresolved for a long time.
However, the mining process changed the scene.
What is mining?
Mining is the act of verifying transactions within a blockchain.
Miners must use their powerful computer equipment to compete with each other and find the solution to complex mathematical problems before the rest.
Whoever manages to find that solution will have solved the problem, so the transactions will be verified and added to the blockchain.
As a reward, they will receive a specific amount of the cryptocurrency they are mining.
This is done through the ‘Proof of Work’ system, but…
What is ‘Proof of Work(PoW)?
Proof of Work (PoW) is a method to avoid malicious behavior in a blockchain-based system.
To do this, miners must do work that is very expensive for them, but easy for the rest of the community to verify. This work is computational -computer-related- and it costs them processing power, which can be turned into time, electricity and hardware.
How does mining work?
To understand how mining works through this method we will divide it into several sections.
Receive transaction requests
On a Blockchain-based platform, each user can have one or more public addresses known as wallets.
Each public address has a private key associated with it. For easier understanding, this key could be something like our fingerprint, and the public address would be our smartphone.
Just as only we can unlock our mobile with our fingerprint, in a blockchain, only the holder of that private key is able to digitally sign a new transaction request.
To make one of these requests, we must first have cryptocurrency entries. In other words, to transfer – for example – Ether, we first need to get Ether either buying it or transferred to our address. After that, we can use it to finance a new transaction.
The miners collect all valid transaction requests and then go on to verify that the data from these transactions match.
Verification of data
When they receive a transaction request, the miners check two things: first, that we have previously received in our wallet that amount from Ether, and second, that we have not already spent it.
To verify this information, the miners go to the copy of the blockchain that each of them stores in their computer, which has recorded all the movements since its inception. In this way, they can know with precision if the operations can be carried out.
Therefore, we could compare the role of the miners with the role of bank ATMs: they inspect the “checks”, making sure that all the corresponding signatures and account numbers are correct, checking the identity of the customer, and looking for evidence that there are sufficient funds to carry out the transaction.
Completing a block
Once the data has been verified, the miner will add that valid operation to his transaction block.
To avoid the difficult task of corrupting a blockchain, its protocols make miners have to compete with each other to find the solution to the mathematical problem.
Once that solution is found, the block will become a part of the chain and this will happen every time most miners reach the consensus that:
The transactions recorded by the miner are valid, and
That he has correctly guessed the value “Nonce”, a special number that solves this mathematical problem.
The community of miners checks this data through the digital signature of the winning block.
But what is “Nonce” and digital signatures?
Digital Signatures and Nonce value
Digital signatures are like the “fingerprints” of a block: they bring all the relevant information to that block and to the previous ones.
They consist of three entries:
The digital signature of the previous block
The list of transactions valid from the previous block
The Nonce value
With these three entries, miners can add their block of transactions to the blockchain for validation and confirmation by the rest of the miners.
These digital signatures operate through the use of hash functions: mathematical equations that take any given input and create a single output for that particular input.
To see how the hash operates, we will give an example based on the hash function “SHA256“, which is the one used in Bitcoin.
If we go to an online hash calculator and put the input text “Miethereum” (without quotes), it will create this hash as an output:
This means that any slight change in the input will drastically change the output.
Therefore, if the entries for the digital signature of a new block are the signature of the previous block, a list of recent transactions and the Nonce, the output will have a unique value that can only be obtained with the correct data.
All miners know the first two entries but do not know the Nonce value.
Finding it is the reason they compete and this is done through their computer equipment.
This is where the ‘Proof of Work‘ system comes in.
To guess this Nonce value, miners begin mathematical calculations: they create hashes from the two entries they know along with random Nonce estimates.
It is as if, for example, they were testing with a Nonce value of ‘1’. If the result is not correct they go on to test with ‘2’, and so repeat this process by ” test and error” until one of them finds this data that completes the exact digital signature of the new block.
Every time a miner solves this ‘working test’, he will transmit the block to the whole network. The rest of the miners should check that both the operations included in the block and the digital signature are valid.
If the great majority approves it, the block will be added to the blockchain in an immutable way.
After this, the miners will begin again to compete to find that new Nonce value that solves the new ‘working test’, knowing the other two necessary entries: the digital signature of this last block and the new transactions carried out in the network.
In Ethereum, the target of this is to add a new block every 15 seconds on average.
To prevent blocks from completing too fast or too slow, the protocol is reset after each block is added to make it easier or harder to guess the Nonce value.
That is, if the winning miner has taken less than 15 seconds, it means that it has been “easier than normal” so the difficulty of mining will increase for the next block. The opposite will happen if it takes longer than that time.
Reward for mining
Having understood all of the above processes, we will also understand why miners perform this task.
As every worker get his or her own salary, the miners also need compensation for theirs.
In each cryptocurrency it is different, but in Ethereum it is given at the rate of 2 Ether for each block mined.
In addition to this “salary”, in each transaction carried out in Ethereum, Ether’s issuer must “pay” a commission to the miners as compensation for the computational expense of their equipment called Gas.
Miners also occasionally receive Uncles reward for mining an uncle block.
Uncle blocks are old blocks whose parents are at a maximum of six blocks before the current block and are rewarded to stop the delay that occurs as a result of spreading a valid block to the entire network.
Miners receive ‘X’ parts of the Ether from the static block reward – or 2,625 Ether – for each uncle block included in a block, with a maximum of 2 uncles allowed per block.
In order to establish what we have learned, we will summarize the 8 steps of mining.
Receive transaction requests
Verify that these can be carried out
Store valid transactions in a block
They compete by performing calculations to find the value Nonce
Whoever gets it, spreads his block to the rest of the miners.
If the majority considers it valid, it is added to the blockchain.
The winning miner receives the reward of the block
What is mining for?
The main goal of mining is to keep the network stable through the general consensus of the network.
But it also serves to prevent the following types of attacks:
Denial of Service (DoS)
Denial of service (DoS) is a specific attack on a computer network that causes a system to become inactive. They are carried out by sending large packets of information simultaneously to a network, which as a result becomes saturated and causes ‘denial of service’.
The extension of this attack is the so-called DDoS -Distributed Denial of Service-. The main difference with its predecessor is that it is carried out from several computers to a single server, consuming all its bandwidth and leaving it inoperative.
The Ethereum network and any project based on Blockchain is susceptible to such attacks.
However, the mining process itself and the miners in particular act as “guards ” to filter the flow of transactions made and reject those that are malicious.
Spam, as we know it colloquially, would be the typical email with advertising that we usually receive repeatedly. It could also be the message that we find in a forum and that has nothing to do with its subject matter.
However, in Ethereum network, Spam refers to the repetition of multiple transactions at the same time.
For example, someone might try to spam by sending thousands of low-cost transactions simultaneously to destabilize the network. However, transactions with very low costs are often not confirmed.
To prevent this, Ethereum uses the ‘Gas‘ system, so that each transaction has a minimal cost, which can increase depending on the complexity of the operation.
Therefore, spam in Ethereum is possible but it is costly and useless in equal parts since the attacker would have to spend a large amount of Ether to carry it out and the reward obtained would be much less than what was spent.
The so-called double spending is a failure that occurs by default in systems based on Blockchain, which consists of being able to spend more than once the same amount of digital currency. It could be said to be the closest thing to “counterfeiting” cryptocurrencies.
Let’s take an example to see more clearly how it works.
Carlos has in his wallet 1 Ether and sends that same Ether simultaneously to two different people, Diego and Julia. If they are confirmed at the same time, both transactions would be valid, so there would have been double spending of the same Ether.
How is this problem resolved?
Waiting for up to 6 confirmations.
When a transaction is processed, it is added to a block of transactions. Before being added to the original chain, the block must be verified by the rest of the miners. When this block receives confirmations from up to 6 different miners, it can be considered valid.
To prevent double spending, there will be one of those two transactions that will be verified up to 6 times. As soon as that happens, the other transaction will be processed as invalid automatically, so double spending will not be possible.
To carry out an attack of this type, the attacker would need to have control of at least 51% of all network nodes, a task whose economic and computational cost makes it totally unviable.
By avoiding these three risk factors, Ethereum is established as a system:
Honest: Any attempt at self-profit to the detriment of the network will not be approved, so trying to cheat is ridiculous.
Stable: Receiving 6 confirmations of the same transaction, the risk of cancellation is less than 0.1%.
Safe: To manipulate the network is necessary to have 51% of the mining power of it, something almost impossible from the technological and economic point of view.
How to start mining
We will explain the steps to follow to start in the world of mining.
Create a digital wallet
First of all, we need to create a wallet for receiving our mining rewards.
Important: we must have the correct wallet for each cryptocurrency we want to mine. For example, we cannot use a Bitcoin wallet to receive Ethereum and vice versa.
If we do not do it correctly, our rewards will be lost forever.
Choosing hardware for mining
The next step is to get special hardware for full-time mining.
There are three types of hardware for mining:
ASICs (Application-Specific Integrated Circuit) are chips whose function is to perform a specific and particular task. These machines are the most widespread in Bitcoin mining.
The CPUs (Central Processor Unit) or Central Processing Unit is what we know as the processor of a computer. Of the three options, this is the least powerful and is hardly used for mining.
The GPUs (Graphic Processor Unit) is what we call a computer’s graphics card. They have a higher hash rate than CPUs, which means they can solve mathematical problems faster.
To increase our chances of success in mining it is possible to create a ‘Rig‘ (mining platform). The ‘Rig’ consists of adding several of these machines to multiply our mining power and our chances of success.
Before choosing our hardware to mine cryptocurrencies, we should consider different factors such as the hash rate, the initial cost of the hardware, its electricity consumption and its profitability.
This last factor will be discussed later. However, to help us do the math, mining profitability calculators such as Coinwarz or What To Mine show us the probable amount of cryptocurrency we can earn with certain mining power.
If the result is positive when comparing the estimate obtained with the initial costs – equipment purchase, installation, electricity consumption, etc. – then it will compensate for the investment. Otherwise, it would not be interesting, unless we mine for the simple pleasure of learning.
What is the most commonly used hardware?
Depending on the cryptocurrency we want to mine, we will use one hardware or another.
For the majority of crypto mining, GPUs are the ones to use. However to mine Bitcoin and other currencies based on the SHA256 algorithm we will use ASIC chips. In the following lines, you could see a list of the 5 best GPUs and the 5 best ASIC chips on the market.
Another option to mine a wide range of crypto coins would be Minergate. In our step-by-step guide, we tell you how to start mining on this platform in just 5 minutes. In addition, it allows installation on Windows, Mac, and Linux.
Join a ‘mining pool’
Let us be honest: it is very unlikely that you will get cryptocurrencies by mining on your own.
On blockchain platforms, there is fierce competition for rewards, and only the miners who have the best machines will have the most options.
If you are going to start mining now, even if you buy very powerful equipment, there is always someone who will have one more powerful than yours.
So how do we get cryptocurrencies by mining?
The answer is simple: joining a mining pool.
But… What is a mining pool?
A ‘mining pool’ is a group of miners who unite the “strength” of their machines to increase their chances of mining blocks.
If one of these mining pools solves the working test of a block, it will receive the cryptocurrency reward, which will be divided among all its users in proportion to the mining power provided by each one.
For example, if a mining pool has 100 members, but one of them contributes with 50% of the total mining power of the pool, on receiving the reward, half of this will go to that miner.
How do we join a mining pool?
Every software is different, but everyone will have the option to join a mining pool. We just have to choose the mining pool we want to participate in, create an account, add our wallet address to the software we are going to use and that is it.
What are the different mining pools?
In Ethereum, the mining pools most used according to the graph are Ethpool / Ethermine -two different websites but contributing to the same pool-, F2pool, and Dwarfpool, which are the ones that share more than 50% of the power of the network.
In Bitcoin there are more pools than in Ethereum, and therefore the power is more distributed, with the highest percentage having AntPool, BTC.TOP and BTC.com, closely followed by Bixin and BTCC Pool.
The great majority of them are concentrated in China, although they are also distributed across Georgia, Sweden, and the United States, among other countries.
To find out which one to choose, we recommend that you do a good search to inform you of their profitability, payment systems, advantages and disadvantages of each of them.
It would also be helpful to ask in forums, social networks or pages like Reddit.
We have already completed all the steps of the process. All that remains is getting down to work and start receiving our first cryptocurrencies.
But… there is still a big question to answer before taking all the steps we have indicated:
Is crypto mining profitable?
At this point in the article where we already know what mining is and how it works, we must resolve this great doubt.
For people who have never mined for themselves, it might seem from the outside that mining is “the goose that lays the golden eggs”. But, unfortunately, that is not the case.
In order to calculate this profitability we must first keep a few aspects in mind:
It is important to know the cost of electricity in the country you want to mine, which will determine what our variable mining costs will be.
For example, in Spain (in 2018) the average round, 0.11€ kWh (about $0.13).
We have seen above the most used hardware for cryptocurrency mining.
The price of these pieces of hardware can range from about 300 € to just over 2,000 €. So the average price would be around 1.200€ per piece.
Life of the equipment
It refers to the time we will be able to use our hardware before it becomes obsolete.
This depends on so many factors such as the increase in the difficulty of mining. The more difficult, the less efficient our machines will be and in less time they will become useless.
Hash rate -Mining power-
This means the mining power of our equipment. Above we saw that hash rates were between 14-35 MH/s for GPUs and 5-14 TH/s for ASICs.
Value of the cryptocurrency
At the end of the day, if we are mining cryptocurrencies we would like to know the value they have in the market right now or the value they will have in the future.
This is quite speculative, and therefore high-risk.
The reality of crypto mining: aTg’s experience
By studying all the factors we have talked about we can estimate how profitable mining is.
However, it is always better to be guided by the experience of someone who has already lived the mining for a long period. For example, the story of ‘aTg‘, one of the pioneers of crypto mining in Spain, which confirms our worst predictions:
“Mining has never been profitable even when I mined bitcoins. The calculations have to be made in cryptocurrencies, not in euros or dollars, because if you do it in that way you are counting on the revaluation.
Everyone who is trying to convince you of the profitability always speaks to you in euros, but he is not going to tell you how many coins you could have bought at the time of the investment in mining equipment, how much those coins would be worth now, and how much he has mined”.
‘aTg’ is the nickname of one of the most historically retired Bitcoin miners in the Spanish country. This young Catalan has earned respect within BitcoinTalk, one of the most prestigious forums on the Bitcoin scene.
In his early days back in 2011, he hesitated between buying Bitcoin (when they were worth 3 dollars) or buying mining equipment and producing it himself. His doubts did not last long and he soon started mining.
At that time, mining was in a transition period: GPU mining was being left behind to start mining with ASICs. However, in between, it was mining with chips called FPGA.
‘aTg’ had several of these chips assembled in his hometown -Barcelona- which, using them for mining, would bring him a daily profit of approximately 12 bitcoins (about 40 € at the time).
But after a short period of time, things started to change.
The enemies of profitability in mining: halving and increasing difficulty
In crypto-mining, halving is the effect of halving rewards from time to time.
At the beginning of Bitcoin, the reward was 50 bitcoins per block, decreasing to 25 and then to 12.5. This process will continue to occur every 210,000 blocks, this is approximately every 4 years.
The increased difficulty refers to the complexity of finding solutions to the mathematical problems that occur in the mining process.
In Bitcoin, the average block creation is every 10 minutes. If the network hardware causes a block to be mined in 5 minutes, the difficulty of mining will increase to keep block creation at an average of 10 minutes.
After understanding these two factors, ‘aTg’ began to see that mining was not as good business as he initially thought.
If he really wanted to make constant profits he would need to increase his mining equipment regularly and drastically.
At this point, the first ASIC chips were created, with the same power as the FPGA chips but with much lower energy consumption and occupying less space.
aTg realized about this and ordered a number of these ASICs to be built in China in order to adapt to the changes and be able to continue in mining.
His surprise was that, when he received these chips, the increase in difficulty had been massive and he could not even connect them: they were already obsolete. As he said, “they were paperweights that cost me 700 bitcoins“.
Moment when difficulty begins to increase exponentially
Increase in difficulty from 2012 to present. The asterisk (*) shows the same point of the previous graph in time. Data: Blockchain.com
Investigating this fact, he realized that he was not the only one affected by this situation. This was responding to a pattern: Chinese manufacturers took a long time to send ASICs intentionally.
They also mined with those kinds of chips, so why compete with themselves?
They had the perfect system to make money: mining cryptocurrencies with those machines, after a while selling them to their “rivals”. Once they received them, the hardware will be obsolete. In the meantime, they will manufacture the new ASICs with which they will repeat the process.
In this way they Chinese manufacturers “monopolized” the mining of Bitcoin eliminating any kind of competition.
This turned crypto-mining from a domestic activity to an industrial one, which is why the famous ‘mining farms‘ exist today: industrial warehouses with thousands and thousands of ASICs, the vast majority of which reside in China.
This meant ‘Game Over’ for many miners, including ‘aTg’.
Profitability mining in a mining pool
The experience of this Spanish miner occurred at a time when people were mining on their own, trying to compete against the rest of the miners (something that, as we have seen, is impossible today).
But what if I buy mining hardware and join a mining pool? Will it be profitable this way?
We are sorry to say that it is also not a good idea if you are looking for profitability. Let us take a look at it in the best way: with examples and doing numbers.
The first example we bring you is the experience shared by one of the users of the Antpool mining pool through Reddit:
“I used BFGMiner which works through the Mac’s terminal. The system was using both the central processor and the video card generating about 16 MHs/s. It’s a 2014 MacBook Pro, very decent machine for video editing and the likes but it proved to be totally surpassed by the task. The pool I used was AntPool.”
I did it just as an experiment, I’m not that stupid. I know even with an Antminer S9 you’ll struggle to earn real amounts. Anyways, I thought I’d share this if anyone is curious. BTW I know there are calculators out there but I wanted to do a real life test.
And sooo after 33 hours of mining at full performance of a MacBook Pro I earned… 0.00000001 BTC.”
The approximate value of the Bitcoin when the user wrote the post was $1,200, so his reward at that time was the equivalent of $0.000012.
Even if we consider the current situation in which Bitcoin is close to 8,000 dollars, the reward today would have been 0.00008 dollars.
Both the MacBook Pro and a desktop computer could consume a full 50 watts every hour. In addition, if the screen is turned on the consumption is around 19 watts/hour, and if it is turned off, about 0.15 watts/hour.
If we take as an example a computer that is switched on 24 hours, along with a screen that is 8 hours switched on and the other 16 hours switched off we have these results:
Approximately it would cost us about 9.5 kWh per week. Now we need to know the cost of electricity.
This varies depending on the country we are in. To continue with this example, we will consider the average price of electricity in Spain, which is around 0.11€ per kWh.
Cost of daily consumption
0,11 € kWh
Weekly consumption cost
0.11 € kWh
Annual consumption cost
Returning to the example of the Antpool user, if the reward for those 33 hours was 0.00000001 bitcoin equivalent to 0.00009 dollars, in the case of being mining uninterruptedly for one year, the annual reward would be 0.00000265454 bitcoin.
Considering the current value of Bitcoin (about 8,000 dollars), they would be equivalent to 0.02123632 dollars.
In other words, mining an entire year at maximum power with a desktop computer would cost approximately 55 € for a return of one 0.02 dollars.
If we also want to add more hardware for Bitcoin mining, such as an ASIC circuit, then both the initial cost and the consumption increase.
As we can see, the maximum daily profit adding one of these hardware machines is 2.64 € and the minimum is 0.08 €, also having an option that gives us losses.
Now we are going to calculate how long it would take to recover the initial investment of each of those ASICs according to the daily profits:
Return on Investment
The results speak for themselves.
Investing in something that brings us less than €3 a day and needs more than a year to recover the investment is not a good investment.
Comparative chart: Ethereum Mining
Everything seen above is based on the mining of Bitcoin. However, the profitability of mining Ethereum moves in the same direction.
Let us look at the profitability table of the 5 most used GPUs to mine Ether:
Nvidia GeForce GTX 1070
AMD Radeon RX 580
AMD Radeon HD 7990
AMD Radeon RX 480
Nvidia GTX 1080 Ti
The average profit is around 60 cents a day, which is quite poor.
Now let us see how long it would take to recover our investment, according to the cost of the hardware:
Return on Investment
Nvidia GeForce GTX 1070
AMD Radeon RX 580
AMD Radeon HD 7990
AMD Radeon RX 480
Nvidia GTX 1080 Ti
As you can see in the chart, a ROI of one year in the best scenario.
It is important to mention that these data are based on the current mining difficulty (both for Bitcoin and for Ethereum), that is, as if this value was constant over time.
That is not the case. The difficulty increases with time.
So the ROI and daily profit numbers will decrease considerably over time.
Another factor influencing the profitability of mining is the price of the currency to be mined. If it increases, we could compensate for the increasing difficulty of mining because the coins we obtain will be worth more money in dollars or euros.
On the other hand, if the value decreases, the profits will be even lower than what we have seen, making mining something that, apart from not being profitable, would produce losses.
Pros and Cons of Crypto-Mining
After having explained the ins and outs of mining, let’s put them in order and bring out the pros and cons of this activity:
It helps to decentralize the network, leaving aside the centralized method followed by traditional banks for recording transactions.
Makes the network a robust and secure system.
Prevents double spending.
Makes it very difficult for the system to receive spam and denial of service (DoS) attacks.
Expectations are that the value of mining rewards will be worth more over time.
Getting into mining -for economic purposes- requires a high initial investment.
The configuration and setting up of the equipment is quite complex for a person who does not know certain minimums of computer science.
Very high power consumption.
Excessive heat and noise as a consequence of the continuous working of the hardware.
Profitability conditioned to the continuous investment in new hardware and the value of the cryptocurrencies mined.
High risk due to market volatility.
Impossibility of competing ‘one to one’ against mining farms all over the world -especially in China-.
Fast obsolescence of hardware acquired.
Constant increase in the difficulty of mining means that the rewards received are considerably reduced over time.
Another form of mining: Cloud Mining
We have proved that traditional mining is not profitable -at least in some countries-.
However, there is light for all those who still want to mine cryptocurrencies but in a more comfortable, cheap and more profitable way.
This is possible thanks to cloud mining.
Cloud mining is a service that consists of directly contracting hash power to certain mining companies for a certain period of time, thus eliminating the whole complex process of assembling and configuring equipment.
Other advantages of this service are that we would get rid of a large electricity bill, purchase costs or shipping costs, among other things. In addition, we would not have to worry about the obsolescence of our machines with the passage of time.
On the other hand, one of the problems of cloud mining is that there are many companies that are scams. That is why we have to be very careful and know the different providers in order to differentiate which is legal and which is not.
To facilitate this search, we have created two mega reviews of the best providers of these services: Genesis Mining and HashFlare.
Mining is a necessary process for the maintenance of most blockchains.
Not only because it is the method through which the cryptocurrencies are generated, but also because it fulfills the purposes for which Blockchain technology reached the world: decentralization, transparency, immutability, and security.
However, we have already seen that being part of this process is not an easy task:
If we talk about Bitcoin mining, it is practically impossible to enter today, unless we participate through cloud mining services.
Regarding Ethereum mining, although it is still possible to carry it out individually from home, factors such as the constant increase in the difficulty of mining or the poor and slow return on investment mean that we have to think about it more than once when it comes to taking the step. To help you make this decision we must mention that when Ethereum goes from ‘Proof of Work’ to ‘Proof of Stake’ in the Serenity stage, mining in Ethereum will no longer exist and all that acquired hardware will be useless.
It is true that there are not only these two currencies. There are currently more than 2,000 coins on the market and the majority are minable, so the future profitability may be in one – or several – of these cryptocurrencies.
Talking about profitability, we have already seen that the scenario is bleak. We showed this with the example of ‘aTg’, based on its experience in 2011, and the situation has clearly got worse over time.
This is why, if you really believe in cryptocurrencies and in the idea that their value will increase considerably as the experts indicate, our advice is clear and straightforward:
Buy them and keep them.
Or, as the community says, ‘Buy and Hodl’.
After all, it is the most direct, safest and simplest method of participating in this crypto-world.
Mining is for people who want to support and maintain the blockchain of a specific project. Also for the ones who enjoy learning about it and want to mine a small number of coins.
If you finally leave the idea of mining and join the idea of buying you can visit Coinbase.
We leave you below the FAQ about mining with the questions from our subscribers:
A hash function is an algorithm that transforms an arbitrary set of data into a single fixed-length value (the “hash”).
The security provided by a hash algorithm is highly dependent on its ability to produce a single value for a given set of data.
The calculated hash value can be used to verify the integrity of copies of original data without the need to provide that data. This irreversibility means that a hash value can be freely distributed or stored since it is only used for comparison purposes.
What is SHA256?
SHA256 is the security algorithm through which Bitcoin and many other cryptocurrencies work. This hash function, which stands for ‘Secure Hash Algorithm’, is a security protocol that favors mining with ASIC chips.
The number ‘256’ refers to the bits of that ‘hash’ value, a 32-byte (digits) alphanumeric encoding character. This comes from the conversion of 1 byte = 8 bits.
What is Ethash?
It is the algorithm under which Ethereum mining operates and is designed to find solutions to mathematical problems that occur to make mining possible.
This ‘Ethash’ security protocol is a mixture of SHA3 protocols more advanced than Bitcoin (SHA2), and therefore more secure. It is resistant to the use of ASICs due to an increased memory requirement, which means that mining is made impossible with such hardware. Ethash requires processing power and this is achieved through GPU hardware or colloquially known as graphics cards.
It also uses a slightly modified version of the previous Dagger and Hashimoto hashes to eliminate the computational overhead, formerly known as Dagger-Hashimoto.
How does the mining algorithm work in Ethereum?
The basic algorithm of block validation in Ethereum is verified step by step. If a step cannot be verified, an error message will be issued and the block will not move to the blockchain. This algorithm follows the following steps:
Checks if the previous referenced block exists and is valid.
It checks that the time stamp of the block is greater than the previous referenced block and less than 15 minutes in the future.
Check the block number, difficulty, root transaction, aunt root and gas limit (several Ethereum specific low-level concepts) are valid.
Check that the working test of the block is valid.
Set S as the state at the end of the previous block.
Set TX as the block’s transaction list, with ‘n’ transactions, where ‘n’ is the number of transactions. For all i in ..n-1, set S[i+1] = APPLY(S[i],TX[i]). If any application returns an error, or if the amount of gas consumed by the block so far exceeds the GASLIMIT, it returns an error.
Sets S_FINAL to S[n], but adds to the block the reward paid by the miner.
Checks if the Merkle tree root of the S_FINAL state is equal to the final state root provided by the block header. If this is so, the block is valid, otherwise, it is not.
What is a Merkle tree and what does it influence in the mining process?
A Merkle tree represents, in the Ethereum blockchain, each of the blocks in the chain. Each block has the structure of a Merkle tree to condense all the transactions that are going to occur in a block.
The transactions will be linked to a single hash value, which will be the hash of the root node of the tree. This hash of the root node will be signed to ensure its integrity, which is received without any kind of damage, without being altered and for the verification to be reliable.
For each miner, the Merkle root is generally different since the way each miner orders transactions is different and therefore the hashes are different. This means that all miners are not going through the same set of calculations when they apply their equipment in that process.
Data for each block can be delivered in parts: a node can download only the header of a block from one source, and another small part of the tree relevant to it from another source. Although this is possible it does not alter the process of ensuring that the data is correct.
This works because the hashes spread from the bottom to the top of the tree. Explained in more detail, if a user tries to modify a transaction in the lower part of the tree, this change will cause a change in the upper part and then another one in the upper part of the tree. This leads to the change being made up to the root of the tree, and with it, also in the hash of the block.
The protocol will register this block as a completely different one from the string. As a conclusion, it will show this block as invalid.
Can other coins -altcoins- be mined apart from Bitcoin or Ethereum?
Yes, they may be more or less same complex to mine than Bitcoin or Ethereum, but there are currently more than 2000 different cryptocurrencies of which almost 90% are minable.
How does mining contribute to network security?
Mining creates the equivalent of a competitive lottery that makes it very difficult for anyone to add new consecutive blocks in the blockchain. This fact:
Protects network neutrality by preventing any individual get the power for blocking certain transactions.
Secures the network from any user seeking to replace parts of the blockchain to reverse their own expenses, which could be used to defraud other users.
Mining makes reversing a transaction extremely difficult by needing to overwrite all of the blocks following that transaction.
What does "hashing" mean?
The term “hashing” refers to the speed with which the mining hardware processes data from the blockchain and solves the complex mathematical equations needed in the mining process.
What is the hash rate? Is it the same as hashing?
Yes, you could say that the hash rate is the same as the hashing. Also often called mining power.
This hash rate is measured in Hashes per second.
What does H/s, MH/s, GH/s or TH/s mean?
They are abbreviations that represent the hash rate that a machine is producing. The main measure is H/s which means “Hashes per second”. It shows the number of hashes – mathematical calculations – per second that it can perform.
The rest would be units above the previous one:
Megahashes per second (MH/s), which are equivalent to one million Hashes per second.
GigaHashes per second (GH/s), which are equivalent to one billion Hashes per second.
TeraHashes per second (TH/s), which are equivalent to one trillion Hashes per second.
What does W / GH or W / TH mean?
W/Gh and W/Th are abbreviations for ‘watts per gigahash ‘and ‘watts per terahash’. These metrics calculate how many hashes a miner can run per watt of electricity.
The lower this data, the more efficient the hardware. Currently, the machine with the lowest rate of GigaHash per watt is the Antminer S7 (0.25 W/Gh).
Need some help?
We know that the world of cryptocurrencies and Smart contracts is not always simple. If you have any questions we will be happy to assist and advise you.