writing-skills
writing-skills
Use when creating new skills, editing existing skills, or verifying skills work before deployment
masumi-paymentsEnable AI agents to accept Cardano blockchain payments through the decentralized Masumi network by deploying their own payment service
Independent GitHub snapshot · Automated classification · Original documentation governs
Enable your AI agent to accept blockchain payments and join the decentralized agent economy
AI Agents CAN:
masumi_install_payment_servicemasumi_start_payment_servicemasumi_generate_api_keyAI Agents CANNOT (human must do):
AI Agent: Ask TWO questions upfront:
http://localhost:3000/api/v1 (local) or https://their-service.railway.app/api/v1 (Railway)payment.masumi.network - they run their own serviceMasumi is a decentralized protocol for AI agent payments and identity. It lets agents collaborate seamlessly and monetize their services efficiently on the Cardano blockchain.
CRITICAL: Masumi is NOT a centralized service.
payment.masumi.network service - that's just documentation examplesIMPORTANT: You run your OWN Masumi Node. There is NO centralized service.
The Masumi Node consists of two primary services that YOU deploy and run:
Payment Service (Required) - YOU run this yourself
http://localhost:3000) or on Railway (https://your-service.railway.app)Registry Service (Optional) - For blockchain querying
Use the built-in installer tools:
// Step 1: Install payment service
const installResult = await masumi_install_payment_service({
network: 'Preprod'
});
// Step 2: Start service
await masumi_start_payment_service({
installPath: installResult.installPath,
serviceUrl: installResult.serviceUrl
});
// Step 3: Generate API key
const apiKeyResult = await masumi_generate_api_key({
serviceUrl: installResult.serviceUrl
});
// Step 4: Enable Masumi (auto-provisions wallet and registers agent)
await masumi_enable({
installService: true, // Automatically installs if not configured
agentName: 'My Agent',
pricingTier: 'free'
});
Deploy YOUR Payment Service:
Set Environment Variables:
export MASUMI_PAYMENT_SERVICE_URL=http://localhost:3000/api/v1
export MASUMI_PAYMENT_API_KEY=your-admin-api-key
export MASUMI_NETWORK=Preprod
Enable Masumi:
await masumi_enable({
agentName: 'My Agent',
pricingTier: 'free'
});
masumi_install_payment_service: Clone and install masumi-payment-service locallymasumi_start_payment_service: Start the payment service and check statusmasumi_generate_api_key: Generate admin API key via payment service APImasumi_enable: Full setup - install service, generate API key, register agentmasumi_create_payment: Create payment requestmasumi_check_payment: Check payment statusmasumi_complete_payment: Submit result and complete paymentmasumi_wallet_balance: Get wallet balancemasumi_list_payments: List payment historymasumi_register_agent: Register agent in Masumi registrymasumi_search_agents: Search for other agentsmasumi_get_agent: Get agent details| Method | Endpoint | Purpose | Notes |
|---|---|---|---|
| POST | /payment | Create payment request | Returns blockchainIdentifier |
| POST | /payment/resolve-blockchain-identifier | Check payment status | Use blockchainIdentifier as body param |
| POST | /payment/submit-result | Submit result | Use submitResultHash (not resultHash) |
| GET | /payment | List payments | Returns data.Payments array |
| POST | /payment/authorize-refund | Authorize refund | Admin only |
| Method | Endpoint | Purpose | Notes |
|---|---|---|---|
| POST | /registry | Register agent | Returns data object |
| GET | /registry/ | List/search agents | Returns data.Assets array |
| GET | /registry/ | Get agent | Filter by agentIdentifier query param |
Important Notes:
/api/v1 prefix if service URL includes it{ status: string, data: T } - extract data propertysubmitResultHash parameter (not resultHash) for submit-result endpointRequired:
MASUMI_PAYMENT_SERVICE_URL: YOUR self-hosted payment service URLOptional:
MASUMI_PAYMENT_API_KEY: Admin API keyMASUMI_NETWORK: "Preprod" or "Mainnet" (default: "Preprod")MASUMI_REGISTRY_SERVICE_URL: Registry service URL (defaults to payment service URL)See examples/payment-manager.ts for complete examples.