public inbox for bitcoindev@googlegroups.com
 help / color / mirror / Atom feed
* [bitcoin-dev] Add a moving checkpoint to the Bitcoin protocol
@ 2019-07-31 12:28 Kenshiro []
  2019-07-31 13:59 ` Alistair Mann
  0 siblings, 1 reply; 10+ messages in thread
From: Kenshiro [] @ 2019-07-31 12:28 UTC (permalink / raw)
  To: bitcoin-dev

[-- Attachment #1: Type: text/plain, Size: 834 bytes --]

Hi all,

I would like to propose that a "moving checkpoint" is added to the Bitcoin protocol. It's a very simple rule already implemented in NXT coin:

- A node will ignore any new block under nodeBlockHeight - N, so the blockchain becomes truly immutable after N blocks, even during a 51% attack which thanks to the moving checkpoint can't rewrite history older than the last N blocks.

NXT coin has a N value of 720 blocks, like 12 hours of blocks.

To be more conservative, Bitcoin could have a N value of 144 blocks (like 24 hours). So users and exchanges could plan their operations with big amounts of BTC knowing that only after 24 hours a transaction is truly immutable.

Maybe a 51% attack never happens but if it does it would be nice to be 100% sure that history rewrite is limited to only 24 hours.

Regards,

[-- Attachment #2: Type: text/html, Size: 2598 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [bitcoin-dev] Add a moving checkpoint to the Bitcoin protocol
  2019-07-31 12:28 [bitcoin-dev] Add a moving checkpoint to the Bitcoin protocol Kenshiro []
@ 2019-07-31 13:59 ` Alistair Mann
  2019-07-31 14:40   ` Kenshiro []
  0 siblings, 1 reply; 10+ messages in thread
From: Alistair Mann @ 2019-07-31 13:59 UTC (permalink / raw)
  To: Kenshiro [], Bitcoin Protocol Discussion

On Wednesday 31 Jul 2019 12:28:58 Kenshiro [] via bitcoin-dev wrote:

> I would like to propose that a "moving checkpoint" is added to the Bitcoin
> protocol. It's a very simple rule already implemented in NXT coin:
> 
> - A node will ignore any new block under nodeBlockHeight - N, so the
> blockchain becomes truly immutable after N blocks, even during a 51% attack
> which thanks to the moving checkpoint can't rewrite history older than the
> last N blocks.

How would a (potentially, state-sponsored) netsplit lasting longer than N be 
handled?  
-- 
Alistair Mann



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [bitcoin-dev] Add a moving checkpoint to the Bitcoin protocol
  2019-07-31 13:59 ` Alistair Mann
@ 2019-07-31 14:40   ` Kenshiro []
  2019-07-31 14:53     ` Kenshiro []
  0 siblings, 1 reply; 10+ messages in thread
From: Kenshiro [] @ 2019-07-31 14:40 UTC (permalink / raw)
  To: Alistair Mann, Bitcoin Protocol Discussion

