officinebitcoin.it

This project is maintained by valerio-vaccaro

Introduction to Mining

Bitcoin mining is a fundamental process of the protocol that serves to propose an order among the transactions present in the mempool, selecting a subset to create a new block and update the blockchain state.

Mining is designed to be decentralized and random (in quotes, since it’s based on a cryptographic puzzle), thus avoiding centralized transaction management.

Purpose of Mining

Mining solves problems related to centralization, such as:

How Mining Works

The mining process can be explained step by step:

Optimizations

To speed up the process, miners can calculate the first SHA-256 on the first 64 bytes of the header (immutable) and then iterate only on the rest, changing the nonce. Specialization has led to hardware (ASIC) that performs billions of attempts per second.

Validation Process

When a miner finds a solution, it transmits the complete block (header + transactions) to the network. Nodes validate:

If valid, the block is added to the blockchain. The reward (coinbase + fees) is spendable only after 100 confirmations (about 16 hours), to ensure stability.

Mining Costs and Rewards

Costs:

Rewards:

The miner must respect consensus rules: an invalid block is discarded, wasting resources without reward. Even a valid block can be “orphaned” if another miner wins the race, causing losses.

Economic Strategy

Mining is competitive: miners seek to maximize uptime to amortize fixed costs. Spot uses (e.g., turning on miners only with excess energy) are impractical, as initial costs require continuity. Return on investment can be long and uncertain.

Solo and Pool Mining

Hashrate Estimation

Hashrate (computing power) is estimated:

Hardware like Nerd Miner uses internal counters for precise data, while pools rely on more variable estimates, visible in oscillating graphs.

Program

This lesson was created for a Satoshi Spritz Connect.