Hot answers tagged

14 votes
Accepted

Why search for a nonce linearly (+1) vs searching only even or odd nonces?

A 2X rate with a 50% chance of missing a winning nonce is no advantage at all. Incrementing the nonce is the easiest mechanism of choosing the next nonce to try, so you try the most nonces per second ...
user avatar
13 votes

What is the extraNonce?

This really helped me understand it: A solo miner increments Nonce until it overflows. Then it increments extraNonce and resets Nonce. extraNonce is located in the coinbase transaction, so changing ...
user avatar
  • 4,307
13 votes
Accepted

Can a miner just introduce a block full of valid predetermined transactions in the blockchain and get rewarded?

This will not work, because a block's content includes the previous block's hash which means that a valid block can only be mined after the previous block is known. The dummy transactions would not ...
user avatar
  • 62.4k
11 votes

What is a nonce?

Nonce is a 32 bit arbitrary random number that is typically used once. In Bitcoin's mining process, the goal is to find a hash below a target number which is calculated based on the difficulty. Proof ...
user avatar
9 votes
Accepted

Why is it important that nonces when signing not be related?

I'm going to use the Schnorr equation here (s = k + H(R||P||m)*d for signature (R,s), pubkey P = d*G, message m), but everything equally applies to ECDSA (which uses s = (H(m) + R.x*d) / k), or even ...
user avatar
8 votes
Accepted

What is the precise nonce finding protocol?

This mining simulator is a good visual of what is being hashed. http://www.yogh.io/#mine:last People are correct you don't have to change the Nonce it's just the fastest way to get a different hash ...
user avatar
8 votes
Accepted

Looking for nonces of even numbers

I think that Tim S. may have the answer with his comment about endian-ness. Your observations about the nonce having its lowest byte zero (being a multiple of 256), are with respect to the little-...
user avatar
8 votes
Accepted

Why didn't Satoshi make the nonce space larger?

There were many good answers to this question. After reading through them, I'm going to take a stab at the answer as well. The coinbase field of the coinbase transaction (as it is called) is really ...
user avatar
  • 13.7k
8 votes
Accepted

How will mining work after 2140?

There’s no such thing as a block without a coinbase transaction. Even if the block reward plus fees is zero, it is still a mandatory transaction at the start of every block, it just pays nothing.
user avatar
  • 15k
7 votes

Has the nonce used in mining been sized?

First of all, when 1 second has passed, the miner can just increment the timestamp in the header. This already gives us 4 Ghash/s rather than 4 GHash/block. When this is not enough, and the nonce ...
user avatar
7 votes
Accepted

In Bitcoin, what happens if there is no viable nonce?

It's important to note that the block hash is over the entire block header, which contains: Block Version Nonce Previous block hash Timestamp Merkle Root nBits Of these, only the nBits and previous ...
user avatar
  • 16.4k
6 votes
Accepted

Maximum # of hashes for finding a block?

The miner can change the block header hash several different ways: Change the timestamp. This is the least intrusive, but works just fine. If you can do more than 4 Th/s, this starts to become a ...
user avatar
  • 7,619
6 votes

Why didn't Satoshi make the nonce space larger?

From the protocol rules, there is no such thing as an extra nonce. There is only a 32-bit nonce in the block header (which can be iterated over very quickly), and up to 100 arbitrary bytes in the ...
user avatar
6 votes
Accepted

Does every nonce really have an equal chance of winning?

It's not unevenly distributed. The reason it appears that way in the graphs above is because the x-axis is plotted in logarithmic units. Here's what it looks like in linear units:
user avatar
  • 4,307
6 votes
Accepted

When do miners stop waiting for new transactions?

They were never "waiting" in the first place. A miner is incrementing nonces and computing hashes continuously. As soon as a new transaction a2 arrives, it is added to the Merkle tree, the block ...
user avatar
6 votes
Accepted

Blockchain SHA256 hash and nonce

