Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [difficulty-retargetting]

The tag has no usage guidance.

-4
votes
0answers
18 views

Insta-mining problems, how to prevent being outgunned? And difficulty + adjustments

I created a new coin to learn something about Bitcoin. I cloned the source code, called it something different, put a new logo on it, nothing major. Then I made some nodes available, and put the ...
0
votes
0answers
20 views

How to calculate difficulty re target?

I am trying to re-calculate difficulty and verify by using the formula T${new}$ = T${old} \times \frac{Time~ taken~ for~ previous~ 2016~ blocks}{2016~\times ~600}$ I used block #s 564697 and 562681 ...
0
votes
1answer
39 views

mining difficulty is not changed on regtest

I want to see the automated mining difficulty change on regtest but it did not change even I generated 2016 blocks. How can I see it? // initial difficulty $ ./bitcoinA/src/bitcoin-cli -rpcuser=...
1
vote
2answers
28 views

Is the price of BTC transactions driven down by the influx of miners?

I'm wondering why Bitcoin transaction speed doesn't increase (and cost decrease) due to more people becoming miners all the time. Is it because the number of transactions is increasing even faster?
1
vote
2answers
59 views

Mining: what is the lowest possible target? Could it be a block hash of all zeros?

I had a basic question about Bitcoin mining. I understand that as the bitcoin difficulty adjustment becomes harder the hash output will require more 0s in the beginning of the hash. Is it ...
2
votes
1answer
33 views

where is the adjustment calculation for the target value in the source code?

Can someone point me to the source code and explain how the average is calculated for the adjustment of difficulty that takes place every 2016 ? Update: i have consulted with previous questions but ...
4
votes
2answers
62 views

Why are block header bits necessary? (Valid difficulty is already implied by chain history)

Difficulty or target is implied by chain history, so why does it need to be explicit in the header? I suppose it exposes miner-intended-difficulty, but I don't see why that would be relevant without ...
1
vote
1answer
76 views

How is the target in Bitcoin set? Who does this?

I want to understand how the target value is adjusted or by whom in Bitcoin. I know that the hash of a block + nonce must be lower or equal to the given target for mining. Who sets this target ? If ...
1
vote
1answer
66 views

Is there any way by which we can see when was last time or which was the block that was created just before bitcoin adjusted its latest difficulty?

I guess if we start doing mathematical calculation then we can easily find exjact block no which was formed just before difficulty was adjusted. But is there anyway around like by using RPC by which ...
1
vote
0answers
73 views

What are the advantages of a 210,000-block subsidy halving interval that's out-of-sync with retargeting?

The block subsidy halves every 210,000 blocks. Where could this number reasonably have come from? I'm not talking about the idea of a four year interval. 210,000 is quite close to four years given 10-...
0
votes
2answers
98 views

How do nodes reach consensus on when the target is recalculated?

Due to network latencies, some nodes may think they are at a different block height than the rest of the network. How then does a node decide if the target has been recalculated since that changes ...
3
votes
1answer
406 views

Rewriting the entire blockchain: is it possible to spoof block timestamps of a privately mined chain?

According to fork.lol and Pieter's bitcoin.sipa, it would currently take ~200 days for an attacker with 100% of the current hashpower to rewrite the entire btc blockchain. My question pertains to how ...
3
votes
1answer
272 views

Why max target is not (2^256 - 1)?

I'm reading https://en.bitcoin.it/wiki/Difficulty And I don't get why max target is not (2^256 - 1) which is 0xFFFFFFFFFFFF... but 0x00000000FFFF...?
1
vote
2answers
230 views

Why does Bitcoin adjust the difficulty every 2016 instead of 2048 blocks?

I am reading Bitcoin wiki and it says over the previous 2016 blocks. Can be further simplified to D * 2**32 / 600 without much loss of accuracy. I guess the reason of reducing to 2**32 is ...
3
votes
3answers
838 views

Why was it chosen to adjust difficulty every 2 weeks (rather than 2 days or every few blocks)?

Is there a benefit to adjusting the difficulty every so often (ie 2 weeks) vs adjusting the difficulty every block?
3
votes
2answers
545 views

Retargetting difficulty in real time

Could the mining difficulty adjust in real time, not only when blocks are found? (NOTE: Not asking about retargetting after every block but continuously as a function of time.) I'm worried about how ...
1
vote
1answer
557 views

How does Bitcoin Gold difficulty adjustment work?

Bitcoin Gold claimed to have per-block difficulty adjustment, how does it work? I find this https://github.com/BTCGPU/BTCGPU/pull/151, but still don't understand how it work by change some parameters.
1
vote
1answer
5k views

difficulty value vs. computational power

Assume a miner has a computational power q while the rest of the network has a computational power p = q-1. Based on Relationship between Hash-Rate and Difficulty: difficulty = hashrate / 7158388.055....
1
vote
1answer
317 views

Is Bitcoin's mining difficulty adjusted if it fails to solve a block [duplicate]

If the current Bitcoin miners lose 99.99% of their hash rate, mining the next block would take a lot more than the average set of 6 per hour (10 minutes). Is the mining difficulty somehow readjusted ...
1
vote
1answer
499 views

Question about retarget system bitcoin, add hardcodet block to exist blockchain

the standard values if (nActualTimespan < params.nPowTargetTimespan/4) nActualTimespan = params.nPowTargetTimespan/4; if (nActualTimespan > params.nPowTargetTimespan*4) ...
2
votes
1answer
603 views

How is the hash target set and verified by all nodes? [duplicate]

As in the title - I understand that nodes look at the last two weeks of calculated hashes and adjust the difficulty to bring the average time to 10 minutes. But how exactly is this done? In ...
0
votes
2answers
780 views

Proof of work: How are target, difficultly and number of leading zeros related to each other

I'm aware of this post, this and this one. I'm a bit confused with the terms. I don't understand how a number of leading zeros, target and difficulty are related to each other. Also, I don't ...
5
votes
1answer
14k views

When will the Bitcoin Cash difficulty adjust next?

Bitcoin Cash adjusts its difficulty downwards if there is, roughly speaking, a 12 hour gap between blocks. At least that's my understanding. Difficulty has dropped to about a quarter of what it was ...
2
votes
1answer
1k views

Bitcoin Cash difficulty before first hard fork: Emergency Difficulty Adjustment (EDA)

What were the network rules regarding the difficulty adjustments of the Bitcoin Cash chain, before the first hard fork was implemented on November 13th, 2017? There was a rule that was a function of ...
0
votes
2answers
179 views

Where in the Bitcoin Cash code is the retargetting period defined?

I'm specifically looking for the difficulty retargetting period of Bitcoin Cash, but since it is a fork of Core it should be the same code.
20
votes
1answer
758 views

Gaming the “off-by-one” bug (difficulty re-target based on 2015 instead of 2016 block time span)?

In this forum post from Gavin Andresen he writes: Second: I've written 'discourage blocks' infrastructure: https://github.com/gavinandresen/bitcoin-git/tree/discourageblocks (code reviews ...