Skip to content

@ens:contenthash.of

Read the decoded content hash of an ENS name (e.g. ipfs://…).

On-chain (@ens:contenthash.of!): Mainnet only; reads the raw content hash bytes (compare against @ens:contenthash) rather than the decoded URI, and a missing record reads as empty bytes.

Returns: string

@ens:contenthash.of(name)
NameTypeDescription
namestringENS name (e.g. vitalik.eth)
# Read the content hash behind a name
set $hash @ens:contenthash.of("vitalik.eth")
print $hash

Mainnet only. Reads the raw multicodec bytes the resolver holds — the decoded ipfs://… rendering is off-chain work — through the @addr!-shaped resolver chain, with a missing resolver reading as empty bytes instead of erroring. The plain @ens:contenthash encoder produces the same raw bytes from a URI, so pinning a site's content is:

assert @ens:contenthash.of!(mysite.eth) == @ens:contenthash("ipfs://Qm...")