mirror of
https://github.com/lnbook/lnbook
synced 2024-11-01 03:20:53 +00:00
fix broken refs 3
This commit is contained in:
parent
b5e380132d
commit
b84990da34
@ -107,7 +107,8 @@ Payment channels have a few very interesting and useful properties:
|
||||
|
||||
* Payments made in a payment channel are only known to you and your partner. In that sense, you gain privacy compared to Bitcoin, where every transaction is public. Only the final balance, which is the aggregate of all payments in that channel, will become visible on the Bitcoin blockchain.
|
||||
|
||||
Bitcoin was about five years old when talented developers first figured out how bi-directional, indefinite lifetime, routeable payment channels could be constructed and by now there are at least three different methods known.
|
||||
Bitcoin was about five years old when talented developers first figured out how bi-directional, indefinite lifetime, routable payment channels could be constructed and by now there are at least three different methods known.
|
||||
|
||||
This chapter will focus on the channel construction method first described in the https://lightning.network/lightning-network-paper.pdf[Lightning Network whitepaper] by Joseph Poon and Thaddeus Dryja in 2015. These are known as _Poon-Dryja_ channels, and are the channel construction method currently used in the Lightning Network.
|
||||
The other two proposed methods are _Duplex Micropayment_ channels, introduced by Christian Decker around the same time as the "Poon-Dryja" channels and _eltoo_ channels, introduced in https://blockstream.com/eltoo.pdf[eltoo: A Simple Layer2 Protocol for Bitcoin] by Christian Decker, Rusty Russel and (author of this book) Olaoluwa Osuntokun in 2018.
|
||||
|
||||
|
@ -140,6 +140,7 @@ For example, the Raspberry Pi 4 cannot benefit from them because of the limited
|
||||
|
||||
To choose the size, let's look at the Bitcoin blockchain. As of August 2021, its size is 360GB including the transaction index and grows by roughly 60GB/year. If you want to have some margin available for future growth or to install other data on your node, purchase at least a 512GB drive or better yet a 1TB drive.
|
||||
|
||||
[[helpers]]
|
||||
=== Using an installer or helper
|
||||
|
||||
Installing a Lightning node or a Bitcoin node may be daunting if you are not familiar with a command line environment. Luckily, there are a number of projects that make "helpers", i.e. software that installs and configures the various components for you. You will still need to learn some command line incantations to interact with your node, but most of the initial work is done for you.
|
||||
@ -620,7 +621,7 @@ Keep in mind that this technique does not move funds into cold storage. Both Lig
|
||||
|
||||
===== Submarine swap sweep
|
||||
|
||||
Another way to reduce your Lightning hot-wallet balance is to use a technique called a _submarine swap_. Submarine swaps, conceptualized by co-author Olaoluwa Osuntokun and Alex Bosworth, allow the exchange of on-chain bitcoin for Lightning payments and vice versa.
|
||||
Another way to reduce your Lightning hot-wallet balance is to use a technique called a _submarine swap_. Submarine swaps, conceptualized by co-author Olaoluwa Osuntokun and Alex Bosworth, allow the exchange of on-chain bitcoin for Lightning payments and vice versa. Essentially, submarine swaps are atomic swaps between Lightning off-chain funds and Bitcoin on-chain funds.
|
||||
|
||||
A node operator can initiate a submarine swap and send all available channel balances to the other party who will send them as a result on-chain bitcoin in exchange.
|
||||
|
||||
@ -628,7 +629,7 @@ In the future, this could be a paid service offered by nodes on the Lightning Ne
|
||||
|
||||
The advantage of a submarine swap for sweeping funds is that no channel needs to be closed. That means that we preserve our channels, only re-balancing our channels through this operation. As we send a Lightning payment out, we shift some balance from local to remote on one or more of our channels. Not only does that reduce the balance exposed in our node's hot wallet, it also increases the balance available for future incoming payments.
|
||||
|
||||
You could do this by trusting an intermediary to act as a gateway, but this risks your coins being stolen. But in the case of a submarine swap, the operation does not require trust. Submarine swaps are non-custodial _atomic_ operations. That means that the counterparty in your submarine swap cannot steal your funds because the on-chain payment depends on the completion of the off-chain payment and vice-versa. We will discuss submarine swaps in more detail in <<submarine_swaps>>.
|
||||
You could do this by trusting an intermediary to act as a gateway, but this risks your coins being stolen. But in the case of a submarine swap, the operation does not require trust. Submarine swaps are non-custodial _atomic_ operations. That means that the counterparty in your submarine swap cannot steal your funds because the on-chain payment depends on the completion of the off-chain payment and vice-versa.
|
||||
|
||||
===== Submarine swaps with Loop
|
||||
|
||||
@ -697,6 +698,7 @@ https://lightning.watch
|
||||
|
||||
Over time, we expect more third-party services to provide specialized Lightning node monitoring payable via micro-payments. Perhaps such services and their APIs will become standardized and will one day be directly supported by Lightning node software.
|
||||
|
||||
[[watchtowers]]
|
||||
==== Watchtowers
|
||||
|
||||
_Watchtowers_ are a mechanism for outsourcing the monitoring and penalty resolution of Lightning protocol violations.
|
||||
@ -772,6 +774,7 @@ One way to find well connected nodes is to open a channel to a popular merchant
|
||||
|
||||
Another way to find well-connected nodes is to use a Lightning Explorer (see <<ln_explorer>>) such as +1ml.com+ and browse the list of nodes sorted by channel capacity and number of channels. Don't go for the biggest nodes as that encourages centralization. Go for a node in the middle of the list so that you can help them grow. Another factor to consider might be the time span a node has been in operation. Nodes established for more than a year are likely to be more reputable and less risky than nodes that started operation a week ago.
|
||||
|
||||
[[autopilot]]
|
||||
===== Autopilot
|
||||
|
||||
The task of opening channels can be partially automated with the use of an _autopilot_, which is software that opens channels automatically based on some heuristic rules. Autopilot software is still relatively new and it doesn't always select the best channel partners for you. Especially in the beginning, it might be better to open channels manually.
|
||||
@ -901,6 +904,7 @@ Some examples:
|
||||
* Your channel partner is online, but is not responding to requests to initiate a mutual close.
|
||||
* Your channel partner is online and your nodes are negotiating a mutual close, but they become stuck and cannot reach a resolution.
|
||||
|
||||
[[channel_rebalancing]]
|
||||
==== Re-balancing channels
|
||||
|
||||
In the course of transacting and routing payments on Lightning, the combination of inbound and outbound capacities can become unbalanced.
|
||||
@ -911,7 +915,7 @@ There are many ways to re-balance channels, each with different advantages and d
|
||||
|
||||
A third way to re-balance channels is to purposefully create a _circular route_ that sends a payment from your node back to your node, via the Lightning Network. By sending a payment out on a channel with large local capacity and arranging the path so that it returns to your node on a channel with large remote capacity, both of those channels will become more balanced. An example of a circular route re-balancing strategy can be seen in <<circular-rebalancing>>.
|
||||
|
||||
[[circular-rebalancing]]
|
||||
[[circular_rebalancing]]
|
||||
.Circular route re-balancing
|
||||
image::images/circular-rebalancing.png[]
|
||||
|
||||
@ -978,7 +982,7 @@ Lightning Labs, the makers of LND, provide a web-based graphical user interface
|
||||
|
||||
https://github.com/lightninglabs/lndmon
|
||||
|
||||
=== ThunderHub
|
||||
==== ThunderHub
|
||||
|
||||
A very aesthetically pleasing web-based graphical user interface similar to RTL but exclusive to LND. It can be used to make payments, rebalance channels and manage the node through a variety of features. Find +ThunderHub+ here:
|
||||
|
||||
|
@ -441,7 +441,7 @@ If more than one commitment transaction are broadcast, there are many factors th
|
||||
|
||||
Let's look more carefully at the commitment transactions in <<competing_commitments_1>>. All four commitment transactions are signed and valid. But only the last one accurately reflects the most recent channel balances. In this particular scenario, Alice has an opportunity to cheat, by broadcasting an older commitment and getting it confirmed on the Bitcoin blockchain. Let's say Alice transmits Commitment #0 and gets it confirmed: she will effectively close the channel and take all 140,000 satoshis herself. In fact, in this particular example any commitment but #3 improves Alice's position and allows her to "cancel" at least part of the payments reflected in the channel.
|
||||
|
||||
In the next section we will see how the Lightning Network resolves this problem - preventing older commitment transactions from being used by the channel partners by a mechanism of revocation and penalties. There are other ways to prevent the transmission of older commitment transactions but they require an upgrade to Bitcoin called _input rebinding_. We discuss this in more detail in <<eltoo>>.
|
||||
In the next section we will see how the Lightning Network resolves this problem - preventing older commitment transactions from being used by the channel partners by a mechanism of revocation and penalties. There are other ways to prevent the transmission of older commitment transactions, such as _eltoo channels_ but they require an upgrade to Bitcoin called _input rebinding_.
|
||||
|
||||
==== Revoking old commitment transactions
|
||||
|
||||
|
@ -275,7 +275,7 @@ An optional, additional property, is the ability to split payments into multiple
|
||||
|
||||
Bitcoin Script is flexible enough that there are dozens of ways to implement a fairness protocol that has the properties of atomicity, trustless operation and multihop security. Choosing a specific implementation is dependent on certain tradeoffs between privacy, efficiency and complexity.
|
||||
|
||||
The fairness protocol for routing used in the Lightning Network today is called a Hash Time-Locked Contract (HTLC). HTLCs use a hash pre-image as the secret that unlocks a payment, as we saw in the gold coin example in this chapter. The recipient of a payment generates a random secret number and calculates its hash. The hash becomes the condition of payment and once the secret is revealed, all the participants can redeem their incoming payments. HTLCs offer atomicity, trustless operation and multihop security. While HTLCs are efficient and very simple, they involve a small compromise of privacy (see <<htlc_privacy_compromise>>).
|
||||
The fairness protocol for routing used in the Lightning Network today is called a Hash Time-Locked Contract (HTLC). HTLCs use a hash pre-image as the secret that unlocks a payment, as we saw in the gold coin example in this chapter. The recipient of a payment generates a random secret number and calculates its hash. The hash becomes the condition of payment and once the secret is revealed, all the participants can redeem their incoming payments. HTLCs offer atomicity, trustless operation and multihop security.
|
||||
|
||||
Another proposed mechanism for implementing routing is a _Point Time-Locked Contract (PTLC)_. PTLCs also achieve atomicity, trustless operation and multihop security, but do so with increased efficiency and better privacy. Efficient implementation of PTLCs depends on a new digital signature algorithm called _Schnorr signatures_, which is expected to be activated in Bitcoin in 2021.
|
||||
|
||||
@ -314,6 +314,7 @@ The mere fact that any transaction can be taken on-chain at any time is precisel
|
||||
|
||||
In all the examples that follow, we will assume that any of these transactions can be made on-chain at any time. The participants will choose to keep them off-chain, but there is no difference in the functionality of the system other than the higher fees and delay imposed by on-chain mining of the transactions. The example works the same if all the transactions are on-chain or off-chain.
|
||||
|
||||
[[htlcs]]
|
||||
=== Hash Time Locked Contracts (HTLCs)
|
||||
|
||||
In this section we explain how Hash Time Locked Contracts (HTLCs) work.
|
||||
|
@ -240,6 +240,7 @@ interpretation requirements are also defined based on the _arity_ of a given `ty
|
||||
chapter once we describe how the Lighting Protocol is upgraded in practice and
|
||||
in theory.
|
||||
|
||||
[[feature_bits]]
|
||||
=== Feature Bits & Protocol Extensibility
|
||||
|
||||
As the Lighting Network is a decentralized system, no single entity can enforce a
|
||||
@ -413,4 +414,4 @@ bumped via Bitcoin's Child-Pays-For-Parent (CPFP) fee management mechanism.
|
||||
|
||||
=== Conclusion
|
||||
|
||||
Lightning's wire protocol is incredibly flexible and allows for rapid innovation and interoperability without strict consensus. It is one of the reasons that the Lightning Network is experiencing much faster development and is attractive to many developers, who might otherwise find Bitcoin's development style too conservative and slow.
|
||||
Lightning's wire protocol is incredibly flexible and allows for rapid innovation and interoperability without strict consensus. It is one of the reasons that the Lightning Network is experiencing much faster development and is attractive to many developers, who might otherwise find Bitcoin's development style too conservative and slow.
|
||||
|
@ -47,14 +47,13 @@ the payment pre-image is for practical purposes a nonce (number only used
|
||||
once). If the sender attempts to make another payment using that identical
|
||||
payment hash, then they risk losing funds, as the payment may not actually be
|
||||
delivered to the destination. It's safe to assume that after a pre-image has
|
||||
been reveled, all nodes in the path will keep it around _forever_, then rather
|
||||
been reveled, all nodes in the path will keep it around forever, then rather
|
||||
than forward the HTLC in order to collect a routing fee if the payment is
|
||||
completed, they can simply _settle_ the payment at that instance and gain the
|
||||
completed, they can simply settle the payment at that instance and gain the
|
||||
entire payment amount in return. As a result, it's unsafe to ever use a payment
|
||||
request more than once.
|
||||
|
||||
New variants of the original
|
||||
Lightning Payment request exist that allow the sender to reuse them as many times as they want. These variants flip the normal payment flow as the sender transmits a pre-image within the encrypted onion payload to the receiver, who is the only
|
||||
New variants of the original Lightning Payment request exist that allow the sender to reuse them as many times as they want. These variants flip the normal payment flow as the sender transmits a pre-image within the encrypted onion payload to the receiver, who is the only
|
||||
one that is able to decrypt it and settle the payment. Alternatively, assuming
|
||||
a mechanism that allows a sender to typically request a new payment request
|
||||
from the receiver, then an interactive protocol can be used in order to allow a
|
||||
|
@ -563,7 +563,7 @@ network.
|
||||
|
||||
The series of signatures and public keys in the message serves to create a
|
||||
_proof_ that the channel actually exists within the base Bitcoin blockchain. As
|
||||
we detail in <<sid>>, each channel is uniquely identified by a locator
|
||||
we detail in <<scid>>, each channel is uniquely identified by a locator
|
||||
that encodes it's _location_ within the blockchain. This locator is called this
|
||||
`short_channel_id` and can fit into a 64-bit integer.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user