What Is a Nonce? A No-Nonsense Dive into Proof of Work

2018-12-19 01:01

The nonce is a central part of the proof of work (PoW) mining algorithm for blockchains and cryptocurrencies like Bitcoin. Miners compete with each other to find a nonce that produces a hash with a value lower than or equal to that set by the network difficulty. If a miner finds such a nonce, called a golden nonce, then they win the right to add that block to the blockchain and receive the block reward.

The nonce is a random, one-time, whole number. Miners test and discard millions of nonces every second. They are hoping to produce a hash value that meets the target and so win the block reward. This is what happens during PoW mining at the most basic level, although, there is a lot more to it. Here, we are going to explore the entire purpose of the nonce throughout the mining process.

Building Blocks with Nonces

The nonce is a 32-bit number. It stays in the block header along with other key data, such as the difficulty target and timestamp. When miners build blocks, they randomly choose a nonce and input it into the block header, creating a new block header hash.

The hash is a 256-bit number and has to start with a huge number of zeros, i.e. have an incredibly small value. If it does not have the sufficient number of zeros, then the miner discards the hash and tries a new nonce. This process is repeated until a miner discovers a nonce that produces a hash with a value less than or equal than that set by the difficulty.


The 32-bit size of the nonce means that there are four billion possible combinations. Although technically, it is much higher due to something called the extra nonce. This is additional space for a longer nonce, meaning you can have tens of billions of combinations.

The nonce is the only parameter that the miner changes, all others remaining static. If the miner finds the golden nonce they add that block to the blockchain and receive the block reward. Currently, there is no way to speed up the process of finding the correct nonce. This means miners are just operating in trial and error until they find a golden nonce. This process is what constitutes the work, in proof of work.

Relation to Mining Difficulty

As we have said, the miner is trying to find a nonce that produces a hash below the value set by the network difficulty. The Bitcoin protocol sets this mining difficulty. As the difficulty increases, so the target value for the hash decreases. This means there have to be more zeros at the start of the hash number. The probability of finding a lower hash value decreases and so miners have to test more nonces. When a miner hashes a block, the hash has to have a value equal to or less than the target number to be successful.

When mining Bitcoin, the difficulty adjusts every 2016 blocks. This works out to be every two weeks. However, other PoW blockchains have faster adjustments. For instance, Litecoin, because of its shorter block time its difficulty adjusts every three and a half days. Digibyte, on the other hand, adjusts its difficulty at every block in real time.

Why the Adjustment Matters

If the difficulty did not adjust, there would be a linear relationship between the hashing power and the block rewards. As more miners join the network and hashing power increases, there would be a corresponding increase in the Bitcoin rewards. This would undermine the inflation controls on the Bitcoin protocol and with it, its sound money properties.

Fortunately by having a difficulty adjustment, the block rewards can be kept relatively stable every two weeks. The difficulty can also adjust lower though. If mining profitability disappears, then miners will cease operations and the hash rate falls. The difficulty will then adjust down appropriately. We have been seeing this now for several months on the Bitcoin network since the difficulty peaked on the 4th October.

On Bitcoin, after every 2016 blocks, the Bitcoin client will compare the real-time for each block to be generated versus the goal time. It will then adjust the difficulty appropriately. The aim is to have miners producing blocks as close to exactly ten minutes as possible.

Protection by Secure Hash Algorithms

The resilience of the SHA-256 algorithm prevents miners from being able to speed up and cheat the trial and error process. SHA-256 belongs to the SHA-2 family of secure hash algorithms and was released by the NSA in 2001. If this algorithm was broken, as happened to the SHA-1 class of cryptographic hash algorithms, then the PoW process would be undermined.

There are several ways to break a hash algorithm. By this we mean being able to circumvent the trial and error method and find correct nonces far quicker. Collision attacks are the latest and most efficient way to do this.

The entire purpose of a secure hash algorithm is to ensure the uniqueness of a hash. When data is hashed, the inputs should create a totally unique hash number. The only way the same number can be replicated is with the exact same inputs, including the nonce. A collision attack, though, means that the same hash can be produced from different inputs. A malicious actor can do this with sufficient computing resources. This completely undermines the purpose of the secure hash algorithm.

Now that a collision attack has been shown to be effective against SHA-1 algorithms, they can no longer be relied upon. The attack was made possible in part because of the huge advances in computer power over the past decade. 

At some point, when computing powers have increased enough, SHA-256 will also be vulnerable to such attacks. However, Bitcoin developers should know this long before it happens. This is because such attacks are almost always shown to be possible in theory before actually proven to work in real life. The Bitcoin Core team should then pivot towards a newer and tougher algorithm.

It is also worth noting that most authentication protocols on the internet currently use SHA-2 algorithms. If they did become vulnerable overnight, then we would have major global problems far beyond Bitcoin’s mining.

Value of Proof of Work

Miners are using their hardware to test these nonces, at a rate of millions per second. The fact that there is no way to fast-track finding the nonce, keeps PoW an open and fair system.

The beneficial feature of this system is that it requires a vast amount of energy, time and capital to solve for the correct value and win the reward. However, at the same time, it is incredibly easy for other nodes to verify the correct value. This dichotomy keeps the network secure and provides a simple way to achieve consensus.

