Bitcoin Forum
May 23, 2024, 09:00:28 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: checkpoints.cpp and timestamps  (Read 1805 times)
rikkejohn (OP)
Hero Member
*****
Offline Offline

Activity: 644
Merit: 500


View Profile
October 11, 2014, 12:31:56 PM
 #1

I'm confused, any help will be appreciated.

There seems to be the view that you stick in a checkpoint every now and again (is it really necessary?)

SHA256 checkpoints.cpp says

// What makes a good checkpoint block?
    // + Is surrounded by blocks with reasonable timestamps
    //   (no blocks before with a timestamp after, none after with
    //    timestamp before)
    // + Contains no strange transactions

        
So I map some checkpoints

        ( 0,     uint256("0x00000447468db4b26ca942c2c6c700b49907e9d0d8ca6ce2bd84223a74972259"))
        ( 5000,     uint256("0x00000000001070b052725af8bf364b9442f957347aa5344304c5c031dd373253"))
        ( 15000,     uint256("0x000000000003d26b8091f8220f151218bb56fcb648ca70bb92968b83ac469848"))
        ( 25000,     uint256("0x000000000004b042f2f61bea4a20d5e8823361d9615e352e34c8ea9b66b3a955"))


But what about the timestamp mentioned above?

Do I have to change the UNIX timestamp everytime I put a checkpoint in? So it matches the checkpoint, or do I just use the original?

My last checkpoint was 000000000004b042f2f61bea4a20d5e8823361d9615e352e34c8ea9b66b3a955
This corresponded with 1412731053 Timestamp

So do I change the timestamp?

static const CCheckpointData data = {
        &mapCheckpoints,
          1412731053  // * UNIX timestamp of last checkpoint block


Or leave it as the original?

static const CCheckpointData data = {
        &mapCheckpoints,
          1410084058  // * UNIX timestamp of last checkpoint block


And WTF to this?
        
       1,     // * total number of transactions between genesis and last checkpoint

Do I just add up the number (say it is 30,000), and put that in?


I known these are shitty questions that will make people groan, but I can't find the answers on Google.

Anyone?
    

1PkwpyTLo5TfagzCPgjdvQFNVzuEyHViGt
andytoshi
Full Member
***
Offline Offline

Activity: 179
Merit: 151

-


View Profile
October 11, 2014, 04:16:12 PM
 #2

Checkpoints are really not necessary. They prevent a DoS attack where on first bootstrap somebody feeds you a bad chain and you waste a lot of time validating it before finding the good one. There is ongoing work right now on "headers first" (largely sipa's doing if you want somebody to thank) which will allow Bitcoin Core to check the proof-of-work before doing any validation, and therefore eliminate bad chains quickly.

They also make an isolation attack harder by forcing an isolation attacker to build fake blocks off the latest checkpoint, which has a high difficulty and will be costly. But this can be fixed without checkpoints by simply encoding a "minimum total work" as a weak sort of checkpoint, which doesn't favour any particular chain, just insists that enough work be done to create it.

We really want checkpoints to be dropped because they cause confusion (some other currencies use them as a stealth consensus centralization mechanism). In Bitcoin they have nothing to do with consensus, they are just a DoS mitigation, and there are certainly better solutions.

Edit: Also, please don't bump your post after only two hours, (and while I'm being a grump, please remove your garish signature).
fbueller
Sr. Member
****
Offline Offline

Activity: 412
Merit: 275


View Profile
October 11, 2014, 06:19:10 PM
 #3

Good post andytoshi.

Why do you want to add checkpoints? They are generally added when the block is a few months in the past, because there's no chance of a blockchain reorganisation going that deep.. In Bitcoin they are purely for clients downing the blockchain for the first time.

Bitwasp Developer.
rikkejohn (OP)
Hero Member
*****
Offline Offline

Activity: 644
Merit: 500


View Profile
October 11, 2014, 11:14:37 PM
 #4

Checkpoints are really not necessary. They prevent a DoS attack where on first bootstrap somebody feeds you a bad chain and you waste a lot of time validating it before finding the good one. There is ongoing work right now on "headers first" (largely sipa's doing if you want somebody to thank) which will allow Bitcoin Core to check the proof-of-work before doing any validation, and therefore eliminate bad chains quickly.

They also make an isolation attack harder by forcing an isolation attacker to build fake blocks off the latest checkpoint, which has a high difficulty and will be costly. But this can be fixed without checkpoints by simply encoding a "minimum total work" as a weak sort of checkpoint, which doesn't favour any particular chain, just insists that enough work be done to create it.

We really want checkpoints to be dropped because they cause confusion (some other currencies use them as a stealth consensus centralization mechanism). In Bitcoin they have nothing to do with consensus, they are just a DoS mitigation, and there are certainly better solutions.

Edit: Also, please don't bump your post after only two hours, (and while I'm being a grump, please remove your garish signature).

LOL - well thanks ... I think ...

The sig didn't pay this week, but it has been regular

Sorry for the bump after 2 hours

so you reckon, screw the damned things!

:-)


1PkwpyTLo5TfagzCPgjdvQFNVzuEyHViGt
rikkejohn (OP)
Hero Member
*****
Offline Offline

Activity: 644
Merit: 500


View Profile
October 11, 2014, 11:16:39 PM
 #5

Good post andytoshi.

Why do you want to add checkpoints? They are generally added when the block is a few months in the past, because there's no chance of a blockchain reorganisation going that deep.. In Bitcoin they are purely for clients downing the blockchain for the first time.

Thanks, and you agree with andy, and I have heard the same before.

I love you both.

1PkwpyTLo5TfagzCPgjdvQFNVzuEyHViGt
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!