Check a Substrate governance preimage before noting it

A proposal that looks correct in a UI can point to different bytes if the signer hashes a full extrinsic or the printable hex representation. A preimage check starts with the encoded runtime call.

Calculate the hash and byte length locally

Use polkadot-js with the intended runtime and a preparedCall built for the proposal. For a standard Substrate chain using the matching registry hasher, take the inner call bytes before wrapping them in preimage.notePreimage. This example constructs the wrapper without submitting it.

const bytes = preparedCall.method.toU8a()
const hash = api.registry.hash(bytes)
console.log({ hash: hash.toHex(), length: bytes.length })
const note = api.tx.preimage.notePreimage(bytes)
console.log(note.method.toHex())

Compare both parts of the lookup

A 90-byte call has 180 printable hex digits before any 0x prefix. If a proposal lookup specifies length 180, it references the wrong length even if its digest matches the correct 90 bytes. Verify the account arguments and amount by decoding the call with the target runtime metadata.

For a runtime upgrade between preparation and enactment, review how the encoded call will decode at enactment. A matching digest establishes byte identity, while call meaning comes from runtime metadata.

Sources