Overview
The Identity Plugin provides comprehensive identity management for ICP applications, handling seed phrases, anonymous identities, and identity switching. It’s the foundation for all authenticated operations in the ICP Agent Kit.Core Features
Seed Phrase Management
Generate and manage identities using BIP39 seed phrases (12 or 24 words)
Anonymous Identities
Create anonymous identities for testing and privacy-focused applications
Identity Switching
Seamlessly switch between multiple identities within your application
Principal & Account ID
Automatic generation of ICP principals and account identifiers
Quick Start
How It Works with ICP Agent Kit
Architecture Integration
The Identity Plugin is tightly integrated with the core ICPAgent class and provides the foundation for all other plugins:1
Automatic Loading
The Identity Plugin is automatically loaded when the ICPAgent is initialized
2
Shared Identity State
All other plugins (Token, Canister, Cycles) use the current active identity
3
Dynamic Switching
Identity changes are immediately reflected across all agent operations
4
Secure Storage
Identities are managed securely in memory with proper cleanup
Integration with ICP Network
Identity Types
1. Seed Phrase Identities
Create recoverable identities from BIP39 mnemonic phrases:2. Anonymous Identities
Perfect for testing and privacy-focused applications:Identity Management
Creating and Switching
Best Practices
Security
Critical Security Guidelines: - Store seed phrases offline in secure locations - Never log
seed phrases in production - Use 24-word phrases for high-value accounts - Implement proper key
rotation policies - Use anonymous identities only for testing
Development
LangChain Integration
The Identity Plugin is integrated with LangChain tools for natural language operations:Available Tools
get_current_identity
Shows current identity information including principal and account ID
create_identity
Creates new identities from seed phrases or anonymous