<p>The blog you linked to talks about a fairly sophisticated attack, involving large scale network manipulation.</p>

<p>The basic premise is:</p>

<ol>
<li>You are able to identify the node that belongs to the person/entity you want to execute a double spend against</li>
<li>You trick that node into thinking that the network time is far behind what it actually is (up to a difference of 70 minutes against the node's own system time)</li>
<li>Optionally, you convince other miners that the network is 70 minutes ahead of the actual time.</li>
</ol>

<p>This gives us the basic following setup:</p>

<p>The actual time, <code>T</code> (the actual value of this is irrelevant)</p>

<p>The majority miners' network time, <code>T+70</code>.</p>

<p>The victim's network time, <code>T-70</code>.</p>

<p>In Bitcoin, when a node receives a new block, it runs through some validation checks. If any of these checks fails, the block is deemed invalid. One of these checks is to verify the timestamp in the block header.</p>

<p>The node checks to verify that this timestamp is within 70 minutes of the what the node believes the network time to be (the network time is the median of the time the peers a node is connected to have reported). </p>

<p>To execute the attack, the bad actor has created a situation where the victim is 70 minutes behind the actual time, and the rest of the world is mining as if the actual time is 70 minutes ahead of the network time.</p>

<p>Thus, when a valid block is found, when the victim's node receives it, it will be dismissed as invalid, since from the victim's point of view it is around 140 minutes ahead of the network time (<code>T+70 - T-70</code>).</p>

<p>The bad actor then uses his own mining power (it is assumed that the attacker has a sufficient share of mining power to produce a few blocks a week) to mine a block that is within the victim's acceptable time parameters. Note that the rest of the network will either already be on a longer chain, or will find a longer chain soon enough, since the attack does not control the majority hashpower.</p>

<p>By broadcasting this block to the victim, the attacker can convince them that some transaction in that block is confirmed. If required, the attacker can then mine a few more blocks (which may take several days) to trick the victim into believing that the block containing the transaction has been confirmed multiple times.</p>

<p>At the same time, the attacker will make another transaction spending the same inputs on the much longer chain being mined by the rest of the miners. This will also be confirmed, and receive far more confirmations than the chain being created by the attacker specifically for the victim's node.</p>

<p>Finally, once the attacker has convinced the victim of the transaction and reaped whatever benefits, the attacker will let the victim's node connect to more honest peers. This will result in the node recalculating the network time, arriving at a more realistic value.</p>

<p>Once this happens, the victim's node will be able to accept the original, longer, honest chain, which will have more blocks (and more work) since it was being mined by the majority hashpower. This chain contains the double spend of the transaction the victim was tricked into believing was confirmed. </p>

<p>The minor chain on which the victim was convinced of the transaction will then disappear, being replaced by the longer chain, and leaving only the double spend on the blockchain.</p>

CC BY-SA 4.0
2018-08-07T10:09:38.283Z
Does the targeted node need to make payments in order to double spend?@Raghav Sood
achu thomas
CC BY-SA 4.0
2018-08-07T10:37:24.943Z
Usually, when executing a double spend, you would get some other value out of it (such as being able to trade your double spent coins on an exchange). This way, the victim only needs to believe they have received the money, and not need to spend it.
Raghav Sood
CC BY-SA 4.0
2018-08-06T12:14:07.197Z
2018-08-06T12:18:48.607Z
2018-08-06T12:18:48.607Z
Raghav Sood
<p><a href="http://culubas.blogspot.com/2011/05/timejacking-bitcoin_802.html" rel="nofollow noreferrer">http://culubas.blogspot.com/2011/05/timejacking-bitcoin_802.html</a></p>

<p>I went over this blog, but I am still not clear how double spending is achieved by this attack. From what I read, the attackers submit wrong timestamps to a target node. During this period, the target wouldn't receive legitimate transactions confirmation because the target node is behind network's median time. However, I am not clear how double spending can be achieved from this. </p>

<bitcoin-core><security><timestamp>
How does timejacking enable double spending?
achu thomas
# How does timejacking enable double spending?

(Asked by: username_0 on 2018-08-06)

<http://culubas.blogspot.com/2011/05/timejacking-bitcoin_802.html>

I went over this blog, but I am still not clear how double spending is achieved by this attack. From what I read, the attackers submit wrong timestamps to a target node. During this period, the target wouldn't receive legitimate transactions confirmation because the target node is behind network's median time. However, I am not clear how double spending can be achieved from this.

**Tags:** bitcoin-core, security, timestamp


---

## 1 answers

### Answer by username_1 on 2018-08-06. Score: 5 | Accepted answer

The blog you linked to talks about a fairly sophisticated attack, involving large scale network manipulation.

The basic premise is:

1. You are able to identify the node that belongs to the person/entity you want to execute a double spend against
2. You trick that node into thinking that the network time is far behind what it actually is (up to a difference of 70 minutes against the node's own system time)
3. Optionally, you convince other miners that the network is 70 minutes ahead of the actual time.

This gives us the basic following setup:

The actual time, `T` (the actual value of this is irrelevant)

The majority miners' network time, `T+70`.

The victim's network time, `T-70`.

In Bitcoin, when a node receives a new block, it runs through some validation checks. If any of these checks fails, the block is deemed invalid. One of these checks is to verify the timestamp in the block header.

The node checks to verify that this timestamp is within 70 minutes of the what the node believes the network time to be (the network time is the median of the time the peers a node is connected to have reported).

To execute the attack, the bad actor has created a situation where the victim is 70 minutes behind the actual time, and the rest of the world is mining as if the actual time is 70 minutes ahead of the network time.

Thus, when a valid block is found, when the victim's node receives it, it will be dismissed as invalid, since from the victim's point of view it is around 140 minutes ahead of the network time (`T+70 - T-70`).

The bad actor then uses his own mining power (it is assumed that the attacker has a sufficient share of mining power to produce a few blocks a week) to mine a block that is within the victim's acceptable time parameters. Note that the rest of the network will either already be on a longer chain, or will find a longer chain soon enough, since the attack does not control the majority hashpower.

By broadcasting this block to the victim, the attacker can convince them that some transaction in that block is confirmed. If required, the attacker can then mine a few more blocks (which may take several days) to trick the victim into believing that the block containing the transaction has been confirmed multiple times.

At the same time, the attacker will make another transaction spending the same inputs on the much longer chain being mined by the rest of the miners. This will also be confirmed, and receive far more confirmations than the chain being created by the attacker specifically for the victim's node.

Finally, once the attacker has convinced the victim of the transaction and reaped whatever benefits, the attacker will let the victim's node connect to more honest peers. This will result in the node recalculating the network time, arriving at a more realistic value.

Once this happens, the victim's node will be able to accept the original, longer, honest chain, which will have more blocks (and more work) since it was being mined by the majority hashpower. This chain contains the double spend of the transaction the victim was tricked into believing was confirmed.

The minor chain on which the victim was convinced of the transaction will then disappear, being replaced by the longer chain, and leaving only the double spend on the blockchain.

> **Comments:**
> **username_0**: Does the targeted node need to make payments in order to double spend?@username_1  
> **username_1**: Usually, when executing a double spend, you would get some other value out of it (such as being able to trade your double spent coins on an exchange). This way, the victim only needs to believe they have received the money, and not need to spend it.  

---

