Author

Topic: [ANN] ¤ DMD Diamond 3.0 | Scarce ¤ Valuable ¤ Secure | PoS 3.0 | Masternodes 65% - page 700. (Read 1260677 times)

newbie
Activity: 23
Merit: 0
I have some question for Cryptonit:
- Why my minted DMD (over 200 confirm, over 7 days) is not existed in Coin Control list?
- After DMD coin is minted, when is it ready for staking (7 days or never)?
legendary
Activity: 3052
Merit: 1053
bit.diamonds | uNiq.diamonds
new competition
in last open irc chat of noblecoin
how often u read DMD:




7

send me your DMD wallet u won 7 DMD!
legendary
Activity: 2716
Merit: 1094
Black Belt Developer
full member
Activity: 128
Merit: 100
trying to install the wallet : error loading blkindex.dat  . known problem?
sr. member
Activity: 393
Merit: 250
Our pacing code is

        if(nActualSpacing < 0)
        {
            printf(">> %s nActualSpacing = %"PRI64d" corrected to 1.\n", fProofOfStake ? "PoS" : "PoW", nActualSpacing);
            nActualSpacing = 1;
        }
        else if(nActualSpacing > nTargetTimespan)
        {
            printf(">> %s nActualSpacing = %"PRI64d" corrected to nTargetTimespan (%"PRI64d").\n", fProofOfStake ? "PoS" : "PoW", nActualSpacing, nTargetTimespan);
            nActualSpacing = nTargetTimespan;
        }


This works well for PoS.

Do you think it would be better to use

if (nActualSpacing<0) nActualSpacing=nTargetSpacing


Yes.


    bnNew.SetCompact(pindexPrev->nBits);
    ....
    int64 nInterval = nTargetTimespan / nTargetSpacing;
    bnNew *= ((nInterval - 1) * nTargetSpacing + nActualSpacing + nActualSpacing);
    bnNew /= ((nInterval + 1) * nTargetSpacing);


The bnNew is set to the last block's nbits. Then its value multiplied by
((nInterval - 1) * nTargetSpacing + nActualSpacing + nActualSpacing)/((nInterval + 1) * nTargetSpacing)

