ERC-8040 · Draft · ERC · 2025-09-06
ERC-8040: ESG Tokenization Protocol
An overlay interface that adds ESG metadata, audit and attestation digests, and an issued-audited-retired lifecycle to ERC-20, ERC-721 or ERC-1155 tokens representing assets such as carbon credits.
What problem does it solve?
Tokenized environmental, social and governance (ESG) assets, carbon credits being the obvious example, need more than ownership and transfers. Buyers and registries want to know where the asset comes from, whether it has been audited, which documents back it, and whether it has already been retired (consumed to offset emissions) so it cannot be counted twice. Each project tends to model this differently.
ERC-8040 adds a common layer for that information on top of the token standards people already use, so wallets, marketplaces and auditors can read ESG lifecycle state in one way.
How it works
A compliant contract implements one base standard, ERC-20, ERC-721 or ERC-1155, for ownership and transfers, plus the IERC8040 interface:
- Metadata:
esgURI(tokenId)must return a JSON document with at leaststandard("ERC-8040/1.0"),category(for examplecarbon),geo(for example an ISO 3166-2 code),carbon_value,cycle,digest,physical_id,attestation {atf_digest, signer},statusandevidence.getMetadata(tokenId)may return the same data on-chain. - Lifecycle: every token is
issued→audited→retired.mintESGToken(metadata)by an authorised issuer; status starts asissued.auditESGToken(tokenId, auditDigest)by an authorised auditor; status becomesaudited.retireESGToken(tokenId, reason)by the owner, an approved operator or an authorised party. Retirement is permanent.
- Digests: documents, audits and attestations are referenced by full 64-byte SHA3-512 digests stored as
bytes(never truncated tobytes32). - Events:
Minted,Audited,AttestedandRetiredgive indexers an auditable trail.
How each base standard maps: with ERC-20 a unit is a fraction (for example 1e18 units for one tonne of CO2e); with ERC-721 each token is one credit; with ERC-1155 an id is a homogeneous batch.
Sample code
Reading a token's ESG state and retiring it (ethers v6):
import { Contract } from "ethers";
const esg = new Contract(tokenAddress, [
"function esgURI(uint256) view returns (string)",
"function retireESGToken(uint256 tokenId, string reason)",
"event Retired(uint256 indexed tokenId, uint256 timestamp, string reason)",
], signer);
const uri = await esg.esgURI(42n);
const meta = await (await fetch(uri)).json();
console.log(meta.category, meta.geo, meta.status); // e.g. "carbon" "BR-RS" "audited"
if (meta.status === "audited") {
await (await esg.retireESGToken(42n, "Offset 2025 scope-1 emissions")).wait();
}
Things to know
- Status is Draft.
- The draft leaves some details open:
carbon_valueis auint256in Solidity but shown as a decimal (12.5) in the JSON example, and there is no function that emitsAttested. Clarify these before building on it. - Solidity has no native SHA3-512 (
keccak256is 256-bit), so digests are computed off-chain and stored as bytes. - On-chain digests prove that documents were not altered, not that the underlying environmental claim is true. Trust still depends on the issuer, auditors and attestation signers.
- Carbon and ESG instruments are subject to registry rules and regulation outside this standard.