From JaxNetwork Wiki
Jump to navigation Jump to search

The "nonce" in a block is a 32-bit (4-byte) field whose value is adjusted by miners so that the hash of the block will satisfy Proof-of-Work conditions of the protocol of the target blockchain network. This concept was introduced in Bitcoin by Satoshi Nakamoto.

Any change to the block data (such as the nonce) will make the block hash completely different. Since it is believed infeasible to predict which combination of bits will result in the right hash, many different nonce values are tried, and the hash is recomputed for each value until a hash less than or equal to the target is found. As this iterative calculation requires time and resources, the presentation of the block with the correct nonce value constitutes proof of work.


In Bitcoin, 4 bytes within a block header are dedicated for the nonce. So a nonce can attain [math]\displaystyle{ \scriptsize 2^{32} }[/math] different values. Thus miners can't generate more than [math]\displaystyle{ \scriptsize 2^{32} }[/math] different hashes for the given block candidate if they modify only the field "nonce". Therefore range of the field nonce is often insufficient and miner use other ways to increase the quantity of possibles hashes for the given block candidate. Even in the early days of Bitcoin the size of field nonce was insufficient and Satoshi Nakamoto has dedicated some space within a coinbase transaction for a field often called "ExtraNonce" or "Extra Nonce".

Since the early days of Bitcoin, the need to get an extra entropy has become even more important. The difficulty of Bitcoin blocks has raised from [math]\displaystyle{ \scriptsize 2^{32} }[/math] hashes to about [math]\displaystyle{ \scriptsize 2^{77} }[/math] and its growth continues. ASIC has become a primary instrument for mining. Usage of the extranonce field has been hardcoded into the ASIC design and the Stratum V1 protocol used by all Bitcoin mining pools.

ExtraNonce often consist of two parts: ExtraNonce1 and ExtraNonce2.

ExtraNonce1 often has 4 bytes. It's unique per connection between a miner and a pool. During a pooled mining the miner doesn't modify this field.

ExtraNonce2 usually occupy 4 bytes. Miners often iterate it during the mining. ExtraNonce2 is a major source of entropy for modern high speed ASICs.

An interesting fact has been found by Sergio Dermain Lerner after analysis of the ExtraNonce field in Bitcoin blocks. He has found a so-called "Patoshi pattern" which marks about 20 thousand blocks allegedly mined by Satoshi Nakamoto during early days of Bitcoin.[1]

Location within a block

Jax.Network use SHA256 block hashing algorithm to generate Proof-of-Work. Although mining of Jax.Network relies on the modified version of the Stratum protocol, it preserves compatibility with all ASIC devices used for Bitcoin mining.

Nevertheless, there is one confusion common among developers who are not familiar with a specification of the merged-mining in Bitcoin.[2] In Bitcoin nonce if often located in the block header. However, in Jax.Network beacon chain block headers and shard chain block headers don't contain such field. Nevertheless nonse field is located in the btcAux header of such blocks. The reason for that is the design of merged-mining which should be thoroughly studied by serious blockchain core developers.

See also

External links