Keysend
Sending a Lightning payment with no invoice, by pushing to the destination's node directly.
Basically
Keysend lets you send a Lightning payment without an invoice. You create the secret needed to claim the payment and send it with the payment.
Key Takeaways
- Keysend enables payments without invoices. The sender generates the payment preimage and includes it in the encrypted onion payload, so you can make spontaneous payments to any node with a known public key.
- Keysend powers streaming payments and micropayments. It is the foundation for Podcasting 2.0 value-for-value streaming, real-time tips, and donation flows where generating invoices for each payment would be impractical.
- The trade-off is that the receiver trusts the preimage. Unlike invoice-based payments, where the receiver generates the preimage, keysend requires the receiver to trust that the sender-generated preimage is unique and has not been reused.
What Is Keysend?
Keysend is a Lightning Network feature that lets you send payments to a node without first requesting an invoice. In standard Lightning payments, the recipient creates an invoice with a payment hash, and only the recipient knows the preimage that unlocks the payment. Keysend reverses this model: the sender generates both the payment hash and preimage, then sends the preimage to the receiver inside the encrypted onion payload.
The name "keysend" describes the core mechanism: you send the key, or preimage, with the payment. The receiver uses this key to claim the funds. Onion encryption ensures that only the final recipient can read the preimage and complete the payment.
LND originally implemented keysend as an experimental feature, and major Lightning implementations have since adopted it. Keysend is not part of the core BOLT specifications. It has become a de facto standard for spontaneous payments through adoption.
How Keysend Works
Standard Lightning payments provide the context for keysend. In a normal payment, the recipient creates an invoice and shares its payment hash with the sender.
Keysend changes this flow by letting the sender generate the payment hash and preimage. The sender places the preimage inside the encrypted onion payload instead of receiving a payment hash through an invoice.
Intermediate routing nodes only see the payment hash in the HTLC. They cannot access the preimage hidden in the onion payload. Only the final recipient, who can fully decrypt the onion, learns the preimage.
Keysend vs Traditional Invoices
Keysend and invoice-based payments both produce completed Lightning transactions. They serve different use cases and have distinct security properties.
When to Use Each
Invoices suit commerce, defined payments, and situations that require explicit payment requests. They provide clear receipts, and the receiver keeps control over payment acceptance.
Keysend suits tips, donations, streaming payments, and cases where generating an invoice for each payment is impractical. It works well for push payments where the receiver passively accepts funds.
Streaming Sats (Podcasting 2.0)
Streaming payments for podcast listeners are the most prominent keysend application. In the Podcasting 2.0 ecosystem, listeners can stream satoshis to creators in real time as they listen. A podcast player might send 100 sats per minute of playback directly to the creator's node.
Invoices would be impractical for streaming payments. Generating and paying an invoice every minute, or more often, would create massive overhead. Keysend enables continuous micropayment streams where each payment is independent and needs no back-and-forth communication.
Tips and Donations
Content creators, open source developers, and anyone accepting Lightning tips can benefit from keysend. A viewer can send a tip to a creator's node without the creator generating a unique invoice. The creator simply publishes their node public key, and supporters can send funds at will.
Asynchronous tipping is a particularly useful application. A blog post might include a node pubkey, and readers can tip days or weeks later without any real-time interaction.
Circular Rebalancing
Node operators use keysend for internal channel rebalancing. You can send a payment from your node back to yourself through a circular route, shifting liquidity between channels. You control both ends, so invoice generation is unnecessary overhead.
Automated Payments
Systems that send programmatic payments can benefit from keysend. A bot distributing rewards, a service paying out earnings, or an automated split payment system can push funds without managing invoice generation and expiry. When combined with AMP, keysend payments can also be split across multiple routes for improved reliability with larger amounts.
Technical Implementation
Keysend uses TLV (Type-Length-Value) extension records in the onion payload. The preimage is transmitted using TLV type 5482373484.
LND Implementation
LND requires keysend to be explicitly enabled. Once active, you can send keysend payments using the sendpayment command.
Core Lightning Implementation
Core Lightning supports keysend through the keysend plugin. You can use the plugin to send keysend payments.
TLV Records
Keysend payments often include additional TLV records for metadata. Common types include records that add context to a payment.
The Podcasting 2.0 specification defines additional TLV types for attribution, splits, and streaming metadata. These records carry information alongside keysend payments.
Preimage Trust Model
Preimage generation creates the fundamental security difference with keysend. In invoice-based payments, the receiver generates the preimage and can guarantee its uniqueness. With keysend, the receiver must trust that the sender generated a unique, random preimage.
A malicious sender could theoretically reuse preimages, though this primarily affects their own proof-of-payment guarantees rather than the receiver's funds. Once the receiver claims the HTLC using the provided preimage, the payment is complete regardless of whether that preimage was used before.
No Native Receipt
Keysend payments lack the structured receipt that invoices provide. They have no description field, no specified amount expectation, and no expiry. Receivers may struggle to attribute incoming keysend payments to specific senders or purposes without additional TLV metadata.
Must Know Recipient Pubkey
Keysend requires you to know the recipient's node public key. This is less user-friendly than scanning a QR code invoice. Recipients need to publish and maintain their pubkey, and senders need additional context about who they are paying. Lightweight clients can use trampoline routing to send keysend payments without maintaining the full network graph.
Spam Potential
Keysend opens nodes to unsolicited payments because anyone can send to a known pubkey without permission. Receiving money is generally positive, but high volumes of dust payments could create operational issues. Most implementations let operators disable keysend if needed.
Not in BOLT Specification
Keysend is not formally specified in the BOLT documents. It emerged from LND as an experimental feature and spread through adoption rather than standardisation. Implementations may therefore have subtle differences, though core functionality is consistent.