The image below is an example of the screen that appears when your
Bitcoins have been sent. There is some text in roughly red marked area
in that image saying “0.00022368 BTC" as a transaction fee to miners.
In order to understand how Bitcoins are mined and why you should pay that transaction fee to miners, read this whole article!
Whenever you start your transaction, there will be a transaction request (i.e. digitally signed message which is carrying your bitcoins) created and it is sent to the miners. Now, I have created a scenario in order to explain the mining process! The words in bold text will have a special significance and will help us to corelate with the actual Bitcoin terminologies later on.
Imagine your transaction request as a letter ( or a courier). Miners collect your letter and put them in a machine. Just like yours’, there might be thousands of such letters from people all around the world! They collect all these and put them in the same machine! They also put some other stuff in this machine. Now, what does this machine do? This machine is designed in such a way that it puts all the letters and other stuff in a box and packs it. After packing the box, the machine sticks a label on it. This label contains a unique serial number which represents the items which are contained in that box. So, we can say that this machine’s work is to pack the box and give a serial number to it!
Now the scenario is looking something like this!
Now, the weight of this box is measured. Let us assume that there is some relation between the serial number given to the box and it’s weight. We (You and me) will create a rule: If this weight is less than a certain limit (for example, the limit can be 2 Kgs), then and only then this box is allowed to be kept in the godown (warehouse). If it exceeds the limit, then a small change is made to the contents of the box so as to keep the weight of the box less than the limit and then it is allowed to enter the godown.
Basically, we have these words from our scenario which are in bold: Letters, machine, other stuff, box, serial number, weight, godown (or warehouse), limit, small change.
In reality (i.e. in actual bitcoin mining), the above same process is taking place digitally! Now let’s try to connect the above scenario with the reality! Now I will replace some of the words mentioned above. In the Bitcoin mining terminology,
You can convert anything into a 256-bit hash (i.e., the input data can be an audio file, video file, a simple text or anything). For example, I have generated a 256-bit hash for the text “ReadBit” which comes out to be “57f062988ce63e000c7728e1cdda48637c7c205a76814cca662ad83d8fa2ef3a”.
In the above scenario, I was referring Block as “box”. According to Wikipedia definition, ”Blocks are the files in which Transaction data is permanently recorded”. This is what I explained in simple words: Letters (transaction data) are put inside the box (block). Now, are you getting the point that why we have created the above scenario? Yes? Good! Read on…
Hash of a Block (“serial number of the box”) in Bitcoin mining looks something like this: “00000000000000000230b7a46ca4f44b17e7e20da5630438269b2a9f94a567d9”
In the explanation at the initial stage, I have also mentioned that there are some “other” stuff going into the “box”. Let’s see what these “other” stuffs are! The “other” things include:
Now, this part is the climax to our journey! Here you will come to know the purpose of doing all the above processes.
Here is a ‘Game’ that all miners play every second! Now, as you read the paragraph below, you start remembering the scenario that we created earlier.
The miners put your transaction data and everything mentioned earlier, in the block and they will hash it! There is something called as a target in Bitcoin terminology (and in our scenario above, it was called as “limit”). Target is also a 256-bit string which all of the Bitcoin software and the miners in the Bitcoin network share with each other! Target is always a constant and it is changed only at a certain condition.
Now the rule of this game is, if the hash (weight of box) obtained for the block (box) is less than (or equal to) this target (limit), then and only then the block is added in the block chain (warehouse) and the miner who has done this first will be rewarded 12.5 new Bitcoins!! This is how new bitcoins are created (mined)!!!! It is like a competition between the miners! All Bitcoin miners out there are constantly racing each other!
But, wait. It not that easy! Getting the hash value less than the target is very difficult task. If the hash value is not less than the target, then miners will change the value of nonce and will hope that this time they will get the hash less than the target and they again start the hashing process from the beginning! Here, nonce is a 32-bit random number. The actual work of every miner is to find an appropriate nonce which will make the hash less than the target. So, the nonce is varied millions of times per second and this computation process requires high amount of computer power.
Every time the nonce is changed, a new hash is formed. This hash is compared with the target. If hash is more than the target, then again the nonce is changed and a new hash is formed. Again the comparison is done with the target and if the hash is now less than target or equal to target, then the miner will get 12.5 Bitcoins as reward! After this, the block (which has won those 12.5 bitcoins for the miner) is finally placed in the block chain and the transactions which were included in that block will get confirmed and sent to their respective Bitcoin addresses. As the miner (who has won) has spent his time for putting the block in block chain and confirming your transactions, he will charge you a small amount of transaction fee.
The websites which say, ”Bitcoin mining involves solving mathematical problems” are actually talking about the mathematical operation involved in creating the hash, changing the nonce and comparing it with the target.
So, now you know what Blockchain is and how Bitcoins are mined!
Thanks for reading.
In order to understand how Bitcoins are mined and why you should pay that transaction fee to miners, read this whole article!
Whenever you start your transaction, there will be a transaction request (i.e. digitally signed message which is carrying your bitcoins) created and it is sent to the miners. Now, I have created a scenario in order to explain the mining process! The words in bold text will have a special significance and will help us to corelate with the actual Bitcoin terminologies later on.
Imagine your transaction request as a letter ( or a courier). Miners collect your letter and put them in a machine. Just like yours’, there might be thousands of such letters from people all around the world! They collect all these and put them in the same machine! They also put some other stuff in this machine. Now, what does this machine do? This machine is designed in such a way that it puts all the letters and other stuff in a box and packs it. After packing the box, the machine sticks a label on it. This label contains a unique serial number which represents the items which are contained in that box. So, we can say that this machine’s work is to pack the box and give a serial number to it!
Now the scenario is looking something like this!
Now, the weight of this box is measured. Let us assume that there is some relation between the serial number given to the box and it’s weight. We (You and me) will create a rule: If this weight is less than a certain limit (for example, the limit can be 2 Kgs), then and only then this box is allowed to be kept in the godown (warehouse). If it exceeds the limit, then a small change is made to the contents of the box so as to keep the weight of the box less than the limit and then it is allowed to enter the godown.
Basically, we have these words from our scenario which are in bold: Letters, machine, other stuff, box, serial number, weight, godown (or warehouse), limit, small change.
In reality (i.e. in actual bitcoin mining), the above same process is taking place digitally! Now let’s try to connect the above scenario with the reality! Now I will replace some of the words mentioned above. In the Bitcoin mining terminology,
- letter is your transaction request.
- The packing machine is SHA-256 (SHA-256 is an algorithm)
- The box is called as a block
- serial number and weight refer to hash (not the Twitter’s hash, of course).
- Hash is a string of random numbers and letters!
- SHA-256 is an algorithm which is used to create this hash! You can add any number of data and it combines all those data and creates a unique Hash! SHA stands for ‘Secure Hash Algorithm”.
You can convert anything into a 256-bit hash (i.e., the input data can be an audio file, video file, a simple text or anything). For example, I have generated a 256-bit hash for the text “ReadBit” which comes out to be “57f062988ce63e000c7728e1cdda48637c7c205a76814cca662ad83d8fa2ef3a”.
In the above scenario, I was referring Block as “box”. According to Wikipedia definition, ”Blocks are the files in which Transaction data is permanently recorded”. This is what I explained in simple words: Letters (transaction data) are put inside the box (block). Now, are you getting the point that why we have created the above scenario? Yes? Good! Read on…
Hash of a Block (“serial number of the box”) in Bitcoin mining looks something like this: “00000000000000000230b7a46ca4f44b17e7e20da5630438269b2a9f94a567d9”
In the explanation at the initial stage, I have also mentioned that there are some “other” stuff going into the “box”. Let’s see what these “other” stuffs are! The “other” things include:
- The hash of previous block.
- In the “other” things (apart from hash of previous block), the block also contains a timestamp.
- The block also contains Nonce!
Now, this part is the climax to our journey! Here you will come to know the purpose of doing all the above processes.
BITCOIN MINING: The Game of luck
Here is a ‘Game’ that all miners play every second! Now, as you read the paragraph below, you start remembering the scenario that we created earlier.
The miners put your transaction data and everything mentioned earlier, in the block and they will hash it! There is something called as a target in Bitcoin terminology (and in our scenario above, it was called as “limit”). Target is also a 256-bit string which all of the Bitcoin software and the miners in the Bitcoin network share with each other! Target is always a constant and it is changed only at a certain condition.
Now the rule of this game is, if the hash (weight of box) obtained for the block (box) is less than (or equal to) this target (limit), then and only then the block is added in the block chain (warehouse) and the miner who has done this first will be rewarded 12.5 new Bitcoins!! This is how new bitcoins are created (mined)!!!! It is like a competition between the miners! All Bitcoin miners out there are constantly racing each other!
But, wait. It not that easy! Getting the hash value less than the target is very difficult task. If the hash value is not less than the target, then miners will change the value of nonce and will hope that this time they will get the hash less than the target and they again start the hashing process from the beginning! Here, nonce is a 32-bit random number. The actual work of every miner is to find an appropriate nonce which will make the hash less than the target. So, the nonce is varied millions of times per second and this computation process requires high amount of computer power.
Every time the nonce is changed, a new hash is formed. This hash is compared with the target. If hash is more than the target, then again the nonce is changed and a new hash is formed. Again the comparison is done with the target and if the hash is now less than target or equal to target, then the miner will get 12.5 Bitcoins as reward! After this, the block (which has won those 12.5 bitcoins for the miner) is finally placed in the block chain and the transactions which were included in that block will get confirmed and sent to their respective Bitcoin addresses. As the miner (who has won) has spent his time for putting the block in block chain and confirming your transactions, he will charge you a small amount of transaction fee.
The websites which say, ”Bitcoin mining involves solving mathematical problems” are actually talking about the mathematical operation involved in creating the hash, changing the nonce and comparing it with the target.
So, now you know what Blockchain is and how Bitcoins are mined!
Thanks for reading.
Comments
Post a Comment