Examples

Real-world integration examples.

1. Claude Books Flight

Use Claude Desktop to book international travel.

Setup

# Store passport info
dcp add identity.passport.number AB123456
dcp add identity.passport.expiry 2030-01-01

# Start MCP server (see MCP docs)
# Restart Claude Desktop

Usage

In Claude:

"Book me a flight to Tokyo on March 25th. Use my passport info from DCP."

Claude asks DCP for passport → You approve → Claude books flight


2. Trading Bot with Budget

Automated trading with safety limits.

Setup

# Create wallet
dcp create-wallet --chain solana

# Start server
npx @dcprotocol/server

Bot Code

import { DcpClient } from '@dcprotocol/client';

const dcp = new DcpClient({ agentName: 'trading-bot' });

async function trade() {
  const price = await getPrice();

  if (shouldBuy(price)) {
    // DCP enforces budget (5 SOL/tx, 20 SOL/day)
    const result = await dcp.signTransaction({
      chain: 'solana',
      amount: 2.5,
      currency: 'SOL',
      transaction: buildBuyTx()
    });

    await broadcast(result.signedTransaction);
  }
}

setInterval(trade, 60000);

3. Shopping Agent

AI handles purchases with your saved address.

Setup

# Store address
dcp add location.home "123 Main St, City, 12345"

# Store payment (tokenized)
dcp add payment.default tok_visa_4242

Agent Code

const dcp = new DcpClient({ agentName: 'shopping-bot' });

async function buyItem(productUrl) {
  // Read address from vault
  const address = await dcp.read('location.home');
  const payment = await dcp.read('payment.default');

  // Complete purchase
  await checkout({
    product: productUrl,
    shippingAddress: address,
    paymentToken: payment
  });
}

4. Multi-Agent Setup

Multiple agents, different permissions, same vault.

Setup

# Create wallets
dcp create-wallet --chain solana
dcp create-wallet --chain ethereum

# Store data
dcp add identity.email you@example.com
dcp add identity.passport.number AB123456
dcp add location.home "123 Main St"

Agents

// Trading Agent - Can ONLY sign Solana (max 10 SOL/day)
const tradingAgent = new DcpClient({ agentName: 'trading-bot' });
await tradingAgent.signTransaction({ chain: 'solana', ... });

// Travel Agent - Can ONLY read passport
const travelAgent = new DcpClient({ agentName: 'travel-bot' });
const passport = await travelAgent.read('identity.passport.*');

// Shopping Agent - Can ONLY read address (max $50/order)
const shoppingAgent = new DcpClient({ agentName: 'shopping-bot' });
const address = await shoppingAgent.read('location.home');

// Email Agent - Can ONLY read email
const emailAgent = new DcpClient({ agentName: 'email-bot' });
const email = await emailAgent.read('identity.email');

Each agent gets exactly what it needs. Nothing more.


5. VPS Trading Bot

Bot runs 24/7 on VPS, keys stay on your laptop.

Local Machine

dcp pairing start vps-trader \
  --scopes sign:solana \
  --budget 50usdc/day \
  --auto-approve-under 5usdc

VPS

# Start proxy
npx @dcprotocol/proxy --pair "<token>" --vault "<id>"

# Run bot
node bot.js

Bot trades 24/7. Keys never leave your laptop.