# Proof of Work figures

I am focused on understanding Proof of Work (PoW) vs Proof of Stake (PoS).

One idea I liked is that we can see the mining of a block as a lottery of probability P, where I buy a ticket of cost C using my hardware and electricity, to obtain a reward R.

Since R should be simple to obtain (the value in ETH of the reward times value of ether in fiat), I want to set up figures for P and C.

What is the simplest way to reach these figures? Starting of course with Hash Rate and Total Difficulty. What are the most popular techniques to arrive to those values?

• In PoW, I answer myself: You get a target which is 2 ** 256 / D and you produce a hash which lives in the interval [0, 2 ** 256], and is supposed to start from a nonce, which are randomly uniformed distributed. Your p at any moment of finding a hash lesser than the target is 1 / D, that is your favorable cases against all the cases. It follows that as Difficulty increases, your odds decrease. – Herman Junge Jan 30 '17 at 8:24
• Now the probability for the network on finding at least one block, given a difficulty D is a different beast: Given that we defined that p = 1 / D, we can say that P(B > 1) = 1 - P(B = 0) = 1 - (1 - p)^H. With H being the amount of hashes we are able to produce at a certain amount of time. – Herman Junge Jan 30 '17 at 13:41

## 1 Answer

If I understand you correctly, you're asking how to calculate the "lottery of probability P" of being chosen and the "ticket cost C" with PoS. I'm not sure what you mean by using hash rate and total difficulty to calculate these values in PoS - I'm not sure these concepts make sense in a PoS context.

That being said, the "lottery of probability P," in PoS, can be calculated by your_eth_deposit/total_eth_deposited. As for "ticket cost C," as the deposit of stake is eventually redeemable, the only loss you are taking (if you are a good validator) is the cost of locking up your capital for some period of time. It's different from person-to-person, depending on what you would be doing with this money otherwise.

Interestingly, one of the nice security properties is that that P is directly proportional to C for each user; there are no economies of scale as C grows larger. This has the interesting security property of helping stop miner/validator centralization - it's not cheaper to buy miners (virtual or physical) in large quantities.

• You are right. I was working with hashrates to get the probability P of getting a block in an interval of time in PoW. – Herman Junge Jan 30 '17 at 8:19