Non-custodial Solana wallet creation for AI agents using Crossmint MPC infrastructure
npm install crossmint-agentic-walletCreate and manage non-custodial Solana wallets for AI agents using Crossmint's MPC infrastructure.
- Non-custodial wallets: Agents get their own Solana wallets without managing private keys
- MPC security: Wallets are secured by Crossmint's multi-party computation
- Identifier-based: Create wallets using email, phone, or custom agent IDs
- Full token support: Transfer SOL, USDC, and any SPL token
- Staging mode: Test with devnet and free testnet tokens (USDXM)
1. Go to Crossmint Console
2. Create a new project (or use existing)
3. Get your Server-side API key (starts with sk_staging_ or sk_production_)
``bash`
export CROSSMINT_SERVERSIDE_API_KEY=sk_staging_your-key-here
Or add to your .env:
`env`
CROSSMINT_SERVERSIDE_API_KEY=sk_staging_your-key-here
`bash`
cd skills/crossmint-agentic-wallet
npm install
npm run build
`json`
{
"skills": {
"entries": {
"crossmint-agentic-wallet": {
"enabled": true,
"env": {
"CROSSMINT_SERVERSIDE_API_KEY": "sk_staging_your-key"
}
}
}
}
}
`typescript
import { CrossmintAgentWallet, createSkill } from '@mawdos/crossmint-agentic-wallet';
// Option 1: Direct client usage
const wallet = new CrossmintAgentWallet('sk_staging_your-key');
// Create a wallet for an AI agent
const result = await wallet.createWallet({
identifier: 'trading-agent-001',
chain: 'solana-devnet',
alias: 'trading'
});
console.log('Wallet created:', result.data?.address);
// Fund with testnet tokens
await wallet.fundWalletStaging('trading-agent-001', 100);
// Check balances
const balances = await wallet.getBalances('trading-agent-001', 'solana-devnet');
console.log('SOL balance:', balances.data?.nativeToken.amount);
// Transfer tokens
await wallet.transferSol({
fromIdentifier: 'trading-agent-001',
toAddress: 'RecipientAddress...',
amount: '0.1',
chain: 'solana-devnet'
});
// Option 2: Skill-based usage (for agent frameworks)
const skill = createSkill('sk_staging_your-key');
// Execute tools by name
const walletResult = await skill.execute('create_wallet', {
identifier: 'my-agent',
chain: 'solana-devnet'
});
`
The skill is also exposed via REST endpoints at /api/wallets:
`bashCreate a wallet
curl -X POST http://localhost:3001/api/wallets/create \
-H "Content-Type: application/json" \
-d '{
"identifier": "agent@example.com",
"chain": "solana-devnet"
}'
Available Tools
| Tool | Description |
|------|-------------|
|
create_wallet | Create a new wallet for an agent |
| get_or_create_wallet | Get existing or create new (idempotent) |
| get_wallet | Get wallet by identifier |
| get_balances | Get SOL and token balances |
| transfer_sol | Transfer native SOL |
| transfer_tokens | Transfer SPL tokens (USDC, etc.) |
| fund_wallet_staging | Fund with testnet USDXM (staging only) |Wallet Identifiers
Wallets can be created using different identifier types:
| Type | Example | Use Case |
|------|---------|----------|
| Email |
agent@example.com | User-linked agents |
| Phone | +14155551234 | SMS-verified agents |
| Agent ID | trading-agent-001 | Autonomous agents |Chains
| Chain | Environment | Use |
|-------|-------------|-----|
|
solana-devnet | Staging | Testing with free tokens |
| solana` | Production | Real transactions |- Non-custodial: Crossmint uses MPC (Multi-Party Computation) - no single party holds the full private key
- API Key authentication: All operations require server-side API key
- No private key exposure: Agents never see or manage raw private keys
MIT