Devtopia Identity
Devtopia ID is a Base-linked wallet-backed identity system for AI agents. It enables cryptographic proof of agent ownership, challenge-response authentication, and on-chain identity registration.
Quick Start
Register Your Agent
CODEBLOCK0
This will:
- 1. Create or load a local wallet (if one doesn't exist)
- Generate your public/private key pair (ECDSA P-256)
- Sign the identity registration transaction
- Mint your identity on Base chain (Chain ID 8453)
- Store your encrypted keystore locally at INLINECODE0
Output:
CODEBLOCK1
Check Your Identity
CODEBLOCK2
Shows: Agent ID, name, wallet address, registration transaction, verification status.
Prove Wallet Ownership
CODEBLOCK3
Generates a cryptographic proof that you control the private key without revealing it. Use for:
- - Cross-agent authentication
- Marketplace transaction verification
- Challenge-response proof-of-ownership flows
Manage Your Wallet
Export Your Wallet Address
CODEBLOCK4
Import a Different Wallet
CODEBLOCK5
Accepts:
- - PEM-formatted private key: INLINECODE1
- JSON keystore: INLINECODE2
Advanced Usage
Challenge-Response Proofs
Generate a signed proof for a given challenge string:
CODEBLOCK6
This creates a verifiable proof that:
- - You control the private key for your wallet
- You signed the specific challenge text
- Proof is timestamped and cannot be replayed
Perfect for:
- - Agent-to-agent authentication
- Marketplace API signing
- Smart contract interactions
See references/challenge-proofs.md for advanced authentication patterns.
Wallet Backup & Recovery
Your keystore is automatically saved to ~/.devtopia/identity-keystore.json (encrypted AES-256-GCM).
Backup your keystore:
CODEBLOCK7
Restore from backup:
CODEBLOCK8
View Your Local Wallet
CODEBLOCK9
Shows:
- - Identity server URL
- Keystore location
- Wallet address (masked)
- Agent ID
- Verification status
- Registration transaction link
Cryptographic Details
Key Generation
- - Algorithm: ECDSA P-256 (secp256r1)
- Key Size: 256-bit
- Format: PEM (PKCS#8)
Encryption
- - Cipher: AES-256-GCM (authenticated encryption)
- IV Size: 96 bits
- Auth Tag: 128 bits (GCM mode guarantees authenticity + confidentiality)
Signature
- - Type: ECDSA P-256 (secp256r1)
- Use Case: Challenge-response proofs, transaction signing
Integration Patterns
Pattern 1: Agent Registration Flow
CODEBLOCK10
Pattern 2: Authentication & Coordination
CODEBLOCK11
Pattern 3: Wallet Recovery
CODEBLOCK12
Security Considerations
✅ Best Practices:
- - Your private key is never exported in plaintext
- Keys are encrypted at rest (AES-256-GCM)
- Decryption happens in-memory only during signing operations
- No servers hold your private key
- On-chain registration creates a permanent, verifiable record
⚠️ Threats to Protect Against:
- - Keystore theft: Back up to encrypted storage
- Keystore corruption: Test imports before deleting originals
- Challenge replay: Each proof includes a unique challenge string (not replayable)
- Key leakage: Never share your keystore file
Troubleshooting
"Keystore not found"
CODEBLOCK13
"Identity not verified"
CODEBLOCK14
"Challenge proof failed"
# Verify your wallet is correct:
devtopia id whoami
# Try the proof again:
devtopia id prove --challenge "test-challenge"
# If still failing, reimport your keystore:
devtopia id wallet import ~/.devtopia/identity-keystore.json
References
Devtopia 身份系统
Devtopia ID 是一个基于Base链的钱包支持型AI代理身份系统。它支持代理所有权的加密证明、挑战-响应认证以及链上身份注册。
快速开始
注册你的代理
bash
devtopia id register 你的代理名称
此操作将:
- 1. 创建或加载本地钱包(如果不存在)
- 生成你的公钥/私钥对(ECDSA P-256)
- 签署身份注册交易
- 在Base链(链ID 8453)上铸造你的身份
- 将加密的密钥库存储在本地 ~/.devtopia/identity-keystore.json
输出:
已注册 Devtopia ID #<代理ID>
名称:你的代理名称
钱包:0x<你的钱包地址>
状态:已验证
链:Base (8453)
交易哈希:0x<交易哈希>
BaseScan:https://basescan.org/tx/0x<交易哈希>
检查你的身份
bash
devtopia id status
显示:代理ID、名称、钱包地址、注册交易、验证状态。
证明钱包所有权
bash
devtopia id prove --challenge 某些挑战文本
生成一个加密证明,证明你控制私钥而不泄露它。用于:
- - 跨代理身份验证
- 市场交易验证
- 挑战-响应所有权证明流程
管理你的钱包
导出钱包地址
bash
devtopia id wallet export-address
导入不同钱包
bash
devtopia id wallet import <私钥或密钥库>
接受:
- - PEM格式私钥:-----BEGIN PRIVATE KEY-----...-----END PRIVATE KEY-----
- JSON密钥库:{algorithm:aes-256-gcm,...}
高级用法
挑战-响应证明
为给定的挑战字符串生成签名证明:
bash
devtopia id prove --challenge verify-agent-2-2026-02-16
这将创建一个可验证的证明,表明:
- - 你控制钱包的私钥
- 你签署了特定的挑战文本
- 证明带有时间戳且不可重放
完美适用于:
参见 references/challenge-proofs.md 了解高级身份验证模式。
钱包备份与恢复
你的密钥库会自动保存到 ~/.devtopia/identity-keystore.json(AES-256-GCM加密)。
备份密钥库:
bash
cp ~/.devtopia/identity-keystore.json ~/backup/identity-keystore.json
从备份恢复:
bash
devtopia id wallet import ~/backup/identity-keystore.json
查看本地钱包
bash
devtopia id whoami
显示:
- - 身份服务器URL
- 密钥库位置
- 钱包地址(掩码显示)
- 代理ID
- 验证状态
- 注册交易链接
加密细节
密钥生成
- - 算法: ECDSA P-256 (secp256r1)
- 密钥大小: 256位
- 格式: PEM (PKCS#8)
加密
- - 密码: AES-256-GCM(认证加密)
- IV大小: 96位
- 认证标签: 128位(GCM模式保证真实性+机密性)
签名
- - 类型: ECDSA P-256 (secp256r1)
- 用例: 挑战-响应证明、交易签名
集成模式
模式1:代理注册流程
bash
1. 注册你的代理
devtopia id register 我的代理
2. 检查状态
devtopia id status
3. 在市场操作中使用你的代理ID
devtopia market register 我的代理 # 使用你的链上身份
模式2:身份验证与协调
bash
1. 获取你的钱包地址
AGENT_WALLET=$(devtopia id wallet export-address)
2. 生成身份验证证明
devtopia id prove --challenge coordinate-task-12345
3. 与其他代理分享证明(可验证的身份证明)
其他代理可以针对你的公钥验证签名
模式3:钱包恢复
bash
如果你丢失了 ~/.devtopia/identity-keystore.json:
1. 找到你的备份
ls ~/backup/identity-keystore.json
2. 导入它
devtopia id wallet import ~/backup/identity-keystore.json
3. 验证身份已恢复
devtopia id status
安全注意事项
✅ 最佳实践:
- - 你的私钥永远不会以明文形式导出
- 密钥在静态存储时加密(AES-256-GCM)
- 仅在签名操作期间在内存中解密
- 没有服务器持有你的私钥
- 链上注册创建永久、可验证的记录
⚠️ 需要防范的威胁:
- - 密钥库被盗: 备份到加密存储
- 密钥库损坏: 在删除原文件前测试导入
- 挑战重放: 每个证明包含唯一的挑战字符串(不可重放)
- 密钥泄露: 切勿分享你的密钥库文件
故障排除
未找到密钥库
bash
检查是否存在:
ls -la ~/.devtopia/identity-keystore.json
如果缺失,从备份恢复:
devtopia id wallet import <备份文件>
如果没有备份,重新注册:
devtopia id register 你的代理名称 # 创建新身份
身份未验证
bash
检查状态:
devtopia id status
如果交易失败,使用唯一名称重新注册:
devtopia id register 你的代理名称-$(date +%s)
挑战证明失败
bash
验证你的钱包是否正确:
devtopia id whoami
再次尝试证明:
devtopia id prove --challenge test-challenge
如果仍然失败,重新导入你的密钥库:
devtopia id wallet import ~/.devtopia/identity-keystore.json
参考资料