The block hash has to be below a certain value and the block hash depends (among others) on the nonce and on the Merkle root. The Merkle root depends on the sequence of transactions. Note that it's a ...
user avatar
  • 3,144
6 votes
Accepted

If two miners come up with two valid nonces, how does consensus take place?

The tie is broken by the first of the two that gets extended with a child block. In practice, in case two conflicting blocks at the same height appear on the network, every node will pick the one they ...
user avatar
5 votes

Does every nonce really have an equal chance of winning?

As you noted, the logarithmic scale skews it right, because the number of nonces within log(10, nonce) > 9 is 3 times larger than log(10, nonce) < 9 The other factor that might skew the nonces ...
user avatar
  • 28.6k
5 votes
Accepted

Why change the nonce instead of just rehashing?

The hashing function used in Bitcoin is deterministic, that is hashing the same input, i.e., block header, will always result in the same output. This is necessary so that others can also check that a ...
user avatar
  • 8,694
5 votes
Accepted

Why check for multiple nonces despite finding a golden nonce?

There's a difference between what is called a "golden nonce" in the context of the source and a valid block header hash. To reduce payout variance, miners group into pools and share their income ...
user avatar
  • 1,254
5 votes
Accepted

What is the largest golden nonce found?

Through block 512961, the highest (little-endian) nonce value to date is 4294956079 (0xffffd42f), in block 219742. The lowest is 1082 (0x0000043a), in block 67071. The script I used to gather this ...
user avatar
5 votes
Accepted

How Do Peers Choose Which Peer To Trust?

either I broke some rule, or the other person did; In this case, how does my client find a trusted peer Your client does not trust any peer. It fully validates the blockchain. In the event of ...
user avatar
  • 60.5k
5 votes
Accepted

If a lot of miners start at nonce 0, how are there no ties?

The block templates of two different miners will never overlap. Miners get paid by assigning the block reward in their mined blocks to themselves. Since each miner is trying to credit a different ...
user avatar
  • 62.4k
4 votes
Accepted

Why is the block header 80 bytes, not 128 bytes (= two SHA-256 blocks)?

It could have been done that way, at the cost of increasing the amount of space it takes to store and send block headers. It seems like block header storage was a big concern for Satoshi, (there's ...
user avatar
  • 28.6k
4 votes
Accepted

Are blocks sent only after finding nonce?

This effectively already happens on several levels, though without direct miner interaction. Both Bitcoin Core and the Bitcoin Relay Network have their own implementation of forward preparation for ...
user avatar
  • 15k
4 votes

What is the precise nonce finding protocol?

There is no concatenation. The nonce is part of the block header. The block header is 80 bytes and is hashed twice. That means you first sha-256 hash the 80 byte block header, and then you hash the ...
user avatar
  • 8,319
4 votes
Accepted

Determining a Block's Extranonce Value

In Bitcoin v0.1.5 to v0.3.24, the coinbase scriptSig contained: txNew.vin[0].scriptSig << nBits << ++bnExtraNonce; In Bitcoin v0.4.0 to v0.5.3, it changed to: pblock->vtx[0].vin[0]....
user avatar
  • 28.6k
4 votes

Why didn't Satoshi make the nonce space larger?

My guess: It seems clear that Satoshi didn't expect pooled mining. In a world without pooled mining, you'd simply have each piece of mining hardware capable of up to 4 gigahashes per second (GH/s) ...
user avatar
4 votes
Accepted

How is the mempool incorporated in the calculation of the block hash?

Every node in the network has a mempool. The mempool contains unconfirmed transactions. Each mempool may be slightly different as they constitute a subset of all unconfirmed transactions in the ...
user avatar
  • 62.4k
4 votes
Accepted

Finding nonce resulting in more zeros than the target

Nothing special happens in this case. If you find a nonce for which the hash has at least the necessary number of zeros (or more precisely, is numerically less than the target value), you have a ...
user avatar

Only top scored, non community-wiki answers of a minimum length are eligible