Bitcoin Forum

Alternate cryptocurrencies => Altcoin Discussion => Topic started by: mammix2 on April 24, 2014, 05:31:10 PM



Title: How to work out 'checkpoint of stake modifiers'?
Post by: mammix2 on April 24, 2014, 05:31:10 PM
Hi All

Im deving for other coins at the moment, can someone tell me how to work out the 'checkpoint of stake modifier' values within kernel.cpp ?

This is for one of those oh so popular PoS coins at the moment  ;)


Code:
// Hard checkpoints of stake modifiers to ensure they are deterministic
static std::map<int, unsigned int> mapStakeModifierCheckpoints =
    boost::assign::map_list_of
            (     0, 0xfd11f4e7u )
;



Title: Re: How to work out 'checkpoint of stake modifiers'?
Post by: mammix2 on April 25, 2014, 08:46:44 AM
Bump.

Anyone?


Title: Re: How to work out 'checkpoint of stake modifiers'?
Post by: YarkoL on April 25, 2014, 10:30:56 AM

I don't know that much about PoS but here's what Sunny King had to say:

CheckStakeModifierCheckpoints() is just used to make sure the stake modifier computation is deterministic and every node computes to the same value. It's only checked with a few blocks, like the hard checkpoint that bitcoin uses.

It's not actually part of the protocol itself. The reason it was there is because of the complexity of modifier computation there could be bugs that made it non-deterministic. I put it there just so if someone runs into it then I would know a bug exists with the modifier computation.

Peercoin currently has 3 checkpoints added after genesis. I guess you can add them whenever you feel like it,
in connection with client updates for instance.


Title: Re: How to work out 'checkpoint of stake modifiers'?
Post by: mammix2 on April 28, 2014, 12:42:07 PM

I don't know that much about PoS but here's what Sunny King had to say:

CheckStakeModifierCheckpoints() is just used to make sure the stake modifier computation is deterministic and every node computes to the same value. It's only checked with a few blocks, like the hard checkpoint that bitcoin uses.

It's not actually part of the protocol itself. The reason it was there is because of the complexity of modifier computation there could be bugs that made it non-deterministic. I put it there just so if someone runs into it then I would know a bug exists with the modifier computation.

Peercoin currently has 3 checkpoints added after genesis. I guess you can add them whenever you feel like it,
in connection with client updates for instance.

Thanks for the reply, i'll check it out :)


Title: Re: How to work out 'checkpoint of stake modifiers'?
Post by: YarkoL on April 28, 2014, 06:08:03 PM
Thanks for the reply, i'll check it out :)

To clarify a little, you don't actually need those as they are extra security precaution.

Still it might be a good idea to add one for the genesis block at least.

When you've got your genesis, run getblock on it. Copy the modifierchecksum field, insert into code and recompile.


Title: Re: How to work out 'checkpoint of stake modifiers'?
Post by: bwmedia on April 28, 2014, 06:52:45 PM
Interesting info :)


Title: Re: How to work out 'checkpoint of stake modifiers'?
Post by: Skyripper on October 31, 2016, 08:15:41 PM
Hi All

Im deving for other coins at the moment, can someone tell me how to work out the 'checkpoint of stake modifier' values within kernel.cpp ?

This is for one of those oh so popular PoS coins at the moment  ;)


Code:
// Hard checkpoints of stake modifiers to ensure they are deterministic
static std::map<int, unsigned int> mapStakeModifierCheckpoints =
    boost::assign::map_list_of
            (     0, 0xfd11f4e7u )
;


Bump! I am interested how to get a Stake Modifier Checksum for the Genesis Block? I got this error:

Code:
ERROR: AddToBlockIndex() : Rejected by stake modifier checkpoint height=0, modifier=0x0000000000000000
ERROR: LoadBlockIndex() : genesis block not accepted


Title: Re: How to work out 'checkpoint of stake modifiers'?
Post by: mammix2 on November 02, 2016, 12:06:06 AM
Hi All

Im deving for other coins at the moment, can someone tell me how to work out the 'checkpoint of stake modifier' values within kernel.cpp ?

This is for one of those oh so popular PoS coins at the moment  ;)


Code:
// Hard checkpoints of stake modifiers to ensure they are deterministic
static std::map<int, unsigned int> mapStakeModifierCheckpoints =
    boost::assign::map_list_of
            (     0, 0xfd11f4e7u )
;


Bump! I am interested how to get a Stake Modifier Checksum for the Genesis Block? I got this error:

Code:
ERROR: AddToBlockIndex() : Rejected by stake modifier checkpoint height=0, modifier=0x0000000000000000
ERROR: LoadBlockIndex() : genesis block not accepted

You need to comment out this check while creating the genesis block

example..
https://github.com/mammix2/boostcoin-core/blob/master/src/main.cpp#L2074-L2075

Then uncomment it once you're up and running


Title: Re: How to work out 'checkpoint of stake modifiers'?
Post by: Skyripper on November 02, 2016, 10:23:07 PM
You need to comment out this check while creating the genesis block

example..
https://github.com/mammix2/boostcoin-core/blob/master/src/main.cpp#L2074-L2075

Then uncomment it once you're up and running

Thank you very much, it helped me a lot.


Title: Re: How to work out 'checkpoint of stake modifiers'?
Post by: leonid_coin on September 17, 2018, 05:37:19 AM
Hi All

Im deving for other coins at the moment, can someone tell me how to work out the 'checkpoint of stake modifier' values within kernel.cpp ?

This is for one of those oh so popular PoS coins at the moment  ;)


Code:
// Hard checkpoints of stake modifiers to ensure they are deterministic
static std::map<int, unsigned int> mapStakeModifierCheckpoints =
    boost::assign::map_list_of
            (     0, 0xfd11f4e7u )
;


Bump! I am interested how to get a Stake Modifier Checksum for the Genesis Block? I got this error:

Code:
ERROR: AddToBlockIndex() : Rejected by stake modifier checkpoint height=0, modifier=0x0000000000000000
ERROR: LoadBlockIndex() : genesis block not accepted

You need to comment out this check while creating the genesis block

example..
https://github.com/mammix2/boostcoin-core/blob/master/src/main.cpp#L2074-L2075

Then uncomment it once you're up and running

would you share your dependencies at C:/tools/* ??