Cryptocurrency mining involves verifying transactions and adding them to the blockchain public ledger. Miners collect transactions, organize them into blocks, and hash each transaction and the block header with a random nonce until a valid hash is found. The first miner to find a valid hash broadcasts the block, and if it is validated by other nodes, they are awarded the mining reward. Sometimes competing blocks are found simultaneously, and the block built on first is considered the valid one while the other becomes an orphan block. Cryptocurrency mining underlies the decentralized peer-to-peer nature of digital currencies.