| name | commerce |
| description | 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. |
| user-invocable | false |
Agentic Commerce Toolkit
This plugin provides a complete toolkit for agent-driven Lightning Network
commerce. Three skills work together to enable agents to send and receive
micropayments over the Lightning Network using the L402 protocol.
Components
| Skill | Purpose |
|---|
| lnd | Run Lightning Terminal (litd: lnd + loop + pool + tapd) |
| lnget | Fetch L402-protected resources (pay for data) |
| aperture | Host paid API endpoints (sell data) |
Full Setup Workflow
Step 1: Install All Components
skills/lnd/scripts/install.sh
skills/lnget/scripts/install.sh
skills/aperture/scripts/install.sh
Step 2: Set Up the Lightning Node
skills/lnd/scripts/start-lnd.sh
skills/lnd/scripts/create-wallet.sh --mode standalone
skills/lnd/scripts/lncli.sh getinfo
Step 3: Fund the Wallet
skills/lnd/scripts/lncli.sh newaddress p2tr
skills/lnd/scripts/lncli.sh walletbalance
Step 4: Open a Channel
skills/lnd/scripts/lncli.sh connect <pubkey>@<host>:9735
skills/lnd/scripts/lncli.sh openchannel --node_key=<pubkey> --local_amt=1000000
skills/lnd/scripts/lncli.sh listchannels
Step 5: Configure lnget
lnget config init
lnget ln status
Step 6: Fetch Paid Resources
lnget --max-cost 1000 https://api.example.com/paid-data
lnget --no-pay https://api.example.com/paid-data
lnget tokens list
Step 7: Host Paid Endpoints (Optional)
python3 -m http.server 8080 &
skills/aperture/scripts/setup.sh --insecure --port 8081
skills/aperture/scripts/start.sh
Agent-to-Agent Commerce
The full loop for autonomous agent commerce:
Agent A (buyer) Agent B (seller)
───────────── ─────────────
lnd node running lnd node running
↓ ↓
lnget fetches URL ──────────────→ aperture receives request
↓
Returns 402 + invoice
↓
lnget pays invoice ─────────────→ lnd receives payment
↓ ↓
lnget retries with token ───────→ aperture validates token
↓
Proxies to backend
↓ ↓
Agent A receives data ←────────── Backend returns data
Buyer Agent Setup
skills/lnd/scripts/install.sh
skills/lnget/scripts/install.sh
skills/lnd/scripts/start-lnd.sh
skills/lnd/scripts/create-wallet.sh --mode standalone
lnget config init
skills/lnd/scripts/lncli.sh newaddress p2tr
skills/lnd/scripts/lncli.sh openchannel --node_key=<pubkey> --local_amt=500000
lnget --max-cost 100 -q https://seller-api.example.com/api/data | jq .
Seller Agent Setup
skills/lnd/scripts/install.sh
skills/aperture/scripts/install.sh
skills/lnd/scripts/start-lnd.sh
skills/lnd/scripts/create-wallet.sh --mode standalone
skills/aperture/scripts/setup.sh --port 8081 --insecure
mkdir -p /tmp/api-data
echo '{"market_data": "..."}' > /tmp/api-data/data.json
cd /tmp/api-data && python3 -m http.server 8080 &
skills/aperture/scripts/start.sh
Cost Management
Agents should always control spending:
lnget --max-cost 500 https://api.example.com/data
lnget --no-pay --json https://api.example.com/data | jq '.invoice_amount_sat'
lnget tokens list --json | jq '[.[] | .amount_paid_sat] | add'
Security Summary
| Component | Security Model |
|---|
| Wallet passphrase | Stored at ~/.lnget/lnd/wallet-password.txt (0600) |
| Seed mnemonic | Stored at ~/.lnget/lnd/seed.txt (0600) |
| L402 tokens | Stored at ~/.lnget/tokens/<domain>/ per domain |
| lnd macaroons | Standard lnd paths at ~/.lnd/data/chain/... |
| Aperture DB | SQLite at ~/.aperture/aperture.db |
For production use with significant funds, use watch-only mode with a remote
signer container. See the lightning-security-module skill for details.
Stopping Everything
skills/aperture/scripts/stop.sh
skills/lnd/scripts/stop-lnd.sh