Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: cafter on March 12, 2023, 03:06:23 PM



Title: is mining is the process of finding nonce?
Post by: cafter on March 12, 2023, 03:06:23 PM

i am getting confused at this , is mining is the process of finding nonce? or something else?


Title: Re: is mining is the process of finding nonce?
Post by: Charles-Tim on March 12, 2023, 03:31:05 PM
It is used by miners for the hash calculation of the block to be mined, which means it is very important in mining a block as every block mined have their own hash. It is a random number that can only be used once. Nonce (number used once). Used to get a valid block hash for their (miners) candidate block.

https://learnmeabitcoin.com/technical/nonce
https://learnmeabitcoin.com/beginners/blocks


Title: Re: is mining is the process of finding nonce?
Post by: cafter on March 12, 2023, 03:33:07 PM
It is used by miners for the hash calculation of the block to be mined, which means it is very important in mining a block as every block mined have their own hash. It is a random number that can only be used once. Nonce (number used once). Used to get a valid block hash for their candidate block.

https://learnmeabitcoin.com/technical/nonce
https://learnmeabitcoin.com/beginners/blocks
is it right to say nonce is just a number/ attempt at which the block is successfully mined, ?


Title: Re: is mining is the process of finding nonce?
Post by: Charles-Tim on March 12, 2023, 03:47:13 PM
is it right to say nonce is just a number/ attempt at which the block is successfully mined, ?
Let me put it like this:

Nonce is what that allows miners to compete in adding new block to the blockchain.


Title: Re: is mining is the process of finding nonce?
Post by: o_e_l_e_o on March 12, 2023, 04:50:39 PM
is it right to say nonce is just a number/ attempt at which the block is successfully mined, ?
To an extent, yes.

After miners have created a candidate block, they double hash the block header and see if the result meets the current target. If not, then they increment the nonce by 1 and try again.

However, the nonce is only a 32 bit number, giving around 4.3 billion possibilities. Big miners can exhaust this in a fraction of a second. And so there are other fields which can also be changed by the miner in order to create more possibilities for them to run through in order to find a successful block. The most commonly used additional fields are the extraNonce part of the coinbase transaction, and the timestamp.


Title: Re: is mining is the process of finding nonce?
Post by: BlackHatCoiner on March 12, 2023, 05:28:08 PM
It is the process of finding a block header (https://learnmeabitcoin.com/technical/block-header) such that if hashed twice with SHA256 (or as it's called in the community, hash256 (https://learnmeabitcoin.com/technical/hash-function#hash256)), it will result in a number below the target (https://learnmeabitcoin.com/technical/target). While searching for such block header, the parameters that change are nonce, extraNonce and the timestamp as said above.


Title: Re: is mining is the process of finding nonce?
Post by: MIner1448 on March 15, 2023, 05:59:03 PM
Mining (from the English mining - production) is the process of creating new blocks in blockchain systems, such as bitcoin. Each block contains data about new transactions, as well as a special code called "nonce" (one-time number), which is used to confirm the creation of the block.

Miners use specialized computers to perform complex mathematical calculations that help them find the right nonce to create a new block. When a block is created, it is added to the blockchain and becomes part of the overall transaction history.

Thus, mining is not directly related to the search for a nonce, but the nonce is used in the mining process to create new blocks.


Title: Re: is mining is the process of finding nonce?
Post by: sha420hashcollision on March 28, 2023, 11:51:05 PM
Mining (from the English mining - production) is the process of creating new blocks in blockchain systems, such as bitcoin. Each block contains data about new transactions, as well as a special code called "nonce" (one-time number), which is used to confirm the creation of the block.

Miners use specialized computers to perform complex mathematical calculations that help them find the right nonce to create a new block. When a block is created, it is added to the blockchain and becomes part of the overall transaction history.

Thus, mining is not directly related to the search for a nonce, but the nonce is used in the mining process to create new blocks.

Well it technically is directly related to it, its just that a nonce is not the only thing you can change in order to find solutions in Nakomoto PoW (see: https://bitcoin.stackexchange.com/questions/117530/what-restrictions-does-the-version-field-in-the-block-header-have).

Something being changed continuously is the core concept of PoW, competitors need to run through a large variety of potential solutions before arriving at one.

This gives it the quality of being difficult to produce a proof but easy to verify one.

ALSO it is such that there are other operations a miner needs to fulfill in order to successfully produce a block for the network, this is the basis for consensus rules. That being said the difficult part of mining is finding the solution via the nonce or some other manipulate-able part of the block.


Title: Re: is mining is the process of finding nonce?
Post by: pooya87 on March 29, 2023, 04:28:08 AM
is mining is the process of finding nonce?
That is an inaccurate or incomplete definition. Mining is about constructing a new block in the chain and setting the header in a way that this 80-byte construct has a specific hash lower than the target.
In each block header there are 5 fields: version, previous block header hash, merkle root hash, block time, target, nonce. From these fields the previous hash and target are fixed while the rest are variables with version and time having some limits. As I said the miner finds a combination of these that has the desired hash. For example by changing the transactions in the block or their orders the miner can change the merkle root hash hence change the header hash.

Each block contains data about new transactions, as well as a special code called "nonce"
You are getting some terminology wrong, blocks contain transactions not some data about them. Also nonce is a 32-bit integer not a code.


Title: Re: is mining is the process of finding nonce?
Post by: sha420hashcollision on March 29, 2023, 04:34:16 AM
is mining is the process of finding nonce?
That is an inaccurate or incomplete definition. Mining is about constructing a new block in the chain and setting the header in a way that this 80-byte construct has a specific hash lower than the target.
In each block header there are 5 fields: version, previous block header hash, merkle root hash, block time, target, nonce. From these fields the previous hash and target are fixed while the rest are variables with version and time having some limits. As I said the miner finds a combination of these that has the desired hash. For example by changing the transactions in the block or their orders the miner can change the merkle root hash hence change the header hash.

Each block contains data about new transactions, as well as a special code called "nonce"
You are getting some terminology wrong, blocks contain transactions not some data about them. Also nonce is a 32-bit integer not a code.

The target (https://bitcoin.stackexchange.com/questions/57184/what-does-the-nbits-value-represent) is not 'fixed' as in constant however it is 'fixed' as in to a specific equation that is based on the block height.

See: https://bitcoin.stackexchange.com/questions/5838/how-is-difficulty-calculated