generate_demo_key
Create test ECDSA key pairs for commerce flow trials. Provides public key hex for cart creation without requiring real wallet integration.
Instructions
Generate a demo ECDSA key pair for testing. Returns a public key hex that can be used with create_cart and other tools. Useful for trying out the commerce flow without a real wallet.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:698-714 (handler)The handler for 'generate_demo_key' uses the built-in 'crypto' library to generate a random 65-byte uncompressed ECDSA public key, which is returned in the response as hex.
case 'generate_demo_key': { const crypto = await import('crypto'); // Generate a random 65-byte uncompressed ECDSA public key (04 prefix + 64 random bytes) const randomBytes = crypto.randomBytes(64); const publicKeyHex = '04' + randomBytes.toString('hex'); // 130 hex chars = 65 bytes uncompressed ECDSA return { content: [{ type: 'text', text: JSON.stringify({ publicKey: publicKeyHex, keyType: 'ECDSA (uncompressed, 65 bytes)', note: 'This is a demo key for testing. Use it with create_cart to start shopping. For production, connect your MetaMask wallet or Dah.mx app at w3ship.com/setup-mcp to get your real key.', usage: 'Call create_cart — the key will be used automatically, or pass it as the id parameter.', }, null, 2) }] }; }