I heard that the complexity of proof of work in blockchain can vary. On what factors does it depend? Is it possible that that proof of work i.e. the required hash starting with certain number of zeros can't be found? What happens then? Do the transaction wait in the queue until the hash is found
1 Answer
Generally speaking, the difficulty is increased if the “mean time between two succesful mined block” diminishes. It is a so called “closed loop” control system. As a result, the time between two blocks tends to remain stable. The solution having a certain number of zeros is not guaranteed existing, but any solution lower than it is ok for the system, and is accepted, so definitely it exists a set “lower than” where a suitable solution can be found.
-
1This answer seems to imply that the difficulty adjusts after every block, however the difficulty only adjusts only every 2016 blocks.– Murch ♦Commented May 29, 2022 at 13:14
-
You are right, but how many blocks between two adjustments depends on the algorithm and there exists many possible choices. Specifically speaking, the control target variable is the “mean time between two blocks”, the number of samples taken to calculate it is, obviously, “more than one”, from 2 to whatever. If 2016 has been chosen for Bitcoin, it’s ok. Adjusted the answer, thank you. Commented May 29, 2022 at 20:32