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-5219 proposes a read-only resource request interface that enables efficient communication with decentralized applications (DApps).
This article translates, summarizes, and expands on the following proposal.
Overview
This Ethereum Improvement Proposal standardizes an interface for requesting resources from smart contracts and receiving HTTP-like responses.
Motivation
Ethereum has an established and diverse ecosystem for building decentralized applications. However, many DApps are not decentralized throughout their entire architecture: users must first visit a centrally hosted website containing the application's front-end code before interacting with its contracts.
This dependence on a centralized website introduces several concerns.
Trust minimization
In conventional centralized applications, users must trust the company or service provider operating the application. Even when the application logic is decentralized, its delivery infrastructure may introduce additional parties that users must trust. A compromised interface can put personal information or funds at risk.
Censorship
Operators of centralized websites can restrict access to content or remove it altogether. Distributing data and code across decentralized infrastructure can reduce dependence on a single party's decisions.
Persistence
A conventional web interface is hosted on servers and can be modified or removed by its operator. An interface whose resources are stored on-chain can have stronger persistence properties, subject to its implementation and the continued availability of the network.
Interoperability
Conventional applications and smart contracts operate in different environments, which can make direct interaction difficult. Effective interoperability between contracts and DApp interfaces is needed to reduce dependence on centrally hosted websites.
ERC-5219 addresses these concerns by standardizing how clients request and retrieve resources from contracts. The aim is to support more decentralized application delivery and reduce unnecessary trust and exposure to censorship.
Specification
Name Resolution
Name resolution allows a client to map a resource or application name to the address or other information needed to access it.
Other EIPs proposing name resolution mechanisms may reference ERC-5219 and recommend that clients support those mechanisms. Clients can also support conventional DNS.
Separation of Concerns
Application functionality should be divided into appropriate components. In particular, the proposal recommends separating application logic, such as backend and smart contract operations, from front-end presentation and user interaction.
This separation can make components easier to maintain and scale and limit the scope of changes.
Contract Interface
DApp contracts implement a defined interface to enable clients to request resources in a consistent manner. The interface specifies how requests and responses are represented, rather than leaving every application to invent a different convention.
The proposal refers implementers to the interface definition, which is linked in the Reference Implementation section below.
Note to Implementers
Efficient resource delivery matters because on-chain storage and computation have costs. The message/external-body MIME type can refer clients to resources that the smart contract itself cannot directly access, such as data stored on IPFS.
The following example illustrates that approach:
statusCode: 200
body: THIS IS NOT REALLY THE BODY!
headers:
- key: Content-type
value: message/external-body; access-type=URL; URL="ipfs://11148a173fd3e32c0fa78b90fe42d305f202244e2739"The response provides a reference to the external resource instead of embedding its contents directly. This can reduce the amount of data that must be returned by the contract.
Together, the name resolution guidance, interface definition, and resource retrieval conventions provide a common approach to communication between clients and DApp contracts.
Rationale
A read-only request method was chosen because operations that submit data to application contracts should be initiated by the DApp after its resources have been retrieved and interpreted.
DApps need to interact with smart contracts, but fetching interface resources should not itself require submitting a state-changing transaction. Such transactions incur costs and require users to wait for inclusion in a block, which can negatively affect the user experience.
Requiring a transaction for every resource request would be both expensive and slow.
Submitting an on-chain transaction generally incurs gas fees and requires waiting for block inclusion. A read-only resource request can instead be evaluated through a read-only call, without submitting a transaction to the network.
Complex front-end logic should run on the end user's device rather than being executed inside smart contracts, where computation and storage would be more expensive.
Storing or implementing complex application logic in contracts can increase deployment and update costs. Running front-end logic on the user's device can be more efficient. Resources containing that logic may still be delivered through a contract-based interface.
Separation of Concerns
The contract serving front-end resources does not need to handle interactions with the application's backend contracts. Other EIPs may be combined with the HTTP-like 307 Temporary Redirect status code to request state-changing operations.
A redirect can identify a resource or operation handled through another mechanism. ERC-5219 does not itself authorize or execute a state-changing transaction merely by returning a redirect.
Rather than reproducing the full HTTP request model, the proposal uses a simplified version.
A smaller request interface makes resource retrieval simpler and avoids unnecessary processing.
GET is the only HTTP method directly relevant to this resource retrieval interface. Query parameters can be encoded in the requested resource, and most HTTP request headers are unnecessary.
GET is intended for retrieving information. Encoding query parameters as part of the resource identifier allows the client to specify what it needs without reproducing the entire HTTP request format.
Backward Compatibility
The proposal is designed to be compatible with the naming standards discussed in its name resolution section.
Security Considerations
Security considerations that apply to conventional URLs also apply here. For example, following a 3XX redirect can expose information about the user to another service.
Applications should consider the privacy implications of retrieving external resources and following redirects, rather than assuming that on-chain resource references eliminate those risks.
Reference Implementation
The interface definition is available at:
https://github.com/ethereum/EIPs/blob/master/assets/eip-5219/IDecentralizedApp.sol
Citation
Gavin John (@Pandapip1), "ERC-5219: Contract Resource Requests," Ethereum Improvement Proposals, no. 5219, July 2022. [Online serial]. Available: https://eips.ethereum.org/EIPS/eip-5219.
Discussion
Developing a DApp generally involves more than implementing smart contracts: front-end and backend components also need to be considered.
My understanding of this proposal is that it addresses interoperability between contracts and front ends while reducing the need to rely on or trust a single application provider.
I would like to explore concrete applications of this approach further. If you have ideas about useful applications, please share them in the comments.
There was also substantial discussion of the proposal in the Ethereum Magicians forum:
Conclusion
ERC-5219 defines a GET-like interface for retrieving resources from smart contracts. It aims to make DApp interfaces less dependent on centrally hosted websites while keeping state-changing operations separate from resource retrieval.
Questions are welcome via Twitter @cardene777.


