Pages:
Author

Topic: How is 51% attack working and the chance of reversible transactions (Read 377 times)

legendary
Activity: 2268
Merit: 18748
What if 273 out of the 336 times, the price had also increased too, between the retarget periods?
If every time the price went up the difficulty followed, then yes, that would be correct. But that's simply not what happens. Sometimes the price goes down and difficulty goes up. Sometimes the price goes up and the difficulty goes down.

What is the common assumption one can make if every other factor remained the same and only price was variable?
That's the whole point - there are too many other variables to say that price accurately determines hashrate. The availability of electricity, the price of that electricity, local disasters/storms/floods/blackouts/etc., the availability/production/cost of new ASICs, the availability of new locations to host mining hardware, the profitability of mining other coins, local laws/regulations/taxes, the list is enormous. The interplay between all these things is far too complex to be able to say "x goes up, so therefore y goes up".

As I said above, if the price fell to $10, then that would be a big enough change to overcome all these things and the hashrate would tank. And if the price rocketed to $1,000,000, then again, that would be a big enough change to overcome all these things except the availability of new ASICs. But at current prices, the price does not exert enough of an influence to cause significant changes in the hashrate, as we have just seen by the price falling by 50% but the hashrate increasing by 33%.
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
In the 336 times the difficulty has been adjusted, 273 of those have been an increase, and only 63 have been a decrease. It's always more likely for the difficulty to rise, regardless of what the price is doing.

What if 273 out of the 336 times, the price had also increased too, between the retarget periods? Would this make my statement seem more correct? What is the common assumption one can make if every other factor remained the same and only price was variable?
legendary
Activity: 2268
Merit: 18748
I don't know all the factors that will affect the difficulty, but when there's a rise in price, I know at least one. Hence, it's more expected to have a rise in difficulty than a fall.
In the 336 times the difficulty has been adjusted, 273 of those have been an increase, and only 63 have been a decrease. It's always more likely for the difficulty to rise, regardless of what the price is doing.

That's only in extreme cases though like when a country like China cracks down on its miners otherwise we have a wide range of miners around the world that are mining with different costs (ranging from $0.002 KWH to $0.20+ KWH) and same mindset (who may not even see the drop as a profit loss but an opportunity).
Which, again, lends credence to my point that price and hashrate are not directly correlated.

If the two things were directly correlated, then when the price falls by 50%, the hashrate would also fall by a similar amount as mining become unprofitable for a large number of miners. Instead, the price falls by 50% and the hashrate continues to increase. The price of bitcoin is obviously high enough that even if it falls by 50% then miners are still turning enough profit not only to not turn off their machines, but to continue adding more hash power. Maybe the two were directly correlated in the past, but for quite some time miners have obviously been earning more than enough that the price can make huge swings and not impact significantly on their operations.
legendary
Activity: 3472
Merit: 10611
Difficulty decreases can happen instantly though, when miners decide it is no longer profitable and just flip the switch on their miners.
That's only in extreme cases though like when a country like China cracks down on its miners otherwise we have a wide range of miners around the world that are mining with different costs (ranging from $0.002 KWH to $0.20+ KWH) and same mindset (who may not even see the drop as a profit loss but an opportunity).
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
Obviously price pays a role, and if bitcoin was worth $10 then of course we wouldn't have almost 200 EH/s of hashrate. But the fact that the price can fall by 50% and the hashrate can continue to increase means that miners are making enough profit that the two things are not directly correlated.
But, I didn't say they're directly correlated. I only said it's reasonable to assume it's more probable to move in the same direction:
Again, I can't know those external factors, but it's reasonable to assume that it's probable for the difficulty to drop if the price does a -50%.
I don't know all the factors that will affect the difficulty, but when there's a rise in price, I know at least one. Hence, it's more expected to have a rise in difficulty than a fall.

