{
  "$schema": "https://degreesofsatoshi.com/encyclopedia/schemas/article-v1.json",
  "schemaVersion": "1.0.0",
  "id": "lightning-submarine-swaps",
  "canonical": "https://degreesofsatoshi.com/encyclopedia/lightning-submarine-swaps/",
  "collection": "bitcoin",
  "title": "Lightning submarine swaps: moving between channels and on-chain funds",
  "description": "Understand how submarine swaps move between on-chain and Lightning balances, including fees, timeouts and refund work.",
  "aliases": [
    "lightning submarine swap loop",
    "lightning submarine swap loop explained"
  ],
  "dates": {
    "published": "2026-10-02",
    "modified": "2026-10-02",
    "verified": "2026-10-02T19:29:20.637Z",
    "dataAsOf": "2026-10-02"
  },
  "authorship": {
    "publisher": "Degrees of Satoshi editorial project",
    "process": "AI-assisted research and drafting with a separate automated source-verification pass; no external expert or named human review is implied."
  },
  "quickAnswer": {
    "text": "A submarine swap exchanges an on-chain Bitcoin payment for a Lightning payment, or the reverse, using linked conditions. The same secret connects the two sides, while a timeout provides a recovery path if the swap fails. This can move liquidity without closing a channel. The design reduces a particular risk of one side taking both payments, but it does not remove fees, time-sensitive actions, software assumptions or the possibility of delayed recovery.",
    "claimId": "lightning-submarine-swaps-quick-answer",
    "sourceIds": [
      "x425-btc-ln-swaps",
      "x425-btc-ln-loop-fees"
    ]
  },
  "keyFacts": [
    {
      "label": "Connection",
      "value": "Linked hash and time conditions",
      "sourceIds": [
        "x425-btc-ln-swaps"
      ],
      "id": "connection",
      "claimId": "lightning-submarine-swaps-fact-connection"
    },
    {
      "label": "Uses",
      "value": "Rebalance between on-chain and Lightning funds",
      "sourceIds": [
        "x425-btc-ln-swaps"
      ],
      "id": "uses",
      "claimId": "lightning-submarine-swaps-fact-uses"
    },
    {
      "label": "Costs",
      "value": "Can include service, routing and miner fees",
      "sourceIds": [
        "x425-btc-ln-loop-fees"
      ],
      "id": "costs",
      "claimId": "lightning-submarine-swaps-fact-costs"
    }
  ],
  "prerequisites": [
    "lightning-inbound-liquidity",
    "bitcoin-timelocks"
  ],
  "sections": [
    {
      "id": "mechanism",
      "heading": "The same secret links two payments",
      "sourceIds": [
        "x425-btc-ln-swaps"
      ],
      "paragraphs": [
        "In the documented flow, an on-chain contract can be claimed by the intended party with a valid signature and the required secret. The Lightning payment reveals that secret when it settles. If the swap fails, the contract’s timeout permits the designated refund path.",
        "The parties must verify the amounts, conditions and deadlines before committing funds. A timeout is a spending condition, not a promise that a service will refund an account at an exact wall-clock moment."
      ]
    },
    {
      "id": "example",
      "heading": "Add every fee category before comparing quotes",
      "sourceIds": [
        "x425-btc-ln-loop-fees"
      ],
      "paragraphs": [
        "Imagine a swap that delivers 100,000 satoshis to the destination and separately charges 500 for service, 100 for routing and 800 for the on-chain claim. Under that stated fee arrangement, the total cost is 1,400 satoshis and the sender’s total outlay is 101,400.",
        "A real service may deduct fees from the stated amount or bundle some categories. Inspect whether the displayed number is the amount sent, the amount received or an estimate. These figures are illustrative, not a current Loop quote."
      ]
    },
    {
      "id": "failure",
      "heading": "A failed swap can still leave a transaction fee",
      "sourceIds": [
        "x425-btc-ln-swaps",
        "x425-btc-ln-loop-fees"
      ],
      "paragraphs": [
        "After an on-chain funding transaction confirms, recovering through a timeout path can require another transaction. Funds may be temporarily locked, and the recovery transaction costs a fee. Some arrangements also include an upfront charge.",
        "Check how the wallet preserves recovery information and monitors deadlines. The swap’s atomic design addresses the exchange conditions; it is not a guarantee against bugs, incorrect parameters or missed claim opportunities."
      ]
    }
  ],
  "faq": [
    {
      "question": "Do submarine swaps create additional bitcoin?",
      "answer": "No. They exchange control of existing on-chain and Lightning balances under linked conditions. The service may charge fees for making that exchange.",
      "sourceIds": [
        "x425-btc-ln-swaps",
        "x425-btc-ln-loop-fees"
      ]
    },
    {
      "question": "Does a failed swap always cost nothing?",
      "answer": "No. Funding and recovery transactions can pay miner fees, and the agreed service terms may include an upfront charge. Review the failure path as well as the success quote.",
      "sourceIds": [
        "x425-btc-ln-swaps",
        "x425-btc-ln-loop-fees"
      ]
    }
  ],
  "claims": [
    {
      "id": "lightning-submarine-swaps-quick-answer",
      "articleSlug": "lightning-submarine-swaps",
      "statement": "A submarine swap exchanges an on-chain Bitcoin payment for a Lightning payment, or the reverse, using linked conditions. The same secret connects the two sides, while a timeout provides a recovery path if the swap fails. This can move liquidity without closing a channel. The design reduces a particular risk of one side taking both payments, but it does not remove fees, time-sensitive actions, software assumptions or the possibility of delayed recovery.",
      "sourceIds": [
        "source-948a23bc4bb5421b",
        "source-70a948d7dc6576e3"
      ],
      "sourceLocators": [
        {
          "sourceId": "source-948a23bc4bb5421b",
          "locator": "Three steps of a Submarine swap; 1. Generate a bitcoin smart contract; 2. Generate and pay a Lightning invoice; 3. Claim bitcoin from the smart contract"
        },
        {
          "sourceId": "source-70a948d7dc6576e3",
          "locator": "Loop Out: Estimated fees, Actual fees; Loop In: Estimated fees, Actual fees"
        }
      ],
      "scope": {
        "collection": "bitcoin",
        "dataAsOf": "2026-10-02",
        "blockHeight": null
      },
      "qualification": "Educational explanation. Product-specific behavior is scoped to the cited documentation, checked 2026-10-02.",
      "evidenceStatus": "documented",
      "verification": {
        "status": "verified",
        "method": "independent automated source review",
        "checkedAt": "2026-10-02T19:29:20.637Z",
        "reviewer": "Independent automated verification — Codex /root/verify_ethereum_100, separate from the Bitcoin drafting agent",
        "notes": [
          "Read submarine swap contract flow and Loop success/failure fee categories.1,400sat fees and101,400sat total are correct under explicitly separate charges. Timeout recovery is a spend path requiring monitoring and possible further fees, not an automatic exact-time refund."
        ]
      }
    },
    {
      "id": "lightning-submarine-swaps-fact-connection",
      "articleSlug": "lightning-submarine-swaps",
      "statement": "Connection: Linked hash and time conditions",
      "sourceIds": [
        "source-948a23bc4bb5421b"
      ],
      "sourceLocators": [
        {
          "sourceId": "source-948a23bc4bb5421b",
          "locator": "Three steps of a Submarine swap; 1. Generate a bitcoin smart contract; 2. Generate and pay a Lightning invoice; 3. Claim bitcoin from the smart contract"
        }
      ],
      "scope": {
        "collection": "bitcoin",
        "dataAsOf": "2026-10-02",
        "blockHeight": null
      },
      "qualification": "",
      "evidenceStatus": "documented",
      "verification": {
        "status": "verified",
        "method": "independent automated source review",
        "checkedAt": "2026-10-02T19:29:20.637Z",
        "reviewer": "Independent automated verification — Codex /root/verify_ethereum_100, separate from the Bitcoin drafting agent",
        "notes": [
          "Read submarine swap contract flow and Loop success/failure fee categories.1,400sat fees and101,400sat total are correct under explicitly separate charges. Timeout recovery is a spend path requiring monitoring and possible further fees, not an automatic exact-time refund."
        ]
      }
    },
    {
      "id": "lightning-submarine-swaps-fact-uses",
      "articleSlug": "lightning-submarine-swaps",
      "statement": "Uses: Rebalance between on-chain and Lightning funds",
      "sourceIds": [
        "source-948a23bc4bb5421b"
      ],
      "sourceLocators": [
        {
          "sourceId": "source-948a23bc4bb5421b",
          "locator": "Three steps of a Submarine swap; 1. Generate a bitcoin smart contract; 2. Generate and pay a Lightning invoice; 3. Claim bitcoin from the smart contract"
        }
      ],
      "scope": {
        "collection": "bitcoin",
        "dataAsOf": "2026-10-02",
        "blockHeight": null
      },
      "qualification": "",
      "evidenceStatus": "documented",
      "verification": {
        "status": "verified",
        "method": "independent automated source review",
        "checkedAt": "2026-10-02T19:29:20.637Z",
        "reviewer": "Independent automated verification — Codex /root/verify_ethereum_100, separate from the Bitcoin drafting agent",
        "notes": [
          "Read submarine swap contract flow and Loop success/failure fee categories.1,400sat fees and101,400sat total are correct under explicitly separate charges. Timeout recovery is a spend path requiring monitoring and possible further fees, not an automatic exact-time refund."
        ]
      }
    },
    {
      "id": "lightning-submarine-swaps-fact-costs",
      "articleSlug": "lightning-submarine-swaps",
      "statement": "Costs: Can include service, routing and miner fees",
      "sourceIds": [
        "source-70a948d7dc6576e3"
      ],
      "sourceLocators": [
        {
          "sourceId": "source-70a948d7dc6576e3",
          "locator": "Loop Out: Estimated fees, Actual fees; Loop In: Estimated fees, Actual fees"
        }
      ],
      "scope": {
        "collection": "bitcoin",
        "dataAsOf": "2026-10-02",
        "blockHeight": null
      },
      "qualification": "",
      "evidenceStatus": "documented",
      "verification": {
        "status": "verified",
        "method": "independent automated source review",
        "checkedAt": "2026-10-02T19:29:20.637Z",
        "reviewer": "Independent automated verification — Codex /root/verify_ethereum_100, separate from the Bitcoin drafting agent",
        "notes": [
          "Read submarine swap contract flow and Loop success/failure fee categories.1,400sat fees and101,400sat total are correct under explicitly separate charges. Timeout recovery is a spend path requiring monitoring and possible further fees, not an automatic exact-time refund."
        ]
      }
    }
  ],
  "sources": [
    {
      "id": "x425-btc-ln-swaps",
      "label": "Understanding Submarine Swaps",
      "publisher": "Lightning Labs",
      "url": "https://raw.githubusercontent.com/lightninglabs/docs.lightning.engineering/0456e1627b2579ac18108cb921fe609f87c8b009/the-lightning-network/multihop-payments/understanding-submarine-swaps.md",
      "locator": "Three steps of a Submarine swap; 1. Generate a bitcoin smart contract; 2. Generate and pay a Lightning invoice; 3. Claim bitcoin from the smart contract",
      "note": "Conditional on-chain/off-chain swaps and timeout refund paths.",
      "version": "Pinned Lightning Labs documentation revision; LND/Loop implementation scope",
      "checkedAt": "2026-10-02T18:53:57.424Z",
      "contentSha256": "b2870689b29366aaa433533f1ef1245ea154f6b6b33a58da0899438d59e21e01",
      "recordId": "source-948a23bc4bb5421b"
    },
    {
      "id": "x425-btc-ln-loop-fees",
      "label": "Loop Fees",
      "publisher": "Lightning Labs",
      "url": "https://raw.githubusercontent.com/lightninglabs/docs.lightning.engineering/0456e1627b2579ac18108cb921fe609f87c8b009/lightning-network-tools/lightning-terminal/loop-fees.md",
      "locator": "Loop Out: Estimated fees, Actual fees; Loop In: Estimated fees, Actual fees",
      "note": "Service, chain and routing fees must be included when evaluating a swap.",
      "version": "Pinned Lightning Labs documentation revision; LND/Loop implementation scope",
      "checkedAt": "2026-10-02T18:53:57.455Z",
      "contentSha256": "fc5c3234433c163729fef92fe344ceec70b4bf56e7426befa2d14dba0fda8cb4",
      "recordId": "source-70a948d7dc6576e3"
    }
  ],
  "related": {
    "articles": [
      "lightning-inbound-liquidity",
      "bitcoin-timelocks",
      "lightning-payment-status",
      "lightning-bolt12-offers"
    ],
    "dossiers": [],
    "wallets": []
  },
  "revisionHistory": [
    {
      "date": "2026-10-02",
      "kind": "published",
      "summary": "First publication after primary-source research and separate automated verification."
    }
  ],
  "citation": "Degrees of Satoshi editorial project. “Lightning submarine swaps: moving between channels and on-chain funds.” Published 2026-10-02; updated 2026-10-02. https://degreesofsatoshi.com/encyclopedia/lightning-submarine-swaps/"
}
