8 ms·
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, cutt
by trifurcate 4y ago
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)
- lazide 4y agoNot 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.
- Anon1096 4y agoI 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.
- lazide 4y agoWith 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.
- tromp 4y ago> 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.
- lazide 4y agoEh, 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.
- trifurcate 4y ago"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.
- lazide 4y agoNope, 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.