Nonce
mining · intermediate
The 32-bit field in a block header that miners increment while searching for a valid hash.
The block header has a 32-bit nonce field. Miners hash the header, check if the result is below the target, and if not, increment the nonce and hash again. With only 4.3 billion possible nonces and quintillions of attempts needed per block, miners also vary the coinbase transaction's extranonce and the timestamp.
The 32-bit nonce was sufficient in 2009 when network hash rate was measured in megahashes per second. At today's exahash scale, a single ASIC exhausts the entire nonce space in a fraction of a second. The "extranonce" — extra bytes in the coinbase transaction's input field — gives miners effectively unlimited additional search space, since changing the coinbase changes the merkle root and thus the header.
The word "nonce" is short for "number used once." Outside of mining, the term shows up across cryptography (ECDSA signatures, CBC-mode IVs, Lightning HTLCs) and always means the same thing: a value that must be fresh for each operation.