主页EIPs
EIPsERC-7617
ERC-7617

Chunk support for ERC-5219 mode in Web3 URL

In ERC-5219 resolve mode, add ability to fetch a Web3 URL resource made of several chunks
DraftStandards Track: ERC
创建时间: 2024-02-08
关联 EIP: EIP-5219, EIP-6944
Qi Zhou (@qizhou), Nicolas Deschildre (@nand2)
社区讨论原文链接编辑
1 分钟了解
欢迎补充好内容
去提交
相关视频
欢迎补充好内容
去提交
正文

Abstract

In the context of the ERC-6860 web3:// standard, this ERC extends the ERC-6944 resolve mode: This standard defines a new optional web3-next-chunk HTTP header returned by the request() call, that contains a web3:// URL pointing to the next data chunk of the resource data. Chunks are streamed to the web3:// client, and it loops until the web3-next-chunk header is no longer present.

Motivation

Ethereum RPC endpoints have a gas limit, which can be reached when serving large content. By adding a chunking feature, we add the possibility to serve arbitrary sized content.

Specification

In the ERC-6944 resolve mode, this standard introduces the new optional web3-next-chunk HTTP header, to be returned in the headers KeyValue array of the request() method defined in ERC-6944.

The value of the header is either a complete web3:// URL, or a relative one. The target smart contract must use the ERC-6944 resolve mode.

When processing the result of the initial request() call, the protocol return the HTTP status code, HTTP headers and body right away to the web3:// client. If a web3-next-chunk header is present, it parse the URL. If the URL is invalid, or the target smart contract is not using the ERC-6944 resolve mode, the HTTP data streaming is ended with an error. Otherwise it call the request() method, ignore the returned statusCode, send the body data as the next chunk of data, and if a web3-next-chunk header is again present, loops until no more are present.

Rationale

The use of a header pointing to the next chunk was chosen because it does not require changes to the ERC-6944 request() interface, and the use of a web3:// URL in the header add flexibility to the means to provide the next chunk.

Security Considerations

No security considerations were found.

Copyright and related rights waived via CC0.

扩展阅读
欢迎补充好内容
去提交
相关项目
欢迎补充好内容
去提交

不想错过最新的 EIP 动态?

订阅 EIPs Fun 周刊以跟进相关更新,建⽴你与 EIP 之间的连接 ,更好地建设以太坊。

详情
支持以太坊贡献者,推动生态建设
资源
GitHub
支持社区