initial commit

This commit is contained in:
Kolomona 2025-12-16 13:33:43 -06:00
commit 328b3c2b17

View File

@ -0,0 +1,262 @@
## The Case for Keysend
# TLDR (Too Long; Didn't Read)
**Keysend** is the superior protocol for Value-for-Value (V4V) applications like streaming sats and Boostagrams. It is **highly efficient** (no HTTP requests), **private** (metadata inside the Lightning Onion via TLV), and **sovereign** (no external server required). **lnaddress/lnurlp** is better suited for simple, one-off payments and **user onboarding** due to its human-readable address, but sacrifices efficiency, metadata capacity, and censorship resistance by relying on centralized web servers.
# Keysend vs lnaddress/lnurlp
## **Keysend**
- Invoice-less, direct node-to-node Lightning payments.
- Enables spontaneous payments, Boostagrams, and streaming sats.
- Supported by advanced wallets (Alby, Fountain, Wavlake, etc.).
- Maximizes sovereignty, censorship resistance, and anonymity (no third-party server required).
- Limited support in mainstream wallets; requires recipient node to be online.
- Not officially part of the Lightning spec (as of 2025).
## **lnaddress / lnurlp**
- User-friendly, email-like addresses for Lightning payments.
- Widely supported by "easy" wallets (Strike, CashApp, Primal, etc.).
- Requires a web server/endpoint to generate invoices (introduces centralization).
- Easier for newcomers, but less suitable for streaming or Boostagrams.
- Payments can be censored or logged by the endpoint; less private.
### Comparison Table: Keysend vs lnurlp
|Feature|Keysend|lnaddress / lnurlp|
|---|---|---|
|Payment Type|Invoice-less, direct node-to-node|Requires invoice from endpoint|
|Metadata|Rich, structured TLV records; **high-capacity**; atomic|Small `comment` field; limited and server-mediated|
|Network Dependence|Peer-to-peer; no external server required|Dependent on web server, DNS, endpoint availability|
|Latency & Efficiency|Low; fewer network hops; efficient for frequent/micro-payments|Higher latency; multiple HTTP requests per payment|
|Censorship Resistance|High; only Lightning-level network risks|Lower; DNS attacks, server shutdown, jurisdictional pressure|
|Privacy|Good for metadata; **Poorer for routing (must use public channels)**|Good for routing (can use private channels/hints); Poorer for metadata/logging|
|Extensibility|High; add new metadata fields without server changes|Limited; new fields require endpoint/server support|
|Use Cases|Boostagrams, streaming sats, complex splits, micro-payments|Simple payments, user-friendly onboarding|
### Key Points on Sovereignty, Censorship Resistance, and Anonymity
#### **Keysend**
- Ensures user sovereignty by removing dependency on third-party servers or invoice generators.
- Preserves **metadata privacy** by keeping payment metadata within the Lightning onion.
- **Routing Constraint:** Requires recipient nodes to be publicly discoverable and payments must route through **public channels**, which can limit routing privacy compared to invoices.
- **Potential vulnerabilities:**
- Requires the recipient Lightning node to be online and reachable; prolonged downtime can prevent receipt of payments.
- Susceptible to general Lightning Network-level attacks or disruptions (e.g., channel exhaustion, routing failures), though these affect all Lightning payments.
- Network-level censorship (ISP blocking Lightning traffic) is possible but non-trivial and not specific to Keysend.
#### **lnaddress/lnurlp**
- Improves usability and onboarding through human-readable identifiers.
- **Routing Advantage:** Since it generates a BOLT 11 invoice, it allows the recipient to include **routing hints** to private channels, potentially improving routing privacy.
- **Metadata/Logging Risk:** Relies on a web server, increasing surveillance surfaces. Server can log payment intent, timing, and comments, and is subject to DNS/server-level censorship.
- **Potential vulnerabilities:**
- **DNS-based attacks:** domain seizure, DNS poisoning, or censorship can prevent resolution of the lnaddress entirely.
- **Server dependency:** the lnurlp endpoint can be rate-limited, shut down, censored, or selectively deny service.
- **Jurisdictional pressure:** endpoints are subject to hosting providers, legal orders, or regulatory compliance.
### Technical Implementation: lnaddress vs Keysend for Boostagrams and Streaming Sats
#### **lnaddress (lnurlp)**
- Each payment requires a network call to fetch a new Lightning invoice.
- Frequent payments increase HTTP requests, network usage, and battery drain.
- Boostagrams require a new invoice per message, adding overhead.
- Payments can be delayed or fail if the server is slow or unreachable.
#### **Keysend**
- Payments are sent directly to the recipient node without repeated network calls.
- Streaming sats can be sent regularly with no extra HTTP requests.
- Boostagrams can include metadata directly in the payment, avoiding additional network overhead.
**Conclusion:** Keysend improves network efficiency and battery life for frequent payments by eliminating repeated HTTP requests and server dependencies.
### Metadata Capacity and Expressiveness: Keysend vs lnurlp
**Keysend** can carry rich, structured metadata in TLV (Type-Length-Value) records. This supports Boostagrams, streaming sats, time-based splits, attribution, and future extensibility.
#### Keysend Metadata Advantages
**Rich, high-capacity metadata**
- TLV records can include JSON or binary data: messages, sender IDs, app names, content references, timestamps, and extensions.
- Metadata travels with the payment and cannot be altered in transit without breaking the payment.
#### **Protocol-native transport & Standardization**
- No external servers are needed; metadata remains within the Lightning Network.
- **Keysend mandates the inclusion of V4V metadata TLVs during the payment execution, which is why it is the functional standard.**
#### **Extensible and future-proof**
- New fields can be added without server changes.
- Wallets and applications evolve independently while remaining interoperable.
#### **Atomicity and integrity**
- Payment and metadata succeed or fail together, critical for receipts, attribution, and auditability.
#### lnurlp Metadata Limitations
#### **Server-Mediated Metadata (BOLT 11 Invoice only)**
- The core `lnurlp` mechanism only allows the server to define the invoice's small `comment` field.
#### **Practical TLV Exclusion**
- While the _Lightning payment_ that settles an invoice is technically capable of carrying TLV records, **no major V4V wallet API currently provides a mechanism to attach custom TLV data when paying a BOLT 11 invoice.**
- This practical exclusion means that `lnurlp` effectively lacks rich TLV support for arbitrary, spontaneous messages like Boostagrams.
#### **Poor fit for complex flows**
- As splits, time-based payments, and message-rich interactions grow, lnurlp metadata does not scale effectively without API changes across the entire ecosystem.
**Summary:** Keysends TLV records provide a high-bandwidth, protocol-native metadata channel that is _mandated and supported_ by V4V applications. In contrast, `lnurlp` relies on the legacy `comment` field and is blocked by the **lack of API support** for attaching custom TLV data to invoice payments.
### The Ecosystem Effect: Standardization & Reading
The native design of Keysend, using rich TLV metadata inside the Lightning payment's onion packet, fosters a standardized and interoperable ecosystem.
- **Standardization:** Keysend embeds metadata in a universally recognized format within the Lightning Network. This means any Keysend-enabled wallet or service (like a podcast app) can process the data without knowing the recipient's specific software setup. The data is stored in the recipient's node in a standardized, machine-readable format.
- **Reading Metadata:** This standardization is directly utilized by tools like **Helipad**, a web front-end and LND poller built by the Podcast Index. Helipad reads the incoming Keysend TLV data (Boostagrams) from the Lightning node and presents it to the user in a human-readable format.
- **lnurlp Fracturing:** To achieve rich messaging with `lnurlp`, applications are forced to use non-standard, **out-of-band methods**. This often involves the sending app creating a third-party server link, sending a separate message (email/text), or having the data logged by the `lnurlp` server itself. This lack of standardization leads to a fractured ecosystem, requiring custom workarounds and increasing the privacy and third-party reliance issues already noted.
### Example Scenario: Splits and Boostagram Payment
**Scenario:** A listener enjoys a music show with 4 value splits for infrastructure and 4 splits for the featured artist. The listener sends a Boostagram during the show.
#### Using Keysend
- Wallet has all 8 keysend addresses for splits.
- Direct payments are sent to each recipient with the appropriate TLV metadata.
- No third-party handling; payments are wallet-to-wallet.
- Each split requires a separate Lightning payment.
**Network Overhead:**
- 8 Lightning payments (one per split).
- No HTTP requests to external servers.
- Efficient handling minimizes battery and network usage.
#### Using lnaddress (lnurlp)
- Wallet has 8 lnurlp addresses.
- Each payment requires resolving the domain, calling the lnurlp endpoint, generating an invoice, and paying.
- Still wallet-to-wallet, but relies on external infrastructure.
**Network Overhead:**
- 3 HTTP requests + 1 Lightning payment per split → ~24 HTTP requests and 8 Lightning payments.
- Dependent on DNS and web server availability.
- Higher battery and network usage compared to Keysend.
**Summary:** Keysend enables efficient, direct payments with embedded metadata. lnurlp adds network overhead, latency, and server dependency. These efficiencies are critical for mobile apps handling streaming or frequent micro-payments.
### Situations Where lnurlp Excels
While Keysend is ideal for streaming and Boostagram-style payments, lnurlp shines in use cases where **user convenience and simplicity** are more important than frequent micro-payments:
- **eCommerce payments:** Users can pay via familiar email-like addresses, invoices are guaranteed by the server, and payment flows are straightforward.
- **One-off donations or tips:** Quick and simple payment collection where the recipient's **wallet/client is not required to be active** during the initial invoice request, as the server handles the generation.
- **Easy onboarding:** New users can pay without understanding node addresses or Keysend intricacies.
- **Invoice management:** Servers can enforce limits, track payments, or provide receipts, which is useful for merchants.
**Principle:** Choosing the right tool for the job matters. Keysend is optimized for value-for-value (V4V) ecosystems in Podcasting 2.0, but lnurlp remains superior for traditional payment experiences, merchant interactions, and simple donation flows.
### A Note on BOLT 12 (Offers)
BOLT 12, or Lightning Offers, is a proposed standard designed to provide static, reusable payment codes, resolving the issue of expiring BOLT 11 invoices without relying on centralized web servers.
|Feature|BOLT 12|Comparison|
|---|---|---|
|**UX**|Static, reusable "offer" QR codes.|Addresses the expiry issue of BOLT 11, similar goal to `lnurlp`'s UX.|
|**Flow**|Sender's wallet communicates with the recipient's node/server **over the Lightning Network** (using Onion messaging) to request a unique BOLT 11 invoice.|More private than `lnurlp` (no HTTPS/web server), but still requires a two-way communication step for invoice generation.|
|**Efficiency**|Better than `lnurlp` (removes HTTP overhead), but requires more steps than Keysend (invoice request/response).|Less efficient than invoice-less Keysend.|
|**Metadata**|Supports structured fields for description, expiration, etc., but **lacks support for the arbitrary, unstructured TLV records** used for rich, unsolicited metadata like Boostagrams and streaming sats.|Like `lnurlp`, it is not optimized for V4V's need for rich, spontaneous, arbitrary messaging.|
**Conclusion:** BOLT 12 offers a significant privacy and UX improvement over `lnurlp` by using the Lightning Network for invoice negotiation. However, because it is fundamentally an invoice-generation protocol and does not natively support the flexible, arbitrary TLV records used for Podcasting 2.0's V4V metadata, Keysend remains the optimal protocol for streaming sats and Boostagram delivery.
# Keysend and lnurlp and the Bitcoin Whitepaper
The philosophical bedrock of Bitcoin, established in Satoshi Nakamoto's whitepaper, is the removal of trusted third parties to create a truly peer-to-peer electronic cash system. Keysend is architecturally the closest realization of this ideal on the Lightning Network Layer 2. By implementing invoice-less, direct node-to-node payments, Keysend completely eliminates the need for any web server, DNS resolver, or trusted intermediary to broker the transaction flow. This adherence to the strictly peer-to-peer model preserves the sovereignty of both the sender and the receiver.
Keysend's core efficiency, which requires zero external HTTP requests, is also essential for realizing the whitepaper's vision of a system capable of handling high-frequency, low-cost micro-payments—the very definition of electronic cash. While other protocols sacrifice the P2P ideal for user convenience by reintroducing server-side dependencies (LNURL-pay), Keysend remains fundamentally optimized for the decentralized, frequent, and data-rich micro-payments that define the future of open podcasting.
## Conclusion
Keysend is the clear technical and philosophical choice for Value-for-Value (V4V) applications like streaming sats and Boostagrams within the Podcasting 2.0 ecosystem. Its core strength lies in its **invoice-less, peer-to-peer nature**, which eliminates third-party reliance, minimizes network overhead, and maximizes user sovereignty and censorship resistance. Crucially, Keysend utilizes **rich, standardized TLV metadata** embedded directly in the Lightning payment, enabling features like Boostagrams that cannot be efficiently or privately supported by protocols like `lnurlp` or even the newer BOLT 12. While `lnurlp` serves a valuable role in simple, human-readable onboarding, Keysend is fundamentally optimized for the decentralized, frequent, and data-rich micro-payments that define the future of open podcasting.
## Addendum
## Why Apps Like Strike Refuse to use Keysend (Speculation)
While solutions like Alby Hub demonstrate that it is technically possible for a single Lightning node to use custom metadata (via Keysend's TLV records) to credit funds to internal "sub-wallets" or user accounts, major regulated custodial platforms, such as Strike and CashApp, overwhelmingly rely on the server-dependent **lnaddress** (which uses the LNURL-pay protocol).
This choice is less about technical feasibility and more about **architectural control and regulatory compliance**.
The fundamental difference lies in _who_ controls the transaction flow:
|Protocol Feature|Keysend (V4V)|LNURL-pay (lnaddress)|Custodial Preference|
|---|---|---|---|
|**Transaction Initiation**|Unsolicited (receiver is passive)|Server-mediated (receiver must generate an invoice)|LNURL-pay|
|**Server Involvement**|Minimal/None (direct peer-to-peer)|Mandatory (Server must be online to generate the invoice)|LNURL-pay|
|**Metadata & Logging**|Encrypted in the Onion (Difficult for custodian to log flow)|All requests logged by the custodian's web server|LNURL-pay|
|**KYC/AML Control Point**|No enforced control point|Server-side API allows for checks and rejection _before_ invoice generation|LNURL-pay|
|**Value Proposition**|Sovereignty, permissionless micro-payments, V4V|Centralized control, compliance, transaction traceability|Centralized control|
By forcing all incoming payments to follow the **LNURL-pay** flow, the custodial service ensures that its web server is the mandatory first point of contact. This gives the regulated entity a critical control plane to enforce regulatory requirements (KYC/AML), log all attempted transactions, and ensure guaranteed credit to the correct internal user account before the payment is even initiated. Keysend's direct, unsolicited, and opaque nature bypasses this essential control plane, making it architecturally undesirable for centralized financial services.
## References
### Podcasting 2.0 Value Tag Specifications
- Podcast Namespace: `value` tag — [https://github.com/Podcastindex-org/podcast-namespace/blob/main/docs/tags/value.md](https://github.com/Podcastindex-org/podcast-namespace/blob/main/docs/tags/value.md "null")
- Podcast Namespace: `valueRecipient` tag — [https://github.com/Podcastindex-org/podcast-namespace/blob/main/docs/tags/value-recipient.md](https://github.com/Podcastindex-org/podcast-namespace/blob/main/docs/tags/value-recipient.md "null")
- Podcast Namespace: `valueTimeSplit` tag — [https://github.com/Podcastindex-org/podcast-namespace/blob/main/docs/tags/value-time-split.md](https://github.com/Podcastindex-org/podcast-namespace/blob/main/docs/tags/value-time-split.md "null")
### Podcasting 2.0 Value Tag Examples
- BLIP-0010 Example — [https://github.com/Podcastindex-org/podcast-namespace/blob/main/docs/examples/value/blip-0010.md](https://github.com/Podcastindex-org/podcast-namespace/blob/main/docs/examples/value/blip-0010.md "null")
- LNAddress Example — [https://github.com/Podcastindex-org/podcast-namespace/blob/main/main/docs/examples/value/lnaddress.md](https://www.google.com/search?q=https://github.com/Podcastindex-org/podcast-namespace/blob/main/main/docs/examples/value/lnaddress.md "null")
- Value Tag Examples — [https://github.com/Podcastindex-org/podcast-namespace/blob/main/docs/examples/value/value.md](https://github.com/Podcastindex-org/podcast-namespace/blob/main/docs/examples/value/value.md "null")
- Value Slugs Reference — [https://github.com/Podcastindex-org/podcast-namespace/blob/main/docs/examples/value/valueslugs.txt](https://github.com/Podcastindex-org/podcast-namespace/blob/main/docs/examples/value/valueslugs.txt "null")
### Technical Documentation
- Alby Wallet API (BOLT 11 Payment) — [https://guides.getalby.com/developer-guide/alby-wallet-api/reference/api-reference/payments#bolt11-payment](https://guides.getalby.com/developer-guide/alby-wallet-api/reference/api-reference/payments#bolt11-payment "null")
- LND Send Payment (Deprecated RPC) — [https://lightning.engineering/api-docs/api/lnd/lightning/send-payment/#lnrpcsendrequest](https://lightning.engineering/api-docs/api/lnd/lightning/send-payment/#lnrpcsendrequest "null")
## Glossary
### Key Concepts for Non-Technical Listeners
- **Sats / Satoshis:** The smallest unit of Bitcoin, like a cent is to a dollar. Lightning Network payments are usually measured in Sats.
- **Lightning Network:** A payment layer built on top of Bitcoin that allows for instant, cheap, and private transactions between parties.
- **Value-for-Value (V4V):** A philosophy where consumers pay creators directly for the value they receive, often through micro-payments (Sats) that can be streamed or sent with messages.
- **Atomicity:** A concept in transactions meaning the payment and any associated data (like a Boostagram message in Keysend) either entirely succeed or entirely fail. There is no partial success, ensuring data integrity.
- **Boostagram:** A small payment (Boost) sent over the Lightning Network that includes a message (gram). It's a way for listeners to support and communicate with content creators instantly.
- **Streaming Sats:** Sending small amounts of Satoshis to a podcast creator _per minute_ or _per second_ while listening, instead of a single lump sum donation.
- **BOLT 11 / Invoice:** The traditional way to ask for a Lightning payment. It's a long, encrypted string (like a QR code) that is only valid once and usually expires quickly.
- **Keysend:** An invoice-less method of sending a Lightning payment directly to a recipient's node (their public ID), eliminating the need for the sender to request a fresh invoice every time. It is used for spontaneous payments like Boostagrams.
- **lnaddress / lnurlp:** A system that creates a human-readable address (like an email address, e.g., `alice@podcaster.com`) that automatically generates a new, non-expiring BOLT 11 invoice via a web server whenever a payment is requested.
- **Lightning Onion (or Onion Routing):** The privacy mechanism of the Lightning Network. Payment and message data are wrapped in layers of encryption, like an onion, so that each node only knows the immediate preceding and succeeding nodes, keeping the overall path and contents private.
- **TLV Records (Type-Length-Value):** The technical format used by Keysend to package rich, structured metadata (like the Boostagram message, sender ID, etc.) and securely send it _inside_ the Lightning Onion payment.