[-- Attachment #1: Type: text/plain, Size: 1369 bytes --]

>>> How would a (potentially, state-sponsored) netsplit lasting longer than N be
handled?

It would be detected by the community much before reaching the reorg limit of N blocks (it's 24 hours) so nodes could stop until the netsplit is fixed.

In the extreme case no one notice the network split during more than N blocks (24 hours) and there are 2 permanent forks longer than N, nodes from one branch could delete their local history so they would join the other branch.

Regards,


________________________________
From: Alistair Mann <al@pectw•net>
Sent: Wednesday, July 31, 2019 15:59
To: Kenshiro [] <tensiam@hotmail•com>; Bitcoin Protocol Discussion <bitcoin-dev@lists•linuxfoundation.org>
Subject: Re: [bitcoin-dev] Add a moving checkpoint to the Bitcoin protocol

On Wednesday 31 Jul 2019 12:28:58 Kenshiro [] via bitcoin-dev wrote:

> I would like to propose that a "moving checkpoint" is added to the Bitcoin
> protocol. It's a very simple rule already implemented in NXT coin:
>
> - A node will ignore any new block under nodeBlockHeight - N, so the
> blockchain becomes truly immutable after N blocks, even during a 51% attack
> which thanks to the moving checkpoint can't rewrite history older than the
> last N blocks.

How would a (potentially, state-sponsored) netsplit lasting longer than N be
handled?
--
Alistair Mann


[-- Attachment #2: Type: text/html, Size: 3157 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [bitcoin-dev] Add a moving checkpoint to the Bitcoin protocol
  2019-07-31 14:40   ` Kenshiro []
@ 2019-07-31 14:53     ` Kenshiro []
  2019-07-31 23:28       ` Alistair Mann
  2019-08-02 12:19       ` Ethan Heilman
  0 siblings, 2 replies; 10+ messages in thread
From: Kenshiro [] @ 2019-07-31 14:53 UTC (permalink / raw)
  To: Alistair Mann, Bitcoin Protocol Discussion

[-- Attachment #1: Type: text/plain, Size: 1768 bytes --]

P.S.: To be clearer, in this example I set an N value of 144 blocks, which is approximately 24 hours.

________________________________
From: Kenshiro [] <tensiam@hotmail•com>
Sent: Wednesday, July 31, 2019 16:40
To: Alistair Mann <al@pectw•net>; Bitcoin Protocol Discussion <bitcoin-dev@lists•linuxfoundation.org>
Subject: Re: [bitcoin-dev] Add a moving checkpoint to the Bitcoin protocol

>>> How would a (potentially, state-sponsored) netsplit lasting longer than N be
handled?

It would be detected by the community much before reaching the reorg limit of N blocks (it's 24 hours) so nodes could stop until the netsplit is fixed.

In the extreme case no one notice the network split during more than N blocks (24 hours) and there are 2 permanent forks longer than N, nodes from one branch could delete their local history so they would join the other branch.

Regards,


________________________________
From: Alistair Mann <al@pectw•net>
Sent: Wednesday, July 31, 2019 15:59
To: Kenshiro [] <tensiam@hotmail•com>; Bitcoin Protocol Discussion <bitcoin-dev@lists•linuxfoundation.org>
Subject: Re: [bitcoin-dev] Add a moving checkpoint to the Bitcoin protocol

On Wednesday 31 Jul 2019 12:28:58 Kenshiro [] via bitcoin-dev wrote:

> I would like to propose that a "moving checkpoint" is added to the Bitcoin
> protocol. It's a very simple rule already implemented in NXT coin:
>
> - A node will ignore any new block under nodeBlockHeight - N, so the
> blockchain becomes truly immutable after N blocks, even during a 51% attack
> which thanks to the moving checkpoint can't rewrite history older than the
> last N blocks.

How would a (potentially, state-sponsored) netsplit lasting longer than N be
handled?
--
Alistair Mann


[-- Attachment #2: Type: text/html, Size: 3999 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [bitcoin-dev] Add a moving checkpoint to the Bitcoin protocol
  2019-07-31 14:53     ` Kenshiro []
@ 2019-07-31 23:28       ` Alistair Mann
  2019-08-01 10:17         ` Kenshiro []
  2019-08-02 12:19       ` Ethan Heilman
  1 sibling, 1 reply; 10+ messages in thread
From: Alistair Mann @ 2019-07-31 23:28 UTC (permalink / raw)
  To: Kenshiro []; +Cc: Bitcoin Protocol Discussion

On Wednesday 31 Jul 2019 14:53:25 Kenshiro [] wrote:
>> How would a (potentially, state-sponsored) netsplit lasting longer than
>> N be handled?
>
> It would be detected by the community much before reaching the reorg limit
> of N blocks (it's 24 hours) so nodes could stop until the netsplit is
> fixed.

A netsplit cannot be detected but merely be suspected where the p2p protocol 
does allow arbitrary connecting/disconnecting of any peer: there's no 
difference between a remote net being split off, that net having nothing to 
say, and that net choosing to disconnect. Detection then mandates manual, out-
of-band communications, which is error prone and centralising.

I also observe 'stopping nodes' during netsplits introduces several attack 
vectors. Among them: create a netsplit, which stops the nodes, turn off the 
netsplit, repeat. A sequence of 365 actors causing their own small netsplits 
could effectively stop Bitcoin at the cost (to them) of no Internet for one 
day a year as the rolling netsplit could never be fixed.

> In the extreme case no one notice the network split during more than N
> blocks (24 hours) and there are 2 permanent forks longer than N, nodes from
> one branch could delete their local history so they would join the other
> branch.
>
> P.S.: To be clearer, in this example I set an N value of 144 blocks, which
> is approximately 24 hours.

I've seen estimates of China hosting more than 51% of hashpower. Say they 
conduct a netsplit. Does your suggestion mean that it's the rest of the world 
that has to delete their local history because they lack the hashpower to 
assert themselves as the proper branch? If so, I think having to delete actual 
history everywhere across the globe but China is not a price worth paying to 
limit reorgs to 24 hours.

I am unconvinced that the moving checkpoint you describe would improve 
Bitcoin.
-- 
Alistair Mann


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [bitcoin-dev] Add a moving checkpoint to the Bitcoin protocol
  2019-07-31 23:28       ` Alistair Mann
@ 2019-08-01 10:17         ` Kenshiro []
  0 siblings, 0 replies; 10+ messages in thread
From: Kenshiro [] @ 2019-08-01 10:17 UTC (permalink / raw)
  To: Alistair Mann; +Cc: Bitcoin Protocol Discussion

[-- Attachment #1: Type: text/plain, Size: 3212 bytes --]

mm you are right, then the "moving checkpoint" rule needs to have some limits to allow the network self-heal instead of requiring humans detecting the splits or stopping nodes.

Let's suppose than a 51% attack can be detected and the developers can release a new version of the software with a new mining protocol in about 3 days. Then the complementary rule could be something like this:

- If 2 forks have a block height difference of 432 blocks (about 3 days) or more, then the moving checkpoint rule is ignored and everything works as with the current protocol. With this rule, the network can self-heal in a 100% automated way.

This would prevent a history rewrite of more than 24 hours during a 51% attack during 3 days, which should give enough time to change the protocol. If instead of a 51% attack what happens is a network split, then nodes should converge to the longest chain in a few days.

But maybe I'm missing something here, I'm still learning.

Regards,



________________________________
From: Alistair Mann <al@pectw•net>
Sent: Thursday, August 1, 2019 1:28
To: Kenshiro [] <tensiam@hotmail•com>
Cc: Bitcoin Protocol Discussion <bitcoin-dev@lists•linuxfoundation.org>
Subject: Re: [bitcoin-dev] Add a moving checkpoint to the Bitcoin protocol

On Wednesday 31 Jul 2019 14:53:25 Kenshiro [] wrote:
>> How would a (potentially, state-sponsored) netsplit lasting longer than
>> N be handled?
>
> It would be detected by the community much before reaching the reorg limit
> of N blocks (it's 24 hours) so nodes could stop until the netsplit is
> fixed.

A netsplit cannot be detected but merely be suspected where the p2p protocol
does allow arbitrary connecting/disconnecting of any peer: there's no
difference between a remote net being split off, that net having nothing to
say, and that net choosing to disconnect. Detection then mandates manual, out-
of-band communications, which is error prone and centralising.

I also observe 'stopping nodes' during netsplits introduces several attack
vectors. Among them: create a netsplit, which stops the nodes, turn off the
netsplit, repeat. A sequence of 365 actors causing their own small netsplits
could effectively stop Bitcoin at the cost (to them) of no Internet for one
day a year as the rolling netsplit could never be fixed.

> In the extreme case no one notice the network split during more than N
> blocks (24 hours) and there are 2 permanent forks longer than N, nodes from
> one branch could delete their local history so they would join the other
> branch.
>
> P.S.: To be clearer, in this example I set an N value of 144 blocks, which
> is approximately 24 hours.

I've seen estimates of China hosting more than 51% of hashpower. Say they
conduct a netsplit. Does your suggestion mean that it's the rest of the world
that has to delete their local history because they lack the hashpower to
assert themselves as the proper branch? If so, I think having to delete actual
history everywhere across the globe but China is not a price worth paying to
limit reorgs to 24 hours.

I am unconvinced that the moving checkpoint you describe would improve
Bitcoin.
--
Alistair Mann

[-- Attachment #2: Type: text/html, Size: 6632 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [bitcoin-dev] Add a moving checkpoint to the Bitcoin protocol
  2019-07-31 14:53     ` Kenshiro []
  2019-07-31 23:28       ` Alistair Mann
@ 2019-08-02 12:19       ` Ethan Heilman
  2019-08-02 13:08         ` Kenshiro []
  1 sibling, 1 reply; 10+ messages in thread
From: Ethan Heilman @ 2019-08-02 12:19 UTC (permalink / raw)
  To: Kenshiro [], Bitcoin Dev

[-- Attachment #1: Type: text/plain, Size: 3745 bytes --]

Attack 1:
I partition (i.e. eclipse) a bunch of nodes from the network this partition
contains no mining power . I then mine 145 blocks for this partition. I
don't even need 51% of the mining power because I'm not competing with any
other miners. Under this rule this partition will hardfork from the network
permanently. Under current rules this partition will be able to rejoin the
network as the least weight chain will be orphaned.

Attack 2:
I pre-mine 145 blocks. A node goes offline for 24 hours, when it rejoins I
feed it 145 blocks which fork off from the consensus chain. I have 24+24
hours to mine these 145 blocks so I should be able to do this with 25% of
the current hash rate at the time the node went offline. Under your rule
each of these offline-->online nodes I attack this way will hardfork
themselves from the rest of the network.

I believe a moving-checkpoint rule as describe above would make Bitcoin
more vulnerable to 51% attacks.

A safer rule would be if a node detects a fork with both sides of the split
having  length > 144 blocks, it halts and requests user intervention to
determine which chain to follow.  I don't think 144 blocks is a great
number to use here as 24 hours is very short. I suspect you could improve
the security of the rule by making the number of blocks a fork most reach
to halt the network proportional to the difference in time between the
timestamp in the block prior to the fork and the current time. I am **NOT**
proposing Bitcoin adopt such a rule.

NXT has a fundamentally different security model as it uses Proof-of-stake
rather than Proof-of-Work.

On Wed, Jul 31, 2019 at 2:37 PM Kenshiro [] via bitcoin-dev <
bitcoin-dev@lists•linuxfoundation.org> wrote:

> P.S.: To be clearer, in this example I set an N value of 144 blocks, which
> is approximately 24 hours.
>
> ------------------------------
> *From:* Kenshiro [] <tensiam@hotmail•com>
> *Sent:* Wednesday, July 31, 2019 16:40
> *To:* Alistair Mann <al@pectw•net>; Bitcoin Protocol Discussion <
> bitcoin-dev@lists•linuxfoundation.org>
> *Subject:* Re: [bitcoin-dev] Add a moving checkpoint to the Bitcoin
> protocol
>
> >>> How would a (potentially, state-sponsored) netsplit lasting longer
> than N be
> handled?
>
> It would be detected by the community much before reaching the reorg limit
> of N blocks (it's 24 hours) so nodes could stop until the netsplit is
> fixed.
>
> In the extreme case no one notice the network split during more than N
> blocks (24 hours) and there are 2 permanent forks longer than N, nodes
> from one branch could delete their local history so they would join the
> other branch.
>
> Regards,
>
>
> ------------------------------
> *From:* Alistair Mann <al@pectw•net>
> *Sent:* Wednesday, July 31, 2019 15:59
> *To:* Kenshiro [] <tensiam@hotmail•com>; Bitcoin Protocol Discussion <
> bitcoin-dev@lists•linuxfoundation.org>
> *Subject:* Re: [bitcoin-dev] Add a moving checkpoint to the Bitcoin
> protocol
>
> On Wednesday 31 Jul 2019 12:28:58 Kenshiro [] via bitcoin-dev wrote:
>
> > I would like to propose that a "moving checkpoint" is added to the
> Bitcoin
> > protocol. It's a very simple rule already implemented in NXT coin:
> >
> > - A node will ignore any new block under nodeBlockHeight - N, so the
> > blockchain becomes truly immutable after N blocks, even during a 51%
> attack
> > which thanks to the moving checkpoint can't rewrite history older than
> the
> > last N blocks.
>
> How would a (potentially, state-sponsored) netsplit lasting longer than N
> be
> handled?
> --
> Alistair Mann
>
> _______________________________________________
> bitcoin-dev mailing list
> bitcoin-dev@lists•linuxfoundation.org
> https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev
>

[-- Attachment #2: Type: text/html, Size: 7028 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [bitcoin-dev] Add a moving checkpoint to the Bitcoin protocol
  2019-08-02 12:19       ` Ethan Heilman
@ 2019-08-02 13:08         ` Kenshiro []
  2019-08-03  0:51           ` LORD HIS EXCELLENCY JAMES HRMH
  0 siblings, 1 reply; 10+ messages in thread
From: Kenshiro [] @ 2019-08-02 13:08 UTC (permalink / raw)
  To: Ethan Heilman, Bitcoin Dev

[-- Attachment #1: Type: text/plain, Size: 6033 bytes --]

Hi all,

Very good points. I did some clarifications in a private conversation, the new rule is making the moving checkpoint valid only if the difference in blocks between the main chain and the new fork is smaller than X blocks, like for example 3 days of blocks, so after a long network split everyone can finally follow the longest chain:

With the current protocol the fix to a network split is simple, the longest chain win. But with the moving checkpoint I'm proposing we have a problem if both chains began to differ more than N blocks ago, the forks are permanent. So we need an additional rule to ignore the moving checkpoint, a limit of X blocks:

If a node sees a fork longer than his main chain, and the fork has at least X blocks more than the main chain, then the node ignore the moving checkpoint rule, and it follows the fork, the longest chain.

So as an example, the moving checkpoint could be 24 hours of blocks, and the limit of X blocks, the blocks of 3 days.

So we have 2 possible situations to consider:

- 51% attack:  the blocks older than 24 hours are protected against a history rewrite during at least 3 days, in that time developers could release an emergency release with another mining algorithm to stop the attack.

- Network split: if the network split is older than N blocks, we have 2 permanent forks (or chains), but in 3 days (or more) the blockchain heights will differ in more than X blocks (the blocks of 3 days) because there will be more miners in one chain than in the other so finally the loser chain will be abandoned and everyone will follow the longest chain.

It could be even more conservative, like 48 hours for the moving checkpoint and a block limit of 7 days of blocks.

Regards,



________________________________
From: Ethan Heilman <eth3rs@gmail•com>
Sent: Friday, August 2, 2019 14:19
To: Kenshiro [] <tensiam@hotmail•com>; Bitcoin Dev <bitcoin-dev@lists•linuxfoundation.org>
Cc: Alistair Mann <al@pectw•net>
Subject: Re: [bitcoin-dev] Add a moving checkpoint to the Bitcoin protocol

Attack 1:
I partition (i.e. eclipse) a bunch of nodes from the network this partition contains no mining power . I then mine 145 blocks for this partition. I don't even need 51% of the mining power because I'm not competing with any other miners. Under this rule this partition will hardfork from the network permanently. Under current rules this partition will be able to rejoin the network as the least weight chain will be orphaned.

Attack 2:
I pre-mine 145 blocks. A node goes offline for 24 hours, when it rejoins I feed it 145 blocks which fork off from the consensus chain. I have 24+24 hours to mine these 145 blocks so I should be able to do this with 25% of the current hash rate at the time the node went offline. Under your rule each of these offline-->online nodes I attack this way will hardfork themselves from the rest of the network.

I believe a moving-checkpoint rule as describe above would make Bitcoin more vulnerable to 51% attacks.

A safer rule would be if a node detects a fork with both sides of the split having  length > 144 blocks, it halts and requests user intervention to determine which chain to follow.  I don't think 144 blocks is a great number to use here as 24 hours is very short. I suspect you could improve the security of the rule by making the number of blocks a fork most reach to halt the network proportional to the difference in time between the timestamp in the block prior to the fork and the current time. I am **NOT** proposing Bitcoin adopt such a rule.

NXT has a fundamentally different security model as it uses Proof-of-stake rather than Proof-of-Work.

On Wed, Jul 31, 2019 at 2:37 PM Kenshiro [] via bitcoin-dev <bitcoin-dev@lists.linuxfoundation.org<mailto:bitcoin-dev@lists•linuxfoundation.org>> wrote:
P.S.: To be clearer, in this example I set an N value of 144 blocks, which is approximately 24 hours.

________________________________
From: Kenshiro [] <tensiam@hotmail.com<mailto:tensiam@hotmail•com>>
Sent: Wednesday, July 31, 2019 16:40
To: Alistair Mann <al@pectw.net<mailto:al@pectw•net>>; Bitcoin Protocol Discussion <bitcoin-dev@lists.linuxfoundation.org<mailto:bitcoin-dev@lists•linuxfoundation.org>>
Subject: Re: [bitcoin-dev] Add a moving checkpoint to the Bitcoin protocol

>>> How would a (potentially, state-sponsored) netsplit lasting longer than N be
handled?

It would be detected by the community much before reaching the reorg limit of N blocks (it's 24 hours) so nodes could stop until the netsplit is fixed.

In the extreme case no one notice the network split during more than N blocks (24 hours) and there are 2 permanent forks longer than N, nodes from one branch could delete their local history so they would join the other branch.

Regards,


________________________________
From: Alistair Mann <al@pectw.net<mailto:al@pectw•net>>
Sent: Wednesday, July 31, 2019 15:59
To: Kenshiro [] <tensiam@hotmail.com<mailto:tensiam@hotmail•com>>; Bitcoin Protocol Discussion <bitcoin-dev@lists.linuxfoundation.org<mailto:bitcoin-dev@lists•linuxfoundation.org>>
Subject: Re: [bitcoin-dev] Add a moving checkpoint to the Bitcoin protocol

On Wednesday 31 Jul 2019 12:28:58 Kenshiro [] via bitcoin-dev wrote:

> I would like to propose that a "moving checkpoint" is added to the Bitcoin
> protocol. It's a very simple rule already implemented in NXT coin:
>
> - A node will ignore any new block under nodeBlockHeight - N, so the
> blockchain becomes truly immutable after N blocks, even during a 51% attack
> which thanks to the moving checkpoint can't rewrite history older than the
> last N blocks.

How would a (potentially, state-sponsored) netsplit lasting longer than N be
handled?
--
Alistair Mann

_______________________________________________
bitcoin-dev mailing list
bitcoin-dev@lists.linuxfoundation.org<mailto:bitcoin-dev@lists•linuxfoundation.org>
https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev

[-- Attachment #2: Type: text/html, Size: 11310 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [bitcoin-dev] Add a moving checkpoint to the Bitcoin protocol
  2019-08-02 13:08         ` Kenshiro []
@ 2019-08-03  0:51           ` LORD HIS EXCELLENCY JAMES HRMH
  2019-08-03 10:35             ` Kenshiro []
  0 siblings, 1 reply; 10+ messages in thread
From: LORD HIS EXCELLENCY JAMES HRMH @ 2019-08-03  0:51 UTC (permalink / raw)
  To: Ethan Heilman, Bitcoin Dev, Kenshiro []

[-- Attachment #1: Type: text/plain, Size: 7030 bytes --]

I have but one point to make in a brief catch-up read over.

With the current protocol the fix to a network split is simple, the longest chain win. But with the moving checkpoint I'm proposing we have a problem if both chains began to differ more than N blocks ago, the forks are permanent. So we need an additional rule to ignore the moving checkpoint, a limit of X blocks:

It is not to be considered the longest chain, it is to be considered the longest chain with the most proof of work.

Regards,
LORD HIS EXCELLENCY JAMES HRMH
<https://earn.com/willtech>


________________________________
From: bitcoin-dev-bounces@lists•linuxfoundation.org <bitcoin-dev-bounces@lists•linuxfoundation.org> on behalf of Kenshiro [] via bitcoin-dev <bitcoin-dev@lists•linuxfoundation.org>
Sent: Friday, 2 August 2019 11:08 PM
To: Ethan Heilman <eth3rs@gmail•com>; Bitcoin Dev <bitcoin-dev@lists•linuxfoundation.org>
Subject: Re: [bitcoin-dev] Add a moving checkpoint to the Bitcoin protocol

Hi all,

Very good points. I did some clarifications in a private conversation, the new rule is making the moving checkpoint valid only if the difference in blocks between the main chain and the new fork is smaller than X blocks, like for example 3 days of blocks, so after a long network split everyone can finally follow the longest chain:

With the current protocol the fix to a network split is simple, the longest chain win. But with the moving checkpoint I'm proposing we have a problem if both chains began to differ more than N blocks ago, the forks are permanent. So we need an additional rule to ignore the moving checkpoint, a limit of X blocks:

If a node sees a fork longer than his main chain, and the fork has at least X blocks more than the main chain, then the node ignore the moving checkpoint rule, and it follows the fork, the longest chain.

So as an example, the moving checkpoint could be 24 hours of blocks, and the limit of X blocks, the blocks of 3 days.

So we have 2 possible situations to consider:

- 51% attack:  the blocks older than 24 hours are protected against a history rewrite during at least 3 days, in that time developers could release an emergency release with another mining algorithm to stop the attack.

- Network split: if the network split is older than N blocks, we have 2 permanent forks (or chains), but in 3 days (or more) the blockchain heights will differ in more than X blocks (the blocks of 3 days) because there will be more miners in one chain than in the other so finally the loser chain will be abandoned and everyone will follow the longest chain.

It could be even more conservative, like 48 hours for the moving checkpoint and a block limit of 7 days of blocks.

Regards,



________________________________
From: Ethan Heilman <eth3rs@gmail•com>
Sent: Friday, August 2, 2019 14:19
To: Kenshiro [] <tensiam@hotmail•com>; Bitcoin Dev <bitcoin-dev@lists•linuxfoundation.org>
Cc: Alistair Mann <al@pectw•net>
Subject: Re: [bitcoin-dev] Add a moving checkpoint to the Bitcoin protocol

Attack 1:
I partition (i.e. eclipse) a bunch of nodes from the network this partition contains no mining power . I then mine 145 blocks for this partition. I don't even need 51% of the mining power because I'm not competing with any other miners. Under this rule this partition will hardfork from the network permanently. Under current rules this partition will be able to rejoin the network as the least weight chain will be orphaned.

Attack 2:
I pre-mine 145 blocks. A node goes offline for 24 hours, when it rejoins I feed it 145 blocks which fork off from the consensus chain. I have 24+24 hours to mine these 145 blocks so I should be able to do this with 25% of the current hash rate at the time the node went offline. Under your rule each of these offline-->online nodes I attack this way will hardfork themselves from the rest of the network.

I believe a moving-checkpoint rule as describe above would make Bitcoin more vulnerable to 51% attacks.

A safer rule would be if a node detects a fork with both sides of the split having  length > 144 blocks, it halts and requests user intervention to determine which chain to follow.  I don't think 144 blocks is a great number to use here as 24 hours is very short. I suspect you could improve the security of the rule by making the number of blocks a fork most reach to halt the network proportional to the difference in time between the timestamp in the block prior to the fork and the current time. I am **NOT** proposing Bitcoin adopt such a rule.

NXT has a fundamentally different security model as it uses Proof-of-stake rather than Proof-of-Work.

On Wed, Jul 31, 2019 at 2:37 PM Kenshiro [] via bitcoin-dev <bitcoin-dev@lists.linuxfoundation.org<mailto:bitcoin-dev@lists•linuxfoundation.org>> wrote:
P.S.: To be clearer, in this example I set an N value of 144 blocks, which is approximately 24 hours.

________________________________
From: Kenshiro [] <tensiam@hotmail.com<mailto:tensiam@hotmail•com>>
Sent: Wednesday, July 31, 2019 16:40
To: Alistair Mann <al@pectw.net<mailto:al@pectw•net>>; Bitcoin Protocol Discussion <bitcoin-dev@lists.linuxfoundation.org<mailto:bitcoin-dev@lists•linuxfoundation.org>>
Subject: Re: [bitcoin-dev] Add a moving checkpoint to the Bitcoin protocol

>>> How would a (potentially, state-sponsored) netsplit lasting longer than N be
handled?

It would be detected by the community much before reaching the reorg limit of N blocks (it's 24 hours) so nodes could stop until the netsplit is fixed.

In the extreme case no one notice the network split during more than N blocks (24 hours) and there are 2 permanent forks longer than N, nodes from one branch could delete their local history so they would join the other branch.

Regards,


________________________________
From: Alistair Mann <al@pectw.net<mailto:al@pectw•net>>
Sent: Wednesday, July 31, 2019 15:59
To: Kenshiro [] <tensiam@hotmail.com<mailto:tensiam@hotmail•com>>; Bitcoin Protocol Discussion <bitcoin-dev@lists.linuxfoundation.org<mailto:bitcoin-dev@lists•linuxfoundation.org>>
Subject: Re: [bitcoin-dev] Add a moving checkpoint to the Bitcoin protocol

On Wednesday 31 Jul 2019 12:28:58 Kenshiro [] via bitcoin-dev wrote:

> I would like to propose that a "moving checkpoint" is added to the Bitcoin
> protocol. It's a very simple rule already implemented in NXT coin:
>
> - A node will ignore any new block under nodeBlockHeight - N, so the
> blockchain becomes truly immutable after N blocks, even during a 51% attack
> which thanks to the moving checkpoint can't rewrite history older than the
> last N blocks.

How would a (potentially, state-sponsored) netsplit lasting longer than N be
handled?
--
Alistair Mann

_______________________________________________
bitcoin-dev mailing list
bitcoin-dev@lists.linuxfoundation.org<mailto:bitcoin-dev@lists•linuxfoundation.org>
https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev

[-- Attachment #2: Type: text/html, Size: 13908 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [bitcoin-dev] Add a moving checkpoint to the Bitcoin protocol
  2019-08-03  0:51           ` LORD HIS EXCELLENCY JAMES HRMH
@ 2019-08-03 10:35             ` Kenshiro []
  0 siblings, 0 replies; 10+ messages in thread
From: Kenshiro [] @ 2019-08-03 10:35 UTC (permalink / raw)
  To: LORD HIS EXCELLENCY JAMES HRMH, Ethan Heilman, Bitcoin Dev

[-- Attachment #1: Type: text/plain, Size: 7807 bytes --]

Good point, for the moving checkpoint a number of blocks (or maybe a timestamp) could be enough, but for the block limit of X blocks to decide if the moving checkpoint is ignored or not, as we have to compare two chains (main chain and fork) maybe is much better to measure the blockchain lengths as numberOfBlocks * averageBlockDifficulty, so if a difficulty adjustment happens in that time interval, it's taken into account.

Regards

________________________________
From: LORD HIS EXCELLENCY JAMES HRMH <willtech@live•com.au>
Sent: Saturday, August 3, 2019 2:51
To: Ethan Heilman <eth3rs@gmail•com>; Bitcoin Dev <bitcoin-dev@lists•linuxfoundation.org>; Kenshiro [] <tensiam@hotmail•com>
Subject: Re: [bitcoin-dev] Add a moving checkpoint to the Bitcoin protocol

I have but one point to make in a brief catch-up read over.

With the current protocol the fix to a network split is simple, the longest chain win. But with the moving checkpoint I'm proposing we have a problem if both chains began to differ more than N blocks ago, the forks are permanent. So we need an additional rule to ignore the moving checkpoint, a limit of X blocks:

It is not to be considered the longest chain, it is to be considered the longest chain with the most proof of work.

Regards,
LORD HIS EXCELLENCY JAMES HRMH
<https://earn.com/willtech>


________________________________
From: bitcoin-dev-bounces@lists•linuxfoundation.org <bitcoin-dev-bounces@lists•linuxfoundation.org> on behalf of Kenshiro [] via bitcoin-dev <bitcoin-dev@lists•linuxfoundation.org>
Sent: Friday, 2 August 2019 11:08 PM
To: Ethan Heilman <eth3rs@gmail•com>; Bitcoin Dev <bitcoin-dev@lists•linuxfoundation.org>
Subject: Re: [bitcoin-dev] Add a moving checkpoint to the Bitcoin protocol

Hi all,

Very good points. I did some clarifications in a private conversation, the new rule is making the moving checkpoint valid only if the difference in blocks between the main chain and the new fork is smaller than X blocks, like for example 3 days of blocks, so after a long network split everyone can finally follow the longest chain:

With the current protocol the fix to a network split is simple, the longest chain win. But with the moving checkpoint I'm proposing we have a problem if both chains began to differ more than N blocks ago, the forks are permanent. So we need an additional rule to ignore the moving checkpoint, a limit of X blocks:

If a node sees a fork longer than his main chain, and the fork has at least X blocks more than the main chain, then the node ignore the moving checkpoint rule, and it follows the fork, the longest chain.

So as an example, the moving checkpoint could be 24 hours of blocks, and the limit of X blocks, the blocks of 3 days.

So we have 2 possible situations to consider:

- 51% attack:  the blocks older than 24 hours are protected against a history rewrite during at least 3 days, in that time developers could release an emergency release with another mining algorithm to stop the attack.

- Network split: if the network split is older than N blocks, we have 2 permanent forks (or chains), but in 3 days (or more) the blockchain heights will differ in more than X blocks (the blocks of 3 days) because there will be more miners in one chain than in the other so finally the loser chain will be abandoned and everyone will follow the longest chain.

It could be even more conservative, like 48 hours for the moving checkpoint and a block limit of 7 days of blocks.

Regards,



________________________________
From: Ethan Heilman <eth3rs@gmail•com>
Sent: Friday, August 2, 2019 14:19
To: Kenshiro [] <tensiam@hotmail•com>; Bitcoin Dev <bitcoin-dev@lists•linuxfoundation.org>
Cc: Alistair Mann <al@pectw•net>
Subject: Re: [bitcoin-dev] Add a moving checkpoint to the Bitcoin protocol

Attack 1:
I partition (i.e. eclipse) a bunch of nodes from the network this partition contains no mining power . I then mine 145 blocks for this partition. I don't even need 51% of the mining power because I'm not competing with any other miners. Under this rule this partition will hardfork from the network permanently. Under current rules this partition will be able to rejoin the network as the least weight chain will be orphaned.

Attack 2:
I pre-mine 145 blocks. A node goes offline for 24 hours, when it rejoins I feed it 145 blocks which fork off from the consensus chain. I have 24+24 hours to mine these 145 blocks so I should be able to do this with 25% of the current hash rate at the time the node went offline. Under your rule each of these offline-->online nodes I attack this way will hardfork themselves from the rest of the network.

I believe a moving-checkpoint rule as describe above would make Bitcoin more vulnerable to 51% attacks.

A safer rule would be if a node detects a fork with both sides of the split having  length > 144 blocks, it halts and requests user intervention to determine which chain to follow.  I don't think 144 blocks is a great number to use here as 24 hours is very short. I suspect you could improve the security of the rule by making the number of blocks a fork most reach to halt the network proportional to the difference in time between the timestamp in the block prior to the fork and the current time. I am **NOT** proposing Bitcoin adopt such a rule.

NXT has a fundamentally different security model as it uses Proof-of-stake rather than Proof-of-Work.

On Wed, Jul 31, 2019 at 2:37 PM Kenshiro [] via bitcoin-dev <bitcoin-dev@lists.linuxfoundation.org<mailto:bitcoin-dev@lists•linuxfoundation.org>> wrote:
P.S.: To be clearer, in this example I set an N value of 144 blocks, which is approximately 24 hours.

________________________________
From: Kenshiro [] <tensiam@hotmail.com<mailto:tensiam@hotmail•com>>
Sent: Wednesday, July 31, 2019 16:40
To: Alistair Mann <al@pectw.net<mailto:al@pectw•net>>; Bitcoin Protocol Discussion <bitcoin-dev@lists.linuxfoundation.org<mailto:bitcoin-dev@lists•linuxfoundation.org>>
Subject: Re: [bitcoin-dev] Add a moving checkpoint to the Bitcoin protocol

>>> How would a (potentially, state-sponsored) netsplit lasting longer than N be
handled?

It would be detected by the community much before reaching the reorg limit of N blocks (it's 24 hours) so nodes could stop until the netsplit is fixed.

In the extreme case no one notice the network split during more than N blocks (24 hours) and there are 2 permanent forks longer than N, nodes from one branch could delete their local history so they would join the other branch.

Regards,


________________________________
From: Alistair Mann <al@pectw.net<mailto:al@pectw•net>>
Sent: Wednesday, July 31, 2019 15:59
To: Kenshiro [] <tensiam@hotmail.com<mailto:tensiam@hotmail•com>>; Bitcoin Protocol Discussion <bitcoin-dev@lists.linuxfoundation.org<mailto:bitcoin-dev@lists•linuxfoundation.org>>
Subject: Re: [bitcoin-dev] Add a moving checkpoint to the Bitcoin protocol

On Wednesday 31 Jul 2019 12:28:58 Kenshiro [] via bitcoin-dev wrote:

> I would like to propose that a "moving checkpoint" is added to the Bitcoin
> protocol. It's a very simple rule already implemented in NXT coin:
>
> - A node will ignore any new block under nodeBlockHeight - N, so the
> blockchain becomes truly immutable after N blocks, even during a 51% attack
> which thanks to the moving checkpoint can't rewrite history older than the
> last N blocks.

How would a (potentially, state-sponsored) netsplit lasting longer than N be
handled?
--
Alistair Mann

_______________________________________________
bitcoin-dev mailing list
bitcoin-dev@lists.linuxfoundation.org<mailto:bitcoin-dev@lists•linuxfoundation.org>
https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev

[-- Attachment #2: Type: text/html, Size: 15516 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2019-08-03 10:35 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-31 12:28 [bitcoin-dev] Add a moving checkpoint to the Bitcoin protocol Kenshiro []
2019-07-31 13:59 ` Alistair Mann
2019-07-31 14:40   ` Kenshiro []
2019-07-31 14:53     ` Kenshiro []
2019-07-31 23:28       ` Alistair Mann
2019-08-01 10:17         ` Kenshiro []
2019-08-02 12:19       ` Ethan Heilman
2019-08-02 13:08         ` Kenshiro []
2019-08-03  0:51           ` LORD HIS EXCELLENCY JAMES HRMH
2019-08-03 10:35             ` Kenshiro []

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox