Free Cryptocurrencies

BTC ETH XMR LTC DOGE BCH ZEC DGB BTX BLK DASH PPC XPM POT

Thursday, September 28, 2017

Complete Explanation of The Role And Function Of Bitcoin Miners

As I explained in the previous article that the actual Bitcoin Mining is a mine activity using a particular device. The process through solving a series of mathematical problems (puzzles) based on certain difficulty levels. Well this activity is called "Mining" or cool term is "Bitcoin Mining".

 pic by coindesk.com

 So what are the miners doing? When someone connects to a Bitcoin network using a device, the node will perform a series of tasks. The tasks performed are:

1. Listening to deals

All nodes that are connected in the Bitcoin network must listen to all transactions that occur. Followed by validating the audited transaction. By checking the digital signature. It is related to the truth of digital signatures and the output included in the transaction must be completely un-spent (not yet issued in other transactions-ensuring no double spending).

2. Keep Blockchain and listen to the new block created

A miner, actually serves to keep the blockchain. Related to handling all transactions that occur. Miners too, will retain Blockchain which has kept all transactions. Miner, can request all history of the block to another node that has entered before it entered into the network. Listen to new blocks that are broadcasted within the network, then validate the received blocks. Because in the block there is a series of transactions, then every transaction that is in the block and even then also must be validated, and valid.

3. Create a new block candidate

Once we have a full copy of the block chain (blockchain), then we can start building blocks. To do so, by grouping all the transactions we hear into the new block, which can later expand on the block we know. However, we must also ensure that all transactions within the block are valid.

4. Finding Nonce to be a valid block

After we validate all transactions in the candidate block, then is looking for nonce in order to make the block become valid. The step here is the most difficult step faced by miners.

5. Hope Blocks are accepted

This is the second difficulty encountered. So if we find a new block, there is no guarantee that the block will be part of the blockchain consensus. Miners need luck here. Expect other miners to accept the proposed block. So we can start mining above the block. So not on other miners' blocks.

6. Receive Advantages

If it turns out that other miners received our block as a valid block, then this is the moment that makes the miner smile satisfied after doing the hard work. Because if our block is received, it will get a reward of 25 Bitcoin (which is still valid at this time). In addition, if several transactions within the block are listed transaction fees, the miner can collect all the transaction costs.

So clearly, that mine is not interpreted as in the search for Bitcoin in faucet, giveaway or the other. However, mine here means using a certain tool, which in the process of doing the six things mentioned above.

Let's continue again. Of the six things, we can classify in two ways.

1. Some of those tasks are to validate the transaction

Serves to help Bitcoin network as a most important function for Bitcoin and Blockchain system can continue to run and exist. So miners, is the main thing that will run all the Bitcoin protocols.

2. Other tasks to compete with each other to find new blocks and make a profit

Why race each other? because basically, this is the most difficult. In addition, it is also associated with the reward incentive block that will be accepted. For those who managed to find new blocks. So it is likened to a race to find and find new blocks. And the incentive given, used as a stimulus of the miners in doing his work.

Then how can i find a valid block? to answer this question, it will be related to the Nonce that must be found in order to be a valid block. We need to understand that in each header block, it will point to the previous block header. And within each block, there will be a merkle tree of all transactions inside the block.

Miners, first compile a set of valid transactions, owned from the pending transaction pool (pool of pending transactions or so-called mempool), then entered into the merkle tree.

Well, in this case, a miner can enter many transactions, until the whole reaches a total of less than 1megabyte (current block size limit). Then, create a block header that shows the previous block.

In this block header, there is a nonce size of 32 bits. So the miners can try this nonce many times. The goal is to find one that can cause the hash of the block to be below the target. Usually to start trying the nonce, can be started with a value of nonce 0. Then the miners can try in succession with the increase of the number until managed to find a nonce that will be able to make a block to be valid.

Generally miners will try every possible value from bit 32 for the nonce. However, there may not be a single one that can generate valid hashes. Well, in casuistic like this, usually the miners will make a change.

The change is a change to the Coinbase transaction, which allows miners to change the value of 32 bits. Because there is an additional nonce in the coinbase transaction. After changing the additional nonce in the coinbase transaction earlier, the miners can start looking for nonce again in the block header.

If you have made a nonce change in the transaction coinbase, then all merkle tree must also change. Why is that? Because the nonce changes will spread to all paths in the merkle tree. So, it can be said that additional nonce changes, its nature as if more difficult than changing the nonce in the block header.

Why is it more difficult? because miners so much time to change the nonce in the block header. It could be that, when it has finished changing the nonce in the block header, they have not been able to find a valid block. That's why this extra nonce conversion is even more difficult. Although it can be done as an alternative way, if you can not find the possible value in 32 bit earlier.

Although difficult and most probably will not work, but if the miners try to keep trying, it may be able to find a proper combination of additional nonce in the coinbase transaction. So the nonce in the block header can generate the correct hash below the target. If the miners can find out, the miners can immediately to announce, and hope to be accepted to get rewards.

Then there is the question that arises:

  • What target actually explains the hash target must be under the target?
  • Do all miners solve the same puzzle?
  • If one miner managed to solve, would the fastest miner always win to find the next block?
The 2nd and 3rd answers are "No". It is impossible for miners to work on the exact same block. Since the blocks are one with the other, of course there will be a different order of transactions. So of course the puzzle is not the same. And most of all, if there are two miners working on blocks whose transactions are identical though, the blocks will remain different.

In a coinbase transaction, miners will determine their own address within the coinbase transaction. This address will make changes to the roots of the merkle tree. So it is certain that no two miners are working on the same puzzle. Unless they share public key. Sharing or sharing this public key, in mining can be done if both miners are part of the same pool mining. So between the two will be able to communicate with each other, whether they include a different nonce in the transaction coinbase. The goal is also to avoid duplication of workmanship.

Well on answer number 1 on target, this will relate to the difficulty level. Let's discuss it.

Degree of difficulty

What is the difficulty level for finding valid blocks? All we have to remember is that miners will try to get the diiginkan. Ie the hash value must be lower than the target. Say, the miner is trying to find the block hash + random number in base16, which is lower than the target.

Target -> as described at the beginning, relates to the difficulty level. While this target is bit 256 on base16. So this target will be lower in value, so the level of difficulty will also increase. So that means, the level of difficulty is the lower the value of the target. Up here clear yes? Let's continue in more detail.

Take, for example, at one time the difficulty level in hexadecimal is:

0000000000000000172EC00000000000000000000000000000000000000000 (base16)

or if in a converted base10 is:

568436119447114618883887501211268589217582000336195813376

If the miners get their hash in base10:

568436119447114618883887501211268589217582000336195813376+ 1,

then that means the miner is unsuccessful, and should try again, try again, and again, until it finds a value lower than its target.

Determination of Difficulty Levels

The difficulty level will change each time until 2016 blocks. The time range is approximately 2 weeks. The change of difficulty level, adjusted from how efficient the miners during the previous 2016 block period. So this kind of calculation of the difficulty level in mining Bitcoin:

x = (y * 2016 * 10 min) / (z)

x = Next Difficulty Level
y = Difficulty Level Previous
z = The time taken to mine 2016 the last block
10 minutes = average creation time of 1 block

In the above calculation, 2016 * 10 minutes will result in exactly 2 weeks time. So that 2016 block will be created later will take approximately 2 weeks. The effect of calculating the above difficulty level changes, determining the scale of difficulty level that might account for a block being found within the network. That is in the average time of 10 minutes.

Each Bitcoin miner will calculate the level of difficulty. And it will only accept blocks that meet the criteria at the level of difficulty they can count. Miners who are in different branches, may not count the same difficulty value. But basically every miner in mining over the same block will agree on the degree of difficulty. So as to enable the achievement of consensus within the network.

Bitcoin's mining difficulty will continue to increase. But the increase will not always be stable and linear, but depends on the activities of its miners, also on the situation in the market. There are several factors such as how many new miners are joining. So it could affect the exchange rate of Bitcoin at the time.

As new miners join the lot, and the mining level is further supported by the emergence of more efficient devices, blocks will be found more quickly. So the level of difficulty was so increased. Then the time it takes will always be around the average in 10 minutes to find and create a new block.

What if in finding blocks, it takes an average of more than 10 minutes?

If this happens, then the difficulty level will drop. Thus, the average conditions for the creation of new blocks within 10 minutes, will affect whether the difficulty level will rise or fall. For example, if the average creation of blocks in 2 weeks is faster or less than 10 minutes, then the difficulty level will increase and adjust. But if the average is greater than 10 minutes, then the difficulty level will decrease.

1 comment:

Leave your Comment Here