Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Lightning Network payments via Archon DIDs - create wallets, send/receive sats, verify payments, Lightning Address zaps
.claude/skills/leoyeai-archon-lightning/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-17 | ✗→✓ | ▲ Improved | 246% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 372% | 0% |
| case-01 | ✗→✓ | ▲ Improved | 169% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 508% | 0% |
| case-04 | ✗→✓ | ▲ Improved | 209% | 0% |
Lightning Network integration for Archon decentralized identities. Send and receive Bitcoin over Lightning using your DID.
Related skills:
archon-keymaster — Core DID identity managementarchon-vault — Encrypted backupsuser@domain.com)npx @didcid/keymaster)~/.archon.env with ARCHON_WALLET_PATH, ARCHON_PASSPHRASE)jq recommended for JSON parsingAll created by archon-keymaster setup. If you don't have Archon configured yet, see the archon-keymaster skill first.
This skill handles Lightning Network payments:
lightning-pay.sh automatically verifies payments; if using keymaster directly, you must verify manually with lightning-check (see Payment Verification Pattern below)~/.archon.env for wallet accessbash./scripts/lightning/add-lightning.sh [id]
Creates a Lightning wallet for your current DID (or specified DID alias).
Examples:
bash./scripts/lightning/add-lightning.sh # Current DID ./scripts/lightning/add-lightning.sh work # Specific DID alias
bash./scripts/lightning/lightning-balance.sh [id]
Returns current balance in satoshis.
Example output:
2257 satsbash./scripts/lightning/lightning-invoice.sh <amount> <memo> [id]
Creates a BOLT11 invoice to receive payment.
Arguments:
amount - Amount in satoshis (1000 = 0.00001 BTC)memo - Description/memo for the invoiceid - (optional) DID alias, defaults to current identityExample:
bash./scripts/lightning/lightning-invoice.sh 1000 "Coffee payment"
Output:
json{ "paymentRequest": "lnbc10u1p...", "paymentHash": "a3f7b8c9..." }
Share this invoice with the payer. They can:
bash./scripts/lightning/lightning-pay.sh <bolt11> [id]
Pay a BOLT11 invoice with automatic payment verification.
Arguments:
bolt11 - BOLT11 invoice stringid - (optional) DID alias to pay fromOutput: Success or failure message with exit code
Example:
bash./scripts/lightning/lightning-pay.sh lnbc10u1p... # ✅ Payment confirmed # (exits 0 on success, 1 on failure)
The script automatically verifies the payment settled before outputting success.
The payment hash is NOT proof of payment! Lightning payments can fail, time out, or remain pending.
Our lightning-pay.sh script handles verification automatically:
bash./scripts/lightning/lightning-pay.sh lnbc10u1p... # ✅ Payment confirmed # (or "❌ Payment failed or pending" + exit 1)
The script verifies the payment settled and outputs a clear success/failure message. No manual checking needed.
Why verification matters:
bash./scripts/lightning/lightning-check.sh <paymentHash> [id]
Check whether a payment settled.
Arguments:
paymentHash - Payment hash from lightning-payid - (optional) DID aliasReturns:
json{ "paid": true, "preimage": "...", "amount": 1000 }
"paid": true — Payment settled successfully"paid": false — Payment failed or still pendingbash./scripts/lightning/lightning-zap.sh <recipient> <amount> [memo] [id]
Send sats to a Lightning Address, DID, or alias.
Arguments:
recipient - Lightning Address (user@domain.com), DID, or aliasamount - Amount in satoshismemo - (optional) Message/memoid - (optional) DID alias to send fromExamples:
bash# Zap to Lightning Address ./scripts/lightning/lightning-zap.sh user@getalby.com 1000 "Great post!" # Zap to DID ./scripts/lightning/lightning-zap.sh did:cid:bagaaiera... 5000 # Zap to alias ./scripts/lightning/lightning-zap.sh alice 2000 "Coffee"
Output: Success or failure message with exit code
Example:
bash./scripts/lightning/lightning-zap.sh user@getalby.com 1000 "Great post!" # ✅ Payment confirmed # (exits 0 on success, 1 on failure)
The script automatically verifies the payment settled before outputting success.
What it does:
bash./scripts/lightning/lightning-payments.sh [id]
Show all Lightning payments (sent and received).
Example output:
2026/03/05 11:17:38 -100 sats "Payment memo"
2026/03/04 17:08:14 +20 sats "Received payment"
2026/03/03 17:16:31 +25 sats "Test invoice"Format: YYYY/MM/DD HH:MM:SS [+/-]amount sats ["memo"]
bash./scripts/lightning/publish-lightning.sh [id]
Add your Lightning endpoint to your DID document.
What it does:
Example:
bash./scripts/lightning/publish-lightning.sh # Your DID document now includes: # { # "didDocument": { # "id": "did:cid:bagaaiera...", # "service": [{ # "id": "did:cid:bagaaiera...#lightning", # "type": "Lightning", # "serviceEndpoint": "http://...onion:4222/invoice/bagaaiera..." # }] # } # }
bash./scripts/lightning/unpublish-lightning.sh [id]
Remove Lightning endpoint from your DID document.
bash./scripts/lightning/lightning-decode.sh <bolt11>
Inspect BOLT11 invoice details before paying.
Example output:
json{ "amount": 1000, "description": "Coffee payment", "paymentHash": "a3f7b8c9...", "timestamp": 1709635800, "expiry": 3600, "destination": "03..." }
Use cases:
bash# Alice creates invoice INVOICE=$(./scripts/lightning/lightning-invoice.sh 1000 "Coffee") echo "Invoice: $INVOICE" # Bob pays invoice RESULT=$(./scripts/lightning/lightning-pay.sh "$INVOICE") HASH=$(echo "$RESULT" | jq -r .paymentHash) # Bob verifies payment STATUS=$(./scripts/lightning/lightning-check.sh "$HASH" | jq -r .paid) if [ "$STATUS" = "true" ]; then echo "✅ Payment confirmed!" fi # Alice checks balance ./scripts/lightning/lightning-balance.sh
bash# Zap creator via Lightning Address ./scripts/lightning/lightning-zap.sh creator@getalby.com 5000 "Love your content!" # ✅ Payment confirmed # Payment verification is automatic - no manual checking needed
bash# Receive a BOLT11 invoice from someone INVOICE="lnbc10u1p..." # Decode to verify amount and recipient ./scripts/lightning/lightning-decode.sh "$INVOICE" # Check amount, description, expiry # If looks good, pay it RESULT=$(./scripts/lightning/lightning-pay.sh "$INVOICE") HASH=$(echo "$RESULT" | jq -r .paymentHash) # CRITICAL: Verify payment settled ./scripts/lightning/lightning-check.sh "$HASH"
bash# Create wallets for different personas ./scripts/lightning/add-lightning.sh personal ./scripts/lightning/add-lightning.sh work ./scripts/lightning/add-lightning.sh project # Check balances ./scripts/lightning/lightning-balance.sh personal ./scripts/lightning/lightning-balance.sh work ./scripts/lightning/lightning-balance.sh project # Pay from specific wallet ./scripts/lightning/lightning-pay.sh lnbc10u1p... work
bash# Create Lightning wallet ./scripts/lightning/add-lightning.sh # Publish to DID document ./scripts/lightning/publish-lightning.sh # Others can now discover your Lightning endpoint # They look up your DID and see your Lightning service # Later, if you want to unpublish: ./scripts/lightning/unpublish-lightning.sh
bash# Alice creates an invoice for 5000 sats INVOICE_JSON=$(npx @didcid/keymaster lightning-invoice 5000 "Consulting fee") INVOICE=$(echo "$INVOICE_JSON" | jq -r .paymentRequest) # Alice sends the invoice to Bob via dmail npx @didcid/keymaster send-dmail \ "did:cid:bob..." \ "Invoice for consulting work" \ "Please pay this invoice: $INVOICE" # Bob receives the dmail, extracts the invoice, and pays npx @didcid/keymaster lightning-pay "$INVOICE" # ✅ Payment confirmed # Alice checks her payment history npx @didcid/keymaster lightning-payments # Shows the received payment
Why this matters: Agents can request payment without needing email, phone numbers, or centralized messaging platforms. Just DIDs + Lightning + dmail.
All scripts require:
bashsource ~/.archon.env # Load wallet path and passphrase
This is automatically sourced by the wrapper scripts. npx is used to run keymaster, so no nvm sourcing is needed.
Environment variables (~/.archon.env):
ARCHON_WALLET_PATH - Path to your wallet fileARCHON_PASSPHRASE - Wallet encryption passphraseARCHON_GATEKEEPER_URL - (optional) Gatekeeper endpointArchon Lightning wallets are:
The wallet is managed by @didcid/keymaster which interfaces with Lightning infrastructure.
Lightning amounts are in satoshis:
Minimum payment typically 1 sat, maximum depends on channel capacity.
BOLT11 invoices typically expire after 1 hour. Check expiry with:
bash./scripts/lightning/lightning-decode.sh lnbc10u1p... | jq .expiry
Lightning Addresses resolve via LNURL:
user@domain.com
→ Query: https://domain.com/.well-known/lnurlp/user
→ Get invoice endpoint
→ Request invoice for amount
→ Pay invoiceThe lightning-zap.sh script handles this automatically.
"No route found":
"Insufficient balance":
./scripts/lightning/lightning-balance.sh"Invoice expired":
./scripts/lightning/lightning-decode.sh"Payment failed":
lightning-checkbash# 1. Attempt payment RESULT=$(./scripts/lightning/lightning-pay.sh "$INVOICE" 2>&1) # 2. Check for errors if ! echo "$RESULT" | jq -e .paymentHash > /dev/null 2>&1; then echo "Payment failed: $RESULT" exit 1 fi # 3. Extract payment hash HASH=$(echo "$RESULT" | jq -r .paymentHash) # 4. Verify payment settled for i in {1..5}; do STATUS=$(./scripts/lightning/lightning-check.sh "$HASH" | jq -r .paid) if [ "$STATUS" = "true" ]; then echo "✅ Payment confirmed" exit 0 fi sleep 2 done echo "⏳ Payment still pending or failed" exit 1
Always verify payments settled:
bash# ❌ WRONG ./scripts/lightning/lightning-pay.sh lnbc10u1p... echo "Paid!" # NO! # ✅ CORRECT HASH=$(./scripts/lightning/lightning-pay.sh lnbc10u1p... | jq -r .paymentHash) ./scripts/lightning/lightning-check.sh "$HASH" | jq -r .paid
Before paying, verify:
bash./scripts/lightning/lightning-decode.sh lnbc10u1p... # Check output before paying
ARCHON_PASSPHRASE securearchon-vault skill)Ensure Node.js is installed and in your PATH:
bashnode --version # Should show v16 or newer npx --version # Should show npm version
If not installed, install Node.js via your package manager or from https://nodejs.org
bashsource ~/.archon.env ls -la "$ARCHON_WALLET_PATH" # Ensure wallet file exists and is readable
Payment may still be pending or failed. Wait 5-10 seconds and try lightning-check again.
bash./scripts/lightning/add-lightning.sh # Creates wallet for current DID
If Archon gatekeeper is unreachable:
bashecho $ARCHON_GATEKEEPER_URL # Verify URL is correct # Try default gatekeeper unset ARCHON_GATEKEEPER_URL ./scripts/lightning/lightning-balance.sh
Lightning payment data is stored:
~/.archon.wallet.jsonNo payment history or balances are exposed publicly unless you explicitly publish them.
Agent-to-Agent Payments:
Content Monetization:
Real-Time Payments:
Value-4-Value:
⚡ Powered by Lightning. Secured by Archon. Built for agents.
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-17 | fail→pass | 11,432 | 9,937 | -13% | 1 | 1 | 0% | 1,717 | 5,933 | +246% | 0 | 0 | — |
case-02 | fail→pass | 9,216 | 13,042 | +42% | 1 | 1 | 0% | 1,441 | 6,797 | +372% | 0 | 0 | — |
case-01 | fail→pass | 10,296 | 2,744 | -73% | 1 | 1 | 0% | 1,843 | 4,957 | +169% | 0 | 0 | — |
case-03 | fail→pass | 6,148 | 5,426 | -12% | 1 | 1 | 0% | 889 | 5,406 | +508% | 0 | 0 | — |
case-04 | fail→pass | 10,692 | 2,343 | -78% | 1 | 1 | 0% | 1,567 | 4,843 | +209% | 0 | 0 | — |
case-05 | fail→pass | 5,344 | 3,770 | -29% | 1 | 1 | 0% | 833 | 4,943 | +493% | 0 | 0 | — |
case-06 | pass→pass | 9,607 | 3,082 | -68% | 1 | 1 | 0% | 1,542 | 4,990 | +224% | 0 | 0 | — |
case-07 | fail→pass | 10,210 | 2,320 | -77% | 1 | 1 | 0% | 1,906 | 4,852 | +155% | 0 | 0 | — |
case-08 | fail→pass | 4,860 | 2,900 | -40% | 1 | 1 | 0% | 844 | 5,006 | +493% | 0 | 0 | — |
case-09 | fail→pass | 14,223 | 2,274 | -84% | 1 | 1 | 0% | 2,629 | 4,802 | +83% | 0 | 0 | — |
case-10 | fail→pass | 16,294 | 2,828 | -83% | 1 | 1 | 0% | 2,170 | 4,888 | +125% | 0 | 0 | — |
case-11 | fail→pass | 12,027 | 1,973 | -84% | 1 | 1 | 0% | 1,654 | 4,790 | +190% | 0 | 0 | — |
case-12 | fail→pass | 11,986 | 3,356 | -72% | 1 | 1 | 0% | 2,011 | 5,142 | +156% | 0 | 0 | — |
case-13 | fail→pass | 13,692 | 4,295 | -69% | 1 | 1 | 0% | 2,413 | 5,235 | +117% | 0 | 0 | — |
case-14 | fail→pass | 10,383 | 2,711 | -74% | 1 | 1 | 0% | 1,588 | 4,937 | +211% | 0 | 0 | — |
case-15 | pass→pass | 3,081 | 2,714 | -12% | 1 | 1 | 0% | 526 | 4,905 | +833% | 0 | 0 | — |
case-16 | pass→pass | 13,165 | 3,821 | -71% | 1 | 1 | 0% | 1,718 | 4,980 | +190% | 0 | 0 | — |
case-18 | fail→pass | 10,973 | 2,167 | -80% | 1 | 1 | 0% | 1,687 | 4,805 | +185% | 0 | 0 | — |
case-19 | fail→pass | 26,934 | 2,166 | -92% | 1 | 1 | 0% | 3,704 | 4,789 | +29% | 0 | 0 | — |
case-20 | fail→fail | 13,412 | 11,151 | -17% | 1 | 1 | 0% | 2,275 | 5,697 | +150% | 0 | 0 | — |
case-21 | fail→pass | 9,656 | 3,590 | -63% | 1 | 1 | 0% | 1,453 | 5,147 | +254% | 0 | 0 | — |
case-22 | fail→pass | 12,134 | 5,234 | -57% | 1 | 1 | 0% | 2,143 | 5,264 | +146% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +82 percentage points is the difference between those two pass rates over the 22 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.