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.
Background
ERC-6860 defines how to translate an HTTP-style Web3 URL into an EVM call.
This article explains and expands on the proposal below.
I also cover other EIPs here.
Overview
The standard translates a URL that uses RFC 3986 syntax, such as web3://uniswap.eth/, into an EVM message.
EVMMessage {
To: 0xaabbccddee.... // where uniswap.eth's address registered at ENS
Calldata: 0x
...
}RFC 3986 defines the syntax of Uniform Resource Identifiers (URIs), which identify Internet resources.
Main components
- Scheme. Identifies the URI scheme, for example
http,https, orftp. - Authority. Can include a host, port, and user information, as in
//user:pass@host:port. - Path. Identifies the resource location, for example
/path/to/resource. - Query. Passes additional information, for example
?key1=value1&key2=value2. - Fragment. Refers to a part of a resource, for example
#section1.
A scheme starts with a letter and can contain letters, digits, plus signs (+), periods (.), and hyphens (-). Characters that cannot appear directly can be percent-encoded. A space is %20, for example. RFC 3986 also defines relative references against a base URI and normalization for comparing URIs.
Example
https://example.com:8080/path/to/resource?query=123#section2
- Scheme:
https - Authority:
example.com:8080 - Path:
/path/to/resource - Query:
query=123 - Fragment:
section2
ERC-6860 modifies parts of ERC-4804.
For more on ERC-4804, see the following article.
[ERC-4804] Calling contracts through HTTP-style Web3 URLs
Motivation
People normally read blockchain data through infrastructure such as RPC nodes, block explorers such as Etherscan, and dapps. Web users rarely interact with onchain content directly. A Web3 URL gives an application a standard way to read such content without relying on a conventional web proxy to translate each request for it.
This is particularly useful when a contract already stores SVG, HTML, or metadata. URI-compatible formats can work with existing web infrastructure while the EVM supplies the content.
Specification
The specification uses Augmented Backus–Naur Form (ABNF), defined in RFC 2234, to express the syntax precisely.
ABNF defines the syntax of protocols and data formats.
Basics
Building blocks
- Rule. A named definition such as
rule = definition. - Literal. Characters written directly, such as
"text". - Alternation. Alternatives separated by
/, as inrule1 / rule2. - Concatenation. A sequence written as adjacent items, as in
rule1 rule2.
Operators
=defines a rule./separates alternatives.()groups elements.[]makes elements optional.*describes repetition.
Numeric and character ranges
DIGIT = %x30-39covers digits from 0 to 9.ALPHA = %x41-5A / %x61-7Acovers A to Z and a to z.
Example
URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ]
scheme = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." )
hier-part = "//" authority path-abemptyURI combines a scheme and hierarchy with an optional query and fragment. scheme starts with a letter and allows letters, digits, +, -, and .. This example's hier-part combines an authority and path-abempty.
A Web3 URL is an ASCII string with the following structure.
web3URL = schema "://" [ userinfo "@" ] contractName [ ":" chainid ] pathQueryschema. The scheme is eitherw3orweb3.
schema = "w3" / "web3"userinfo. This address becomes the EVM call'sfromvalue. If omitted, the protocol uses the zero address,0x0.
userinfo = addresscontractName. This identifies the EVM call'stoaddress. It may be a hexadecimal address or a domain that a name service such as ENS resolves to an address.
contractName = address / domainName
address = "0x" 20( HEXDIG HEXDIG )
domainName = *( unreserved / pct-encoded / sub-delims )chainid. This selects the blockchain. When omitted, the protocol defaults to the main chain associated with the name service provider, for example1for ENS. When no name service is used, it defaults to1.
chainid = %x31-39 *DIGITpathQuery. This contains a path and optional query. Its grammar depends on whether the contract uses manual or auto mode.
pathQuery = mPathQuery / aPathQueryRelative URLs
Resolution modes define how Web3 relative URLs are handled.
web3UrlRef = web3URL / relativeWeb3URL
relativeWeb3URL = relPathQuery
relPathQuery = relMPathQuery / relAPathQueryExample
web3://0x1234567890abcdef1234567890abcdef12345678@0xabcdef1234567890abcdef1234567890abcdef12:1/path/to/resource?query=paramschema:web3.userinfo:0x1234567890abcdef1234567890abcdef12345678, the EVM call sender.contractName:0xabcdef1234567890abcdef1234567890abcdef12, the contract address.chainid:1, Ethereum mainnet.pathQuery:/path/to/resource?query=param, the resource path and query.
Resolution modes
The protocol supports manual and auto mode.
How the client checks the mode
The client calls resolveMode at the to address. Its Solidity signature is as follows.
function resolveMode() external returns (bytes32);Supported resolution modes
Manual mode
A contract selects manual mode by returning this bytes32 encoding of "manual".
0x6d616e75616c0000000000000000000000000000000000000000000000000000Auto mode
A contract selects auto mode by returning this bytes32 encoding of "auto".
0x6175746f00000000000000000000000000000000000000000000000000000000A zero result also selects auto mode.
0x0000000000000000000000000000000000000000000000000000000000000000Auto mode is also the fallback if the call errors, for example because the method is absent or reverts.
Other modes
For another return value, the request fails with unsupported resolve mode.
Manual mode
Manual mode uses the raw mPathQuery as the call data.
Manual mode grammar
mPathQuery
mPathQuery = mPath [ "?" mQuery ]mPath
The path uses mPathAbempty. It starts with / or is empty.
mPath = mPathAbempty ; begins with "/" or is emptyA nonempty path contains segments and may end in a file extension.
mPathAbempty = [ *( "/" segment ) "/" segment [ "." fileExtension ] ]
segment = *pchar ; as in RFC 3986
fileExtension = 1*( ALPHA / DIGIT )Each segment consists of RFC 3986 pchar characters. A file extension contains at least one letter or digit.
mQuery
The query follows RFC 3986.
mQuery = *( pchar / "/" / "?" ) ; as in RFC 3986Manual mode behavior
If mPathQuery is empty, the call data is / (0x2f). The client treats the call result as ABI-encoded bytes, decodes it, and returns the bytes to the frontend. The default MIME type is text/html. When a file extension is present, the client can derive the MIME type from it.
Relative URLs
Manual mode supports relative references similar to HTTP URLs.
relMPathQuery
relMPathQuery = relMPath [ "?" mQuery ]relMPath
A relative path can take the absolute, no-scheme, or empty form.
relMPath = mPathAbsolute ; begins with "/" but not "//"
/ mPathNoscheme ; begins with a non-colon segment
/ mPathEmpty ; zero charactersAn absolute path starts with one slash and can include a file extension.
mPathAbsolute = "/" [ segmentNz *( "/" segment ) ] [ "." fileExtension ]A no-scheme path starts with a segment that contains no colon. It can also include a file extension.
mPathNoscheme = segmentNzNc *( "/" segment ) [ "." fileExtension ]
segmentNzNc = 1*( unreserved / pct-encoded / sub-delims / "@" )An empty path has no characters.
mPathEmpty = 0<pchar>Auto mode
Auto mode uses a path to specify a contract method and arguments. The client maps them to an EVM call and returns the result.
Auto mode grammar
aPathQuery
aPathQuery = aPath [ "?" aQuery ]aPath
The path optionally contains a method and arguments. If it is empty or contains only /, the client calls the contract with empty call data. Otherwise, it encodes the call with the Solidity ABI.
aPath = [ "/" [ method *( "/" argument ) ] ]method
The method names the function to call.
method = ( ALPHA / "$" / "_" ) *( ALPHA / DIGIT / "$" / "_" )argument
An argument can use one of the following grammar rules.
argument = boolArg / uintArg / intArg / addressArg / bytesArg / stringArgboolArg. Boolean.
boolArg = [ "bool!" ] ( "true" / "false" )uintArg. Unsigned integer.
uintArg = [ "uint" [ intSizes ] "!" ] 1*DIGITintArg. Signed integer type.
intArg = "int" [ intSizes ] "!" 1*DIGITaddressArg. Address or resolvable domain.
addressArg = [ "address!" ] ( address / domainName )bytesArg. Byte string.
bytesArg = [ "bytes!" ] bytes / "bytes1!0x" 1( HEXDIG HEXDIG ) / ... / "bytes32!0x" 32( HEXDIG HEXDIG )stringArg. String.
stringArg = "string!" *pchar [ "." fileExtension ]Type inference
When an argument has no explicit type prefix, the client can infer the following types.
- A decimal number is
uint256. - A 32-byte hexadecimal value is
bytes32. - A 20-byte hexadecimal value is an
address. - Other hexadecimal byte data is
bytes. trueandfalsearebool.- Otherwise, resolve the argument as a domain name to an
address, or return an error if it cannot be resolved.
aQuery
The query can specify how to encode the response.
aQuery = attribute *( "&" attribute )The returns attribute or its alias returnTypes controls response handling.
attribute = attrName "=" attrValue
attrName = "returns" / "returnTypes"
attrValue = [ "(" [ retTypes ] ")" ]
retTypes = retType *( "," retType )
retType = retRawType *( "[" [ %x31-39 *DIGIT ] "]" )
retRawType = "(" retTypes ")" / retBaseType
retBaseType = "bool" / "uint" [ intSizes ] / "int" [ intSize ] / "address" / "bytes" [ bytesSizes ] / "string"Return data
When the return type attribute is absent or has an empty value, the client treats the call result as an ABI-encoded byte string. For returns=(), it puts the raw result in a JSON array as a single 0x-prefixed hexadecimal string. If types are specified, it decodes the ABI result using those types and serializes them as JSON.
Relative URLs
Auto-mode relative URLs resolve against the current contract. They can refer to the current resource, a / path, or a complete method and argument sequence.
Examples
Example 1a
# 手動モード
web3://w3url.eth/- Resolve
w3url.eththrough ENS on Ethereum mainnet, chain ID1. - Call
resolveMode()with selector0xDD473FAEand confirm the result ismanual. - Send the call to that address with
0x2F(/) as call data. - Decode the ABI-encoded byte string and return it to the frontend. The default MIME type is
text/html.
Example 1b
# 自動モード
web3://w3url.eth/- Resolve
w3url.eththrough ENS on Ethereum mainnet, chain ID1. - Call
resolveMode()with selector0xDD473FAEand confirm that the result indicates auto mode. - Call the address with empty call data.
- Decode the ABI-encoded byte string and return it to the frontend. The example does not specify a MIME type.
Example 2
# 自動モード
web3://cyberbrokers-meta.eth/renderBroker/9999- Resolve
cyberbrokers-meta.eththrough ENS on Ethereum mainnet, chain ID1. - Call
resolveMode()with selector0xDD473FAEand confirm auto mode. - Call the resolved address with
0x+keccak("renderBroker(uint256)")[0:4]+abi.encode(uint256(9999)). - Decode the ABI-encoded bytes and return them to the frontend. The example does not specify a MIME type.
Example 3
# 手動モード
web3://vitalikblog.eth:5/- Obtain the ENS address for
vitalikblog.ethon chain ID5, the historical Goerli testnet. - Call
resolveMode()and confirm manual mode. - Call the resolved address with
0x2F(/) as call data. - Decode the ABI-encoded bytes and return them to the frontend as
text/html.
Example 4
# 手動モード
web3://0xe4ba0e245436b737468c206ab5c8f4950597ab7f:42170/- Call
resolveMode()and confirm manual mode. - Call
0xe4ba0e245436b737468c206ab5c8f4950597ab7fon chain ID42170, Arbitrum Nova, with0x2F(/) as call data. - Decode the ABI-encoded bytes and return them to the frontend as
text/html.
Example 5
# 自動モード
web3://0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/balanceOf/vitalik.eth?returns=(uint256)- Resolve
vitalik.eththrough ENS on Ethereum mainnet, chain ID1. - Call the contract's
balanceOf(address)function with the resolved address. - Decode the result as
uint256and return it to the frontend asapplication/json.
Example 6
# 自動モード
web3://0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/balanceOf/vitalik.eth?returns=()- Resolve
vitalik.eththrough ENS on Ethereum mainnet, chain ID1. - Call the contract's
balanceOf(address)function with the resolved address. - Return the raw result bytes in JSON. The MIME type is
application/json.
Complete Web3 URL ABNF
Show the complete Web3 URL ABNF
web3URL = schema "://" [ userinfo "@" ] contractName [ ":" chainid ] pathQuery
schema = "w3" / "web3"
userinfo = address
contractName = address
/ domainName
chainid = %x31-39 *DIGIT
pathQuery = mPathQuery ; path+query for manual mode
/ aPathQuery ; path+query for auto mode
web3UrlRef = web3URL
/ relativeWeb3URL
relativeWeb3URL = relPathQuery
relPathQuery = relMPathQuery ; Relative URL path+query for manual mode
/ relAPathQuery ; Relative URL path+query for auto mode
mPathQuery = mPath [ "?" mQuery ]
mPath = mPathAbempty ; begins with "/" or is empty
relMPathQuery = relMPath [ "?" mQuery ]
relMPath = mPathAbsolute ; begins with "/" but not "//"
/ mPathNoscheme ; begins with a non-colon segment
/ mPathEmpty ; zero characters
mPathAbempty = [ *( "/" segment ) "/" segment [ "." fileExtension ] ]
mPathAbsolute = "/" [ segmentNz *( "/" segment ) ] [ "." fileExtension ]
mPathNoscheme = segmentNzNc *( "/" segment ) [ "." fileExtension ]
mPathEmpty = 0<pchar>
segment = *pchar ; as in RFC 3986
segmentNz = 1*pchar ; as in RFC 3986
segmentNzNc = 1*( unreserved / pct-encoded / sub-delims / "@" )
; as in RFC 3986: non-zero-length segment without any colon ":"
mQuery = *( pchar / "/" / "?" ) ; as in RFC 3986
aPathQuery = aPath [ "?" aQuery ]
aPath = [ "/" [ method *( "/" argument ) ] ]
relAPathQuery = aPath [ "?" aQuery ]
method = ( ALPHA / "$" / "_" ) *( ALPHA / DIGIT / "$" / "_" )
argument = boolArg
/ uintArg
/ intArg
/ addressArg
/ bytesArg
/ stringArg
boolArg = [ "bool!" ] ( "true" / "false" )
uintArg = [ "uint" [ intSizes ] "!" ] 1*DIGIT
intArg = "int" [ intSizes ] "!" 1*DIGIT
intSizes = "8" / "16" / "24" / "32" / "40" / "48" / "56" / "64" / "72" / "80" / "88" / "96" / "104" / "112" / "120" / "128" / "136" / "144" / "152" / "160" / "168" / "176" / "184" / "192" / "200" / "208" / "216" / "224" / "232" / "240" / "248" / "256"
addressArg = [ "address!" ] ( address / domainName )
bytesArg = [ "bytes!" ] bytes
/ "bytes1!0x" 1( HEXDIG HEXDIG )
/ "bytes2!0x" 2( HEXDIG HEXDIG )
/ "bytes3!0x" 3( HEXDIG HEXDIG )
/ "bytes4!0x" 4( HEXDIG HEXDIG )
/ "bytes5!0x" 5( HEXDIG HEXDIG )
/ "bytes6!0x" 6( HEXDIG HEXDIG )
/ "bytes7!0x" 7( HEXDIG HEXDIG )
/ "bytes8!0x" 8( HEXDIG HEXDIG )
/ "bytes9!0x" 9( HEXDIG HEXDIG )
/ "bytes10!0x" 10( HEXDIG HEXDIG )
/ "bytes11!0x" 11( HEXDIG HEXDIG )
/ "bytes12!0x" 12( HEXDIG HEXDIG )
/ "bytes13!0x" 13( HEXDIG HEXDIG )
/ "bytes14!0x" 14( HEXDIG HEXDIG )
/ "bytes15!0x" 15( HEXDIG HEXDIG )
/ "bytes16!0x" 16( HEXDIG HEXDIG )
/ "bytes17!0x" 17( HEXDIG HEXDIG )
/ "bytes18!0x" 18( HEXDIG HEXDIG )
/ "bytes19!0x" 19( HEXDIG HEXDIG )
/ "bytes20!0x" 20( HEXDIG HEXDIG )
/ "bytes21!0x" 21( HEXDIG HEXDIG )
/ "bytes22!0x" 22( HEXDIG HEXDIG )
/ "bytes23!0x" 23( HEXDIG HEXDIG )
/ "bytes24!0x" 24( HEXDIG HEXDIG )
/ "bytes25!0x" 25( HEXDIG HEXDIG )
/ "bytes26!0x" 26( HEXDIG HEXDIG )
/ "bytes27!0x" 27( HEXDIG HEXDIG )
/ "bytes28!0x" 28( HEXDIG HEXDIG )
/ "bytes29!0x" 29( HEXDIG HEXDIG )
/ "bytes30!0x" 30( HEXDIG HEXDIG )
/ "bytes31!0x" 31( HEXDIG HEXDIG )
/ "bytes32!0x" 32( HEXDIG HEXDIG )
stringArg = "string!" *pchar [ "." fileExtension ]
aQuery = attribute *( "&" attribute )
attribute = attrName "=" attrValue
attrName = "returns"
/ "returnTypes"
attrValue = [ "(" [ retTypes ] ")" ]
retTypes = retType *( "," retType )
retType = retRawType *( "[" [ %x31-39 *DIGIT ] "]" )
retRawType = "(" retTypes ")"
/ retBaseType
retBaseType = "bool" / "uint" [ intSizes ] / "int" [ intSize ] / "address" / "bytes" [ bytesSizes ] / "string"
bytesSizes = %x31-39 ; 1-9
/ ( "1" / "2" ) DIGIT ; 10-29
/ "31" / "32" ; 31-32
domainName = *( unreserved / pct-encoded / sub-delims ) ; As in RFC 3986
fileExtension = 1*( ALPHA / DIGIT )
address = "0x" 20( HEXDIG HEXDIG )
bytes = "0x" *( HEXDIG HEXDIG )
pchar = unreserved / pct-encoded / sub-delims / ":" / "@" ; As in RFC 3986
pct-encoded = "%" HEXDIG HEXDIG ; As in RFC 3986
unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~" ; As in RFC 3986
sub-delims = "!" / "$" / "&" / "'" / "(" / ")"
/ "*" / "+" / "," / ";" / "=" ; As in RFC 3986Changes from ERC-4804
Corrections
- Manual mode. ERC-4804 used the path and query as-is. ERC-6860 also uses the extension in the path to choose the MIME type.
- Auto mode. When the query has no return type attribute, ERC-6860 clarifies that the return data is an ABI-encoded byte string rather than an ABI-encoded
bytes32.
Clarifications
- Formal grammar. The standard defines the URL format in ABNF.
- Resolution mode. It details how the client chooses a mode.
- Manual mode. It specifies percent-encoding, response handling, and MIME type selection.
- Auto mode. It details argument encoding and the format and handling of
returns.
Modifications
- Protocol names. ERC-6860 removes the
ethereum-web3://andeth-web3://schemes from ERC-4804. - Auto mode types. ERC-4804 supported
uint256,bytes32,address,bytes, andstring. ERC-6860 supports more types. - Auto mode integer encoding. ERC-4804 encoded returned integers as strings. ERC-6860 uses
0x-prefixed hexadecimal strings in line with Ethereum JSON-RPC.
Rationale
The proposal aims to add a decentralized presentation layer to Ethereum. Human-readable URLs can reference onchain web content such as HTML, CSS, JPG, PNG, and SVG. The EVM acts as a decentralized backend for serving that content.
Design principles
Readability
Web3 URLs should be as recognizable as ordinary web URLs such as http://. Names are easier to read than hexadecimal addresses, and method names and arguments are easier to read than raw hexadecimal call data. The client translates these forms into addresses and calldata.
Compatibility with HTTP URLs
Web3 URLs should support familiar URL concepts such as relative paths, queries, fragments, and percent-encoding. Existing browser and HTTP URL support can therefore be adapted with fewer changes, and web users have less new syntax to learn.
Simplicity
Clients infer argument types such as address, bytes32, and uint256 to keep URLs short. Authors can specify a type when inference is insufficient.
Flexibility
A contract can override the default encoding rules to control how the URL identifies the intended web resource.
Citation
Qi Zhou (@qizhou), Chao Pi (@pichaoqkc), Sam Wilson (@SamWilsn), Nicolas Deschildre (@nand2), "ERC-6860: Web3 URL to EVM Call Message Translation [DRAFT]," Ethereum Improvement Proposals, no. 6860, September 2023. [Online serial]. Available: https://eips.ethereum.org/EIPS/eip-6860.
Conclusion
ERC-6860 translates HTTP-style Web3 URLs into EVM calls so clients can retrieve onchain content using a familiar URL format.
Questions are welcome via direct message.
You can find more of my work at these links.



