Bitcoin Forum

Bitcoin => Bitcoin Discussion => Topic started by: supermankid on April 12, 2022, 06:57:01 PM



Title: what happens if miners cannot find solution?
Post by: supermankid on April 12, 2022, 06:57:01 PM
What happens if the miners cannot find the solution or takes a really long time. Because it looks like the solution not only depends on nonce but also on no. of  txn/position. So what if the miners cannot find solution to let's say hash that requires 30s from any of the combination and nonce because nonce is 2^32 which can run out quite easily without finding a solution. What happens in such case or how does bitcoin prevent such situations?


Title: Re: what happens if miners cannot find solution?
Post by: jackg on April 12, 2022, 07:14:10 PM
The nonce is a target set by nodes, there are many solutions to fulfill this demand realistically.

Blocks can take hours to mine sometimes but that just proves the algorithm works (I don't think one's taken more than just over 2 hours though).


There are a few things miners do to optimise finding a solution:
1. They can shuffle the order of transactions to completely change what the value of the hash is.
2. They can change other values in the transaction (the nonce in the coinbase for example, the address that gets paid out the reward or the version number).



Title: Re: what happens if miners cannot find solution?
Post by: Upgrade00 on April 12, 2022, 07:23:24 PM
What happens if the miners cannot find the solution or takes a really long time.
If the miners cannot find the solution at their first attempt, they adjust a parameter in their header and try again. It's a continuous process which continues until a miner gets the hash result. This can take a long time or a quite short time period.

The time it takes to solve the cryptographic puzzle and confirm a block, is averagely fixed as the difficulty level is adjusted to match the Bitcoin hashrate so the time between transactions is approximately 10minutes, not a fixed time.


Title: Re: what happens if miners cannot find solution?
Post by: franky1 on April 12, 2022, 08:53:30 PM
the nonce is just 4bytes or 32bits.. meaning ~4.3billion combinations..
4,294,967,296

ASICs these days can churn through 4.3B hashes(4.3thashs) in 0.03seconds.
yep ASICS these days can do 140billion combinations a second

these days that nonce is soo small and gets churned through so fast no block i solved on the first round of nonce.

what you find out is that an asic is hashing a certain lump of data.
this data consists of
[block version] [previous blocks hash] [transaction merkle root hash] [timestamp] [bits] [nonce]

once the nonce has been churned through. they found it easier to change one of the outputs of the coinbase transaction, which then changes the merkle root hash, which then allows them to have more combinations

the amount of combinations of just changing one detail of one output of one transaction is a number even you cant think of a name for (over 115792089237316000000000000000000000000000000000000000000000000000000000000000)
so it becomes unimportant how big this is.
basically this allows far far far more combinations to churn through than anyone can imagine in 10,000+ years

..
as for the slowness of blocks. its not actually a ~10min rule. but instead a target to try to get 2016 blocks solved in 2weeks. .. which for easy human translation is thought of as ~1 block per 10min

what occurs is if after 2016 blocks the time of that 2016th block is not within range of the 2weeks. meaning if it took much longer then two weeks to make 2016 blocks, then the difficulty target (hardness of puzzle) is made easier to compensate, thus easier to find the solution hash of the next lot of blocks within an easier result to find.



Title: Re: what happens if miners cannot find solution?
Post by: odolvlobo on April 12, 2022, 10:31:37 PM
What happens if the miners cannot find the solution or takes a really long time. Because it looks like the solution not only depends on nonce but also on no. of  txn/position. So what if the miners cannot find solution to let's say hash that requires 30s from any of the combination and nonce because nonce is 2^32 which can run out quite easily without finding a solution. What happens in such case or how does bitcoin prevent such situations?

There should always be a solution because there are more than 2256 possible block headers for any particular block. There are many ways to change the block header than just varying the nonce, such as varying the time, the coinbase transaction, and the order of the transactions.

Sometimes blocks do take a long time, but that doesn't matter as it all averages out in the end to 10 minutes per block.


Title: Re: what happens if miners cannot find solution?
Post by: supermankid on April 13, 2022, 11:14:03 AM
🙏🙏🙏🙏🙏🙏Thanks to everyone above for shining the light 🙏🙏🙏🙏🙏🙏

When I looked a little further, it looks like the number of possible solutions at a time seems to be quite large.
So, the probability of finding the solution is also quite high. Since it does not directly related to my initial question in this thread, I have posted it seperately on another thread.
Again. Thanks to everyone for answers. :)

https://bitcointalk.org/index.php?topic=5394410.msg59849147#msg59849147 (https://bitcointalk.org/index.php?topic=5394410.msg59849147#msg59849147)