---
eip: 7617
title: Chunk support for ERC-5219 mode in Web3 URL
description: In ERC-5219 resolve mode, add ability to fetch a Web3 URL resource made of several chunks
author: Qi Zhou (@qizhou), Nicolas Deschildre (@nand2)
discussions-to: https://ethereum-magicians.org/t/erc-5219-resolve-mode/14088
status: Draft
type: Standards Track
category: ERC
created: 2024-02-08
requires: 5219, 6944
---

## Abstract

In the context of the [ERC-6860](./eip-6860.md) `web3://` standard, this ERC extends the [ERC-6944](./eip-6944.md) 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](./eip-6944.md) 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](./eip-6944.md).

The value of the header is either a complete `web3://` URL, or a relative one. The target smart contract must use the [ERC-6944](./eip-6944.md) 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](./eip-6944.md) 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](./eip-6944.md) `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

Copyright and related rights waived via [CC0](../LICENSE.md).
