0.0961 s - время 147 - запросов

We use cookies in order to improve your experience while using our website. If you continue to use our site, you accept our Cookies Policy, revised Privacy Policy and updated Terms of Use.

BTC $ 4021.42153841 (-1.47 %)
ETH $ 136.238800053 (-2.89 %)
XRP $ 0.3110919998 (-2.33 %)
LTC $ 59.0369103042 (-2.37 %)
EOS $ 3.6405969968 (-2.63 %)
BCH $ 154.274247116 (-3.81 %)
BNB $ 14.8056917234 (-3.42 %)
XLM $ 0.1067299791 (-4.46 %)
USDT $ 1.0097046269 (-0.15 %)
TRX $ 0.0225190334 (-1.82 %)

Nonce As Simplest Component Of Block

20:30 05/02/2019
The Term Of Nonce In Crypto Sphere

Introduction

 

Each block in blockchains is a complex union of different components. These components represent various technological solutions and are intended to solve different tasks. Still, their combination leads to a single goal, which is ledger prolongation.

 

The whole block content includes standard components, such as a standard start-bit sequence in the block (Magic no), block size, block header, and transactions. Transactions take the biggest part of a block. Their structure is quite simple. They consist of a payment source, payment destination, inputs and outputs, etc. All complex components related to block functions are placed in the header. There are several hashing results, block version, timestamp, complexity, and nonce. This last component is one of the simplest, yet it is very important. Let’s examine it in detail.

 

What is nonce?

 

The origin of the “nonce” term is simple. It is a shortening from “number used once”. Simply saying it is the counter incremented under certain conditions. Obviously this counter is used once during some action it is intended to. The nonce is not only used in Bitcoin. For instance Ethereum has two different nonces used in blocks and accounts of both kinds.

 

Other projects also use nonce. Among well known projects we may recollect NEO and Ripple.

 

Nonce in Bitcoin

 

The main goal of nonce in Bitcoin is to bring randomness, which is crucial for mining. As we know, mining requires multiple recalculation of the block content. If a hashing result satisfies requirements, mining is successful. Unfortunately, it is hard to get a correct hash result in a single try.

 

According to Bitcoin rules, an average time of block closing is 10 minutes. This means that all network participants generate one block in 10 minutes regardless of how many hashing facilities are involved. The block has to be recalculated many times. A block with the same content gives the same hash result — thus, we need to change it. There are only a few components that can be changed: transactions, timestamp, and nonce.

 

The problem is that changes have to be as small as possible to reduce recalculation time. This makes transactions substitution inefficient because of the necessity to recalculate the Merkle tree. A timestamp may have an influence on the choice of the right block in the case of simultaneous mining. Thus, it should not be changed too often. This leaves nonce as the only appropriate option. Changing nonce every time when an unsatisfactory block hash is calculated is the best choice.

 

Nonce in Ethereum

 

Ethereum uses nonce in two different ways. The first implementation is similar to Bitcoin. Nonce is a standard component of Ethereum blocks. The second application concerns multiple transactions of a single account. According to the Ethereum glossary, an account nonce is a simple counter of transactions. It is used to strengthen the state change protection and prevent multiple spending attacks.

 

Nonce for mining pools

 

Another important implementation area of nonce is the mining pool workload distribution. Each mining pool should avoid multiple calculations of a single block by several participants at the same time. This can be performed in several ways. The pool coordinator can avoid sending timestamp to participants, send different transactions sets to different participants, or give nonce ranges to different participants.

 

The first approach is risky because all pool members are working around the same time. The second approach requires a lot of extra work performed by the pool coordinator. Thus, the last approach is the most efficient.

 

Afterword

 

By taking “nonce” as an example, we can clearly see that even the simplest component of crypto projects performs significant functions. Removing a nonce would instantly lead to the need to solve many problems without an effective solution being prepared.

Found a mistake? Highlight it and press Ctrl + Enter to notify the administrator.

Up-to-date Blockchain and cryptocurrency news. Be the first to know!

What is it for?