Skip to content

Commit f295dc9

Browse files
committed
Address comments
Added faqs with fees explainer, regtest section from Oli's PR, and several other tweaks
1 parent f25bdd4 commit f295dc9

File tree

2 files changed

+96
-22
lines changed

2 files changed

+96
-22
lines changed

README.md

Lines changed: 35 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ bitcoin into and out of the Lightning Network.
1111

1212
## Use Cases
1313
- Automate channel balancing with AutoLoop ([Learn more](https://github.com/lightninglabs/loop/blob/master/docs/autoloop.md))
14-
- Deposit to a Bitcoin address without closing channels
15-
- Convert outbound liquidity into inbound liquidity
16-
- Refill depleted Lightning channels
14+
- Deposit to a Bitcoin address without closing channels with Loop In
15+
- Convert outbound liquidity into inbound liquidity with Loop Out
16+
- Refill depleted Lightning channels with Loop In
1717

1818
## Installation
1919
Download the latest binaries from the [releases](https://github.com/lightninglabs/loop/releases) page.
@@ -25,26 +25,14 @@ The Loop client needs its own short-lived daemon to facilitate swaps. To start `
2525
loopd
2626
```
2727

28-
To use Loop in testnet, simply pass the network flag:
29-
```
30-
loopd --network=testnet
31-
```
32-
3328
By default `loopd` attempts to connect to the `lnd` instance running on
3429
`localhost:10009` and reads the macaroon and tls certificate from `~/.lnd`.
3530
This can be altered using command line flags. See `loopd --help`.
3631

37-
## LND
38-
Note that Loop requires `lnd` to be built with **all of its subservers**. Download the latest [official release binary](https://github.com/lightningnetwork/lnd/releases/latest) or build `lnd` from source by following the [installation instructions](https://github.com/lightningnetwork/lnd/blob/master/docs/INSTALL.md). If you choose to build `lnd` from source, use the following command to enable all the relevant subservers:
39-
40-
```
41-
make install tags="signrpc walletrpc chainrpc invoicesrpc"
42-
```
43-
4432
## Usage
4533

4634
### AutoLoop
47-
AutoLoop makes it easy to keep your channels balanced. Checkout our [autoloop documentation](https://github.com/lightninglabs/loop/blob/master/docs/autoloop.md) for details.
35+
AutoLoop makes it easy to keep your channels balanced. Checkout our [autoloop documentation](https://docs.lightning.engineering/advanced-best-practices/advanced-best-practices-overview/autoloop) for details.
4836

4937
### Loop Out
5038
Use Loop Out to move bitcoins on Lightning into an on-chain Bitcoin address.
@@ -69,6 +57,37 @@ To execute a Loop In:
6957
loop in <amt_in_satoshis>
7058
```
7159

60+
### More info
61+
For more information about using Loop checkout our [Loop FAQs](./docs/faqs.md).
62+
63+
## Development
64+
65+
### Regtest
66+
To get started with local development against a stripped down dummy Loop server
67+
running in a local `regtest` Bitcoin network, take a look at the
68+
[`regtest` server environment example documentation](./regtest/README.md).
69+
70+
### Testnet
71+
To use Loop in testnet, simply pass the network flag:
72+
```
73+
loopd --network=testnet
74+
```
75+
76+
### Submit feature requests
77+
The [GitHub issue tracker](https://github.com/lightninglabs/loop/issues) can be
78+
used to request specific improvements or report bugs.
79+
80+
### Join us on Slack
81+
Join us on the
82+
[LND Slack](https://lightning.engineering/slack.html) and join the #loop
83+
channel to ask questions and interact with the community.
84+
85+
## LND
86+
Note that Loop requires `lnd` to be built with **all of its subservers**. Download the latest [official release binary](https://github.com/lightningnetwork/lnd/releases/latest) or build `lnd` from source by following the [installation instructions](https://github.com/lightningnetwork/lnd/blob/master/docs/INSTALL.md). If you choose to build `lnd` from source, use the following command to enable all the relevant subservers:
87+
88+
```
89+
make install tags="signrpc walletrpc chainrpc invoicesrpc"
90+
```
7291

7392
## API
7493
The Loop daemon exposes a [gRPC API](https://lightning.engineering/loopapi/#lightning-loop-grpc-api-reference)
@@ -99,9 +118,3 @@ git clone https://github.com/lightninglabs/loop.git
99118
cd loop/cmd
100119
go install ./...
101120
```
102-
103-
## Development and Support
104-
The [GitHub issue tracker](https://github.com/lightninglabs/loop/issues) can be
105-
used to request specific improvements or register and get help with any
106-
problems. Community support is also available in the
107-
[LND Slack](https://lightning.engineering/slack.html).

docs/faqs.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
2+
# Frequently Asked Questions
3+
4+
## How does Loop recover from a crash?
5+
When `loopd` is terminated (or killed) for whatever reason, it will pickup
6+
pending swaps after a restart.
7+
8+
Information about pending swaps is stored persistently in the swap database.
9+
Its location is `~/.loopd/<network>/loop.db`.
10+
11+
## Can Loop handle multiple simultaneous swaps?
12+
It is possible to execute multiple swaps simultaneously. Just keep loopd
13+
running.
14+
15+
## What are the fees?
16+
17+
You can pass the `--verbose` flag when using Loop to get a detailed fee
18+
breakdown
19+
20+
### Loop Out Fees
21+
22+
An explanation of each fee:
23+
24+
- **Estimated on-chain fee**: The estimated cost to sweep the
25+
HTLC in case of success, calculated based on the _current_ on-chain fees.
26+
This value is called `miner_fee` in the gRPC/REST responses.
27+
- **Max on-chain fee**: The maximum on-chain fee the daemon
28+
is going to allow for sweeping the HTLC in case of success. A fee estimation
29+
based on the `--conf_target` flag is always performed before sweeping. The
30+
factor of `100` times the estimated fee is applied in case the fees spike
31+
between the time the swap is initiated and the time the HTLC can be swept. But
32+
that is the absolute worst-case fee that will be paid. If there is no fee
33+
spike, a normal, much lower fee will be used.
34+
- **Max off-chain swap routing fee**: The maximum off-chain
35+
routing fee that the daemon should pay when finding a route to pay the
36+
Lightning invoice. This is a hard limit. If no route with a lower or equal fee
37+
is found, the payment (and the swap) is aborted. This value is calculated
38+
statically based on the swap amount (see `maxRoutingFeeBase` and
39+
`maxRoutingFeeRate` in `cmd/loop/main.go`).
40+
- **Max off-chain prepay routing fee**: The maximum off-chain routing
41+
fee that the daemon should pay when finding a route to pay the prepay fee.
42+
This is a hard limit. If no route with a lower or equal fee is found, the
43+
payment (and the swap) is aborted. This value is calculated statically based
44+
on the prepay amount (see `maxRoutingFeeBase` and `maxRoutingFeeRate` in
45+
`cmd/loop/main.go`).
46+
- **No show penalty (prepay)**: This is the amount that has to be
47+
pre-paid (off-chain) before the server publishes the HTLC on-chain. This is
48+
necessary to ensure the server's on-chain fees are paid if the client aborts
49+
and never completes the swap _after_ the HTLC has been published on-chain.
50+
If the swap completes normally, this amount is counted towards the full swap
51+
amount and therefore is actually a pre-payment and not a fee. This value is
52+
called `prepay_amt` in the gRPC/REST responses.
53+
54+
### Loop In Fees
55+
56+
An explanation of each fee:
57+
58+
- **Estimated on-chain fee**: The estimated on-chain fee that the
59+
daemon has to pay to publish the HTLC. This is an estimation from `lnd`'s
60+
wallet based on the available UTXOs and current network fees. This value is
61+
called `miner_fee` in the gRPC/REST responses.

0 commit comments

Comments
 (0)