واژه‌نامه

Nonce

۱۴۰۵/۱/۲۷

A nonce (number used once) is a 32-bit integer field in a block header that miners increment with each hash attempt. The goal of Proof of Work mining is to find a nonce value that produces a block hash below the current difficulty target.

How nonces work in mining

  1. The miner takes the block header (containing the previous block hash, Merkle root, timestamp, and other fields)
  2. Appends a nonce value (starting at 0)
  3. Hashes the entire header with SHA-256 (or the relevant algorithm)
  4. Checks if the result is below the target
  5. If not — increments the nonce by 1 and repeats
  6. If yes — the block is valid and broadcast to the network

With Bitcoin's 32-bit nonce space (about 4 billion values), modern ASICs exhaust all nonce values in milliseconds. When that happens, miners modify other fields (e.g., the timestamp or extra nonce in the coinbase transaction) to continue searching.

Nonce vs. extra nonce

Nonce Extra nonce
Location Block header Coinbase transaction
Size 32 bits (~4 billion values) Up to 8 bytes (much larger space)
Purpose Primary search field Expands search space when nonce is exhausted

See also