2

I don't understand what exactly the PoS formula means in Vitalik's blog post On Stake on the Ethereum blog:

SHA256(prevhash + address + timestamp) <= 2^256 * balance / diff
  • Why do you need to multiply by 2^256?
  • Why do you need to divide balance by difficulty?
  • Does a miner create a candidate block only per second because timestamp is the only difference for new block?

Each variable means:

  • prevhash: the hash of the previous block.
  • address: the address of the stake-miner.
  • timestamp: the current Unix time in second.
  • balance: the account balance of the stack-miner.
  • diff: an adjustable global difficulty parameter.
1

I can't speak for the author, but here's my take:

Why do you need to multiply by 2^256?

You don't need to but doing so allows you to think about it intuitively. 0 to 2^256 is the range of possible outputs of the SHA256 funtion. Therefore balance/diff is the proportion of that range that allows the "miner" to get reward.

Why do you need to divide balance by difficulty?

For automated global modulation of the reward range. This allows the latency between new blocks to be kept within pre-defined bounds, it therefore also influences supply of new currency.

Does a miner create a candidate block only per second because timestamp is the only difference for new block?

The prevhash would also be different as well for a new block, but yes; the timestamp resolution is seconds.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.