@agentic-trust/8004-ext-sdk
v1.0.34
Published
ERC-8004 Agentic Trust SDK - A TypeScript SDK for managing AI agents with ENS integration, identity management, and reputation systems
Downloads
4,107
Maintainers
Readme
ERC-8004 Agentic Trust SDK
A TypeScript SDK for managing AI agents with ENS integration, identity management, and reputation systems on Ethereum L1 and L2. This SDK extends the core ERC-8004 SDK with agent-specific functionality.
Features
- AI Agent Management: Complete lifecycle management for AI agents
- ENS Integration: Seamless integration with Ethereum Name Service for agent naming
- Multi-Chain Support: Works on Ethereum L1 and L2 networks (Base, Optimism)
- Identity Management: Agent identity registration and metadata management
- Reputation System: Feedback and scoring for AI agents
- Organization Support: Tools for managing agent organizations
Installation
npm install @agentic-trust/8004-ext-sdk
# or
yarn add @agentic-trust/8004-ext-sdk
# or
pnpm add @agentic-trust/8004-ext-sdkQuick Start
import { AIAgentENSClient, AIAgentIdentityClient } from '@agentic-trust/8004-ext-sdk';
import { sepolia } from 'viem/chains';
// Create an ENS client for agent management
const ensClient = new AIAgentENSClient(
sepolia,
'https://eth-sepolia.g.alchemy.com/v2/YOUR_KEY',
adapter,
'0x...', // ENS Registry
'0x...', // ENS Resolver
'0x...' // Identity Registry
);
// Create an identity client
const identityClient = new AIAgentIdentityClient(
11155111, // ETH Sepolia chain ID
'https://eth-sepolia.g.alchemy.com/v2/YOUR_KEY',
'0x...' // Identity Registry
);
// Get agent identity by name
const { agentId, account } = await ensClient.getAgentIdentityByName('alice.agent.eth');Core Components
AIAgentENSClient
Handles ENS operations for AI agents:
import { AIAgentENSClient } from '@agentic-trust/8004-ext-sdk';
const ensClient = new AIAgentENSClient(chain, rpcUrl, adapter, ensRegistry, ensResolver, identityRegistry);
// Get agent identity by ENS name
const { agentId, account } = await ensClient.getAgentIdentityByName('alice.agent.eth');
// Get agent account by ENS name
const account = await ensClient.getAgentAccountByName('alice.agent.eth');
// Get reverse resolution (account to ENS name)
const { agentId, ensName } = await ensClient.getAgentIdentityByAccount('0x...');AIAgentIdentityClient
Manages agent identity and metadata:
import { AIAgentIdentityClient } from '@agentic-trust/8004-ext-sdk';
const identityClient = new AIAgentIdentityClient(chainId, rpcUrl, identityRegistry);
// Get agent metadata
const metadata = await identityClient.getMetadata(agentId, 'agentName');
// Get agent name
const name = await identityClient.getAgentName(agentId);
// Get agent EOA by account
const eoa = await identityClient.getAgentEoaByAgentAccount(agentAccount);AIAgentReputationClient
Handles reputation and feedback:
import { AIAgentReputationClient } from '@agentic-trust/8004-ext-sdk';
const reputationClient = new AIAgentReputationClient(chain, orgAdapter, agentAdapter, reputationRegistry);
// Give feedback to an agent
await reputationClient.giveFeedback({
agent: '0x...',
score: 5,
feedback: 'Excellent service!',
metadata: [{ key: 'category', value: 'quality' }]
});
// Get reputation score
const score = await reputationClient.getReputationScore('0x...');AIAgentL2ENSDurenClient
L2-specific ENS operations:
import { AIAgentL2ENSDurenClient } from '@agentic-trust/8004-ext-sdk';
const l2Client = new AIAgentL2ENSDurenClient(chain, rpcUrl, adapter, ensRegistry, ensResolver, identityRegistry);
// L2-specific agent operations
const account = await l2Client.getAgentAccountByName('alice.agent.base');OrgIdentityClient
Organization management utilities:
import { OrgIdentityClient } from '@agentic-trust/8004-ext-sdk';
const orgClient = new OrgIdentityClient(adapter, { ensRegistry: '0x...', rpcUrl: 'https://...' });
// Get organization account by ENS name
const account = await orgClient.getOrgAccountByName('myorg.eth');
// Get organization EOA by account
const eoa = await orgClient.getOrgEoaByAccount(orgAccount);Supported Networks
- Ethereum Sepolia (Chain ID: 11155111)
- Base Sepolia (Chain ID: 84532)
- Optimism Sepolia (Chain ID: 11155420)
Dependencies
This SDK depends on:
@agentic-trust/8004-sdk- Core ERC-8004 functionalityviem- Ethereum libraryethers- Alternative Ethereum library@metamask/smart-accounts-kit- MetaMask Smart Accounts integration@thenamespace/mint-manager- ENS minting@thenamespace/indexer- ENS indexing
Development
Building
npm run buildDevelopment Mode
npm run devCleaning
npm run cleanArchitecture
The Agentic Trust SDK is built on top of the core ERC-8004 SDK and provides:
- Agent-Specific Extensions: Specialized classes for AI agent management
- ENS Integration: Seamless naming and resolution for agents
- Multi-Chain Support: Works across different Ethereum networks
- Reputation Management: Feedback and scoring systems
- Organization Tools: Utilities for managing agent organizations
Contributing
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Support
Changelog
v1.0.0
- Initial release
- Full AI agent management support
- ENS integration for L1 and L2
- Reputation and feedback systems
- Organization management tools
- Multi-chain support
