{"eip":8040,"title":"ESG Tokenization Protocol","description":"Environmental, Social, and Governance (ESG) asset tokenization with metadata, attestations, and lifecycle integrity.","authors":["Leandro Lemos (@agronetlabs) \u003cleandro@agronet.io\u003e"],"status":"Draft","type":"Standards Track","category":"ERC","created":"2025-09-06","requires":[20,721,1155],"discussionsTo":"https://ethereum-magicians.org/t/erc-8040-esg-tokenization-protocol/25846","repo":"ERCs","label":"ERC-8040","officialUrl":"https://eips.ethereum.org/EIPS/eip-8040","sourceUrl":"https://github.com/ethereum/ERCs/blob/master/ERCS/erc-8040.md","url":"https://eips.huatuo.xyz/eip-8040/","tldr":{"en":"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.","ja":"カーボンクレジットなどの資産を表す ERC-20、ERC-721、ERC-1155 トークンに、ESG メタデータ、監査・証明のダイジェスト、発行・監査・償却のライフサイクルを追加するオーバーレイインターフェース。","ko":"탄소 배출권 같은 자산을 나타내는 ERC-20, ERC-721, ERC-1155 토큰에 ESG 메타데이터, 감사 및 증명 다이제스트, 발행-감사-소각 수명 주기를 더하는 오버레이 인터페이스.","zh":"一个叠加接口，为代表碳信用等资产的 ERC-20、ERC-721 或 ERC-1155 代币增加 ESG 元数据、审计与证明摘要，以及“已发行-已审计-已注销”的生命周期。"},"tags":["esg","carbon","rwa","metadata","tokenization"],"explainers":{"en":{"lang":"en","tldr":"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.","tags":["esg","carbon","rwa","metadata","tokenization"],"related":[20,721,1155],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/eip-8040/","markdown":"## What problem does it solve?\n\nTokenized 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.\n\nERC-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.\n\n## How it works\n\nA compliant contract implements one base standard, [ERC-20](/eip-20/), [ERC-721](/eip-721/) or [ERC-1155](/eip-1155/), for ownership and transfers, **plus** the `IERC8040` interface:\n\n- **Metadata**: `esgURI(tokenId)` must return a JSON document with at least `standard` (`\"ERC-8040/1.0\"`), `category` (for example `carbon`), `geo` (for example an ISO 3166-2 code), `carbon_value`, `cycle`, `digest`, `physical_id`, `attestation {atf_digest, signer}`, `status` and `evidence`. `getMetadata(tokenId)` may return the same data on-chain.\n- **Lifecycle**: every token is `issued` → `audited` → `retired`.\n  - `mintESGToken(metadata)` by an authorised issuer; status starts as `issued`.\n  - `auditESGToken(tokenId, auditDigest)` by an authorised auditor; status becomes `audited`.\n  - `retireESGToken(tokenId, reason)` by the owner, an approved operator or an authorised party. Retirement is permanent.\n- **Digests**: documents, audits and attestations are referenced by full 64-byte SHA3-512 digests stored as `bytes` (never truncated to `bytes32`).\n- **Events**: `Minted`, `Audited`, `Attested` and `Retired` give indexers an auditable trail.\n\nHow 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.\n\n## Sample code\n\nReading a token's ESG state and retiring it (ethers v6):\n\n```ts\nimport { Contract } from \"ethers\";\n\nconst esg = new Contract(tokenAddress, [\n  \"function esgURI(uint256) view returns (string)\",\n  \"function retireESGToken(uint256 tokenId, string reason)\",\n  \"event Retired(uint256 indexed tokenId, uint256 timestamp, string reason)\",\n], signer);\n\nconst uri = await esg.esgURI(42n);\nconst meta = await (await fetch(uri)).json();\nconsole.log(meta.category, meta.geo, meta.status); // e.g. \"carbon\" \"BR-RS\" \"audited\"\n\nif (meta.status === \"audited\") {\n  await (await esg.retireESGToken(42n, \"Offset 2025 scope-1 emissions\")).wait();\n}\n```\n\n## Things to know\n\n- Status is **Draft**.\n- The draft leaves some details open: `carbon_value` is a `uint256` in Solidity but shown as a decimal (`12.5`) in the JSON example, and there is no function that emits `Attested`. Clarify these before building on it.\n- Solidity has no native SHA3-512 (`keccak256` is 256-bit), so digests are computed off-chain and stored as bytes.\n- 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.\n- Carbon and ESG instruments are subject to registry rules and regulation outside this standard.\n"},"ja":{"lang":"ja","tldr":"カーボンクレジットなどの資産を表す ERC-20、ERC-721、ERC-1155 トークンに、ESG メタデータ、監査・証明のダイジェスト、発行・監査・償却のライフサイクルを追加するオーバーレイインターフェース。","tags":["esg","carbon","rwa","metadata","tokenization"],"related":[20,721,1155],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ja/eip-8040/","markdown":"## 何を解決するのか\n\nトークン化された環境・社会・ガバナンス（ESG）資産、代表例はカーボンクレジットですが、これらには所有権と送金以上のものが必要です。買い手やレジストリは、その資産がどこから来たのか、監査を受けたか、どの文書が裏付けているか、そしてすでに**償却**（排出量の相殺のために消費）されて二重にカウントされないか、を知りたがります。プロジェクトごとにこれを異なる方法でモデル化しがちです。\n\nERC-8040 は、人々がすでに使っているトークン標準の上に、この情報のための共通レイヤーを追加します。これにより、ウォレット、マーケットプレイス、監査人が ESG のライフサイクル状態を同じ方法で読めるようになります。\n\n## 仕組み\n\n準拠するコントラクトは、所有権と送金のために基本標準のいずれか 1 つ（[ERC-20](/eip-20/)、[ERC-721](/eip-721/)、[ERC-1155](/eip-1155/)）を実装し、**さらに** `IERC8040` インターフェースを実装します。\n\n- **メタデータ**: `esgURI(tokenId)` は、少なくとも `standard`（`\"ERC-8040/1.0\"`）、`category`（例: `carbon`）、`geo`（例: ISO 3166-2 コード）、`carbon_value`、`cycle`、`digest`、`physical_id`、`attestation {atf_digest, signer}`、`status`、`evidence` を含む JSON ドキュメントを返さなければなりません。`getMetadata(tokenId)` は同じデータをオンチェーンで返してもかまいません。\n- **ライフサイクル**: すべてのトークンは `issued` → `audited` → `retired` と進みます。\n  - `mintESGToken(metadata)` は権限を持つ発行者が実行し、ステータスは `issued` から始まります。\n  - `auditESGToken(tokenId, auditDigest)` は権限を持つ監査人が実行し、ステータスは `audited` になります。\n  - `retireESGToken(tokenId, reason)` は所有者、承認済みの operator、または権限を持つ当事者が実行します。償却は永続的です。\n- **ダイジェスト**: 文書、監査、証明は、`bytes` として保存される 64 バイトの完全な SHA3-512 ダイジェストで参照されます（`bytes32` に切り詰めることはありません）。\n- **イベント**: `Minted`、`Audited`、`Attested`、`Retired` により、インデクサーは監査可能な履歴を得られます。\n\n各基本標準との対応: ERC-20 では 1 単位は端数です（たとえば CO2e 1 トンが 1e18 単位）。ERC-721 では各トークンが 1 クレジットです。ERC-1155 では ID が同質のバッチを表します。\n\n## サンプルコード\n\nトークンの ESG 状態を読み取り、償却する例（ethers v6）:\n\n```ts\nimport { Contract } from \"ethers\";\n\nconst esg = new Contract(tokenAddress, [\n  \"function esgURI(uint256) view returns (string)\",\n  \"function retireESGToken(uint256 tokenId, string reason)\",\n  \"event Retired(uint256 indexed tokenId, uint256 timestamp, string reason)\",\n], signer);\n\nconst uri = await esg.esgURI(42n);\nconst meta = await (await fetch(uri)).json();\nconsole.log(meta.category, meta.geo, meta.status); // e.g. \"carbon\" \"BR-RS\" \"audited\"\n\nif (meta.status === \"audited\") {\n  await (await esg.retireESGToken(42n, \"Offset 2025 scope-1 emissions\")).wait();\n}\n```\n\n## 知っておくべきこと\n\n- ステータスは **Draft** です。\n- ドラフトにはいくつか未確定の詳細があります。`carbon_value` は Solidity では `uint256` ですが、JSON の例では小数（`12.5`）で示されており、`Attested` を emit する関数もありません。これらを明確にしてから、これを前提に構築してください。\n- Solidity にはネイティブの SHA3-512 がない（`keccak256` は 256 ビット）ため、ダイジェストはオフチェーンで計算し、bytes として保存します。\n- オンチェーンのダイジェストが証明するのは文書が改ざんされていないことであり、背後にある環境上の主張が真実であることではありません。信頼は依然として、発行者、監査人、証明の署名者に依存します。\n- カーボンや ESG の金融商品は、この標準の外にあるレジストリのルールや規制の対象になります。\n"},"ko":{"lang":"ko","tldr":"탄소 배출권 같은 자산을 나타내는 ERC-20, ERC-721, ERC-1155 토큰에 ESG 메타데이터, 감사 및 증명 다이제스트, 발행-감사-소각 수명 주기를 더하는 오버레이 인터페이스.","tags":["esg","carbon","rwa","metadata","tokenization"],"related":[20,721,1155],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ko/eip-8040/","markdown":"## 어떤 문제를 해결하나요?\n\n토큰화된 환경·사회·지배구조(ESG) 자산, 대표적으로 탄소 배출권은 소유권과 전송 이상의 것이 필요합니다. 구매자와 등록 기관은 자산이 어디서 왔는지, 감사를 받았는지, 어떤 문서가 뒷받침하는지, 그리고 이미 **소각**(배출량 상쇄를 위해 소비)되어 중복 계산될 수 없는지를 알고 싶어 합니다. 프로젝트마다 이를 다르게 모델링하는 경향이 있습니다.\n\nERC-8040은 사람들이 이미 쓰는 토큰 표준 위에 이 정보를 위한 공통 계층을 추가해서, 지갑, 마켓플레이스, 감사인이 ESG 수명 주기 상태를 같은 방식으로 읽을 수 있게 합니다.\n\n## 어떻게 동작하나요?\n\n규격을 따르는 컨트랙트는 소유권과 전송을 위해 기본 표준 하나([ERC-20](/eip-20/), [ERC-721](/eip-721/) 또는 [ERC-1155](/eip-1155/))를 구현하고, **추가로** `IERC8040` 인터페이스를 구현합니다.\n\n- **메타데이터**: `esgURI(tokenId)`는 최소한 `standard`(`\"ERC-8040/1.0\"`), `category`(예: `carbon`), `geo`(예: ISO 3166-2 코드), `carbon_value`, `cycle`, `digest`, `physical_id`, `attestation {atf_digest, signer}`, `status`, `evidence`를 포함한 JSON 문서를 반환해야 합니다. `getMetadata(tokenId)`는 같은 데이터를 온체인으로 반환할 수 있습니다.\n- **수명 주기**: 모든 토큰은 `issued` → `audited` → `retired`로 진행됩니다.\n  - `mintESGToken(metadata)`는 권한 있는 발행자가 호출하며 상태는 `issued`로 시작합니다.\n  - `auditESGToken(tokenId, auditDigest)`는 권한 있는 감사인이 호출하며 상태가 `audited`가 됩니다.\n  - `retireESGToken(tokenId, reason)`은 소유자, 승인된 operator 또는 권한 있는 당사자가 호출합니다. 소각은 영구적입니다.\n- **다이제스트**: 문서, 감사, 증명은 `bytes`로 저장되는 64바이트 전체 SHA3-512 다이제스트로 참조합니다(`bytes32`로 절대 잘라내지 않습니다).\n- **이벤트**: `Minted`, `Audited`, `Attested`, `Retired`가 인덱서에 감사 가능한 기록을 제공합니다.\n\n기본 표준별 대응: ERC-20에서는 한 단위가 소수 조각입니다(예를 들어 CO2e 1톤이 1e18 단위). ERC-721에서는 토큰 하나가 크레딧 하나입니다. ERC-1155에서는 id 하나가 동질적인 묶음입니다.\n\n## 샘플 코드\n\n토큰의 ESG 상태를 읽고 소각하기(ethers v6):\n\n```ts\nimport { Contract } from \"ethers\";\n\nconst esg = new Contract(tokenAddress, [\n  \"function esgURI(uint256) view returns (string)\",\n  \"function retireESGToken(uint256 tokenId, string reason)\",\n  \"event Retired(uint256 indexed tokenId, uint256 timestamp, string reason)\",\n], signer);\n\nconst uri = await esg.esgURI(42n);\nconst meta = await (await fetch(uri)).json();\nconsole.log(meta.category, meta.geo, meta.status); // e.g. \"carbon\" \"BR-RS\" \"audited\"\n\nif (meta.status === \"audited\") {\n  await (await esg.retireESGToken(42n, \"Offset 2025 scope-1 emissions\")).wait();\n}\n```\n\n## 알아둘 점\n\n- 상태는 **Draft**입니다.\n- 초안에는 몇 가지 세부 사항이 열려 있습니다. `carbon_value`는 Solidity에서는 `uint256`이지만 JSON 예시에서는 소수(`12.5`)로 표시되고, `Attested`를 emit하는 함수도 없습니다. 이를 바탕으로 만들기 전에 먼저 명확히 하세요.\n- Solidity에는 네이티브 SHA3-512가 없으므로(`keccak256`은 256비트) 다이제스트는 오프체인에서 계산해 bytes로 저장합니다.\n- 온체인 다이제스트는 문서가 변조되지 않았음을 증명할 뿐, 그 뒤에 있는 환경 관련 주장이 사실임을 증명하지는 않습니다. 신뢰는 여전히 발행자, 감사인, 증명 서명자에게 달려 있습니다.\n- 탄소 및 ESG 금융 상품은 이 표준 밖의 등록 기관 규칙과 규제의 적용을 받습니다.\n"},"zh":{"lang":"zh","tldr":"一个叠加接口，为代表碳信用等资产的 ERC-20、ERC-721 或 ERC-1155 代币增加 ESG 元数据、审计与证明摘要，以及“已发行-已审计-已注销”的生命周期。","tags":["esg","carbon","rwa","metadata","tokenization"],"related":[20,721,1155],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/zh/eip-8040/","markdown":"## 它解决什么问题？\n\n代币化的环境、社会和治理（ESG）资产，最典型的就是碳信用，需要的不仅是所有权和转账。买家和登记机构想知道资产来自哪里、是否经过审计、有哪些文件作为依据，以及它是否已经被**注销**（用于抵消排放而被消耗），从而避免被重复计算。每个项目往往用不同的方式建模。\n\nERC-8040 在人们已经在用的代币标准之上增加了一个通用层来承载这些信息，让钱包、市场和审计方能以统一的方式读取 ESG 生命周期状态。\n\n## 它如何运作\n\n符合规范的合约要实现一个基础标准（[ERC-20](/eip-20/)、[ERC-721](/eip-721/) 或 [ERC-1155](/eip-1155/)）来处理所有权和转账，**并且**实现 `IERC8040` 接口：\n\n- **元数据**：`esgURI(tokenId)` 必须返回一个 JSON 文档，至少包含 `standard`（`\"ERC-8040/1.0\"`）、`category`（例如 `carbon`）、`geo`（例如 ISO 3166-2 代码）、`carbon_value`、`cycle`、`digest`、`physical_id`、`attestation {atf_digest, signer}`、`status` 和 `evidence`。`getMetadata(tokenId)` 可以在链上返回相同的数据。\n- **生命周期**：每个代币都经历 `issued` → `audited` → `retired`。\n  - `mintESGToken(metadata)` 由获授权的发行方调用；状态初始为 `issued`。\n  - `auditESGToken(tokenId, auditDigest)` 由获授权的审计方调用；状态变为 `audited`。\n  - `retireESGToken(tokenId, reason)` 由所有者、获批准的 operator 或获授权方调用。注销是永久性的。\n- **摘要**：文档、审计和证明通过完整的 64 字节 SHA3-512 摘要来引用，以 `bytes` 存储（绝不截断为 `bytes32`）。\n- **事件**：`Minted`、`Audited`、`Attested` 和 `Retired` 为索引器提供可审计的轨迹。\n\n各基础标准的对应关系：ERC-20 中一个单位是一个小数份额（例如 1e18 个单位代表一吨 CO2e）；ERC-721 中每个代币是一份信用；ERC-1155 中一个 id 代表一批同质资产。\n\n## 示例代码\n\n读取代币的 ESG 状态并将其注销（ethers v6）：\n\n```ts\nimport { Contract } from \"ethers\";\n\nconst esg = new Contract(tokenAddress, [\n  \"function esgURI(uint256) view returns (string)\",\n  \"function retireESGToken(uint256 tokenId, string reason)\",\n  \"event Retired(uint256 indexed tokenId, uint256 timestamp, string reason)\",\n], signer);\n\nconst uri = await esg.esgURI(42n);\nconst meta = await (await fetch(uri)).json();\nconsole.log(meta.category, meta.geo, meta.status); // e.g. \"carbon\" \"BR-RS\" \"audited\"\n\nif (meta.status === \"audited\") {\n  await (await esg.retireESGToken(42n, \"Offset 2025 scope-1 emissions\")).wait();\n}\n```\n\n## 需要注意\n\n- 状态为 **Draft**。\n- 草案留下了一些未决细节：`carbon_value` 在 Solidity 中是 `uint256`，但在 JSON 示例中显示为小数（`12.5`），而且没有任何函数会触发 `Attested`。在基于它构建之前请先澄清这些问题。\n- Solidity 没有原生的 SHA3-512（`keccak256` 是 256 位的），因此摘要在链下计算，并以 bytes 存储。\n- 链上摘要只能证明文件未被篡改，不能证明背后的环境声明为真。信任仍然取决于发行方、审计方和证明签署方。\n- 碳和 ESG 工具受本标准之外的登记机构规则和法规约束。\n"}}}
