1

I found in this link on Ethereum Stack Exchange that a block hash is calculated by using

const blockData = [
        block.parentHash,
        block.sha3Uncles,
        block.miner,
        block.stateRoot,
        block.transactionsRoot,
        block.receiptsRoot,
        block.logsBloom,
        block.difficulty,
        block.number,
        block.gasLimit,
        block.gasUsed,
        block.timestamp,
        block.extraData,
        block.mixHash,
        block.nonce,
      ];
const txHash ="0x" + Buffer.from(keccak256(rlp.encode(blockData))).toString("hex");

This form to get the hash data is perfect for transactions before "the merge" so I want to know how data must be change to get the block hash post-merge

1 Answer 1

0

See answer here, freshly discovered and posted today. Very annoying! Covers all 5 different block header eras, and how to recreate the block hash for each: How to verify block.hash post-merge (block > 15.5M)?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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