and if the rest of the miners decide to not accept a 6 block reorg with competing transactions, the attacker's blockchain will eventually be not the blockchain with the most work.
The unwillingness of miners to do what you describe is what makes Bitcoin censorship-resistant money. Whether they accepted or declined the reorg, it'd harm its principles.
legendary
Activity: 2268
Merit: 18748
I don't think most exchanges or services actually enforce 6 confirmations, for which the threshold hashrate is 51%. Else, you can get away with a lot less than 51%.
I'm not quite sure what you mean by the "threshold hashrate"? Even with only 40% of the hashrate, you still have a 50% chance of reversing 6 confirmations.

There has always been a limited supply of miners, so the difficulty is going to be constrained by the supply chain.
In response to this, and pooya87's response above as well: That holds true for difficulty increases. Difficulty decreases can happen instantly though, when miners decide it is no longer profitable and just flip the switch on their miners. And yet, as I explained above, despite a fall in price of 50% over the last 3 months, the difficulty has continued to trend upwards.

Obviously price pays a role, and if bitcoin was worth $10 then of course we wouldn't have almost 200 EH/s of hashrate. But the fact that the price can fall by 50% and the hashrate can continue to increase means that miners are making enough profit that the two things are not directly correlated.

and if the rest of the miners decide to not accept a 6 block reorg with competing transactions, the attacker's blockchain will eventually be not the blockchain with the most work.
This would require a coordinated intervention by the vast majority of nodes on the network to break protocol and deliberately follow a chain with less work. I think that's a big assumption to make.

copper member
Activity: 1666
Merit: 1901
Amazon Prime Member #7
You mentioned two examples. If I gave you another 10, would it make my assumption more correct?
That's exactly my point. If you carefully select the right dates and times you can show a direct correlation, and if you carefully select different dates and times, you can instead show an inverse correlation. My point is that there is only a weak direct correlation over large time scales (i.e. both price and hashrate/difficult trend upwards over time), but the price does not determine the difficulty nor vice versa
There has always been a limited supply of miners, so the difficulty is going to be constrained by the supply chain.

Mining has become more efficient (in terms of cost per hash) over time, so the difficulty will increase as more efficient miners come to market.

An economically rational market participant will keep their miners running as long as it is profitable to do so (if they lack capacity, they will sell their miner to another economically rational market participant who will do the same), and will turn off their miners once it is no longer profitable to use their equipment. One factor that influences if it is profitable to mine with a given miner is the value of the coin the miner mines. Similarly, if it goes from not being profitable, to being profitable to mine with specific equipment, an economically rational person will turn their equipment on.

