Skip to content

Commit 40e7045

Browse files
committed
fix: correct struct order, update references, and improve formatting
1 parent 355810b commit 40e7045

File tree

1 file changed

+121
-118
lines changed

1 file changed

+121
-118
lines changed

EIPS/eip-8040.md

Lines changed: 121 additions & 118 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,38 @@
11
---
2-
eip: 8040
2+
eip: TBD
33
title: ESG Tokenization Protocol
4-
description: ESG-compliant, AI-native asset tokenization with quantum auditability and lifecycle integrity.
4+
description: Standard for AI-native, compliance-grade, quantum-auditable asset tokenization with lifecycle integrity, provenance, and post-quantum security.
55
author: Leandro Lemos (@agronetlabs) <[email protected]>
6-
discussions-to: https://ethereum-magicians.org/t/erc-8040-esg-tokenization-protocol/25846
6+
discussions-to: https://ethereum-magicians.org/t/erc-esg-tokenization-protocol-agrocrypto/ADD-SLUG
77
status: Draft
88
type: Standards Track
9-
category: ERC
9+
category: Core
1010
created: 2025-09-06
1111
requires: 20, 721, 1155
12+
license: CC0-1.0
1213
---
1314

14-
## Abstract
15+
# Abstract
1516

16-
This ERC defines an AI-native protocol for ESG-compliant asset tokenization, with quantum auditability, compliance-grade metadata, and lifecycle integrity.
17+
This EIP defines a compliance-grade, AI-native protocol for ESG-compliant asset tokenization, governed by ATF-AI and protected by post-quantum cryptography.
18+
It codifies lifecycle, metadata, and auditability for compliance-grade deployment, aligns with UN SDGs, and enforces machine-verifiable governance for public, audit-ready markets.
1719

18-
## Specification
20+
# Motivation
1921

20-
### Metadata Structure
22+
Current tokenization standards (ERC-20, ERC-721, ERC-1155) do not provide out-of-the-box mechanisms for deterministic auditability, ESG alignment, and compliance-first lifecycle controls demanded by institutional environments.
23+
This proposal defines a governance and metadata framework to:
24+
- Enforce lifecycle integrity (issue, audit, retire).
25+
- Guarantee immutable, verifiable, and attestable metadata.
26+
- Enable machine-verifiable attestations under ATF-AI.
27+
- Provide forward security posture with post-quantum readiness.
2128

22-
Tokens MUST expose a metadata JSON with the following minimum fields:
29+
# Specification
2330

24-
json
31+
## Metadata Structure
2532

26-
```
33+
Tokens MUST expose a metadata JSON with the following minimum fields:
34+
35+
```json
2736
{
2837
"standard": "ERC-ESG/1.0",
2938
"category": "carbon",
@@ -41,134 +50,128 @@ json
4150
}
4251
```
4352

44-
### Smart Contract Interface
53+
### Interface
4554

46-
Contracts implementing this standard MUST support the following interface:
47-
48-
solidity
55+
Contracts SHOULD implement (Solidity):
4956

57+
```solidity
58+
function mintESGToken(Metadata memory metadata) external;
59+
function auditESGToken(uint256 tokenId) external;
60+
function retireESGToken(uint256 tokenId) external;
61+
function esgURI(uint256 tokenId) external view returns (string memory);
5062
```
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-
}
63+
64+
### Events
65+
66+
```solidity
67+
event Attested(uint256 indexed tokenId, bytes32 atfDigest, string esgURI);
68+
event Retired(uint256 indexed tokenId, uint256 amount, string reason);
11969
```
12070

12171
### JSON-RPC Example
12272

123-
json
124-
125-
```
73+
```json
12674
{
75+
"jsonrpc": "2.0",
76+
"id": 1,
12777
"method": "eth_call",
12878
"params": [
12979
{
13080
"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-
}
81+
"data": "mintESGToken(encodedMetadata)"
82+
},
83+
"latest"
84+
]
14485
}
14586
```
14687

