Skip to content

Commit d892718

Browse files
authored
Merge 355810b into e773e43
2 parents e773e43 + 355810b commit d892718

File tree

2 files changed

+175
-2
lines changed

2 files changed

+175
-2
lines changed

EIPS/eip-8040.md

Lines changed: 174 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,174 @@
1+
---
2+
eip: 8040
3+
title: ESG Tokenization Protocol
4+
description: ESG-compliant, AI-native asset tokenization with quantum auditability and lifecycle integrity.
5+
author: Leandro Lemos (@agronetlabs) <[email protected]>
6+
discussions-to: https://ethereum-magicians.org/t/erc-8040-esg-tokenization-protocol/25846
7+
status: Draft
8+
type: Standards Track
9+
category: ERC
10+
created: 2025-09-06
11+
requires: 20, 721, 1155
12+
---
13+
14+
## Abstract
15+
16+
This ERC defines an AI-native protocol for ESG-compliant asset tokenization, with quantum auditability, compliance-grade metadata, and lifecycle integrity.
17+
18+
## Specification
19+
20+
### Metadata Structure
21+
22+
Tokens MUST expose a metadata JSON with the following minimum fields:
23+
24+
json
25+
26+
```
27+
{
28+
"standard": "ERC-ESG/1.0",
29+
"category": "carbon",
30+
"geo": "BR-RS",
31+
"carbon_value": 12.5,
32+
"cycle": "2025-Q3",
33+
"digest": "sha3-512:...",
34+
"physical_id": "seal:XYZ123",
35+
"attestation": {
36+
"atf_digest": "sha3-512:...",
37+
"signer": "did:atf:ai:..."
38+
},
39+
"status": "issued|audited|retired",
40+
"evidence": "cid:Qm..."
41+
}
42+
```
43+
44+
### Smart Contract Interface
45+
46+
Contracts implementing this standard MUST support the following interface:
47+
48+
solidity
49+
50+
```
51+
pragma solidity ^0.8.0;
52+
53+
interface IERC8040 {
54+
/// @notice Metadata structure for ESG tokens
55+
/// @dev All digest fields use bytes to support SHA3-512 (64 bytes)
56+
struct Metadata {
57+
string standard;
58+
string category;
59+
string geo;
60+
uint256 carbon_value;
61+
string cycle;
62+
bytes digest; // SHA3-512 digest (64 bytes)
63+
string physical_id;
64+
Attestation attestation;
65+
string status;
66+
string evidence;
67+
}
68+
69+
/// @notice Attestation structure for AI-native validation
70+
/// @dev atf_digest uses bytes to support SHA3-512 (64 bytes)
71+
struct Attestation {
72+
bytes atf_digest; // SHA3-512 attestation digest (64 bytes)
73+
string signer;
74+
}
75+
76+
/// @notice Mints a new ESG token with provided metadata
77+
/// @param metadata The ESG metadata structure
78+
/// @return tokenId The ID of the newly minted token
79+
function mintESGToken(Metadata memory metadata) external returns (uint256 tokenId);
80+
81+
/// @notice Audits an existing ESG token
82+
/// @param tokenId The token to audit
83+
/// @param auditDigest SHA3-512 digest of the audit report (64 bytes)
84+
function auditESGToken(uint256 tokenId, bytes memory auditDigest) external;
85+
86+
/// @notice Retires an ESG token permanently
87+
/// @param tokenId The token to retire
88+
/// @param reason Human-readable retirement reason
89+
function retireESGToken(uint256 tokenId, string memory reason) external;
90+
91+
/// @notice Returns the ESG metadata URI for a token
92+
/// @param tokenId The token ID
93+
/// @return The URI string pointing to off-chain metadata
94+
function esgURI(uint256 tokenId) external view returns (string memory);
95+
96+
/// @notice Returns the complete on-chain metadata for a token
97+
/// @param tokenId The token ID
98+
/// @return The complete Metadata structure
99+
function getMetadata(uint256 tokenId) external view returns (Metadata memory);
100+
101+
/// @notice Emitted when a new ESG token is minted
102+
/// @param tokenId The ID of the minted token
103+
/// @param category The ESG category (e.g., "carbon")
104+
/// @param geo Geographic identifier (e.g., "BR-RS")
105+
event Minted(uint256 indexed tokenId, string category, string geo);
106+
107+
/// @notice Emitted when a token is attested by AI validator
108+
/// @param tokenId The ID of the attested token
109+
/// @param atfDigest SHA3-512 digest of the attestation (64 bytes)
110+
/// @param esgURI The URI of the ESG metadata
111+
event Attested(uint256 indexed tokenId, bytes atfDigest, string esgURI);
112+
113+
/// @notice Emitted when a token is permanently retired
114+
/// @param tokenId The ID of the retired token
115+
/// @param timestamp The retirement timestamp
116+
/// @param reason Human-readable retirement reason
117+
event Retired(uint256 indexed tokenId, uint256 timestamp, string reason);
118+
}
119+
```
120+
121+
### JSON-RPC Example
122+
123+
json
124+
125+
```
126+
{
127+
"method": "eth_call",
128+
"params": [
129+
{
130+
"to": "0xContractAddress",
131+
"data": "0x..."
132+
}
133+
],
134+
"example_metadata": {
135+
"category": "carbon",
136+
"geo": "BR-RS",
137+
"carbon_value": 12.5,
138+
"digest": "sha3-512:abc123def456...",
139+
"attestation": {
140+
"atf_digest": "sha3-512:xyz789...",
141+
"signer": "did:atf:ai:validator-001"
142+
}
143+
}
144+
}
145+
```
146+
147+
### Mapping & Compatibility
148+
149+
- [ERC-20](./eip-20.md): Each unit represents a standardized fraction (e.g., 1e18 = 1 tCO2e).
150+
- [ERC-721](./eip-721.md): Single credit with unique esgURI and immutable metadata.
151+
- [ERC-1155](./eip-1155.md): Homogeneous batch with common URI, metadata, and fungible amounts.
152+
153+
## Rationale
154+
155+
- **Deterministic flows**: Lifecycle follows strict state transitions (issued → audited → retired).
156+
- **Immutable metadata**: SHA3-512 digest ensures tamper-proof records with 512-bit security.
157+
- **Machine-verifiable audit trails**: ATF-AI validates compliance deterministically.
158+
- **Post-quantum readiness**: SHA3-512 hash functions provide quantum-resistant cryptography.
159+
- **Full hash storage**: Using bytes instead of bytes32 allows complete SHA3-512 digest storage (64 bytes).
160+
161+
## Security Considerations
162+
163+
1. **Metadata immutability**: All metadata fields MUST be cryptographically sealed after minting.
164+
2. **Zero-trust validation**: ATF-AI provides deterministic validation; all attestations are timestamped.
165+
3. **Digest integrity**: SHA3-512 (64 bytes) ensures audit-trail integrity. Implementations MUST use bytes type to store complete 512-bit digests.
166+
4. **Post-quantum cryptography**: Hash functions and signature schemes MUST be quantum-resistant. SHA3-512 provides 512-bit security suitable for post-quantum scenarios.
167+
5. **Irreversible retirement**: Once retired, tokens cannot be reactivated.
168+
6. **Physical seal validation**: On-chain digest MUST match physical seal cryptographic hash.
169+
7. **Input validation**: All off-chain documents MUST be hashed using SHA3-512 and publicly referenced on-chain.
170+
8. **Hash truncation prevention**: Implementations MUST NOT truncate SHA3-512 digests. The bytes type MUST be used instead of bytes32 to prevent loss of cryptographic security.
171+
172+
## Copyright
173+
174+
Copyright and related rights waived via CC0-1.0.

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
# Ethereum Improvement Proposals (EIPs)
2-
1+
# EIPs Ethereum Improvement Proposals
32
> **_ATTENTION_**: The EIPs repository has recently [undergone](https://github.com/ethereum/EIPs/pull/7206) a separation of ERCs and EIPs. ERCs are now accessible at [https://github.com/ethereum/ercs](https://github.com/ethereum/ercs). All new ERCs and updates to existing ones must be directed at this new repository. The editors apologize for this inconvenience.
43
54
The goal of the EIP project is to standardize and provide high-quality documentation for Ethereum itself and conventions built upon it. This repository tracks past and ongoing improvements to Ethereum in the form of Ethereum Improvement Proposals (EIPs). [EIP-1](https://eips.ethereum.org/EIPS/eip-1) governs how EIPs are published.

0 commit comments

Comments
 (0)