Bitcoin Forum
May 06, 2024, 10:08:00 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Attacks to influence the difficulty adjustment algorithm of Bitcoin mining  (Read 72 times)
SickDayIn (OP)
Jr. Member
*
Offline Offline

Activity: 42
Merit: 12


View Profile
April 03, 2024, 08:57:57 AM
 #1

Could it theoretically be possible to perform a network attack on nodes to influence the difficulty adjustment algorithm of Bitcoin mining, by providing inaccurate timestamps?

As this is the technical section of the forum, I will assume that readers of this thread have an existing intermediate level of knowledge on Bitcoin mining, and so I won't define all concepts here. However, given the decentralised nature of the Bitcoin blockchain there is a reliance on the use of time, and timestamps, to create the chain of mined blocks, and determine the difficulty adjustment algorithm.

In the early days it was very easy to mine Bitcoin rapidly on a CPU on a single personal computer, as the set difficulty was much lower. What if it would be possible to influence a Bitcoin node into believing the current time, is a date far in the past where the difficulty was lower, and therefore it might be easier to mine a block and get newly generated Bitcoins as a reward?

To start building a possible attack chain to alter the timestamp of a Bitcoin node, we must first understand how Bitcoin nodes and blocks define their time. To quote some reading from here: https://en.bitcoin.it/wiki/Block_timestamp

Quote
Each block contains a Unix time timestamp. In addition to serving as a source of variation for the block hash, they also make it more difficult for an adversary to manipulate the block chain.

A timestamp is accepted as valid if it is greater than the median timestamp of previous 11 blocks, and less than the network-adjusted time + 2 hours. "Network-adjusted time" is the median of the timestamps returned by all nodes connected to you. As a result block timestamps are not exactly accurate, and they do not need to be. Block times are accurate only to within an hour or two.

Whenever a node connects to another node, it gets a UTC timestamp from it, and stores its offset from node-local UTC. The network-adjusted time is then the node-local UTC plus the median offset from all connected nodes. Network time is never adjusted more than 70 minutes from local system time, however.

If you generated and run sufficient Bitcoin nodes with an altered internal clock, then other nodes could connected to it, then the "Network-adjusted time" which is the median of timestamps returned by all nodes connected to you, could be adjusted to an arbitrary time where the difficulty algorithm is weaker.

Therefore, would it be possible to manipulate a victim Bitcoin nodes' view of the current time, and make it believe the date is 2009 or 2010 as example to mine blocks faster and easier?

Note: At present I believe this is a theoretical attack and not practical as you would need significant resources and compute to influence Bitcoin nodes median network clock time.
1714990080
Hero Member
*
Offline Offline

Posts: 1714990080

View Profile Personal Message (Offline)

Ignore
1714990080
Reply with quote  #2

1714990080
Report to moderator
1714990080
Hero Member
*
Offline Offline

Posts: 1714990080

View Profile Personal Message (Offline)

Ignore
1714990080
Reply with quote  #2

1714990080
Report to moderator
The forum was founded in 2009 by Satoshi and Sirius. It replaced a SourceForge forum.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714990080
Hero Member
*
Offline Offline

Posts: 1714990080

View Profile Personal Message (Offline)

Ignore
1714990080
Reply with quote  #2

1714990080
Report to moderator
1714990080
Hero Member
*
Offline Offline

Posts: 1714990080

View Profile Personal Message (Offline)

Ignore
1714990080
Reply with quote  #2

1714990080
Report to moderator
LoyceV
Legendary
*
Online Online

Activity: 3304
Merit: 16604


Thick-Skinned Gang Leader and Golden Feather 2021


View Profile WWW
April 03, 2024, 09:18:03 AM
 #2

What if it would be possible to influence a Bitcoin node into believing the current time, is a date far in the past where the difficulty was lower, and therefore it might be easier to mine a block and get newly generated Bitcoins as a reward?
That's not going to work. The difficulty is determined every 2016 blocks (~14 days). If you manage to get the time on all nodes a week behind, the difficulty will go up more (to reach an average 10 minute block time). If anything, you could try the opposite: make it look as if 28 days have passed, so the difficulty drops. But every honest node on the network will reject your blocks, so you're wasting hash power on a worthless Fork.

ABCbits
Legendary
*
Offline Offline

Activity: 2870
Merit: 7470


Crypto Swap Exchange


View Profile
April 03, 2024, 11:04:11 AM
 #3

Relevant discussion thread, Can avarage block time calculated in every 2016 block be manipulated?.

If you generated and run sufficient Bitcoin nodes with an altered internal clock, then other nodes could connected to it, then the "Network-adjusted time" which is the median of timestamps returned by all nodes connected to you, could be adjusted to an arbitrary time where the difficulty algorithm is weaker.

Honestly i have doubt Bitcoin Core (and other full node software) would simply accept timestamp from other node when the difference is too big.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
SickDayIn (OP)
Jr. Member
*
Offline Offline

Activity: 42
Merit: 12


View Profile
April 03, 2024, 11:19:47 AM
 #4

Relevant discussion thread, Can avarage block time calculated in every 2016 block be manipulated?.

If you generated and run sufficient Bitcoin nodes with an altered internal clock, then other nodes could connected to it, then the "Network-adjusted time" which is the median of timestamps returned by all nodes connected to you, could be adjusted to an arbitrary time where the difficulty algorithm is weaker.

Honestly i have doubt Bitcoin Core (and other full node software) would simply accept timestamp from other node when the difference is too big.
I don't believe that any node would just accept a random timestamp from another node, however if you controlled enough nodes that the median node timestamp was altered from reality, it could be influenced potentially?
DaveF
Legendary
*
Offline Offline

Activity: 3472
Merit: 6263


Crypto Swap Exchange


View Profile WWW
April 03, 2024, 11:40:16 AM
 #5

Short answer: No

Longer answer:

As stated above the difficulty is based on the last 2016 blocks. Altering the time will just get your nodes ignored if your timestamps of blocks you mine are too far off.
The current difficulty is the current difficulty, nothing else matters. If you did manage to do a lot of oddball things and get this to work, the rest of the nodes would ignore you and you would have a fork coin.

-Dave

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!