> ## Documentation Index
> Fetch the complete documentation index at: https://docs.spark.money/llms.txt
> Use this file to discover all available pages before exploring further.

# Self-Custody Lightning

Lightning Network enables instant Bitcoin payments, but traditional Lightning wallets force a choice: run complex infrastructure or give up custody. Spark eliminates this tradeoff.

## The Lightning Custody Problem

Traditional Lightning has a UX problem:

### Option 1: Run Your Own Node

* Manage channels and liquidity
* Keep node online 24/7
* Handle routing and rebalancing
* Technical complexity deters most users

### Option 2: Custodial Wallet

* Easy to use
* **Someone else holds your Bitcoin**
* Counterparty risk
* Not your keys, not your coins

Most users choose custodial wallets because self-custody Lightning is too hard. This undermines Bitcoin's core value proposition.

## Spark: Self-Custody Lightning Without the Complexity

Spark gives you **true self-custody** with **native Lightning support**:

```typescript theme={null}
// Send a Lightning payment - you keep custody
const payment = await wallet.payLightningInvoice({
  invoice: "lnbc100n1p3..."
});

// Receive via Lightning - funds go to YOUR wallet
const invoice = await wallet.createLightningInvoice({
  amountSats: 10000,
  memo: "Payment for coffee"
});
```

No channels. No liquidity management. No node. Just Lightning payments where you control the keys.

## How It Works

### Sending Lightning Payments

When you pay a Lightning invoice from Spark:

1. Your Spark wallet signs the payment authorization
2. Spark Service Providers (SSPs) route the payment over Lightning
3. The recipient gets paid instantly
4. **Your keys never leave your device**

You pay a small routing fee (0.25% + network fees), but you maintain custody throughout.

### Receiving Lightning Payments

When someone pays your Lightning invoice:

1. SSPs receive the Lightning payment
2. Funds are credited to your Spark wallet
3. **You can unilaterally exit to L1 anytime**

The Bitcoin that arrives is real Bitcoin you control, not an IOU.

## Custody Comparison

| Aspect                      | Custodial Lightning | Self-Custody (Node) | Spark |
| --------------------------- | ------------------- | ------------------- | ----- |
| **Who holds keys?**         | Service provider    | You                 | You   |
| **Can they steal funds?**   | Yes                 | No                  | No    |
| **Channel management?**     | N/A                 | Required            | None  |
| **Liquidity requirements?** | N/A                 | Yes                 | None  |
| **Node uptime required?**   | N/A                 | Yes                 | No    |
| **Unilateral exit?**        | No                  | Yes                 | Yes   |

## Real Self-Custody Guarantees

What makes Spark Lightning truly self-custodial:

### 1. Your Keys, Your Bitcoin

Private keys are generated and stored on your device. Spark operators never have access to move your funds without your signature.

### 2. Unilateral Exit

If Spark operators disappear, go rogue, or refuse to cooperate, you can exit to Bitcoin L1 by broadcasting a pre-signed transaction. No one can stop you.

### 3. No Counterparty Risk

Unlike custodial Lightning, there's no single entity that can lose, steal, or freeze your funds. The system is designed to be trustless.

## Use Cases

### For Users

* **Daily payments**: Pay Lightning invoices without custody tradeoffs
* **Receive tips/payments**: Get paid in Lightning, keep self-custody
* **Store of value**: Hold Bitcoin with Lightning accessibility

### For Developers

* **Wallets**: Build self-custody wallets with Lightning out of the box
* **Payment apps**: Accept Lightning without custodial risk
* **Exchanges**: Offer Lightning deposits/withdrawals with better security

## Getting Started

### 1. Create a Wallet

```typescript theme={null}
import { SparkWallet } from "@buildonspark/spark-sdk";

const wallet = await SparkWallet.initialize({
  mnemonicOrSeed: "your twelve word mnemonic phrase here..."
});
```

### 2. Pay a Lightning Invoice

```typescript theme={null}
const result = await wallet.payLightningInvoice({
  invoice: "lnbc100n1p3..."
});

console.log(`Paid ${result.amountSats} sats, fee: ${result.feeSats}`);
```

### 3. Receive via Lightning

```typescript theme={null}
const invoice = await wallet.createLightningInvoice({
  amountSats: 50000,
  memo: "Self-custody Lightning payment"
});

console.log(`Share this invoice: ${invoice.bolt11}`);
```

## The Bottom Line

Lightning Network is powerful but historically required either technical complexity or custody compromise. Spark removes this tradeoff:

* **Keep your keys**: True self-custody, not custodial accounts
* **No infrastructure**: No node, no channels, no liquidity
* **Unilateral exit**: Always able to exit to L1 if needed
* **Simple SDK**: Lightning payments in a few lines of code

Self-custody Lightning is finally accessible to everyone.

***

## Learn More

* [Lightning Integration Guide](/wallets/deposit-from-lightning)
* [How Spark Works](/learn/tldr)
* [Self-Custody Guarantees](/learn/sovereignty)
* [Wallet SDK Reference](/api-reference/wallet-overview)
