Introduction
Hi, I'm cardene, a software engineer and technical writer focused on blockchain and AI.
I've also authored Japanese technical books on specification-driven development with LLMs and decentralized application (DApp) development.
I also build and publish a variety of tools, libraries, and open-source projects.
ERC-4804 defines how HTTP-style Web3 URLs can be translated into EVM call messages.
This article translates, summarizes, and expands on the following specification.
More ERC explainers:
Overview
The standard translates a URI, such as web3://uniswap.eth/, into a message that can be used to call a contract on an Ethereum-compatible blockchain. This message is referred to as an EVMMessage.
The translation allows users to access contracts through human-readable URLs rather than constructing EVM call data manually.
An EVMMessage includes two important components:
- To: The destination contract address, which may be obtained by resolving a name such as
uniswap.eththrough ENS. - Calldata: The encoded instruction or data supplied to the destination contract.
ERC-4804 connects human-readable Web URLs with the underlying technical representation of contract calls. A client translates the URL into a message suitable for EVM execution.
Motivation
Blockchain explorers, websites, and other intermediary services help users access and interpret blockchain data. However, these services operate outside the direct control of their users and can introduce additional trust and availability assumptions.
ERC-4804 aims to make blockchain data, particularly on-chain Web content such as SVG and HTML, accessible to users through familiar URL conventions.
Compatible clients can retrieve content from contracts, including ERC-20 and ERC-721 contracts, without requiring an application-specific website to construct each call.
This does not eliminate every infrastructure dependency: clients still need access to blockchain state, such as through a local node or an RPC provider.
Because Web3 URLs are designed to work with existing URI conventions, they can also be referenced by technologies such as HTML and SVG. This helps bridge conventional Web applications and blockchain-based content.
Specification
A Web3 URL identifies a contract and a call on a particular blockchain.
The original article reproduces the following grammar:
web3URL = web3Schema [userinfo "@"] contractName [":" chainid] path ["?" query]
web3Schema = [ "ethereum-web3://" | "eth-web3://" | "web3://" ]
contractName = address | [name "." [ subDomain0 "." ... ]] nsProviderSuffix
path = ["/" method ["/" argument_0 ["/" argument_1 ... ]]]
argument = [type "!"] value
query = "attribute_1=value_1 [ "&" attribute_2=value_2 ... ]
attribute = "returns" | "returnTypes" | other_attributeThe components have the following meanings:
web3Schema- Identifies the Web3 URL scheme, such as
ethereum-web3://,eth-web3://, orweb3://. - A compatible browser or application uses the scheme to select the appropriate handling mechanism.
- Identifies the Web3 URL scheme, such as
userinfo- Specifies the caller identity for the EVM call, with a default used when omitted.
- This is a call-context field, not proof that the user controls the specified address.
contractName- Identifies the target contract and corresponds to the To field of the EVM message.
- It may be a hexadecimal address representing 20 bytes, prefixed with
0x, or a name resolved through a naming service such as ENS. - Names include a provider suffix, such as
eth.
chainid- Identifies the blockchain on which the call is to be executed.
- If omitted, the naming-service rules or the default Ethereum mainnet chain ID of 1 determine the target chain.
path- Identifies the method and its arguments, depending on the contract's resolution mode.
- For example,
/transfer/0xab.../100illustrates a method name followed by arguments. The abbreviated address must be replaced with a valid value in an actual call.
query- Optionally supplies additional attributes, including return-type information.
- Attributes are represented as key-value pairs separated by ampersands.
These components allow compatible applications to construct EVM calls for different contracts and chains.
Important: The URL resolution mechanism is intended for reading or retrieving content through EVM calls. A URL containing a method named transfer does not by itself authorize or submit a state-changing transaction. In particular, a supplied caller address does not provide a transaction signature.
The grammar above is preserved from the original article; consult the normative specification for complete parsing rules.
Resolve Mode
The protocol queries the destination contract's resolveMode method on the selected chain to determine how the URL should be translated into calldata.
Two resolution modes are defined.
Manual mode
In manual mode, the path and query are passed as calldata according to the protocol's encoding rules rather than being interpreted as an ABI-encoded function call.
The contract can implement its own interpretation of those bytes, for example by treating them as a resource path.
Auto mode
Auto mode is the default. The client constructs calldata using Solidity ABI conventions.
An empty path results in empty calldata. Otherwise, the client interprets the method name and arguments, converts explicitly typed arguments to their specified types, and infers types where the protocol permits.
The returns attribute can additionally specify how returned values should be decoded. A return-type declaration can produce structured JSON output, while the protocol also supports raw-byte output.
These resolution modes allow applications to expose both conventional ABI-based contract functions and custom resource-routing behavior through Web3 URLs.
Examples
The following examples illustrate Web3 URL resolution.
web3://w3url.eth/
The name is resolved through ENS on Ethereum mainnet (chain ID 1). In the manual-mode example, the slash is passed as calldata, represented by byte 0x2F.
web3://cyberbrokers-meta.eth/renderBroker/9999
The URL identifies the contract associated with cyberbrokers-meta.eth and requests a call to its renderBroker method with the argument 9999.
web3://vitalikblog.eth:5/
This historical example specifies the Goerli testnet, chain ID 5, as the target chain. The naming and target-chain rules determine how the destination address is obtained.
Goerli is used here to illustrate the original specification, not as a recommendation for a new testnet deployment.
web3://0xe4ba0e245436b737468c206ab5c8f4950597ab7f:42170/
The URL directly specifies a contract address on Arbitrum Nova, chain ID 42170. No name resolution is needed for the destination address.
web3://0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/balanceOf/vitalik.eth?returns=(uint256)
The URL calls the specified ERC-20 contract's balanceOf method using the address resolved from vitalik.eth. The return value is interpreted as a uint256.
web3://0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/balanceOf/vitalik.eth?returns=()
This example calls the same method but requests raw-byte output rather than decoding the result according to an explicit return-type list.
These examples demonstrate how a Web3 URL can identify different chains, contracts, functions, arguments, and return-value handling conventions.
Rationale
ERC-4804 aims to make on-chain content, such as HTML and SVG, accessible through familiar Web conventions. The EVM can act as a backend for retrieving and generating such content.
The design follows four main principles.
Human readability
Web3 URLs should be readable in much the same way as conventional Web URLs.
Names can replace hexadecimal addresses, and readable method names and arguments can replace manually constructed calldata. The client performs the translation.
Compatibility with HTTP URL conventions
Supporting familiar URL features, including relative paths and query parameters, helps existing Web technologies accommodate Web3 content with fewer changes.
Simplicity
Argument types such as addresses and uint256 values can be inferred according to the protocol's rules, keeping URLs concise.
Explicit type annotations remain available when inference would be ambiguous.
Flexibility
Contracts can customize how resource requests are interpreted through manual resolution, enabling application-specific routing and response generation.
Citation
Qi Zhou (@qizhou), Chao Pi (@pichaoqkc), Sam Wilson (@SamWilsn), "ERC-4804: Web3 URL to EVM Call Message Translation," Ethereum Improvement Proposals, no. 4804, February 2022. [Online serial]. Available: https://eips.ethereum.org/EIPS/eip-4804.
Conclusion
ERC-4804 defines a translation mechanism from human-readable Web3 URLs to EVM call messages, with support for naming services, chain selection, ABI-based calls, custom resolution modes, and return-value handling.
Questions are welcome via Twitter @cardene777.
Other publications:


