ERC-7588: Blob Transactions Metadata JSON Schema
Attaching metadata to blobs carried by blob transactions
Abstract
This EIP introduces a standard for attaching metadata to blobs carried by blob transactions, as outlined in EIP-4844. The metadata is represented as a JSON object adhering to a predefined schema, and its string representation is placed in the data field of the blob transaction.
Motivation
EIP-4844 defines a new type of transaction known as a “blob transaction.” These transactions contain a list of blobs along with their KZG commitments and proofs. Blob transactions serve as a mechanism for rollups to post their layer 2 transaction data to Ethereum layer 1.
While rollups typically manage their own posted blob transactions, third-party solutions (such as Portal Network and blobscan) may also index all blobs ever posted to Ethereum, and provide querying services for blobs. By attaching metadata to blobs, such as information about the originator, a description, or content type, we can significantly enhance the visibility and auditability of these data structures.
Furthermore, decentralized storage applications may utilize blob transactions to post user data to Ethereum, sync and store the blobs off-chain for future retrieval. The inclusion of metadata opens up possibilities for novel applications, including inscriptions and other creative use cases.
Specification
Metadata JSON Schema
The metadata is represented as a JSON object adhering to the following JSON Schema:
For example, suppose Vitalik wants to send a blob transaction carrying two blobs explaining “data availability sampling.” He could include a paragraph of textual explanation in the first blob and an illustration image in the second blob. The corresponding metadata JSON object would look like this:
The complete blob transaction would include this metadata in the data field, along with other relevant fields:
Blob Transaction Envelope
The blob transaction's calldata (i.e., the data field) should be set to the string representation of the metadata JSON object, encoded in UTF-8.
Rationale
In the Ethereum ecosystem, various types of transactions exist, each serving different purposes. The usage of the data field within these transactions varies:
- Regular Funds Transfer Transactions: In these transactions, the data field is typically not used, and users may optionally include arbitrary data.
- Smart Contract Deployment Transactions: For deploying smart contracts. The data field holds the contract bytecode and any encoded arguments required by the constructor.
- Smart Contract Function Call Transactions: When invoking smart contract functions, the data field contains the function call data, including the function signature and any necessary parameters.
Blob transactions are specifically designed for posting blobs, and normally, the data field remains unused. This EIP proposes a novel approach: utilizing the data field to attach metadata to the carried blobs. By doing so, we can enhance the auditability and usability of blob transactions.
However, it’s essential to note that there are scenarios where blob transactions may also need to call smart contract functions. Consider a decentralized storage application that employs a smart contract to track blob versioned hashes and metadata like MIME types. In such cases, users could submit a blob transaction containing blobs while simultaneously using the data field to invoke smart contract functions to store versioned hashes and MIME types of those blobs. It’s important to recognize that this EIP does not cover such specific use cases.
Backwards Compatibility
This EIP is backward compatible with EIP-4844, as it does not modify the structure or functionality of blob transactions, but only adds an optional metadata field to them.
Security Considerations
This EIP does not introduce any new security risks or vulnerabilities, as the metadata is only an informational field that does not affect the execution or validity of blob transactions. However, users and applications should be aware of the following potential issues:
-
The metadata is not verified or enforced by the consensus layer, and therefore it may not be accurate or trustworthy. Users and applications should not rely on the metadata for critical or sensitive operations, and should always verify the contents and sources of the blobs themselves.
-
The metadata may contain malicious or harmful data, such as spam, phishing, malware, etc. Users and applications should not blindly trust or execute the metadata, and should always scan and sanitize the metadata before using it.
-
The metadata may increase the gas cost of blob transactions, as more data is included in the data field. Users and applications should balance the benefits and costs of using the metadata, and should optimize the size and format of the metadata to reduce the gas cost.
Copyright
Copyright and related rights waived via CC0.