Author

Topic: About difficulty adjustments, network security, and the hashrate (Read 151 times)

legendary
Activity: 2730
Merit: 7065
Thank you DannyHamilton and the rest of the lads for chipping in. Especially the part where you explained how important it is when the hashrate drop occurs was very informative. I had to read the second point a few times to make sure I understand it.

As far as how much it would change "the security of Bitcoin"?  Well, I think the hash rate was half of what it is today back on September 7th (about 5 or 6 months ago). Was security much worse back then than it is now?
It wasn't necessarily worse, but it was 50% easier (less costly) to carry out a successful attack if one was interested in attempting that. Even if the hashrate were to drop by 50-60% or more it wouldn't make the the network unsecure. As you said yourself, it would depend how the remaining computational power was used, and if new miners entered the game, how they used their hashrate.       
legendary
Activity: 3472
Merit: 4801
Upgrade00 is mistaken though.  Until the difficulty adjustment, there wouldn't be an increase in the profitability of mining. Therefore, you wouldn't immediately see new miners jump in.  The increase in profitability (leading to an incentive for new miners) wouldn't happen until after the difficulty adjustments.
I was assuming a situation where miners have less competition. Using a analogy in this case;
If multiple indibiiwherw given an opportunity to roll a dice inorder to hit a particular number, they are competing against luck and also each other, cause once one person gets it, that round is over. But if there are less players then there should be more trials for the remaining lot. Correct me if I'm wrong
Correct me if I'm wrong

You are wrong. We are not competing for the same block.  We are each creating our own block, and competing against the difficulty.

The only point at which your solving of a block has any bearing on my chances to get paid are in the microseconds of block propagation during which you've begun broadcasting your block and I haven't yet heard about it. This is a function of connectivity, and not a function of difficulty or hash rate. During that time there is a small, very small, chance that I could also solve a block. If that happens, then I'll start broadcasting mine, and the network will temporarily split based on whose block each miner (or pool) heard about first. Then, only one of us will get paid (whichever block gets mined on top of first).  This doesn't happen often enough to significantly change profitability.  As soon as I've heard about your block, assuming I haven't broadcast a competing solved block yet, my chances of getting paid immediately go back to the ratio between my hash rate and the difficulty.

Let's say that I hand 1000 people 6 dice each, and allow them to roll those dice once every minute.  I agree to pay out a prize to anyone that rolls six 6's in any single roll.  Since the odds of rolling six 6's are 1 in 7,776, and there are 1000 people playing, I can expect to have to pay a prize, on average, once every 7.776 minutes (the amount of time for 7,776 rolls total across all players). However, each individual can only expect to be paid, on average, once every 7,776 rolls (their own personal odds of winning), or in other words, once every 7,776 minutes.  If I double the number of players, I will now expect to pay out a prize once every 3.888 minutes (since there are now 2000 rolls per minute), however, each individual player can still expect to get paid only once every 7,776 rolls (or 7,776 minutes).  Their personal odds of winning (and total winnings per day/week/month/etc) won't change just because more people have been added.

Now, if I don't want my prize paying rate to increase, I can adjust the difficulty and state that after rolling six 6's you need to roll a single die and get a 4, 5, or 6 to get paid.  This will make it twice as hard for any individual to win, which reduces my rate of paying prizes back to once every 7.776 minutes on average, but it also changes each player's personal odds from 1 in 7,776 to 1 in 15,552. Therefore, each player's profitability is now cut in half as they have to wait twice as long for a win.

See how adding (or removing) players (i.e. hash power) doesn't change any individual's profitability, but just changes the frequency of wins and the total payout per minute? Also see how adjusting difficulty DOES change all individual's profitability, and ALSO changes the frequency of wins and the total payout per minute?

To be clear, at the extremes difficulty might have an effect.  If the difficulty were to drop to the point where the average time between blocks was less than the average network propagation time, then multiple blocks would regularly be broadcast before full propagation of any individual block. This would reduce profitability since solved blocks would frequently NOT be paid (since a competing block would be paid instead).  However, collisions like that are pretty rare under current normal network conditions and therefore don't really have much effect on profitability.

legendary
Activity: 3038
Merit: 4418
Crypto Swap Exchange
but it would still be limited by active nodes.
An active node or any node will not help in 51% attacks.

