We add an opcode
DATAHASH
(with byte valueHASH_OPCODE_BYTE
) which takes as input one stack argumentindex
, and returnstx.message.blob_versioned_hashes[index]
ifindex < len(tx.message.blob_versioned_hashes)
, and otherwise zero. The opcode has a gas cost ofHASH_OPCODE_GAS
.
Was a name other than DATAHASH
considered? I think it is too similar to CALLDATA
as well as potentially accessing the “data” portion of an account code could have such opcodes.
I’d propose to use something akin to BLOBHASH
or TXBLOBHASH
to start utilising a TX
prefix. In connection to EIP-1803: Rename opcodes for clarity we discussed prefixing opcodes according to their role (BLOCK
, TX
, …)