A Guide to Understanding Nonces
A nonce is a value used in cryptographic or blockchain operations to enhance uniqueness and prevent duplication. In proof of work, it helps miners find a block hash that meets the difficulty requirement; on account-model chains such as Ethereum, it serves as a transaction sequence counter to prevent duplicate transaction submissions.
Nonces in Cryptography and Mining
A nonce means “a number used only once.” In proof-of-work blockchains, it is stored in the block header. Miners continuously adjust its value and calculate results using transactions, timestamps, and the previous block's hash until they find a valid hash below the network target.
Why Mining Requires Repeated Attempts
Because hash functions are unpredictable, miners generally cannot know in advance which nonce will be valid, so they try possible values one by one. The nonce field in the Bitcoin block header is 32 bits; if the search is still unsuccessful after exhausting the range, miners also adjust the timestamp or additional fields before continuing the search.
The Role of Transaction Nonces
On Ethereum and other EVM-compatible chains, a transaction nonce is a sequential counter associated with a wallet address, usually starting from 0 and increasing with each outgoing transaction. It both helps the network process transactions in order and prevents the same transaction from being submitted repeatedly, thereby reducing the risk of replay attacks.
Differences Between the Two Use Cases
Mining nonces are used for block searching in proof of work, whereas transaction nonces are used for transaction management in account models. After Ethereum transitioned to proof of stake, mining nonces no longer apply to that network, but transaction nonces remain an important mechanism for transaction ordering and duplicate prevention.
Original Tutorial
https://www.binance.com/zh-CN/academy/glossary/nonce
Mark it complete when you understand it.
Opening a lesson does not complete it automatically. You can change its status at any time.