1
sha3(nonce, currentChallenge, block.blockhash(block.number-1))

In this line I get it that blockhash is a random number, but why are we taking it from the previous block, any hard and fast rule here ?

sha3(nonce, currentChallenge)

In this line there are only two parameters , is third variable a default one in implementation of sha3 ?

1
sha3(nonce, currentChallenge, block.blockhash(block.number-1))
  • nonce is a unique increasing by one value that ensures that the transaction is unique and not a replay of a previous transaction
  • currentChallenge a uniformly random value that is used in the PoW; for the exact details see page 6 of the yellow paper
  • block.blockhash(block.number-1) a hash that has the role of a pointer to the previous block in the block chain. This is the chaining mechanism that holds the block chain together
| improve this answer | |
1

Is sha3 you can pass any number of parameters. It will return a hash of the conatenated string.

Previous block is required to verify the parent of the block.

| improve this answer | |
  • Thanks, No of arguments is clear. But I'm unable to understand that why do we need to verify the parent , why the immediate parent why not block.number-2 ? – Ayush Aggarwal Jul 19 '16 at 10:49

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.