EIPs Explained

ERC-7588 · Final · ERC · 2024-01-01

ERC-7588: Blob Transactions Metadata JSON Schema

A JSON schema for describing the blobs in an EIP-4844 blob transaction (originator, description, MIME type per blob), placed as UTF-8 text in the transaction's data field so indexers and storage apps can tell what the blobs contain.

What problem does it solve?

EIP-4844 added blob transactions: transactions that carry large, temporary data blobs, mainly used by rollups to post their batch data cheaply. A blob is just 128 KB of opaque bytes. Rollups know what their own blobs mean, but anyone else looking at them, such as blob explorers, indexing services or storage networks that archive blobs, sees only raw data.

The data (calldata) field of a blob transaction is usually empty. ERC-7588 proposes using it to carry a small, human- and machine-readable description of the blobs: who posted them, what they are, and their MIME type. This makes blobs easier to audit and opens the door to apps such as decentralized storage or "blob inscriptions".

How it works

The transaction's data field is set to the UTF-8 bytes of a JSON object with these optional properties:

Property Meaning
originator Who posted the blobs
description What the blobs contain
content_type MIME type (per RFC 2046) for all blobs
extras Free-form extra information (string)
blobs Array, one entry per blob in order, each with its own description, content_type and extras that override the top-level values

Nothing else about the blob transaction changes. The metadata is not checked by consensus and has no effect on execution or validity; it is purely informational for off-chain readers.

The standard covers blob transactions whose data field is otherwise unused. If a blob transaction also needs to call a contract (for example a storage contract recording versioned hashes), the data field holds that call instead and this ERC does not apply.

Sample code

Sending a blob transaction with metadata (ethers v6, which needs a KZG library for blobs):

import { Wallet, JsonRpcProvider, toUtf8Bytes, hexlify, parseUnits } from "ethers";

const provider = new JsonRpcProvider(process.env.RPC_URL);
const wallet = new Wallet(process.env.PRIVATE_KEY!, provider);

const metadata = {
  originator: "example.app",
  description: "Text plus an illustration",
  blobs: [
    { content_type: "text/plain", description: "Explanation text" },
    { content_type: "image/png", description: "Illustration, RFC 2397 data URL" },
  ],
};

const tx = await wallet.sendTransaction({
  type: 3,
  to: wallet.address,
  data: hexlify(toUtf8Bytes(JSON.stringify(metadata))),
  blobs: [textBlobBytes, imageBlobBytes], // blob payloads (Uint8Array)
  kzg,                                   // a KZG library instance (e.g. c-kzg / kzg-wasm) for commitments
  maxFeePerBlobGas: parseUnits("10", "gwei"),
});

Reading it back:

import { toUtf8String } from "ethers";
const meta = JSON.parse(toUtf8String((await provider.getTransaction(hash))!.data));

Things to know

  • Status is Final.
  • Metadata is unverified: anyone can claim any originator or content type. Treat it as a hint and validate the blob contents yourself.
  • Treat it as untrusted input. It can contain spam, phishing links or malicious payloads; sanitise before displaying.
  • Calldata costs gas, so keep metadata small. Unlike blobs, the data field is stored permanently in execution-layer history, while blobs themselves are pruned by consensus nodes after a limited retention window.

#blobs #metadata #json #data-availability #indexing

Details

Authors
Gavin Fu (@gavfu), Leo Wang (@wanglie1986), Bova Chen (@appoipp), Aiden X (@4ever9)
Status
Final
Type
Standards Track / ERC
Created
2024-01-01
Requires

Machine-readable: Markdown · JSON