Formula for calculating odds of blockchain reorg?

Hey mhps,
I am sorry for being so solvenly.
I try it again: In on of the last posts, I derived the following formula.

[quote=“josojo, post:14, topic:2668”]What is the probability for the attacker to find the next block?:
p=NumberOfCoinsParticipatingInAttack60/(NumberOfCoinsParticipatingInAttack60+NumberOfCoinsMintingMainchain);[/quote]
The basic idea behind this formula is that the proportion of coindays, held by the attacker, compared to the coindays, held by minters on the mainchain, gives the probability to mint the next block. If you have any questions on its derivation, please ask!

Then, I plugged in your numbers.
NumberOfCoinsParticipatingInAttack=547588,
collected coindays by the attacker= 54,
NumberOfCoinsMintingMainchain=4294901760 xPoSdif / ( 600);
PoSdif=11

This gives us
p=.27

Yes, please. Then I can also update the myth thread.[/quote]
Let us wait until others confirm that it makes any sense!

Ah, okay. That makes sense. I am not sure about the error term, but probably it is a good approximation.

(1-(1-p10)^(t*(t-1))/2 ) and (1-(1-p10)^(t*(t-1)) ) follow the logic introduced by glv. If you want to find two blocks with t stacks, you have (t*(t-1))/2 ) or (t*(t-1)) possible combinations to do that - depending on your counting method. The probability that no combination works is approximated by (1-p10)^(t*(t-1)) or (1-p10)^(t*(t-1))/2 ) and that at least one works is then given by (1-(1-p10)^(t*(t-1))/2 ) and (1-(1-p10)^(t*(t-1)) ) .

But, the more I think about it, I am getting convinced that the approximation for the probability that no combination works , given by (1-p10)^(t*(t-1)) or (1-p10)^(t*(t-1))/2 ), is wrong. My mistake.

[quote=“josojo, post:21, topic:2668”]Hey mhps,
I am sorry for being so solvenly.
I try it again: In on of the last posts, I derived the following formula.

[quote=“josojo, post:14, topic:2668”]What is the probability for the attacker to find the next block?:
p=NumberOfCoinsParticipatingInAttack60/(NumberOfCoinsParticipatingInAttack60+NumberOfCoinsMintingMainchain);[/quote]
The basic idea behind this formula is that the proportion of coindays, held by the attacker, compared to the coindays, held by minters on the mainchain, gives the probability to mint the next block. If you have any questions on its derivation, please ask!

Then, I plugged in your numbers.
NumberOfCoinsParticipatingInAttack=547588,
collected coindays by the attacker= 54,
NumberOfCoinsMintingMainchain=4294901760 xPoSdif / ( 600);
PoSdif=11

This gives us
p=.27[/quote]

I think your calculation of probability expectation is right, except that the 600 should be 507, the actual average per-block time in the peroid?

Excellent catch!

Plugging in, we obtain:

p=54*547588/(54*547588+4294901760 *11 / (507))=0.24

what matches well the measured 0.235.

Beside pillow, no one commented on the question, whether satoshi mathematical model of competing blockchains - which I outlined in my first post in this thread - is also reasonable for peercoin. What do you think?

Excellent catch!

Plugging in, we obtain:

p=54*547588/(54*547588+4294901760 *11 / (507))=0.24

what matches well the measured 0.235.[/quote]

Wow. This is SPOT ON! So what was I doing wrong to get 0.27?

In five days the number of 2, 3, 4 consecutive blocks are predicted to be 49, 12, 3, closer to the actual numbers 44, 6, 1, respectively, than my prediction.

