# Gridcoin Bluepaper Section for Expected Time to Stake, Net Weight, and Related Concepts (Final Release Version)

I am pleased to present Gridcoin's first Bluepaper section that covers Expected Time to Stake, Net Weight, and related concepts. On September 9th I posted a preview copy of this bluepaper section about 90% complete and asked for input. We have received a number of really good suggestions that have improved the clarity of the document.

Again I would like to thank my co-authors, @ILikeChocolate and @snipatomic, for helping put together a first class paper. Thanks to Nutney, @h202 and @hotbit for many good suggestions.

The timing of the release of this paper is good in that Gridcoin CBR is less than 15 days away. Time to get sharp on staking! Please see my earlier post on UTXO optimization, which should also be helpful to folks at https://steemit.com/gridcoin/@jamescowens/utxo-size-vs-efficiency-for-upcoming-constant-block-rewards.

Here is a modified recap from the earlier post on the bluepaper...

This bluepaper formally documents in a mathematically rigorous way the new expected time to stake algorithm I coded which is in wallet version 3.7.12.0+, and covers the staking process in Gridcoin's version of PoSv2 from a probability point of view (not security). This paper covers the following areas:

- Basic Staking Probability

* Difficulty and Staking

* Estimated Time to Stake (ETTS) by the Expected Value Method

* Retargeting Algorithm

* Net Weight vs Difficulty - Cooldown

* Cooldown Correction for ETTS

* Staking Efficiency - ETTS in the Gridcoin Wallet Version 3.7.12.0+

* Hybrid Approach for ETTS

* Hybrid Algorithm for ETTS

* Expected Value vs. Hybrid Approach

* Variable Probability Versions of ETTS

Note that the concepts in this paper are applicable to other PoSv2 coins, with appropriate modification of the constants. Here is a link to the pdf version of the paper. It has been written in LaTeX anticipating eventual submission to arXiv.org, and integration with other bluepaper sections.

https://drive.google.com/open?id=1NwEBSKuG2IvZXPvzbTEvZLpaN2JCP_nK

You will recognize all of the thumb rules I have published here on Steemit during the past few months, useful for ETTS calculations and the upcoming CBR. For ready reference here are the important ones. (Note I have changed the formal mathematical variable names back to words to be easier on folks.):

For a wallet with n equally sized UTXOs...

(UTXO Value) = Balance / n

For ETTS...

(ETTS without cooldown) = (10000/Balance) * Difficulty

or (ETTS without cooldown) = (1/960) * ((net weight) / Balance)

(ETTS with cooldown) = ((cooldown time) / n) + (ETTS without cooldown)

where (cooldown time) = 2/3 day

Net Weight...

(net weight) = 10000000 * Difficulty

UTXO size for desired efficiency

(UTXO value) = 15000 * Difficulty * (1/E - 1), where E is the desired efficiency % as a decimal, i.e. 95% is 0.95.

Note that E = (staking frequency with cooldown) / (ideal staking frequency without cooldown) which is also

E= (ETTS without cooldown) / (ETTS with cooldown)

ETTS modified for different "confidence levels" besides the 63% for the expected value version...

(ETTS with cooldown at Confidence P) =((cooldown time) / n) - ln(1 - P) * (10000/Balance) * Difficulty

In particular, the 80% level used in the wallet gives

(ETTS with cooldown at 80%) = ((cooldown time) / n) * (16000/Balance) * Difficulty

I hope this paper provides some much needed clarity in this subject area and will be of good use as a reference.

snipatomic (25)4 years agoHurray! It's finally out!

It was a pleasure to work with you guys. I think this sets a good, high standard for the upcoming blue paper sections.

gridcoin-booster (45)4 years agoThis post received a courtesy vote from @gridcoin-booster! Thank you for your contribution to the #gridcoin community!

bosssko (28)4 years agoFabulous work =)

frygrid (25)4 years agoInteresting, would be nice to see some of this automated with exact amounts. Web project time

jamescowens (53)4 years ago (edited)@tomasbrod is right. It is implemented in the code. Tomas rewrote the staking protocol for V8+, part of which is in the CreateCoinStake function. I rewrote (later) the ETTS stuff, which are the other functions listed.

In any case, if you are referring to doing a web-based calculator, that is a good idea. We would be wise to get gridcoinstats.eu to do it, since that is the main block explorer, and it could use active chain data. We could also end up linking that to the main gridcoin.us site eventually.

tomasbrod (51)4 years agoIts implemented in wallet source. There are even code locations in the paper apendix.

steemitboard (66)4 years agoCongratulations @jamescowens! You have completed the following achievement on the Steem blockchain and have been rewarded with new badge(s) :

Award for the number of upvotes received

_{Click on the badge to view your Board of Honor.}_{If you no longer want to receive notifications, reply to this comment with the word STOP}Do not miss the last post from @steemitboard: