[Ethereum] What are eth_getWork parameters

miningmining-pools

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?

Best Answer

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:

Related Topic