So there are other factors that influence the difficulty, however, one factor is most definitely the price of bitcoin.
True! So, the computational cost AND the block rewards should be less than the transacted amount to incentivize cheating, right? (Excluding the market's upheaval)
I suppose it depends on whether the attacker controls 51% of the hashrate or not. If they do, and are guaranteed to eventually overcome the main chain, then they are guaranteed all those block rewards. If they control say 30-40%, and are just "trying their luck" so to speak, then there is the risk that they manage to mine several blocks but not enough to overcome the main chain, and then they lose all those rewards.
If an attacker has 40% of the network hashpower, they cannot maintain a 51% attack indefinitely. They may be able to periodically create a competing chain that is 6+ blocks deep, however, they won't be able to do that forever, and if the rest of the miners decide to not accept a 6 block reorg with competing transactions, the attacker's blockchain will eventually be not the blockchain with the most work.
legendary
Activity: 3472
Merit: 10611
That's exactly my point. If you carefully select the right dates and times you can show a direct correlation, and if you carefully select different dates and times, you can instead show an inverse correlation. My point is that there is only a weak direct correlation over large time scales (i.e. both price and hashrate/difficult trend upwards over time), but the price does not determine the difficulty nor vice versa.
I believe the issue is that there is a delay between price rise and hashrate rise, otherwise there is a direct relation between price and hashrate.

Lets say price has been $30k for a year, that means hashrate has to be stable. Then today price goes to $60k so the miners' profit is increased. But they can't produce hashrate (ASICs) out of thin air to increase the total hashrate and difficulty, they first have to decide if the profit is going to remain high to justify the new purchase then they have to place an order with a manufacturer and it could easily take a month for the manufacturer to ship the new ASICs. If they start mining exactly as they receive them it would still take some time (depending on distance from difficulty adjustment but up to 2 weeks) for the new difficulty.

In other words in this hypothetical scenario a 100% price increase in 1 day led to a proportionate increase in hashrate but in 30 to 40 days.

This could also explain why difficulty still rises even during some of the big price drops.
legendary
Activity: 3038
Merit: 4418
Crypto Swap Exchange
I suppose it depends on whether the attacker controls 51% of the hashrate or not. If they do, and are guaranteed to eventually overcome the main chain, then they are guaranteed all those block rewards. If they control say 30-40%, and are just "trying their luck" so to speak, then there is the risk that they manage to mine several blocks but not enough to overcome the main chain, and then they lose all those rewards.
I think then selfish mining also plays a part. In certain scenarios, intentionally delaying the propagation of a block would make it more profitable than to broadcast it immediately. There are specific conditions for it to happen though, but generally the trend makes it kind of feasible.

I don't think most exchanges or services actually enforce 6 confirmations, for which the threshold hashrate is 51%. Else, you can get away with a lot less than 51%.
legendary
Activity: 2268
Merit: 18748
You mentioned two examples. If I gave you another 10, would it make my assumption more correct?
That's exactly my point. If you carefully select the right dates and times you can show a direct correlation, and if you carefully select different dates and times, you can instead show an inverse correlation. My point is that there is only a weak direct correlation over large time scales (i.e. both price and hashrate/difficult trend upwards over time), but the price does not determine the difficulty nor vice versa.

True! So, the computational cost AND the block rewards should be less than the transacted amount to incentivize cheating, right? (Excluding the market's upheaval)
I suppose it depends on whether the attacker controls 51% of the hashrate or not. If they do, and are guaranteed to eventually overcome the main chain, then they are guaranteed all those block rewards. If they control say 30-40%, and are just "trying their luck" so to speak, then there is the risk that they manage to mine several blocks but not enough to overcome the main chain, and then they lose all those rewards.
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
This discussion gave me the following idea: Betting for the next adjustment(s). How does it sound?  Tongue

And 3 months ago the price was over $60k. Now it's $33k. In the same period, the difficulty has gone from 20 T to 26.6 T.
Maybe their huge earnings from the ATH cover their current losses. Maybe we should wait for a little more to judge. I had read that a company invested nearly a billion dollars in mining equipment recently. Mempool.space predicts a -5% in the next adjustment.

You mentioned two examples. If I gave you another 10, would it make my assumption more correct? Again, I can't know those external factors, but it's reasonable to assume that it's probable for the difficulty to drop if the price does a -50%. I chose those dates arbitrarily and they turned out to confirm my reasoning. How do you explain the similarity of the charts?

But if an attacker is successful at creating their own chain which replaces the last 10 blocks, then they will receive the block reward for all 10 of those blocks in their new chain.
True! So, the computational cost AND the block rewards should be less than the transacted amount to incentivize cheating, right? (Excluding the market's upheaval)
copper member
Activity: 1666
Merit: 1901
Amazon Prime Member #7
that 1 confirmation transactions can be reversed and be double spend by the bad miners?
It's not as simple as that. Although it is certainly easier to reverse 1 confirmation as compared to 6, say, 1 confirmation is still secure enough for the vast majority of transactions. By the same logic, it is easier to reverse 6 than it is to reverse 20, although in reality neither of these will ever happen.
If someone is able to create a competing chain 6 blocks deep, they are able to create a competing chain an arbitrary number of blocks deep.

If someone is actively trying to 51% attack the network, chances are they are dealing in amounts such that the block reward is not of a concern, so the additional cost in terms of lost block subsidies to creating a competing chain 20 blocks deep compared to creating a competing chain 6 blocks deep is irrelevant. An attacker is only going to care about the bool value of their ability to create a competing chain.

the hashes miners are producing reach all time high level again some days ago, this makes the blockchain to be getting stronger
Off-topic, but I suppose due to the recent crash, the mining difficulty will drop hard.  Tongue
I don't think so. The difficulty has not kept up with the increase in price in recent years. The efficiency of miners (cost [in terms of electricity] per hash) has also improved in recent years.

About transactions, is it true that the number of confirmations is necessary for bitcoin not to be reversed? that 1 confirmation transactions can be reversed and be double spend by the bad miners?

Rather than true/false, number of confirmation makes it's harder to reverse Bitcoin transaction. Additionally, attacker could reverse any transaction, but they only can double spend their own coin.
An attacker can double-spend any transaction of which they have a valid competing transaction. An attacker for example could sell the ability to double-spend confirmed transactions and as part of this service would collect the competing transaction their customer wants to be confirmed.
legendary
Activity: 2268
Merit: 18748
This means that within this 2-months period, the price and difficulty went up by 25.5% and 22% respectively.
And 3 months ago the price was over $60k. Now it's $33k. In the same period, the difficulty has gone from 20 T to 26.6 T. So a fall in price of almost 50%, and a rise in difficulty of 33%. During the whole of 2018, the price went steadily down from $13k to $3k, while the difficulty went steadily up from 2 T to 6 T.

Both price and difficulty tend to trend upwards, but they are not directly correlated.

If you have 7 BTC per coinbase transaction (for example as 6.25 BTC plus 0.75 BTC in fees) and you moved 70 BTC, you should wait for around 10 confirmations, because then it is very unlikely that someone will attack the chain (because the attacker will have to spend around 70 BTC to reorg 10 blocks with 7 BTC each).
But if an attacker is successful at creating their own chain which replaces the last 10 blocks, then they will receive the block reward for all 10 of those blocks in their new chain.
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
Common sense might say so, but when has the network ever behaved in the way you would expect it to?
On 1st of July, the equivalent of 1 BTC was around $35,000. On 1st of September, the equivalent of 1 BTC was around $47,000. Few days after the 1st of July, once the difficulty retargeted, it fell to 14,363,025,673,660.00. Around a week later on September, the difficulty went up to 18,415,156,832,118.00.

This means that within this 2-months period, the price and difficulty went up by 25.5% and 22% respectively. The changes happen analogously, because the rise of the demand (which is the only thing that affects the price) increases the miners' profit. There are definitely factors that go against this such as state intervention, but judging by the two charts[1][2], my common sense works as a canon.

[1] https://blockchair.com/bitcoin/charts/price
[2] https://blockchair.com/bitcoin/charts/difficulty

(Click on “All Time”)

If miners are expecting the price to rise again in the future, then why would they turn off their miners now?
Because there are also miners who don't expect that the price will rise. This brings equilibrium, I guess.

You are incentivized to reverse the transaction as long as the amount you move is not covered by the new coinbase transactions.
This is true only for the mining costs. Who knows the chaos which will prevail in the market once they find out you reversed a transaction, if they somehow manage to. I highly doubt if it's favoring you to reverse a transaction unless it exceeds astronomical amounts for one individual. (e.g., > 1000 BTC)
copper member
Activity: 821
Merit: 1992
Quote
You should definitely wait for more than 1 confirmation if you're moving much money. For instance, you may have noticed that some exchanges require more than 1 confirmation if you're moving 10+ BTC. The payee has to ensure you're not incentivized to reverse the transaction.
You are incentivized to reverse the transaction as long as the amount you move is not covered by the new coinbase transactions. If you have 7 BTC per coinbase transaction (for example as 6.25 BTC plus 0.75 BTC in fees) and you moved 70 BTC, you should wait for around 10 confirmations, because then it is very unlikely that someone will attack the chain (because the attacker will have to spend around 70 BTC to reorg 10 blocks with 7 BTC each).
legendary
Activity: 2268
Merit: 18748
There are many factors I don't examine which can change the final output, but my common sense says that if we have hard drops in price, we'll have similar drops in difficulty too.
Common sense might say so, but when has the network ever behaved in the way you would expect it to? If miners are expecting the price to rise again in the future, then why would they turn off their miners now?

How can you sue someone if you had your Bitcoin transaction reversed? There's no evidence that it happened. Sorry, I don't think that I understand you.
No evidence on the new main chain maybe, but the blocks which have been discarded/made stale will still exist on many nodes, block explorers, databases, etc. It is often possible to look up invalid transactions which have had their inputs double spent for some time after they are rejected from the mempool.
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
There's no real evidence of that happening at the moment.
There are many factors I don't examine which can change the final output, but my common sense says that if we have hard drops in price, we'll have similar drops in difficulty too.

Aside from amount of money involved, there are few other consideration such as whether you could sue them for fraud/fraud attempt and how much trust you them.
How can you sue someone if you had your Bitcoin transaction reversed? There's no evidence that it happened. Sorry, I don't think that I understand you.
legendary
Activity: 2268
Merit: 18748
There are sites and people that suggest that it is good to wait for 6 confirmations before you can accept a bitcoin payment, I guess that is not necessary because bitcoin blockchain is strong, if nothing can reverse the 1 confirmation transaction than 51% attack, then I can still accept 1 confirmation transaction from people.
It depends entirely on the risk attached to the transaction in question, and the value of the transactions. If I were accepting payment for a coffee from someone I knew, I might be happy with zero confirmations. If it was a payment for a coffee from a total stranger, then maybe I would want to wait for 1 confirmation, since the cost of reliably overturning a single confirmation is still significantly higher than the cost of a coffee, and even if it happens then I'm only out of pocket for a few bucks. If I was accepting payment for a house or other property, then I'm definitely going to be waiting for 6 or more confirmations, since an attacker would have much more incentive to spend money to overturn such a transaction.

Off-topic, but I suppose due to the recent crash, the mining difficulty will drop hard.  Tongue
There's no real evidence of that happening at the moment. The last difficulty retarget 3 days ago increased the difficulty by 9%, and during this difficulty period we are only around 2% behind where we should be.
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
There are sites and people that suggest that it is good to wait for 6 confirmations before you can accept a bitcoin payment
You should definitely wait for more than 1 confirmation if you're moving much money. For instance, you may have noticed that some exchanges require more than 1 confirmation if you're moving 10+ BTC. The payee has to ensure you're not incentivized to reverse the transaction.

the hashes miners are producing reach all time high level again some days ago, this makes the blockchain to be getting stronger
Off-topic, but I suppose due to the recent crash, the mining difficulty will drop hard.  Tongue
legendary
Activity: 1064
Merit: 1298
Lightning network is good with small amount of BTC
It's not as simple as that. Although it is certainly easier to reverse 1 confirmation as compared to 6, say, 1 confirmation is still secure enough for the vast majority of transactions. By the same logic, it is easier to reverse 6 than it is to reverse 20, although in reality neither of these will ever happen.
Bitcoin blockchain is the strongest blockchain, even recently when the price of bitcoin has been decreasing, the hashes miners are producing reach all time high level again some days ago, this makes the blockchain to be getting stronger. There are sites and people that suggest that it is good to wait for 6 confirmations before you can accept a bitcoin payment, I guess that is not necessary because bitcoin blockchain is strong, if nothing can reverse the 1 confirmation transaction than 51% attack, then I can still accept 1 confirmation transaction from people.
Pages:
Jump to: