Crypto Wallet Auth & Treasury

Authenticate autonomous AI bots via cryptographic signatures and manage on-chain micro-credit deposits.

Cowpin supports native cryptographic wallet authentication for autonomous AI agents (Base AgentKit, ai16z Eliza, Virtuals Protocol).

Agents authenticate without email or passwords by signing an EIP-191 challenge with their private key, receiving an instant API token and micro-credit ledger.


๐Ÿ” Cryptographic Authentication Flow

[Agent Base / Solana Wallet]
       โ”‚
       โ–ผ  1. POST /api/agent/auth/challenge (Sends wallet address)
[Cowpin Server returns Nonce & Challenge Message]
       โ”‚
       โ–ผ  2. Agent signs message with private key (personal_sign)
[Cryptographic Signature]
       โ”‚
       โ–ผ  3. POST /api/agent/auth/verify (Sends signature)
[Cowpin validates signature & returns API Key + $0.10 Welcome Grant]

Step 1: Request Challenge

curl -X POST https://www.cowpin.com/api/agent/auth/challenge \
  -H "Content-Type: application/json" \
  -d '{
    "address": "0xYourWalletAddressHere",
    "chain": "BASE"
  }'

Response:

{
  "ok": true,
  "address": "0xYourWalletAddressHere",
  "chain": "BASE",
  "nonce": "a1b2c3d4e5f6...",
  "challenge": "Cowpin AI Agent Memory Vault Auth\nAddress: 0x...\nNonce: ...\nSign this challenge to authenticate.",
  "expiresAt": "2026-09-27T12:30:00.000Z"
}

Step 2: Verify Signature & Receive API Token

Sign the challenge string using your EVM private key (personal_sign / EIP-191) or Solana key (Ed25519), then submit to verify:

curl -X POST https://www.cowpin.com/api/agent/auth/verify \
  -H "Content-Type: application/json" \
  -d '{
    "address": "0xYourWalletAddressHere",
    "chain": "BASE",
    "signature": "0xYourHexSignatureHere",
    "challenge": "Cowpin AI Agent Memory Vault Auth...",
    "agentName": "My Research Agent"
  }'

Response:

{
  "ok": true,
  "apiKey": "cw_agent_8f92a10b4c83d9...",
  "address": "0xYourWalletAddressHere",
  "chain": "BASE",
  "balanceUsd": 0.10,
  "balanceCredits": 100000
}

๐Ÿ’ฐ Unit Economics & Credit Ledger

OperationMicro-CreditsUSD Equivalent
Welcome Grant (First sign-in)100,000+$0.10 Free
Memory Save & Embed1,000-$0.001 (0.1ยข)
Semantic Vector Recall2,000-$0.002 (0.2ยข)
1.00 USDC Deposit1,000,000+$1.00 (1,000 saves)

๐Ÿ›๏ธ Multi-Chain Deposit Addresses

To top up an agent's credit balance, send native tokens or USDC to Cowpin's on-chain treasury:

NetworkSupported AssetsOfficial Treasury Address
Base (L2) โญUSDC, ETH0xE064Cf686D46F866Df69Cb308e0707b34940a7a7
SolanaUSDC (SPL), SOL4ZEN8gb6HxsJNssWjeA2edAfBdmYP4Zop7nxXzM14P8T
Ethereum & L2s (Arbitrum, Optimism, Polygon)USDC, ETH, MATIC0xE064Cf686D46F866Df69Cb308e0707b34940a7a7
TRONUSDT (TRC-20), TRXTNMuZ8G6MPmfr1yBaXxRPX4rbgP6JeEHzu
BitcoinNative SegWit BTCbc1qpm9gau3gggnpre85larrrwjnvq8y078xlu7gmc

Crediting an On-Chain Deposit

Once an on-chain transaction is broadcast, record the transaction to credit the wallet immediately:

curl -X POST https://www.cowpin.com/api/agent/deposit \
  -H "Authorization: Bearer cw_agent_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "amountUsdc": 5.00,
    "chain": "BASE",
    "txHash": "0xYourTransactionHashHere"
  }'