News for hackers. Stuff that matters.
Re:Bitcoin hashrate drops nearly 40% as deadly U.S. storm un... by tromp on Monday December 26, 2022 @01:55PM (#34140579)
> as the hash rate rate drops, your individual profitability will rise

This is not quite accurate. As the hash rate drops, then the next difficulty adjustment will lower the difficulty, and that is what improves profitability. It doesn't matter how many other miners join, that just makes blocks arrive faster; it just change the frequency at which a given miner hits the difficulty target.

The last adjustment was around Dec 19 [1], and the next one is normally 2 weeks after, but with 3/5 of the former hashrate, blocks will arrive 5/3 slower (60% slower), so it will take longer to adjust to a lower difficulty, in early to mid January.

[1] https://bitinfocharts.com/comparison/bitcoin-difficulty.html...

Re:Bitcoin hashrate drops nearly 40% as deadly U.S. storm un... by lazide on Monday December 26, 2022 @02:37PM (#34140991)
Eh, not quite. There is an important distinction here in how it actually works.

The Bitcoin chain difficulty is essentially the number of random lottery tickets ‘issued’ for a given block (size of hash space hashes will be generated in).

The first miner to get a winning lottery ticket wins the block rewards. (Each hash being a ‘ticket’). The space is typically insanely large, think 10’s of trillions.

Sometimes that happens really fast, sometimes it takes a long time. The difficulty (number of tickets) adjusts at periodic intervals to keep the average winning frequency at around 5 minutes based on the current quantity of hashing, but the actual win rate varies a lot.

So cutting actual hash power in half (by taking half of miners off line) gives any single miner remaining twice the odds of getting a block reward. But it will likely take twice as long hashing, and the blocks will mine about half the speed of usual (think 10 mins avg instead of 5), unless the difficulty resets.

Re:Bitcoin hashrate drops nearly 40% as deadly U.S. storm un... by trifurcate on Monday December 26, 2022 @02:49PM (#34141098)
Not quite squared. The hashrate of the rest of the network does not directly matter to you. Only the difficulty matters. Without a difficulty readjustment, cutting actual hash power in half does not double your odds.

Think of it like this: if the difficulty is such that there is 1 winning hash out of 1 million possible hashes (oversimplified), and if your hardware calculates 1,000 hashes per second, then your odds of finding a winning hash in 1 second is 1/1,000. Notice how this odds calculation does not take as an input what the other miners are doing.

Of course, after a difficulty readjustment, your odds will actually change; that is the entire purpose of the difficulty target.

(This comment ignores block header propagation etc. affecting mining latency, which will change mining overhead slightly if block times double)

Re:Bitcoin hashrate drops nearly 40% as deadly U.S. storm un... by lazide on Monday December 26, 2022 @03:07PM (#34141282)
Not sure where you got squared from?

If half the hash rate disappears, your odds do indeed double, as every hash anyone does has the same odds of success, and with has of your competition gone, you now have twice the odds of being the one that gets it. It’s a (approximate to many decimal places) linear relationship.

If you had 1% odds, you’d now have 2% odds in the ‘half the hash power disappears’ situation.

Re:Bitcoin hashrate drops nearly 40% as deadly U.S. storm un... by Anon1096 on Monday December 26, 2022 @03:15PM (#34141358)
I don't have expertise in this, but wouldn't it be that your chance of mining a specific block doubles? I don't believe it would affect your overall profitability, because in the inverse case of the amount of miners doubling, if you lose out on a specific block, you can just start mining the next one instead, so on average it should be the same. And you don't lose out on work because of the high randomness of winning hashes.
Re:Bitcoin hashrate drops nearly 40% as deadly U.S. storm un... by lazide on Monday December 26, 2022 @03:46PM (#34141684)
With only one winning block (generally), yes your chance of mining the specific winning block doubles.

There is no explicit co-ordination regarding blocks mined, and no hashes tried by other miners have any impact on you or your odds, except if they win, as there is no (known) co-ordination between (independent) miners on what has or has not been tried yet - any block which produces a valid next-in-chain value is the 'right' one, and every miner who gets a value which isn't the right one, got a wrong one.

Re:Bitcoin hashrate drops nearly 40% as deadly U.S. storm un... by tromp on Monday December 26, 2022 @03:48PM (#34141699)
> you now have twice the odds of being the one that gets it

This is not the right way to think about it. Someone else publishing a valid block doesn't deprive you of a reward. You just continue mining on top of their now latest block.

When a miner's hash meets the difficulty target, they have a valid block that they publish, and will collect its reward (except in the unlikely case of another miner finding a valid block at almost exactly the same time). The amount of rewards a miner collects thus depends solely on how often their hashes meet the difficulty target, irrespective of the total hashrate.

Re:Bitcoin hashrate drops nearly 40% as deadly U.S. storm un... by lazide on Monday December 26, 2022 @04:16PM (#34141981)
Eh, we're saying similar things, but you're wrong in a fundamental detail - and you're making it really confusing for everyone who doesn't understand what is really going on.

The rewards a miner collects do not depend solely on how often their hashes meet the difficulty target. Otherwise, every miner could keep mining prior blocks forever until they got a hash that matched, and collect the reward for that block. But that isn't allowed to happen.

The first miner that gets a block accepted by the network with a valid hash wins. A block can only be mined once, by one miner. Otherwise, transactions would be double spent, or blocks double mined.

Your individual odds of being that miner are directly proportional to the amount of hash power being used to mine the current, most recent block.

The window of time you have (aka the 'time until the lottery drawing') is until someone finds a winning hash to the current block. When there is a conflict/split in the blockchain, the longest/highest chain of blocks wins, and everything on the 'split' chain gets ignored.

The algorithm bitcoin uses to mine is a rather simple one.

1) Collect validated transactions

2) Add the block metadata, such as prior/highest current block (this is what makes it a block chain), this miners metadata (if any), and the block reward address if this block wins.

3) Add/Change the blocks random nonce

4) Construct a block by putting all these together into the binary format.

5) Hash it

6) If the produced output hash has the right number of zeros in it (really) to match the difficulty target, it is a winning block. Publish it, and if the network accepts and builds more blocks on top of it, you can spend your reward. Otherwise, go back to 3.

The difficulty target is partitioning up the bitspace to determine the odds of 'winning' blocks, just like I'm describing using the lottery ticket analogy.

There is no way any miner can change their odds here (or 'try to meet the difficulty target'), unless they collude with others to avoid already tried hashes/nonces for the same exact block values, which they have negative incentive to do.

In fact, independent miners have every incentive to make their opponents try the things they already know won't work.

Removing half the hash power would double the chances (all other things remaining the same) of the remaining hashers winning, as there is now half the number of competitors randomly trying to get a winning hash, as the winning hashes are randomly distributed.

It also doubles the time to find a winning hash, all other things remaining the same, as there is now half the number of players trying random values. (or half the number of random attempts to find the right value).

Unless someone has broken SHA-256, Every active miner has the same odds on any hash attempt to get the winning hash value.

That means everyone has to try every value within that space. And they won't know what value they'll get from hashing until they do the actual hashing (aka do the work).

That's pretty fundamental to the protocol.

Increasing/changing difficulty targets isn't linear in impact, but that's not related to what is being discussed here, as the target itself isn't changing. Just available hashing power.

Re:Bitcoin hashrate drops nearly 40% as deadly U.S. storm un... by Dylan16807 on Monday December 26, 2022 @06:24PM (#34143067)
> Eh, we're saying similar things, but you're wrong in a fundamental detail - and you're making it really confusing for everyone who doesn't understand what is really going on.

Which detail?

> The rewards a miner collects do not depend solely on how often their hashes meet the difficulty target. Otherwise, every miner could keep mining prior blocks forever until they got a hash that matched, and collect the reward for that block. But that isn't allowed to happen.

Obviously you have to mine based on the current block. Nobody suggested otherwise.

It doesn't affect your odds of finding blocks because it only takes a fraction of a second to switch to the new one.

> The first miner [...] and everything on the 'split' chain gets ignored.

Nobody suggested otherwise.

> The algorithm bitcoin uses

Yes.

> There is no way any miner can change their odds here

Nobody suggested otherwise.

> (or 'try to meet the difficulty target')

That just means doing hashes and hoping you win.

> Removing half the hash power would double the chances (all other things remaining the same) of the remaining hashers winning, as there is now half the number of competitors randomly trying to get a winning hash, as the winning hashes are randomly distributed.

It changes the percent of blocks a miner wins.

It does not change the number of blocks per hour they win. And that's the only number that matters.

(Both expressed as expected averages, of course.)

> Unless someone [...] Just available hashing power.

Nobody suggested otherwise.

Re:Bitcoin hashrate drops nearly 40% as deadly U.S. storm un... by lazide on Monday December 26, 2022 @08:03PM (#34143732)
Good luck!
Re:Bitcoin hashrate drops nearly 40% as deadly U.S. storm un... by trifurcate on Monday December 26, 2022 @03:50PM (#34141712)
"Not quite squared", because the parent comment also started with "not quite".

The sibling comment is exactly right. Your odds of mining a specific block are altered, but this doesn't mean much. If everyone else but you disappeared from the network, without a difficulty retarget, your odds of mining the next specific block are 100%. The rate at which you mine these blocks is exactly the same as the rate at which you mine blocks when you represent 1% or 0.1% of the network hashrate.

Example: Fixed difficulty, so 1/1,000,000 hash wins, 1,000 hashes/sec.

a) You are 100% of the network hashrate. Your odds of finding the next block are 100%. After 500 seconds of mining, your odds of having mined 1 block are 50%. After 500 seconds, the network will have produced on average 0.5 blocks (I know, awkward.)

b) You are 1% of the network hashrate. Your odds of finding the next block are 1%. After 500 seconds of mining, your odds of having mined 1 block are 50%. After 500 seconds, the network will have produced on average 50 blocks.

Re:Bitcoin hashrate drops nearly 40% as deadly U.S. storm un... by lazide on Monday December 26, 2022 @04:21PM (#34142021)
Nope, see reply to the sibling comment.

If the OVERALL rate of exploration of the keyspace of valid hashes halves, the remaining half will take twice as long (on average) to find the winning value.

Whoever finds a winning value first stops the contest.

If I am 1% of the networks hashrate, and everyone but me disappears, my odds are indeed 100% of finding the next block - but that's not the right analogy here, because there is always someone else looking, and whoever is the first to find it wins.

The time you could expect that to take, if all but 1% of the hashrate disappears, is going to be 100x of the time (on average) it would take with the original hashrate. Unless it takes so long the difficulty target reduces, of course, and the odds change.

This is done infrequently to avoid someone gaming the system by kicking everyone else off to start being the sole miner with an economic amount of $$ spent.

You got lost at your example b I think because you seem to think that the odds of any particular hash attempt being a win have something to do with current aggregate hashrate (which is what we're discussing changing), but it does not. It only changes the odds of it being a match IN TIME.

With network hash rate being a rate (aka value over time), halving the value, doubles the time to completion on average.

The odds of any specific hash being a win is set by the difficulty target, which is based on HISTORIC AVERAGE hash rate, and only adjusts infrequently. When that is adjusted, it changes the odds. But that is done independently of this whole 'suddenly half the network disappears' event.

Re:Bitcoin hashrate drops nearly 40% as deadly U.S. storm un... by mlyle on Monday December 26, 2022 @04:41PM (#34142204)
I think you guys are talking past each other.

It doesn't matter what happens to the rest of the network--- you'll win the same number of blocks per year, whether you're the only miner or one of many miners. You'll win a greater proportion of blocks if there's fewer miners, but the same number overall.

Only difficulty changing changes this.

Re:Bitcoin hashrate drops nearly 40% as deadly U.S. storm un... by lazide on Monday December 26, 2022 @04:56PM (#34142329)
That is the part that is false.

You will not win the same number of blocks per year, and fundamentally can’t, unless you have the same share of the overall mining hashpower that entire time.

Bitcoin literally could not work if that was not the case.

If your share of the hash power doubles, because your total hashes stayed the same but the overall hash power halved, you’ll ‘win’ twice as many blocks.

Changing difficulty does not change this.

Changing difficulty only changes how much hashpower is required (on average) to mine a block, and indirectly the number of blocks produced over over time, for a given hashpower.

Difficulty changes the odds of any given hash attempt winning. It does not change the odds you will find a winning hash before anyone else does. That is based on your proportion of the overall hash rate.

This is why there is such strong incentive to add more hashpower at lower per-hash price to mine Bitcoin. Because it increases individuals share of the overall hashrate, they end up mining more blocks, and they get more block rewards for it.

Less efficient hashers get less and less share of winning blocks as this happens, until it becomes uneconomic for them to hash at all.

If all miners dropped off (or 99%), blocks won’t keep getting mined every 5 minutes. They’ll take forever to mine until the network adjusts the difficulty, which takes awhile - 2016 blocks, to be precise.

In fact, with a sufficiently high hash rate setting a high difficulty, then dropping to a sufficiently low hash rate right after a difficulty adjustment, it might never adjust back, and it could be years or decades to mine the next block.

Re:Bitcoin hashrate drops nearly 40% as deadly U.S. storm un... by Dylan16807 on Monday December 26, 2022 @06:35PM (#34143135)
> Difficulty changes the odds of any given hash attempt winning. It does not change the odds you will find a winning hash before anyone else does. That is based on your proportion of the overall hash rate.

Nobody cares about who finds it first.

They care about blocks per hour.

> If all miners dropped off (or 99%), blocks won’t keep getting mined every 5 minutes. They’ll take forever to mine until the network adjusts the difficulty, which takes awhile - 2016 blocks, to be precise.

And until that difficulty changes, the remaining miners will find they still get the same number of blocks per hour. In the time the network used to find 1000 blocks, of which they got 10, the network will now find 10 blocks, and they will get... 10.

Re:Bitcoin hashrate drops nearly 40% as deadly U.S. storm un... by lazide on Monday December 26, 2022 @07:09PM (#34143348)
Since the only person who gets paid is the person who finds the hash for any given block first, you better believe people care who finds it first for a block!

Since SHA256 has not yet been broken, it will over time be in proportion to each miners contribution to the overall hash rate. By design.

If someone gets a valid value for a block and gets it in the chain (mines the block) is 100% dependent on if anyone else finds it first and gets it accepted by the network.

As to the rest of it - yikes. Not only is there no mechanism whatsoever that would do what you seem to think happens, but it makes zero sense if you have a cursory idea of how Bitcoin is constructed, or what miners even do.

Good luck, and adios!

Re:Bitcoin hashrate drops nearly 40% as deadly U.S. storm un... by Dylan16807 on Monday December 26, 2022 @07:15PM (#34143386)
Nobody wants any particular block.

They want to find A block.

So two seconds after someone else finds a block, they're working on the next block. They don't care about the event at all. Their expected reward per hash doesn't change at all. Their expected reward per hour doesn't change at all.

Finding a hash "first" is an irrelevant idea, because everyone stops searching for that block instantly, and starts searching for the next block. Roughly zero hashes get wasted.

> As to the rest of it - yikes.

I'm quoting the scenario in your earlier post, you goofus.

> The time you could expect that to take, if all but 1% of the hashrate disappears, is going to be 100x of the time (on average) it would take with the original hashrate. Unless it takes so long the difficulty target reduces, of course, and the odds change.

It takes the remaining miners 100x as long to find blocks.

But they get to keep 100x as many of the found blocks.

So they still get the same reward per hour. Until the difficulty adjusts.

This is basic arithmetic.

> Since SHA256 has not yet been broken, it will over time be in proportion to each miners contribution to the overall hash rate. By design.

In proportion to each miner's contribution, and also in proportion to how many blocks per minute are being found.

If you don't wait for a difficulty update, then removing some amount of miners changes the block-finding rate in exact inverse proportion. So the blocks-per-hour of each miner stays exactly the same.

Remove half the miners, blocks are found half as fast until difficulty updates.

Triple the number of miners, blocks are found three times as fast until difficulty updates.

2x win rate * 1/2x block rate = 1x

1/3x win rate * 3x block rate = 1x

Until the difficulty updates.

Re:Bitcoin hashrate drops nearly 40% as deadly U.S. storm un... by lazide on Tuesday December 27, 2022 @12:09PM (#34150746)
Ah hah, thanks! I’m finally understanding the relationship you’re discussing. Thanks!
Re:Bitcoin hashrate drops nearly 40% as deadly U.S. storm un... by mlyle on Monday December 26, 2022 @08:21PM (#34143857)
> You will not win the same number of blocks per year, and fundamentally can’t, unless you have the same share of the overall mining hashpower that entire time.

But, unless difficulty changes, the blockrate changes.

If you keep the entire existing network, and say I'm 0.002% of the hashpower; I'll win 1 block per year, losing 99.998% of blocks.

If the whole rest of the network goes away except me, it'll take me 1 year to mine a block. I lose 0% of blocks.

But in either case, I mine one block per year.

Re:Bitcoin hashrate drops nearly 40% as deadly U.S. storm un... by tromp on Tuesday December 27, 2022 @04:28AM (#34147033)
> If your share of the hash power doubles, because your total hashes stayed the same but the overall hash power halved, you’ll ‘win’ twice as many blocks.

This is wrong. Each of your hashes (the number of which in a given period is fixed as you admit) either meets the difficulty target or not. If it does, you win a block reward. Otherwise you don't.

The only impact other miners have on this is how often you have to rebuild your candidate block in order to always mine on top of the latest block.

Please just think this through before replying...

Re:Bitcoin hashrate drops nearly 40% as deadly U.S. storm un... by lucb1e on Monday December 26, 2022 @02:09PM (#34140713)
Sorry, your reply coincided with my editing that out. I saw another comment in in this subthread https://news.ycombinator.com/item?id=34140409 that indeed pointed that out already and then edited my post just before you replied.