I was assuming a situation where miners have less competition. Using a analogy in this case;
If multiple indibiiwherw given an opportunity to roll a dice inorder to hit a particular number, they are competing against luck and also each other, cause once one person gets it, that round is over. But if there are less players then there should be more trials for the remaining lot. Correct me if I'm wrong
Correct me if I'm wrong
No. The ease of mining a block is independent of the miners there is or the hashrate but it is solely dependent on the difficulty. Even if you were to eliminate all of the miners there is on the network now and start mining, the time taken to mine the next block will not change. You will only be able to generate a block if you can calculate a block header that meets the required target. In a similar vein, having half the hashrate doesn't affect your chances of mining a block; the difficulty remains the same. The profitability (expected time to generate a block/expected earnings) does not change until the difficulty adjusts.

legendary
Activity: 2114
Merit: 2248
Playgram - The Telegram Casino
Upgrade00 is mistaken though.  Until the difficulty adjustment, there wouldn't be an increase in the profitability of mining. Therefore, you wouldn't immediately see new miners jump in.  The increase in profitability (leading to an incentive for new miners) wouldn't happen until after the difficulty adjustments.
I was assuming a situation where miners have less competition. Using a analogy in this case;
If multiple individuals are given an opportunity to roll a dice inorder to hit a particular number, they are competing against luck and also each other, cause once one person gets it, that round is over. But if there are less players then there should be more trials for the remaining lot.
Correct me if I'm wrong
legendary
Activity: 3472
Merit: 4801
You've already got 2 very good answers from ranochigo and BlackHatCoiner.  However, here are a few details that were glossed over, just in case you didn't catch on.

The average time between blocks would increase proportionally.  So, if the hash rate dropped to 50% of what the average hash rate had been at the previous difficulty adjustment, then the average time between blocks would be double (or 20 minutes). If the hash rate dropped to 25% of what the average hash rate had been at the previous difficulty adjustment, then the average time between blocks would be 4X (or 40 minutes).

However, the total time until the next adjustment (and how big that adjustment would be) would depend on WHEN that drop in hash rate happens:
  • If it happens IMMEDIATELY after the difficulty adjustment, then it's going to take approximately 4 weeks (assuming no other changes to hash rate during that time), since 2016 * 20 minutes = 40320 minutes = 28 days.
  • If it happens instantaneously immediately after the 2015th block, then it's going to take approximately 20 minutes HOWEVER, that adjustment WON'T be sufficient. Since the total time since the previous will have been (2015 * 10 minutes + 1 * 20 minutes) = 20170 minutes (an increase over expected time of only about 0.05%) the difficulty will only drop by about 0.05%. Meanwhile, the time between blocks will average 19 minutes 59.6 seconds for the next 2016 blocks after which the difficulty will finally catch up with the hash rate.
  • In case you still haven't caught on yet if it happened instantaneously after 1008 blocks, then the total time for 2016 blocks will have been about 30240 minutes, so the difficulty adjustment will only drop by about 25%.  Then 2016 blocks later (at an average time between blocks of 15 minutes), it will adjust again to the new appropriate level.

As you can see, the exact effect (and how long it will last) depends on BOTH how much the hash rate drops AND when that drop occurs. The adjustment is NOT based on the available hash rate, but rather on the total time since the previous adjustment (which is an indirect result of the available hash rate multiplied by the number of blocks at that hash rate).

At first, nobody would know that the hash rate had dropped (well, if all that hash rate was at a single pool, then the operator of that pool would notice, but nobody else would).  All they'd notice would be that the most recent block (or few blocks) took longer than the typical average. Long times between individual blocks happens all the time, so it wouldn't immediately raise any concerns.  As more and more blocks took significantly more than 10 minutes, people would start to notice and wonder if the hash rate had dropped and if so by how much.  Anyone that trusted any hash-rate charts would have a false sense of security since those charts are based on an average hash rate over the past many blocks.  So, to them, it would appear that the hash rate was falling slowly at first.  As more time went on, the new time between blocks would become a larger percentage of the calculations of the charts, so the drop would appear to accelerate and then eventually (after a few weeks) taper off towards the new hash rate.

Initially, the immediate effect would be to increase the number of transactions waiting for confirmation (since the same number of transactions are being created per day, but only half of them are being confirmed)  and therefore increase the necessary fees to get a transaction confirmed quickly. However, this increase in fees would lead to fewer people trying to send transactions which would reduce the number of transactions waiting for confirmation and allow fees to drop back down to a more typical level.

