2

I was looking over at https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_getwork and I don't understand some of the parameters:

  • DATA, 32 Bytes - current block header pow-hash
  • DATA, 32 Bytes - the seed hash used for the DAG.
  • DATA, 32 Bytes - the boundary condition ("target"), 2^256 / difficulty.

Here are my questions:

  1. Is the first parameter the hash of the whole block or just header? (is transaction tree included)
  2. Where does the seed hash come from? Is it deterministic? Is every miner receiving the same seed hash?
3

Is the first parameter the hash of the whole block or just header? (is transaction tree included)

The first parameter is the hash of the block header, not the entire block. The header includes the root of the transaction trie, but the trie itself is stored in the main part of the block, outside of the header.

More formally, the first parameter is the hash of the truncated block header, which includes neither the nonce or mix-hash components that a complete block header normally has.

Where does the seed hash come from? Is it deterministic? Is every miner receiving the same seed hash?

  • It's based on the current block number and which epoch we're in. (An epoch is 30,000 blocks.) This is the same for everyone mining the same block, and so...
  • ...yes, it's deterministic, so...
  • ...yes.

Note that even though seed generation is deterministic for a given block, the DAG is generated from this seed using a pseudorandomly generated cache (using the MemoHash algorithm). Which means the DAG will (almost certainly) be different for every miner.

Sources:

  • mkcache seems very deterministic for me, where is the pseudorandom part? – Visgean Skeloru Aug 5 '16 at 21:58
  • It's not too obvious from the algorithm, but it uses unpredictable memory accesses as its source of randomness (or at least pseudorandomness). Section 5 of the MemoHash paper explains this in more detail: hashcash.org/papers/memohash.pdf – Richard Horrocks Aug 5 '16 at 22:21

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.