14788
### Mapping & Compatibility
14889

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.
90+
- **ERC-20:** Each unit = a standardized fraction (e.g., 1e18 = 1 tCO2e).
91+
- **ERC-721:** Single credit, unique esgURI.
92+
- **ERC-1155:** Homogeneous batch with common URI and amount.
93+
94+
# Rationale
95+
96+
This protocol is designed for compliance-grade and non-speculative deployment.
97+
It enforces deterministic flows, immutable metadata, machine-verifiable audit trails, and compliance-grade governance.
98+
*atfDigest* and *buildDigest* unite off-chain audit with on-chain proof.
99+
The protocol is extensible and avoids hard-forks by using optional interfaces and events.
100+
101+
Within this framework, **AI-Compliance** is defined as:
102+
**AI-Compliance = AI-Governed DAO**
103+
104+
This establishes ATF-AI as a compliance mechanism where governance is executed through an AI-Governed DAO, rather than discretionary human oversight.
105+
It codifies compliance into a machine-verifiable, audit-ready process that remains deterministic across jurisdictions.
106+
107+
# Backwards Compatibility
108+
109+
Does not break ERC-20,721,1155.
110+
Legacy tokens may reference metadata externally but lack full ATF-AI compliance.
111+
Migration tools can wrap legacy tokens with compliant metadata, enabling gradual adoption.
112+
113+
# Test Cases
114+
115+
- Mint token with valid metadata.
116+
- Audit token with ATF-AI digest.
117+
- Retire token and log final audit state.
118+
- Validate physical seal against metadata digest.
119+
120+
# Security Considerations
121+
122+
- Metadata MUST be immutable and cryptographically sealed.
123+
- ATF-AI provides zero-trust validation; all attestations timestamped.
124+
- Digest (SHA3-512) ensures audit integrity.
125+
- Quantum-ready primitives recommended for all bridges.
126+
- Retirement is irreversible; physical seals MUST validate against digest.
127+
- All inputs and off-chain docs MUST be hashed and publicly referenced.
128+
129+
# Reference Implementation
130+
131+
- Crate: agrocrypto-core v2.0.0
132+
- GitHub: agrocrypto-core
133+
- ESG Manifest: ESG-Manifest
134+
- AgroCryptoGit Profile: AgroCryptoGit
135+
- Manifesto: Human+AI (published with hash)
136+
137+
**Hashes:**
138+
- 201672f1605f30a361254cacbb073d8de7b806ba392ef82ca4723e17f4d39dd6
139+
- f81783bcda0f70958b05732651fb7ca30a0cef4c3acf0bf45ca4dfa3e7a23645
140+
141+
**Timestamp:** 2025-09-06T08:21:00 PDT
142+
143+
# Changelog
144+
145+
All changes to this protocol are treated as compliance-grade events.
146+
Each entry below is timestamped and hashed for public auditability.
147+
148+
**Added**
149+
150+
- Initial publication of the AgroCrypto Quantum Governance EIP.
151+
- Lifecycle methods: mintESGToken, auditESGToken, retireESGToken.
152+
- Metadata structure with SHA3-512 digest and optional physical seal.
153+
- JSON-RPC example for AI-native minting.
154+
- Reference implementation: agrocrypto-core v2.0.0.
155+
- Security considerations: PQC readiness, zero-trust validation, seal verification.
156+
- Citation and license: CC0 + compliance-grade copyright.
157+
158+
**Hashes:**
159+
201672f1605f30a361254cacbb073d8de7b806ba392ef82ca4723e17f4d39dd6
160+
f81783bcda0f70958b05732651fb7ca30a0cef4c3acf0bf45ca4dfa3e7a23645
152161

153-
## Rationale
162+
**Planned**
154163

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).
164+
- Integration with AgroPay for ESG token lifecycle tracking.
165+
- Visual seal registry with cryptographic linkage to metadata.
166+
- Expanded test cases for audit and retirement flows.
167+
- Optional bridge module for multi-chain deployment.
160168

161-
## Security Considerations
169+
# Compliance Notes
162170

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+
- All corrections are treated as compliance-grade events.
172+
- Hashes are published publicly and timestamped.
173+
- No retroactive edits permitted without changelog entry.
171174

172-
## Copyright
175+
# Copyright
173176

174177
Copyright and related rights waived via CC0-1.0.

0 commit comments

Comments
 (0)