If you set nActualSpacing to 1 then it will be multiplied by
((nInterval - 1) * nTargetSpacing + 2)/((nInterval + 1) * nTargetSpacing)=
(nInterval - 1)/(nInterval + 1) + 2/((nInterval + 1) * nTargetSpacing) =
((nTargetTimespan-nTargetSpacing) / (nTargetTimespan+nTargetSpacing)) + 2/((nTargetTimespan + nTargetSpacing) =
((nTargetTimespan-nTargetSpacing+2) / (nTargetTimespan+nTargetSpacing)) =
(1802-nTargetSpacing)/(1800+nTargetSpacing)
If nTargetSpacing>1 then it is smaller than 1 so you will decrease the target and increase the diff. It gives an exploitable bug: If you generates negative time hopping then you can artifically increase the diff and slow down the blockchain.
If it is a PoS block then nTargetSpacing=600 and the multiplier is (1802-600)/(1800+600)=0.5 approx. Now there are only PoS blocks, so every negative time hopping block will double the diff.

If you set nActualSpacing=nTargetSpacing, then:
((nInterval - 1) * nTargetSpacing + nActualSpacing + nActualSpacing)/((nInterval + 1) * nTargetSpacing) =
((nInterval - 1) * nTargetSpacing + nTargetSpacing + nTargetSpacing )/((nInterval + 1) * nTargetSpacing) =
((nInterval + 1) * nTargetSpacing )/((nInterval + 1) * nTargetSpacing) = 1

So if there are a negative time hopping attack the target and diff will not change, so there will be no advantage of this kind of attack.

Your analisys is good and indeed it seems the better way to address the problem. Is there no problem for nActualSpacing > nTargetTimespan?

Doing some more tests, it seems that once we let this "negative" number in, it keeps staying negative. I am experimenting now with adding the same "make positive" code for bnNew as well. Do you see any problems with this?

Also, while we are at this stage that requires forking, do you have any other code improvement suggestions?
member
Activity: 107
Merit: 13
unfortunately there is a lot of people who need to take it out by badwording and offending on forums, because they can't in real life.
Why do you fell offended .I'm not talking to you. There is some tissue paper in the washroom go wipe your eyes.
Its unfortunate you cant complete a sentence as well. Do you mix that shit up in your mouth and than spit it out.

It is a public forum. If you don't want comments then you have to send private messages.
legendary
Activity: 2716
Merit: 1094
Black Belt Developer
Let's view PPC chart http://coinmarketcap.com/currencies/peercoin/
After they release new wallet in android.
I'm learning dev app in android, I'll free to join DMD wallet project .
We need to make something for DMD, to make it's more popular.

I've already compiled the headless wallet on arm and it works on android. The interface is missing of course.
We discussed this recently (should it stake? full blockchain? fork bitcoin opensource android wallet? etc.).
newbie
Activity: 23
Merit: 0
Let's view PPC chart http://coinmarketcap.com/currencies/peercoin/
After they release new wallet in android.
I'm learning dev app in android, I'll free to join DMD wallet project .
We need to make something for DMD, to make it's more popular.
hero member
Activity: 896
Merit: 520
unfortunately there is a lot of people who need to take it out by badwording and offending on forums, because they can't in real life.
Yah some of us can speak English. unlike the DEV who cant spell
legendary
Activity: 2716
Merit: 1094
Black Belt Developer
unfortunately there is a lot of people who need to take it out by badwording and offending on forums, because they can't in real life.
full member
Activity: 175
Merit: 100
IMPORTANT:
we need anyone have his DMD wallet in minting mode please
thx for ur support



tell cryptsy they probably have largest wallet.

eta on mining fix ?
legendary
Activity: 3052
Merit: 1053
bit.diamonds | uNiq.diamonds
IMPORTANT:
we need anyone have his DMD wallet in minting mode please
thx for ur support


member
Activity: 107
Merit: 13
Our pacing code is

        if(nActualSpacing < 0)
        {
            printf(">> %s nActualSpacing = %"PRI64d" corrected to 1.\n", fProofOfStake ? "PoS" : "PoW", nActualSpacing);
            nActualSpacing = 1;
        }
        else if(nActualSpacing > nTargetTimespan)
        {
            printf(">> %s nActualSpacing = %"PRI64d" corrected to nTargetTimespan (%"PRI64d").\n", fProofOfStake ? "PoS" : "PoW", nActualSpacing, nTargetTimespan);
            nActualSpacing = nTargetTimespan;
        }


This works well for PoS.

Do you think it would be better to use

if (nActualSpacing<0) nActualSpacing=nTargetSpacing


Yes.


    bnNew.SetCompact(pindexPrev->nBits);
    ....
    int64 nInterval = nTargetTimespan / nTargetSpacing;
    bnNew *= ((nInterval - 1) * nTargetSpacing + nActualSpacing + nActualSpacing);
    bnNew /= ((nInterval + 1) * nTargetSpacing);


The bnNew is set to the last block's nbits. Then its value multiplied by
((nInterval - 1) * nTargetSpacing + nActualSpacing + nActualSpacing)/((nInterval + 1) * nTargetSpacing)

If you set nActualSpacing to 1 then it will be multiplied by
((nInterval - 1) * nTargetSpacing + 2)/((nInterval + 1) * nTargetSpacing)=
(nInterval - 1)/(nInterval + 1) + 2/((nInterval + 1) * nTargetSpacing) =
((nTargetTimespan-nTargetSpacing) / (nTargetTimespan+nTargetSpacing)) + 2/((nTargetTimespan + nTargetSpacing) =
((nTargetTimespan-nTargetSpacing+2) / (nTargetTimespan+nTargetSpacing)) =
(1802-nTargetSpacing)/(1800+nTargetSpacing)
If nTargetSpacing>1 then it is smaller than 1 so you will decrease the target and increase the diff. It gives an exploitable bug: If you generates negative time hopping then you can artifically increase the diff and slow down the blockchain.
If it is a PoS block then nTargetSpacing=600 and the multiplier is (1802-600)/(1800+600)=0.5 approx. Now there are only PoS blocks, so every negative time hopping block will double the diff.

If you set nActualSpacing=nTargetSpacing, then:
((nInterval - 1) * nTargetSpacing + nActualSpacing + nActualSpacing)/((nInterval + 1) * nTargetSpacing) =
((nInterval - 1) * nTargetSpacing + nTargetSpacing + nTargetSpacing )/((nInterval + 1) * nTargetSpacing) =
((nInterval + 1) * nTargetSpacing )/((nInterval + 1) * nTargetSpacing) = 1

So if there are a negative time hopping attack the target and diff will not change, so there will be no advantage of this kind of attack.
sr. member
Activity: 393
Merit: 250
Our pacing code is

        if(nActualSpacing < 0)
        {
            printf(">> %s nActualSpacing = %"PRI64d" corrected to 1.\n", fProofOfStake ? "PoS" : "PoW", nActualSpacing);
            nActualSpacing = 1;
        }
        else if(nActualSpacing > nTargetTimespan)
        {
            printf(">> %s nActualSpacing = %"PRI64d" corrected to nTargetTimespan (%"PRI64d").\n", fProofOfStake ? "PoS" : "PoW", nActualSpacing, nTargetTimespan);
            nActualSpacing = nTargetTimespan;
        }


This works well for PoS.

Do you think it would be better to use

if (nActualSpacing<0) nActualSpacing=nTargetSpacing
full member
Activity: 126
Merit: 100
have 2 minted blocks.. here is one transaction

Status: 37 confirmations, broadcast through 13 nodes
Date: 17/09/2014 13:39
Debit: 0.00 DMD
Net amount: -105.404543 DMD
Transaction ID: f4eb765ee338c4fcf958c9946d177856c1a543b412c87e57b0ce302633a63760

any idea if this is a true minted block??

thanks for ur time...
mugwarh

Proof of Stake: 4.867123 coins generated  Grin

http://diamond.danbo.bg:2750/block/63dcc0387d4d9bdafdef62da643069eb1b2dedb1390675d92218e590cdcbdaab
thanks cryptonit i now have 3 pending minted blocks... my wallet is always open and minting hope this helps
member
Activity: 107
Merit: 13
The other solution is the blockcheck fixing to do not accept negative times. But in this case if somebody successfully submits a block with +30min blocktime, then the chain will be stopped for 30 minutes.
If you limit the time between two blocks to avoid forward hopping, then if you have enought hashrate you can deadlock the blockchain, by at first increasing diff then removing the rig from the network.
member
Activity: 107
Merit: 13
My friend(elbandi) found an anomaly in blockchain. The 576751 went back in time compared to prev block 576750

576750: 1410868131 (2014-09-16 11:48:51)
576751: 1410866296 (2014-09-16 11:18:16)

In the wallet there are a
int64 nActualSpacing = pindexPrev->GetBlockTime() - pindexPrevPrev->GetBlockTime();

In this case nActualSpacing went to negative and pushed bnNew to negative too.

We know this.

This is what was not implemented for PoW in Diamond. We implemented it for PoS only. (long story)

Your suggested fix to make bnTarget 'unsigned' will work. We have other options too, such as letting it be < 0 for a while. Then the time pacing code will kick in and it won't become negative again.

Do you have code suggestion to fix the mantissa/characteristic in the block generator?

In GetNextTargetRequired, replace the end with this:

...
    CBigNum bnNew;
    bnNew.SetCompact(pindexPrev->nBits);
    int64 nTargetSpacing = fProofOfStake? nStakeTargetSpacing : min(nTargetSpacingWorkMax, (int64) nWorkTargetSpacing * (1 + pindexLast->nH
eight - pindexPrev->nHeight));
    int64 nInterval = nTargetTimespan / nTargetSpacing;
    bnNew *= ((nInterval - 1) * nTargetSpacing + nActualSpacing + nActualSpacing);
    bnNew /= ((nInterval + 1) * nTargetSpacing);

    if (bnNew > bnTargetLimit)
        bnNew = bnTargetLimit;
    
    uint32_t newnbits;

     newnbits=bnNew.GetCompact();
     //compact format:  (M=mantissa, K=characteric)
     //nbits= 0xKKMMMMMM,  bnNew=0xMMMMMM <<(8*0xKK-3)
     //0xMMMMMM max allowed value 0x7FFFFF, because of it is signed(OMG).

     if ( newnbits & 0x00800000 )
        newnbits=( ( newnbits & 0xFF000000 ) + 0x01000000 ) | ( ( newnbits&0x00FFFFFF )>>8 );

    return newnbits;
}


But if you don't let bnNew to be negative, then you don't need this fix. It would be better because this fix multiplies the target with -1, therefore it probably produces other bugs which could be exploited by negative times and fuck ups the diff(there are only one pros: the blockchain will not stop under time hopping attack).

I see Bitcoin has now different SetCompact/GetCompact code, but this might far too dangerous to change in haste. The 'always positive' code might be better -- although not sure it is very portable..


But if you don't let bnNew to be negative, then you don't need this fix. It would be better because this fix multiplies the target with -1, therefore it probably produces other bugs which could be exploited by negative times and fuck ups the diff(there are only one pros: the blockchain will not stop under time hopping attack). If you put a value check after nActualSpacing
if (nActualSpacing<0) nActualSpacing=nTargetSpacing
then diff will not change if time hop occoured.

legendary
Activity: 3052
Merit: 1053
bit.diamonds | uNiq.diamonds
IMPORTANT:
we need anyone have his DMD wallet in minting mode please
thx for ur support

sr. member
Activity: 393
Merit: 250
My friend(elbandi) found an anomaly in blockchain. The 576751 went back in time compared to prev block 576750

576750: 1410868131 (2014-09-16 11:48:51)
576751: 1410866296 (2014-09-16 11:18:16)

In the wallet there are a
int64 nActualSpacing = pindexPrev->GetBlockTime() - pindexPrevPrev->GetBlockTime();

In this case nActualSpacing went to negative and pushed bnNew to negative too.

We know this.

This is what was not implemented for PoW in Diamond. We implemented it for PoS only. (long story)

Your suggested fix to make bnTarget 'unsigned' will work. We have other options too, such as letting it be < 0 for a while. Then the time pacing code will kick in and it won't become negative again.

Do you have code suggestion to fix the mantissa/characteristic in the block generator?

In GetNextTargetRequired, replace the end with this:

...
    CBigNum bnNew;
    bnNew.SetCompact(pindexPrev->nBits);
    int64 nTargetSpacing = fProofOfStake? nStakeTargetSpacing : min(nTargetSpacingWorkMax, (int64) nWorkTargetSpacing * (1 + pindexLast->nH
eight - pindexPrev->nHeight));
    int64 nInterval = nTargetTimespan / nTargetSpacing;
    bnNew *= ((nInterval - 1) * nTargetSpacing + nActualSpacing + nActualSpacing);
    bnNew /= ((nInterval + 1) * nTargetSpacing);

    if (bnNew > bnTargetLimit)
        bnNew = bnTargetLimit;
    
    uint32_t newnbits;

     newnbits=bnNew.GetCompact();
     //compact format:  (M=mantissa, K=characteric)
     //nbits= 0xKKMMMMMM,  bnNew=0xMMMMMM <<(8*0xKK-3)
     //0xMMMMMM max allowed value 0x7FFFFF, because of it is signed(OMG).

     if ( newnbits & 0x00800000 )
        newnbits=( ( newnbits & 0xFF000000 ) + 0x01000000 ) | ( ( newnbits&0x00FFFFFF )>>8 );

    return newnbits;
}


But if you don't let bnNew to be negative, then you don't need this fix. It would be better because this fix multiplies the target with -1, therefore it probably produces other bugs which could be exploited by negative times and fuck ups the diff(there are only one pros: the blockchain will not stop under time hopping attack).

I see Bitcoin has now different SetCompact/GetCompact code, but this might far too dangerous to change in haste. The 'always positive' code might be better -- although not sure it is very portable..
Jump to: