Every blockchain is based on a certain algorithm. The best-known today is Proof-of-Work (PoW), which is used in Bitcoin, Ethereum, Litecoin, Dogecoin, Bitcoin Cash and Monero.
How it works
The miner must use his equipment to solve a complex cryptographic problem to create a new block in the chain. The solution process is a search through millions of possible combinations to find the code, this requires enormous computing power. In the end, a hash is created — some unique value and proof of the miner's work.
Once the hash is found, the miner sends it to the other members of the network for verification. They can validate the hash for the task at hand, but not use it to create a new block - all rights to the hash belong to its developer.
The problem with finding a new hash is its asymmetry: it is difficult to find, but very easy to verify. Each new hash carries information from previous blocks in the chain. This proves that all actions were performed strictly within a particular blockchain system.
A simple example
You know the number of the winning ticket in the next lottery drawing, but you can't ask for a coupon with this particular number - all tickets are sold only randomly. It remains only to buy a lottery ticket, hoping that it will be "lucky". If not, you buy another ticket and so on. You can try as many times as you want, but you have to pay for each new ticket.
Every lottery player expects to get the cherished number before anyone else. Likewise, a miner hopes that he can create a new hash before his competitors and be rewarded with the cryptocurrency of that blockchain.
Disadvantages of the PoW algorithm
- Damage to the environment. Mining is extremely energy intensive. The equipment quickly becomes unusable, computers are replaced with new ones, and the old ones are simply thrown away. Parts dumps are created.
- Insufficient security. The Proof-of-Work algorithm can provide the necessary level of security only if there is a large enough group of miners in the blockchain, and thus competition for rewards. If the network is small, there is a high probability that some hacker will be able to secure most of the processing power and simply reorganize the blocks in the network as he sees fit. Such situation is called a "51% attack".