38
votes
Accepted
Can bitcoin exist without miners?
if in the coming years the difficulty increases so much that mining is no longer profitable
That's not really possible. The mining power is set so that the miners need 10 minutes in average to mine a ...
21
votes
How is difficulty calculated?
Meni's answer is good. I just want to give some practical detail method about difficulty calculation, perhaps helpful for future views of this question's answer.
Let's take a look at Satoshi's genesis ...
16
votes
Accepted
How is a block header hash compared to the target (bits)?
How to calculate the target from bits
Let's start with a block-header, always 80-bytes that looks like this:
...
16
votes
Accepted
Isn't Bitcoin's hash target supposed to be a power of 2?
Contrary to popular belief, the target is not actually based on the number of leading zeroes. This is a major simplification that is used to get the general idea across, but is not actually how the ...
14
votes
Accepted
Why is it harder to compute nonce for a hash with a certain number zero prefixes than it is for any other hash?
A hash is 256 bits long, so there are 2^256 possible hashes in the hash space. But if you assert that the hash has to begin with a 0, that halves the number of hashes that are allowed (and thus ...
14
votes
Isn't Bitcoin's hash target supposed to be a power of 2?
As Andrew's answer points out, the 'number of leading zeros' is just a simplification, so I thought I would give an example to more concretely illustrate this:
Block hashes are usually represented in ...
12
votes
Accepted
Why are block header bits necessary? (Valid difficulty is already implied by chain history)
They aren't really necessary. The reason that they are included can only be known by Satoshi, and AFAIK, he did not state why he chose to include nBits in the block header (or many other things that ...
11
votes
How many zeroes does the current target have?
17 judging by the latest blocks published on blockchain.info:
https://blockchain.info/block/0000000000000000057fcc708cf0130d95e27c5819203e9f967ac56e4df598ee
11
votes
Accepted
Why didn't the difficulty adjust for the first 30,240 blocks?
Because blocks were not being mined in less than 10 minutes on average during this time (so the difficulty would only decrease and not increase), and the difficulty cannot go lower than 1.
10
votes
Why this ugly looking formula to calculate 'target' from 'nBits' in block header: target = coefficient * 256**(exponent-3)
TL;DR The formula comes from turning an algorithm into a mathematical formula. nBits encodes the target with the first bytes as the size of the final target, followed by the 3 most significant bytes ...
9
votes
What will happen to Bitcoin when it takes years to complete a calculation?
Mining is a self-adjusting system. The difficulty only rises in accordance to the available mining power. Hence, it can neither go to a difficulty where it will take months for a block to be found, ...
9
votes
Accepted
Why is target stored in the block at all?
You're presenting it as a choice between either allowing miners to choose the difficulty, or having it be implied by previous history.
In fact, neither is true. The target is determined by history (...
9
votes
Testnet difficulty change
Testnet has a built in functionality that changes the difficulty to 1 if the mining process takes 20 minutes or longer.
This question explains the dropping of difficulty to 1.
So while the ...
8
votes
Accepted
Is there actual consensus on the blockchain's tip or only until the next block?
No, there is no consensus until the next block is found. The network is experiencing a blockchain-fork. It will only mend once one of the tips pulls ahead by adding another block. Then all nodes will ...
8
votes
Accepted
Is there a rationale for the compact representation of the target?
It looks like the format was designed for other purposes than Bitcoin's target, and used unmodified in the code.
If you want a rationale for why a compact representation in the first place: not to ...
8
votes
understanding bits and difficulty in a block header
Contrary to popular belief, Bitcoin's proof of work is not actually based on the number of zeroes. Rather the block hash, when interpreted as a 256 bit integer, must be less than the target value. The ...
7
votes
How is difficulty calculated?
I would like to give my 2 cents here, by expliciting the relationship between the probability of mining a block given the current target t and the corresponding difficulty d as it is calculated in ...
7
votes
Accepted
How can I forecast the date Bitcoin will hit a certain blockheight?
Take the difference (in days) between the current date and the date you are trying to estimate the block height for.
Then multiple that difference by 24 hours and by 6 (6 blocks per hour)
Current ...
7
votes
Accepted
Why was the maximum target set to 0xffff0000000...?
I admit that I don't know for sure, but I have a guess. Since Satoshi was mining by himself for the first blocks, he probably set the initial target to whatever would take approximately 10 minutes to ...
7
votes
Accepted
What does the nBits value represent?
nBits refers to the target. The target is inversely proportional to the difficulty, and is encoded as a compact representation of a 256-bit number. The first byte of the 32-bit field represents an ...
7
votes
Accepted
Why is difficulty measured in a hash’s leading zeroes?
The "leading zeros" are a simplification. The difficulty is encoded as a target which is essentially a 256 bit number. Since block hashes are produced by SHA-256, they're also a string of 256 bits. If ...
7
votes
Why aren't block hashes used directly as scores for difficulty purposes?
The "apparent" work is 2x higher than actual work due to luck, but the reason it's good bitcoin doesn't use the apparent work is because it has bad stability properties due to variance, and bad game ...
7
votes
Would Bitcoin still work without a target difficulty?
It's not trivial a) to agree on the time in a distributed system, especially how much time has passed between two events, b) to establish when exactly a block candidate was found. Further, when a node ...
7
votes
Accepted
Bitcoin difficulty - why leading 0s?
Not understanding the math behind it in-depth, the best answer I can come up with is that the protocol requires that the proof of work hash (hash of nonce and block data) should be equal to or lower ...
6
votes
Accepted
Why not decrease the difficulty to increase capacity?
One problem is that lower block times mean an increased chance of forking, which makes head of the chain, and the system, less reliable.
Another problem is that it normally takes a block a few ...
6
votes
How does solving reduced difficulty hashes contribute to solving a block?
Contrary to popular belief, mining is not something where there is progress. Each hash has the same probability of being a valid block hash. You could get lucky and find a valid hash with your next ...
6
votes
Accepted
When will the Bitcoin Cash difficulty adjust next?
The original bitcoin adjusted difficulty every 2016 blocks, which would nominally be 14 days @ 6 blocks per hour. The 238th such adjustment is due at block 479,808, and we are presently (early 4 Aug ...
6
votes
How to select minimum difficulty when mining with Slush Pool
From the research I have done to understand the minimum difficulty it boils down to a balance between server/client bandwidth limitations and time to put at risk.
The pool which you connect to ...
6
votes
Accepted
How is mining difficulty defined (formula)?
The nBits field is basically scientific notation in base-256 (256 is 2^8). As an example, we take the one found on the Bitcoin.org Developer Reference: 0x181bc330 (Big-Endian order). This is split ...
6
votes
Why was it chosen to adjust difficulty every 2 weeks (rather than 2 days or every few blocks)?
Yes, there is a risk with adjusting the difficulty every block. It entirely depends on the method of adjusting. With how Bitcoin does it, if you adjusted every block, the difficulty would vary wildly ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
difficulty × 342hashpower × 44
hash × 43
mining-theory × 41
mining-pools × 32
block × 29
blockchain × 28
difficulty-retargetting × 24
mining-profitability × 22
mining-pool-shares × 16
block-interval × 16
bitcoin-core × 15
proof-of-work × 15
mining-hardware × 13
block-header × 13
protocol × 12
mining-reward × 12
security × 10
litecoin × 10
testnet × 9
nonce × 8
mining-technical-details × 8
development × 7
bitcoin-cash × 7
miner-configuration × 7