Site icon farm-bitcoin.com

proof of work – What exactly is Mining?

proof of work – What exactly is Mining?


Miners maintain the immutability property of the blockchain. Proof-of-work makes it so that the cost to “undo” any mined transaction will grow with time. Miners get paid for this service: with block reward subsidy & user’s transaction fees.

You can think of transactions as destroying bills and creating new bills of total same value. Nodes maintain a current database of active bills, and will reject a transaction trying to use an old bill. That’s the double-spend check. It requires look-up / delete / insert operations with the UTXO database.

Popular belief is that miners get paid for the job of verifying and assembling transactions into blocks, but that is wrong. That is a job any node is capable of doing and it doesn’t cost them much. Your RPi node can assemble transactions into a “block template”, but it just can’t fill in the 1 blank that will satisfy the last consensus rule it needs to satisfy to be a valid block – the PoW difficulty check. That’s why you can’t simply kick out one block and replace it with another, because finding that nonce takes time. PoW’s purpose is to increase the cost of undo.

Miners get paid for the job of filling in the nonce that will produce a satisfying block header hash, they get paid for the hashes because the only way to find a satisfying nonce is to make lots of guesses and hash the guesses. The network essentially bids for the hashes with block reward subsidy and users bid for the hashes with their transaction fees, and the more total reward the more secure the whole network becomes* since the cost of “undoing” a block will be bigger because difficulty will grow higher.
(*assuming constant price)

Each transaction is a business transaction with a miner, they’re the recipient of the implicit output (the fee), which is a payment from user for the service of maintaining the immutability property of the ledger! Of course miners would include their own business transactions into blocks they create!

During the early days of Bitcoin, nodes did all these jobs:

  1. Verified incoming transactions and blocks
  2. Made their own transactions and broadcast them to the network
  3. Assembled transactions into a block template (full block, with just the nonce missing)
  4. Filled in the nonce to make the block header pass the PoW check

Since then, the jobs have been separated.

Now it’s mostly pools who do 1-3, and “miners” are just blindly doing the 4.: getting 80 bytes of block header from the pool and grinding the nonce. How do the miners verify what they’re mining? Well, they have to get paid eventually, right?

Miners get paid their reward from the pool, so to independently verify they’re getting paid correctly in proportion to their work, they also need to have some regular node, which can be off-site and doesn’t need to be involved in mining! In that case they run a node to verify they themselves got paid for some past work in the right currency! This gives pools the power to direct hash-power of many as they like, but the pool can’t really hide what they’re doing, so everyone’s on good behavior.

Note that “miners” are not exclusive to a single blockchain network. All Bitcoin miners are sha256d miners, but not all sha256d miners are Bitcoin miners! The era of one blockchain is long gone. Networks bid for the hashes, miners sell the hashes.

What happens if a subset of nodes changes the rules? All nodes under old rules will reject changed rules, and all nodes with changed rules will reject old rules. This happened in 2017 with the BCH fork. If both will be mined, then both will continue to exist independently.
Which will get more hashes? It will depend on market price.

Miners pay for their energy usage and hardware in some external currency, they have to exchange it to pay the bills. If they can exchange the blockchain’s native currency (BTC, BCH) for the cost currency (USD, CNY), and still have something left — then they can make a profit. Their profit depends on there being liquidity for the native currency and the native currency having value! So they don’t just arbitrarily decide which network to mine. They have strong incentive to get a ROI on their hardware, and optimal mining is to mine ALL networks which have a liquid market for the rewards, and in proportion to market value of their block rewards.



Source link

Exit mobile version