commerce
End-to-end agentic commerce workflow using Lightning Network. Use when an agent needs to set up a full payment stack (lnd + lnget + aperture), buy or sell data via L402, or enable agent-to-agent micropayments.
Why use this skill?
Enable your AI agent to buy and sell data using the L402 protocol on the Lightning Network. Set up a complete node, wallet, and paywall.
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/roasbeef/lightning-agent-commerceWhat This Skill Does
The commerce skill provides a comprehensive infrastructure for agentic Lightning Network operations. It integrates three core components: lnd (the Lightning node), lnget (the HTTP client), and aperture (the L402 paywall proxy). This allows your AI agent to function as a self-sovereign financial actor, capable of autonomously paying for premium data sources via the L402 protocol and monetizing its own API endpoints by hosting paid services. It effectively transforms your local OpenClaw agent into a node on the Lightning Network, enabling seamless machine-to-machine micropayments without intermediaries.
Installation
Installation follows an modular approach via the OpenClaw CLI. First, ensure your environment supports persistent storage as the lightning wallet requires state management. Execute the following sequence:
- Run
skills/lnd/scripts/install.shto fetch the Lightning Terminal suite. - Execute
skills/lnget/scripts/install.shto install the payment-enabled HTTP client. - Complete the setup with
skills/aperture/scripts/install.shto configure the L402 reverse proxy. Always ensure your lnd wallet is initialized withskills/lnd/scripts/create-wallet.sh --mode standaloneand properly funded on the testnet before attempting live transactions.
Use Cases
- Automated Research: Program your agent to fetch high-quality market data or research reports from L402-protected APIs, paying only for the specific data chunks retrieved.
- Agent-to-Agent Service Marketplace: Offer specialized tasks (like data synthesis or model inference) by placing an aperture paywall in front of your internal API, allowing other agents to pay you in sats.
- Micropayment Infrastructure: Enable cost-effective, high-frequency transactions that would be economically impossible on-chain, such as pay-per-token API access.
Example Prompts
- "Set up a new lightning wallet and open a channel to a liquidity provider with 500k sats so I can start buying data."
- "Use lnget to fetch the latest analytics from https://api.dataprovider.com, pay up to 500 sats per request."
- "Deploy an aperture paywall for my local service running on port 8080 and set the price to 100 sats per request."
Tips & Limitations
- Security: Running an lnd node carries financial risk. Never expose your seed phrase and ensure your node is behind a secure firewall. Use 'testnet' exclusively during your initial experimentation phase.
- Liquidity: You must actively manage channel liquidity. If your agent is receiving many payments, it needs enough inbound capacity to accept the funds.
- Performance: Ensure you have enough storage and consistent internet connectivity, as lightning nodes require synchronization to remain functional for payments.
Metadata
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-roasbeef-lightning-agent-commerce": {
"enabled": true,
"auto_update": true
}
}
}Tags(AI)
Flags: network-access, file-write, file-read, external-api
Related Skills
lnd
Install and run Lightning Terminal (litd) which bundles lnd, loop, pool, tapd, and faraday in a single Docker container. Defaults to neutrino backend with SQLite storage on testnet. Supports watch-only mode with remote signer, standalone mode, and regtest development. Use when setting up a Lightning node for payments, channel management, liquidity management (loop), channel marketplace (pool), taproot assets (tapd), or enabling agent L402 commerce.
aperture
Install and run Aperture, the L402 Lightning reverse proxy from Lightning Labs. Use when creating L402 paywalls, configuring paid API endpoints, hosting paid content for other agents, or testing L402 authentication flows.
lightning-mcp-server
Build and configure the MCP server for Lightning Node Connect (LNC). Connects AI assistants to lnd nodes via encrypted WebSocket tunnels using pairing phrases — no direct network access or TLS certs needed. Read-only by default (18 tools for querying node state, channels, payments, invoices, peers, on-chain data).
lnget
Install and use lnget, a Lightning-native HTTP client with automatic L402 payment support. Use when downloading files behind Lightning paywalls, managing L402 tokens, checking Lightning backend status, or making HTTP requests that may require micropayments.
macaroon-bakery
Bake, inspect, and manage lnd macaroons for least-privilege agent access. Use when an agent needs scoped credentials — pay-only, invoice-only, read-only, or custom permissions. Also covers signer macaroon scoping and macaroon rotation.