Skip to content

Instantly share code, notes, and snippets.

@epheph
Last active June 20, 2020 21:58
Show Gist options
  • Select an option

  • Save epheph/35525113bb9378f3799d809eeac91e75 to your computer and use it in GitHub Desktop.

Select an option

Save epheph/35525113bb9378f3799d809eeac91e75 to your computer and use it in GitHub Desktop.
// NOTE: Non-functional pseudo code
function verifyBlock(parentBlock, stateRoot, blockNumber, timestamp, ...) returns (bool) {
bytes32 _realBlockHash = blockhash(blockNumber);
bytes32 _proposedBlockHash = keccek256(rlpEncode(parentBlock, stateRoot, blockNumber, timestamp, ...));
return _proposedBlockHash == _realBlockHash;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment