Skip to main content
Share Your Experience: Take the 2024 Developer Survey
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 ...
David Schwartz's user avatar
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 ...
Murch's user avatar
  • 75.7k
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 ...
abeikverdi's user avatar
10 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 ...
Pieter Wuille's user avatar
8 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 ...
Raghav Sood's user avatar
  • 17.1k
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.
Claris's user avatar
  • 15.4k
7 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 ...
UTF-8's user avatar
  • 3,224
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 ...
Nate Eldredge's user avatar
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 ...
Jimmy Song's user avatar
  • 7,759
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 ...
Pieter Wuille's user avatar
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 ...
alcio's user avatar
  • 1,274
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 ...
Nate Eldredge's 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 ...
Ava Chow's user avatar
  • 70.8k
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 ...
Murch's user avatar
  • 75.7k
5 votes
Accepted

Can the difference be determined between two nonces k1, k2, having a linear relationship if the nonce and private key are unknown, i.e., k2 - k1 = n?

This is trivially broken. Given: (1) s1 = (z1 + r1d) / k1 (2) s2 = (z2 + r2d) / k2 (3) k2 = k1 + d Substituting (3) into (2), eliminating k2: (4) s2 = (z2 + r2d) / (k1 + d) Solving (1) for k1: (5)...
Pieter Wuille's user avatar
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 ...
Nate Eldredge'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 ...
Murch's user avatar
  • 75.7k
4 votes
Accepted

How finding a working nonce says anyting about the validity of an initial transaction

Finding the nonce and computing Proof of Work is unrelated to transaction validation. Locking blocks together in a chain of expensive Proof of Work ensures that is expensive to replace the current ...
Matthew Stannard's user avatar
4 votes
Accepted

Why is the probability of finding a winning nonce exactly the same for a new header and a header where you've already tried 1 billion nonces?

I would have thought that the probability would be slightly higher for the first block (h1) as there are 1 billion nonces that you know do not succeed, i.e. fewer winning possibilities. Would you ...
Rich Apodaca's user avatar
  • 2,421
4 votes

Why is the probability of finding a winning nonce exactly the same for a new header and a header where you've already tried 1 billion nonces?

I think I know the reason behind your confusion here. Here's my interpretation of your original question: "Out of the finite number of things whose combination is being hashed, all else being the ...
strangeloop's user avatar
4 votes

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

What prevents this is the requirement to have the hash of the previous block's header in the new block header which is then put through Proof-of-Work. The hash of the previous block's header cannot be ...
Mark H's user avatar
  • 3,334
4 votes

Is it possible for an unsolvable block to exist?

It depends on what you mean. (Review: https://en.bitcoin.it/wiki/Block_hashing_algorithm) Is it possible that with today's difficulty target a miner can exhaust the 32-bit nonce space in the block ...
pinhead's user avatar
  • 5,154
4 votes
Accepted

Do mining pools expose attempted nonces to the public?

Do mining pools expose attempted nonce to the public ? No, that's pointless and would be completely infeasible. The combined network tries over 100 billion billion nonces per second (as of december ...
Pieter Wuille's user avatar
3 votes

Who decides what the next, correct Nonce is?

Each node is searching for a different set of Nonces, actually. This is because each node collects randomly a bunch of transactions that will form a block. So each block that the nodes are mining is ...
Matt's user avatar
  • 131
3 votes

Steal proof-of-work answer from a miner

The proof-of-work is the fact that the hash of the block is a low number, when you interpret the hash as a long 256-bit number. If you change anything in the block then the hash changes and is very ...
Dr.Haribo's user avatar
  • 8,469
3 votes
Accepted

What if is there is no solution to a block?

Since I expect mining pool members to all agree what transactions to include and which timestamp to use, it can be possible that for the given block no solution exists. That is usually not the case. ...
Ava Chow's user avatar
  • 70.8k
3 votes
Accepted

What is the Coin Base Text of a bitcoin block?

Every block has one coinbase transaction, which is a transaction that miners use to send the block reward and fees to one or more outputs. Since that transaction is generating new coins it has a ...
Paul's user avatar
  • 183
3 votes

Understanding the Hash Function

From the Bitcoin.org Developer Documentation, a block header consists of a: Version Previous block header hash merkle root timestamp nBits field nonce In that order. So as you say, the only ...
meshcollider's user avatar
  • 11.8k
3 votes
Accepted

How do I get Bitcoin block header data with nonce?

There is no need to buy any data, and if someone is offering to sell you block headers, then you are being scammed. The Bitcoin network protocol supports transmitting just block headers. So you can ...
Ava Chow's user avatar
  • 70.8k
3 votes
Accepted

nTime rolling is just an optimization for large/fast pools, correct?

Is this understanding correct? Basically, but you've failed to account for the small size of the header nonce space (32 bits) and the speed of modern hardware (on the order of 10 terrahashes per ...
David A. Harding's user avatar

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