What is cryptocurrency mining?

in mining •  6 years ago 

There is no actual digging involved :P As we know, a hash function takes a message of any length and returns a fixed length hash which looks quote random. If we change the message even a little bit, the whole hash changes. This is how the cryptocurrency mining works in brief.

We have a block. In top of the block is a hash is a hash of the previous block and a number called Nonce. This is the number we are making up. We start with a number and go up. For example, we start from 1 and go a l the way up. When the block is mined with the nonce, the hash should be small. To mine successfully, the hash of the entire block should be smaller than a fixed length. The length is not constant and varies according to the number of miners in the network. As the length reduces, the time taken to mine increases.

If a miner successfully picked a nonce and the hash is smaller than the expected length, the mining is successful. And, the miner will get a cryptocurrency. Every time, you hash with a differant nonce, the hash value changes. When the cryptocurrency is mined, the transaction will be accepted and the block will be transmitted to the entire network.

The block that the miner has mined will be taken by another miner and will be mined for the next block. Everyone someone stumbles upon a hash that is small enough, the miner will get cryptocurrency and the transaction will be accepted. The That is how the difficulty of the network is changed. The length of the has will be changed. Every couple of thousand of blocks, the network will look at the time that it took to mine it and will change the difficulty of the network.

If more miners have joined the network, the threshold of the hash will be decreased. So, it will take more time to mine. The network changed the difficulty in such a way that a cryptocurrency is mined roughly every 10 minutes. If a bunch of miners go offline and it takes more time to mine, the difficulty of the network will be decreased to compensate it.

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!