Assessment results contain all the data needed to generate a valid ERC-8004 agentURI JSON — the metadata document required for on-chain agent registration. This issue adds a utility that transforms assessment output into a ready-to-register agentURI.
Related: #10 validates existing agentURIs read from on-chain data. This issue generates new agentURIs from assessment results.
Gating Logic
Before generating, the assessment must confirm at least one protocol layer:
| Condition |
Result |
| MCP valid OR A2A valid |
Proceed with generation |
| Neither MCP nor A2A detected |
Return not-recommended state |
JSON Generation from Assessment Results
Map assessment layer results to agentURI fields:
| agentURI Field |
Source |
type |
Fixed: https://eips.ethereum.org/EIPS/eip-8004#registration-v1 |
services[] |
Auto-populated from validated layers (MCP endpoint+version, A2A endpoint+version, web URL from HTML layer) |
x402Support |
x402 layer result |
active |
true if HTTP layer confirms reachability |
name, description, image |
Placeholders for user input (returned in editableFields) |
registrations[] |
Empty array (agentId unknown before registration) |
supportedTrust |
Based on available on-chain data from ERC-8004 layer |
Data URI Encoding
Provide method to encode the generated JSON as a data URI for tokenURI registration:
- Standard:
data:application/json;base64,...
- Compressed:
data:application/json;enc=gzip;base64,...
Diff Generation (Update Case)
If the ERC-8004 layer shows the agent is already registered, compare the current on-chain agentURI with the newly generated one:
- Return diff of changes (added/removed services, changed fields)
- Enable informed decision on whether to update
Three Return States
{ state: 'not-recommended', reason: 'No MCP or A2A detected' }
{ state: 'register', agentURI: {...}, dataURI: '...', editableFields: ['name','description','image'] }
{ state: 'update', agentId, agentURI: {...}, dataURI: '...', diff: [...], editableFields: ['name','description','image'] }
Acceptance Criteria
References
Assessment results contain all the data needed to generate a valid ERC-8004 agentURI JSON — the metadata document required for on-chain agent registration. This issue adds a utility that transforms assessment output into a ready-to-register agentURI.
Related: #10 validates existing agentURIs read from on-chain data. This issue generates new agentURIs from assessment results.
Gating Logic
Before generating, the assessment must confirm at least one protocol layer:
not-recommendedstateJSON Generation from Assessment Results
Map assessment layer results to agentURI fields:
typehttps://eips.ethereum.org/EIPS/eip-8004#registration-v1services[]x402Supportactivetrueif HTTP layer confirms reachabilityname,description,imageeditableFields)registrations[]supportedTrustData URI Encoding
Provide method to encode the generated JSON as a data URI for
tokenURIregistration:data:application/json;base64,...data:application/json;enc=gzip;base64,...Diff Generation (Update Case)
If the ERC-8004 layer shows the agent is already registered, compare the current on-chain agentURI with the newly generated one:
Three Return States
Acceptance Criteria
not-recommendedwhen neither MCP nor A2A layer is validx402Supportandactivederived from respective layersReferences
context/erc-8004-registry-best-practices.txt(Pages 5-6: AgentURI schema)context/smartcontracts/contract-analysis.md(contract functions)0x8004a169fb4a3325136eb29fa0ceb6d2e539a432(Ethereum + Base)