Miners (and mining pools) would not immediately see any increase in revenue, since the number of blocks per day is determined by the ratio of individual hash rate to difficulty and not individual hash rate to total hash rate. After the first difficulty adjustment, miners (and pools) would see their revenue increase, and then (if that increase in revenue didn't bring in a significant amount of new hash power) after the second adjustment they'd see their revenue increase again to the "new normal".

Of course, since mining is such a competitive business, all this new revenue would bring in a lot of new hashpower from miners that, thinking that it was no longer profitable, had previously shut off their equipment (which in turn would increase the difficulty back up until it was once again just barely profitable to mine).

All of these effects are based on the assumption that the exchange rate would not drop significantly.  As stompx points out, there certainly is a possibility that many people would panic and sell off the bitcoin that they hold.  As such, the profitability of mining might drop, and it could result in a cascade of miners shutting off their, no longer profitable, equipment.

Upgrade00 is mistaken though.  Until the difficulty adjustment, there wouldn't be an increase in the profitability of mining. Therefore, you wouldn't immediately see new miners jump in.  The increase in profitability (leading to an incentive for new miners) wouldn't happen until after the difficulty adjustments, and only if the exchange rate hadn't fallen excessively by then.

As far as how much it would change "the security of Bitcoin"?  Well, I think the hash rate was half of what it is today back on September 7th (about 5 or 6 months ago). Was security much worse back then than it is now?

It really depends on why the hash power vanished and where it went. If there were a cascade of hash power being shut off due to a drop in exchange rate, then it could lead to an eventual drop in security.  If that 50% of hash power that disappeared was owned by a single entity, and they immediately started mining on their own alternate secret chain, then it would undoubtedly result in a drop in security.  If all that removed hash power were to show up for sale (eBay, etc) and a single entity started buying up ALL the available hash power on the market, then it would probably result in a drop in security.
legendary
Activity: 2912
Merit: 6403
Blackjack.fun
What would happen if the global hashrate dropped significantly (50-60% for example) after a mining difficulty adjustment?

Prolonged drop, continuously for at least 2 or 3 days?
It will be a bloodbath on the exchanges, there will be panic, a spike in fees people paying intense amounts to move their coins somewhere afraid they will be too late to liquidate, fear of an attack, fear that the 60% of missing hash power might be mining in secret a longer chain, not a great picture, one of the few moments where indeed you will need balls of steel to hold

Would it affect the block generation and could blocks still be found every 10 minutes on average?
The next adjustment would come in 2.016 blocks, but how long would it take to mine those blocks?

Unless all the planets align themselves in all the galaxies, no, the block time will increase proportionally to the hash drop.
And the adjustment will be delayed by the same ratio, hashrate drops by 50% it will take 4 weeks, drop by 75% it will take 8.

What about network congestion and unconfirmed transaction count?

Pretty obvious what will happen, you cut the capacity of the network, fees will go through the roof, exchanges will charge you more for withdrawals and this will probably hit a peak where the majority of users will simply stop using it until the adjustment, leaving only those who send around tens of thousands of $ for who $10 or $80 is not a big difference.

As for the mempool, nothing would change, except from the total transactions. The median fee would remain the same.

You might want to check what happened between 20 October - 3rd of November last year.
Hint:
Quote
2020-11-03 10:28:10   16,787,779,609,932 - 16.79 T   - 16.05 %   
https://ycharts.com/indicators/bitcoin_average_transaction_fee
legendary
Activity: 2114
Merit: 2248
Playgram - The Telegram Casino
Would it affect the block generation and could blocks still be found every 10 minutes on average?
It would. Changes in hashrate affects the block generation time and sometimes it takes more than ~2 weeks (2,016 blocks) to bring the time back to 10 minutes.

The next adjustment would come in 2.016 blocks, but how long would it take to mine those blocks?
As long as it would take with the current average generation time.
I would assume a drop in hashrate would create an opportunity for new miners to jump in. If there's less competition, even at the same difficulty rate, it increases the chances of a miner to get the next block; which should attract new miners.

How would the security of the network be affected and what about network congestion and unconfirmed transaction count?
On security, it could make a 51% attack more plausible, but it would still be limited by active nodes. It would also still be quite expensive to carry out and any malicious miner would earn more by simply confirming blocks.
There would likely be a backlog of unconfirmed transactions, due to slower confirmation time.
legendary
Activity: 3038
Merit: 4418
Crypto Swap Exchange
Every 2.016 blocks there is a difficulty adjustment on the bitcoin network to keep the block generation time close to 10 minutes. What would happen if the global hashrate dropped significantly (50-60% for example) after a mining difficulty adjustment?
It takes the average. The total time between blocks would be longer. Note that the difficulty can change to either 4X the previous or 1/4 the previous[1]. That is the upper and lower bound of change.

Would it affect the block generation and could blocks still be found every 10 minutes on average?
By logic, the time between blocks would be longer. When you approximate it to 2016 blocks, the chances of the blocks in that difficulty period being 10 minutes on average while having the hashrate drop to half is practically zero.
The next adjustment would come in 2.016 blocks, but how long would it take to mine those blocks?
If it drops by half, then the block interval would be 20 minutes on average, etc.
How would the security of the network be affected and what about network congestion and unconfirmed transaction count?
Is my thinking correct that it would be much more challenging to find new blocks in an environment meant to accommodate 50% more processing power? With greater difficulty but lower computational power, we wouldn’t have a new difficulty adjustment after two weeks because it would take much more to mine those 2016 blocks. 1 month? 2 months? …

That would spill over to network costs which will go up because users want their transactions to confirm. I don’t want to focus on 51% attacks and the (in)effectiveness of those, but can a 50% drop in hashrate (network security) be equal to 50% greater chances of an adversary to successfully attack the network? An attack meant to deliver another punch, not a means to profit from it.
51% attack would be less costly and the unconfirmed transactions would likely increase owing to the longer block times.

The rationale behind the attack is to outpace the entire network. By reducing the hashrate by half, you have to outpace the remaining hashrate of the network, which is basically a little more than the 50% drop in the hashrate. That makes the attack cheaper than trying to outpace the entire 100% of the network without the drop in the hashrate.

[1] https://github.com/bitcoin/bitcoin/blob/c7ad94428ab6f54661d7a5441e1fdd0ebf034903/src/pow.cpp#L54
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
Every 2.016 blocks there is a difficulty adjustment on the bitcoin network to keep the block generation time close to 10 minutes. What would happen if the global hashrate dropped significantly (50-60% for example) after a mining difficulty adjustment?

You can't just say that. Why would it drop that significantly? Hashrate isn't just a number on a database. Anyway, let's assume that difficulty dropped by 50-60%. Every new block would be mined every 20-22 minutes instead of 10 and that's because half of the total processing power, would be lost. Even on this excessive possibility, the network would be okay once the difficulty re-adjucted.

As for the mempool, nothing would change, except from the total transactions. The median fee would remain the same.



Same thing would happen if hashrate increased significantly by 50-60%, which would result on mining new block every 5 minutes on average.
legendary
Activity: 2730
Merit: 7065
I posted Bitcoin mining is Made in China, but until when? yesterday in this subforum but the thread was moved to the bitcoin mining sub. Fair enough, I think it fits better in the mining section. But there were a few things in that topic that I wanted to discuss with active members here, and I think they will be overlooked in the mining section (and because of the huge wall of text). They already are. So, I will try to address those again.

Every 2.016 blocks there is a difficulty adjustment on the bitcoin network to keep the block generation time close to 10 minutes. What would happen if the global hashrate dropped significantly (50-60% for example) after a mining difficulty adjustment?

Would it affect the block generation and could blocks still be found every 10 minutes on average?
The next adjustment would come in 2.016 blocks, but how long would it take to mine those blocks?
How would the security of the network be affected and what about network congestion and unconfirmed transaction count?

I am going to quote my own thoughts from the linked thread:

Quote
Is my thinking correct that it would be much more challenging to find new blocks in an environment meant to accommodate 50% more processing power? With greater difficulty but lower computational power, we wouldn’t have a new difficulty adjustment after two weeks because it would take much more to mine those 2016 blocks. 1 month? 2 months? …

That would spill over to network costs which will go up because users want their transactions to confirm. I don’t want to focus on 51% attacks and the (in)effectiveness of those, but can a 50% drop in hashrate (network security) be equal to 50% greater chances of an adversary to successfully attack the network? An attack meant to deliver another punch, not a means to profit from it.
   
Jump to: