web3://
is a new protocol to access content returned by smart contracts in EVM-compatible blockchains.
It is meant to be similar to the https://
protocol : one can browse websites and download content using their web browser, CURL-like apps, ... except that the content come from blockchains.
Web3 URLs are very similar in structure to traditional https://
URLs, and have been defined in several Ethereum ERC standards.
Learn more about the web3://
vision
web3://web3url.eth
This on-chain website is located in the 0x5ad14e8439b9619e165db27545faf6df13e2b947
smart contract in the QuarkChain L2 testnet blockchain.
⏩ Try now with a web3:// gateway, or with the others
web3://
clients
web3://0x4e1f41613c9084fdb9e34e11fae9412427480e56/tokenHTML/9352
This URL will fetch the HTML of the NFT number 9352 of the Terraforms NFT collection located at 0x4e1f41613c9084fdb9e34e11fae9412427480e56
on the Ethereum mainnet blockchain.
⏩ Try now with a web3:// gateway, or with the others
web3://
clients
web3://0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/balanceOf/nemorino.eth?returns=(uint256)
This URL will fetch the balance of USDC of the account nemorino.eth
.
⏩ Try now with a web3:// gateway, or with the others
web3://
clients
Before fetching data, the web3://
protocol determine the resolve mode of the smart contract, to know how to deal with it. Learn more about resolve modes.
The vast majority of existing smart contracts were not specifically designed for the web3://
protocol and thus the resolve mode will be auto
.
In this mode, the URL is structured to identify the smart contract method to call, and the structure of the returned data. web3://0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/balanceOf/nemorino.eth?returns=(uint256)
is an example of URL with a resolve mode of auto
.
Learn more about auto mode URLs
When a smart contract is designed for the web3://
protocol, it will implement a specific interface, and there is much more freedom with URL paths.
Two differents resolve modes exists for this scenario: manual
and resource request
. web3://web3url.eth
is an example of URL with a resolve mode of manual
.
Learn more about manual mode URLs and 5219 mode URLs