ERC-7829 · Review · ERC · 2024-11-29
ERC-7829: Data Asset NFT
An ERC-721 extension for selling digital content as NFTs, adding multiple Readers per token plus onchain storage metadata (commitment, size, expiry) backed by storage proofs.
What problem does it solve?
An NFT usually holds only a link to its content. A contract cannot tell whether that content still exists, was altered, or has expired at the storage provider, so the token can keep trading after the thing it represents is gone. NFTs have also mostly suited high-value, scarce items, while everyday digital products (posts, videos, small games, music) are naturally copyable and sold to many buyers.
ERC-7829 targets these "data assets". It ties each token to storage metadata that a data-availability (DA) layer keeps provably correct, and lets one token grant read access to many addresses.
How it works
Data assets are split into three parts:
- Storage metadata (onchain, in a storage contract): commitment, size, expiry and uploader.
- Permission metadata (onchain, in the ERC-721 contract): owner, approvals and readers.
- Data content (offchain, on storage nodes).
The token contract implements IERC7829:
| Function | Purpose |
|---|---|
setReader(tokenId, reader, valid) |
Grant or revoke read access; emits UpdateReader |
isReader(tokenId, reader) |
Check access |
commitByTokenId / sizeByTokenId / expireByTokenId |
Expose storage metadata |
Readers cannot transfer, approve or add other readers. A transfer changes the owner and clears approval but keeps all readers. transfer, approve and setReader must fail once block.timestamp is past the token's expire.
For integrity, the DA provider periodically submits storage proofs. The spec recommends KZG polynomial commitments with random sampling and aggregation, verified optimistically: the aggregated proof is checked onchain, and anyone can challenge it during a window, with rewards and penalties for the challenger and prover.
Sample code
Minimal reader logic on top of OpenZeppelin ERC721:
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
import {ERC721} from "@openzeppelin/contracts/token/ERC721/ERC721.sol";
contract DataAssetNFT is ERC721 {
event UpdateReader(uint256 indexed tokenId, address indexed reader, bool valid);
struct Meta { bytes commit; uint256 size; uint64 expire; }
mapping(uint256 => Meta) public meta;
mapping(uint256 => mapping(address => bool)) private _readers;
constructor() ERC721("Data Asset", "DATA") {}
modifier notExpired(uint256 id) {
require(block.timestamp <= meta[id].expire, "expired");
_;
}
function setReader(uint256 id, address reader, bool valid) external notExpired(id) {
require(_isAuthorized(ownerOf(id), msg.sender, id), "not owner/approved");
_readers[id][reader] = valid;
emit UpdateReader(id, reader, valid);
}
function isReader(uint256 id, address reader) external view returns (bool) {
return _readers[id][reader];
}
function commitByTokenId(uint256 id) external view returns (bytes memory) { return meta[id].commit; }
function sizeByTokenId(uint256 id) external view returns (uint256) { return meta[id].size; }
function expireByTokenId(uint256 id) external view returns (uint64) { return meta[id].expire; }
}
Things to know
- Status: Review.
- "Reader" is an onchain permission flag. Actually gating the offchain content (decryption keys, gateway checks) is up to the storage system.
- Security depends heavily on the chosen DA layer and storage nodes; the ERC leaves that choice to the implementer.
- The KZG and fraud-proof flow is described at a high level, not as a fixed contract interface.
- For time-limited "user" rights on NFTs, compare ERC-4907 (rental), which uses a single user per token.