Ultimately, then the nonce is just one small part of the Bitcoin mining process. However, it plays a crucial role in maintaining its integrity. The nonce is the one and the only thing that a miner changes to find a sufficient hash value. It is really the accelerator, brake, and clutch to the entire setup.

The post What Is a Nonce? A No-Nonsense Dive into Proof of Work appeared first on CoinCentral.

Similar to Notcoin - Blum - Airdrops In 2024

origin »

PROOF (PF) на Currencies.ru

$ 0.0523461 (+0.00%)
Объем 24H $0
Изменеия 24h: 0.00 %, 7d: -25.66 %
Cегодня L: $0.0523461 - H: $0.0523461
Капитализация $0 Rank 9758
Цена в час новости $ 0.00071419 (7229.44%)

work proof nonce dive no-nonsense adjustment difficulty

work proof → Результатов: 91


R3 Announces Global Payment App With XRP as Base Currency

R3 has unveiled a new app on their international blockchain, a global payment platform that uses Ripple’s XRP as its initial base currency. The app, dubbed Corda Settler, continues R3’s track record for pursuing  ambitious blockchain projects, and it is allegedly “purpose-built to allow for payment obligations raised on the Corda blockchain platform to be made through any of the world’s payment systems, both traditional and blockchain-based.

2018-12-6 01:54


Фото:

The Swiss Federal Railway Trials a Digital Identity Pilot on the Ethereum Blockchain

The Swiss federal railway SBB is working on implementing its first blockchain use case around certifications for its employees that work on railway tracks. In fact, a collaboration between SBB, Linum Labs and uPort, is exploring a viable solution to verified worker credentials and has produced published a blog entry around proof of concept last […] The Swiss Federal Railway Trials a Digital Identity Pilot on the Ethereum Blockchain was originally found on [blokt] - Blockchain, Bitcoin & Cryptocurrency News.

2018-11-19 17:59


О структуре и функциях Ethereum 2.0

13 ноября 2018 года Ethereum 2.0 был объявлен официально - через блог компании ConsenSys, хотя он уже появился давно. Весь технологический процесс Ethereum 2.0 будет состоять из четырёх разных уровней цепей - ныне действующей основной цепочки Proof-of-Work (PoW) эфириума с добавлением к ней цепочек Beacon Chain, Shard Chains и Virtual Machine. Ethereum 2.0 начнётся с […]

2018-11-14 13:23


Merkle Tree Proofs (MTP), Proof of Work Crypto Mining and ASIC Resistance Debate Heats Up

Merkle Tree Proofs ASIC Resistance Egalitarian mining and the proof-of-work algorithm (PoW) makes ASIC resistance worth the pursuit. The algorithm, called Merkle Tree Proofs, is one that Zcoin seems to believe in and states that it is “premature” to give up this early on in the game. There are many reasons for ASIC resistance. The […]

2018-10-31 00:30


Examining Ethereum’s Constantinople Upgrade Challenges and Causes of Delay

In the quest for ethereum’s growth and scalability, the organization had the third milestone on their roadmap slated for this year. This third stage called Metropolis involves the upgrading of the ethereum platform from the Proof of Work consensus to the Proof of Stake consensus, whilst solving its scalability issues. This upgrade called Constantinople has […]

2018-10-29 19:50


What is Proof of Assignment (PoA)?

Proof of Assignment (PoA) is a new-age consensus mechanism that requires less power and can run on relatively low-end hardware. It claims to score higher than traditional consensus algorithms like Proof of Work (PoW) and Proof of Stake (PoS), which are alleged to consume more energy and require substantially more computing power and memory. PoA’s […]

2018-10-22 09:00


Трудности перехода: Почему производители вкладывают миллионы в асики для эфириума

А что если эфириум никогда не сменит свой основной алгоритм консенсуса? Этот вопрос может показаться абсурдным разработчикам, создающим второй по величине блокчейн в мире, в котором давно уже заложены планы перехода с модели Proof-of-Work (PoW) к её альтернативе, Proof-of-Sta...

2018-10-6 17:13


IBM пытается усовершенствовать алгоритм Proof-of-Work для интернета вещей

Proof-of-Work (PoW) — механизм консенсуса, который делает возможным функционирование биткоина и многих других криптовалют, — считается крайне энергозатратной технологией. Часто можно услышать, что сеть сверхмощных компьютеров, решающих случайные математические задачи, использует тако...

2018-10-4 14:32


Фото:

DevCon 4 Will Set the Stage for Ethereum’s Next Milestone: Constantinople

Ethereum is embracing the Constantinople milestone at the end of November 2018, after DevCon4 in Prague. Constantinople is the latest Ethereum release, introduced through a hard fork, that will include five Ethereum Improvement Proposals (EIPs):Bitwise shifting instructions (EIP 145) in the Ethereum Virtual Machine (EVM) allow for direct manipulation of bytes on the EVM layer.

2018-9-11 18:15


Фото:

Алгоритм Proof of Weight. Что это и какие есть преимущества?

Об алгоритмах, на основе которых функционируют блокчейны монет, слышал каждый ходлер. Например, Биткоин работает на Proof of Work (PoW), а Эфириум вскоре должен перейти на доказательство доли владения или Proof of Stake (PoS). Существует ещё множество алгоритмов, каждый из которых...

2018-8-16 18:15