# How to Formulate a Question for Peercoin Sim

Peercoin Sim, or ‘OptimumUTXO’, is a Peercoin project aiming to simulate minter probability distributions and expected rewards. As such, it is an incredibly powerful tool for minters. There are two obvious questions that it answers first:

1. When will I mint?
2. How much will I earn if I mint?

These questions are not quite well formulated yet, but we can certainly ‘answer’ them in the context of Peercoin Sim. The more we understand about how to formulate questions, the more advanced concepts we can discuss. Peercoin sim is from one point of view a series of equations, but from another perspective it is an idea: Can we have a comprehensive universal model that we draw from when we answer questions about minting in the Peercoin network? The answer to that particular question seems to be a resounding ‘yes’.

Let’s just go ahead and reform the two above questions:

1. With what frequency will I mint a particular output size at an assumed constant network difficulty?
2. What is my maximum expected annualized rate of return from minting, and how do I maximize this reward given a constant difficulty?

These questions are easily answered by OptimumUTXO functions “averageMints” and “averageRewards”, with some extra peak-finding thrown in to finish off the second part of the second questions. These are functions that take in network difficulty and output size and return a mint frequency or an annualized reward.

So that’s great, and now we can use that in our client to inform about maximizing reward through an optimum output size (hence the name). But are there other questions we can answer? Of course yes, let’s take a stab at some colloquial questions about minting.

1. How many minters are there?
2. How many coins do I need to have an impact?
3. How many coins would it take to complete the fork?
4. What happens in worst case scenarios, like if everyone stops minting?

I think that’s a good set of questions for this OP, but I hope that I impress upon you how many questions there could be. These will certainly elucidate a good bit though. Let’s reform them into more defined questions.

1. What percentage of the network is participating in the minting process? (outputs are fungible in Peercoin Sim, so we look for a number of coins participating as a fraction of supply)
2. What is the maximum effect my coins could have on the difficulty on average? (any UTXO size has a likelihood of minting, let’s aim to quantify the impact of a pile of coins assuming maximal statistics)
3. What is the relationship between “percent fork completion” and “difficulty”? (Use the inverse answer to 4 to get to number of coins)
4. What are the maximum and minimum difficulties?

These are all advanced questions we can answer with Peercoin Sim. Question 3 requires additional knowledge about the chain, not just the difficulty, because different output sizes will mint differently and some may not mint regularly. In order to define the ‘participation rate’ we can just take a moving average for each block of (Output Size * Simulated Mint Frequency) in order to get a concept of how many coins are participating per unit time, which we then simply normalize by the total supply to get a participation fraction.

Question 4 can be understood through the concept of the security parameter. The security parameter can be calculated by simple multiplication and division of the difficulty, the total supply, and protocol constants. Take security parameter times total supply to get the equivalent number of maximally minting coins. If you assume your coins are also to be maximally minting, then you can just divide the coins by each other to get a fraction. Multiply the difficulty by this fraction and you get the answer to the question. i.e. change in difficulty = your coins * MaxDayWeight * BlockIntervalSecs / 2^32, or ~1/120,000. This means that 120,000 peercoin changes the difficulty by 1. This assumes infinite splitting and minting time, but there are some straightforward manipulations we can do here to return a more practical estimation. The number comes out to around 200,000 PPC per unit of difficulty, as a rule of thumb, entirely independent of difficulty or total supply. So take your number of coins and divide by 200,000 and that’s how many difficulty points your coins will account for. Note that this cannot give us the participation rate, a la 3, but rather gives a more linearized concept of coins required to overtake the network. Hence ‘security parameter’.

Question 5 is where things start to converge on an understanding. There are at least 4 possible ways we could talk about the original form of this question:
a) a la question 3, how many more coins need to organically enter the system and vote for the fork to achieve a 1% change in fork percentage? Can we use the current minter distribution to simulate an ‘organic’ number of coins?
b) a la question 4, what is the relationship between security parameter and fork percent? This one’s easy, number of coins = % completion needed * security parameter * total supply / (1 - % completion needed)
c) What if the distribution is not statistically maximal, then how many coins will it take to pass the fork? Just use the answer to b and apply the manipulations as in question 4 to return a more practical number, such as optimal reward targeted instead of maximal statistics.
d) Some other form of the question, like what if particular minting outputs switch from one version to another how will it impact the fork percentage. These are all answered using the same concepts as above and are left as an exercise for the reader.

The new form of question 5 is much more straightforward. % completion needed * difficulty * 200,000 = practical number of coins required to complete the fork. The 200,000 is taken from question 4.

Finally, question 6 is delightful to me because I bet you didn’t know that there are maximums and minimums of the network. If all coins participated maximally, the difficulty would be ‘total supply/120,000’ from question 4, which is around 240 PoS difficulty. On the other end of the scale, if we have fewer total utxos than the 4,320 required to fill the 30 day minimum maturation period then the difficulty will spiral endlessly toward 0. With the minimum dust size, this implies that the minimum number of coins required to maintain a 10 min block time is 43.2 PPC, split into dust. If we instead look at when the dust size becomes the reward optimum, that happens at ~1.5 difficulty where the annual reward is around 40%/year.

Lots of questions can be answered, but many of these seem more academic or curiosity rather than extremely practical the way the optimum was. I think we may find that these concepts develop an intellectual framework on which we can build other ideas. However, for the moment they at least allow us to properly frame our questions about minting such that they can be objectively and quantitatively answered.

2 Likes