Keysend

From claude-dev-suite/claude-dev-suite · View interactive version

Keysend is an AI agent skill from the GitHub repository claude-dev-suite/claude-dev-suite. Keysend / spontaneous payments: send Lightning to a destination without an invoice. Receiver derives preimage from sender-supplied TLV record. BOLT 9 bit 50. USE WHEN: implementing tipping flows, designing zero-friction micro-payments, evaluating keysend vs BOLT11 invoice flow.

How to use this skill

Skill file

Keysend / Spontaneous Payments

Keysend lets the sender pay a destination by node pubkey without

the receiver issuing a BOLT11 invoice first. The sender includes the

preimage as a TLV record in the onion; receiver extracts and fulfills.

Mechanism

Sender:
  preimage_random = random(32 bytes)
  payment_hash = SHA256(preimage_random)
  Build onion with TLV record:
    type 5482373484 ("keysend"): preimage_random
  HTLC for amount → forwarded via onion routing → arrives at destination.

Receiver:
  Receives HTLC with payment_hash.
  Sees TLV type 5482373484 in onion payload.
  Extracts preimage. Verifies SHA256(preimage) == payment_hash.
  If matches, fulfill HTLC immediately.

Why custom record number 5482373484?

Per BOLT 1: custom records ≥ 65536 are reserved for proprietary use.

The keysend type was chosen by Lightning Labs as a (large) sentinel.

Limitations of bare keysend

never receives a signed invoice. Some compliance / accounting

flows fail.

Custom records (e.g., pubky podcast app) extend with text/plain

type for memos.

feature support.

Spontaneous payments + AMP

AMP-keysend combines AMP's per-part nonces with keysend's preimage-in-

onion mechanism. Each part contributes a Shamir share; receiver

reassembles preimage. Used by some podcast apps for streaming sats.

Use cases

sats per minute.

(some impls).

Custom records (extend keysend)

Common custom record types:

These are app-defined; no global registry. Risk of conflicts; check

app docs.

Implementation status

| Impl | Keysend send | Keysend receive |

|------|--------------|-----------------|

| LND | yes | yes |

| CLN | yes (via plugin) | yes |

| LDK | yes | yes |

| Eclair | yes | yes |

| Phoenix | partial | yes |

BOLT12 keysend equivalent

BOLT12 supports an "offer" that allows arbitrary amount payments

WITHOUT pre-issued per-payment invoices, but with proper proof of

payment (signed by recipient).

For new builds, prefer BOLT12 keysend over bare keysend where

implementation supports it.

Common bugs

"incorrect_payment_details".

treats as unknown payment_hash.

rejected at routing.

unknown TLVs (they shouldn't but happens).

See also

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.