Bitcoin and Ethereum miners validate transactions on a blockchain, earning cryptocurrencies in the process. They compete to be the first to solve cryptographic puzzles — the more they guess correctly, the faster they can add new blocks to the chain and earn rewards.