The error could be in the estimated diff (11) and the average stake size (which affects the average coin-age (54).

Beside pillow, no one commented on the question, whether satoshi mathematical model of competing blockchains - which I outlined in my first post in this thread - is also reasonable for peercoin. What do you think?

It looks like in the right direction but I haven’t checked the math.

Hey guys, this is an excellent thread. Did spread a few ‘applauds’. Hope we will have a broadly accepted conclusion for publication. This will be a great indicator on how safe it will be to remove checkpoints at any point in time or where the ideal difficulty should be to safely remove the checkpoint by default.

hey Cybnate,

thxs for the applauds, that is kind of you.

Well I am not sure, but think about this:
You calculated p=1 - [1 - (8000) / ( 11* 2^32)]^(3650*507)=0.27
This is the probability that at least one block is found in 507 seconds by 3650 stacks.
The probability that other stacks on the ppcnetwork find at least one block in this time period wont be 1-0.27. I think its something like 0.85.
You see these numbers 0.85 and 0.27 do not sum to 1, hence you can compare them only relatively if you want to estimate how many blocks will be found in total by the 3650 stacks over 5 days.

As you can see here (http://www.peercointalk.org/index.php?topic=2976.msg28107#msg28107) I’ve copied and pasted something from this thread that I don’t understand at all.

Since I don’t understand what you guys are doing here, could you help me with creating a step-by-step process (just like the one I copied+pasted)?

That way more people will be able to read it and perhaps when its broken down a bit, even be able to follow it.

[quote=“josojo, post:28, topic:2668”]hey Cybnate,

thxs for the applauds, this is kind.[/quote]

Appreciated Cybnate.

This is the probability that at least one block is found in 507 seconds by 3650 stacks. The probability that other stacks on the ppcnetwork find at least one block in this time period wont be 1-0.27. I think its something like 0.85.

How do you get the 0.85 number?

[quote=“pillow, post:29, topic:2668”]As you can see here (http://www.peercointalk.org/index.php?topic=2976.msg28107#msg28107) I’ve copied and pasted something from this thread that I don’t understand at all.

Since I don’t understand what you guys are doing here, could you help me with creating a step-by-step process (just like the one I copied+pasted)?

That way more people will be able to read it and perhaps when its broken down a bit, even be able to follow it.[/quote]

Maybe I am overly conservative but I would just point to this thread until we have a conclusion. Cryptocurrency is still in its infacy. Not everything has a clear and dry answer yet.

[quote=“mhps, post:31, topic:2668”][quote=“pillow, post:29, topic:2668”]As you can see here (http://www.peercointalk.org/index.php?topic=2976.msg28107#msg28107) I’ve copied and pasted something from this thread that I don’t understand at all.

Since I don’t understand what you guys are doing here, could you help me with creating a step-by-step process (just like the one I copied+pasted)?

That way more people will be able to read it and perhaps when its broken down a bit, even be able to follow it.[/quote]

Maybe I am overly conservative but I would just point to this thread until we have a conclusion. Cryptocurrency is still in its infacy. Not everything has a clear and dry answer yet.[/quote]

Done, myth thread updated as you suggested. This thread has been linked instead. I think this thread will be prove to be very valuable for other people looking into this. Thanks to both of you for participating in it!

0.85 was a number I made up in rough and dirty estimate. I made up this number to illustrate that the probability for finding at least a block is not suitable for estimating how many blocks will be found in a bigger time interval. Did you get my argument? Does it make sense?

But since you asked, I tried to calculate the probability for the mainchain to find at least one block in 10 mins:

If we fix the PoSDifficultiy we can estimate how many coindays are minting on the mainchain. The coindays are given by

coindays=4294901760 xPoSdif / (600)

-as explained in previous posts.
This means that the probability that someone in the network finds the next block with the next timestamp - i.e. within the next second - is

numberofcoindays/(PoSdif*2^31)=(4294901760 xPoSdif / (600))/(4294901760 xPoSdif)=1/600

Thus, the probability that the mainchain finds at least one block in 600 seconds is

1-(1-1/600)^600=0.6324273381~=1-e^-1=0.63212055882.

As you can see 0.85 was very quick and dirty estimate!

In this model I did not consider the distribution of the coindays into their stacks. But this does not matter as the following calculation shows. Imagine that all the coins minting on the mainchain are split up in 10000 equal stacks (-or to be more specific transactions outputs).
Then each stack has the probability 1/600/10000 to find the next block with the next timestamp.
Thus, the probability that the mainchain finds at least one block in 600 seconds is

1-(1-1/600/10000)^(600*10000)=0.63212058953~=1-e^-1=0.63212055882.

As you can see the probability changes marginally. This is due to the fact that (1-1/n)^n converts fast enough to e^-1 for our purposes.

This calculation reassures one of my assumptions: the probability to find the next block is approximately proportional to the number of coindays available and does not depend significantly on a distribution of stacks.

I am wondering about the current proba of blockchain reorg right now and how it compares to bitcoin for example…