You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: lightning-network-tools/loop/the-loop-cli.md
+15-5
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ description: Understand fees in Lightning Loop and get the most out of it
4
4
5
5
# The Loop CLI
6
6
7
-
## Using Loop <ahref="docs-internal-guid-0588c9ab-7fff-a9c6-0c68-1ad299980217"id="docs-internal-guid-0588c9ab-7fff-a9c6-0c68-1ad299980217"></a>
7
+
## Using Loop <ahref="#docs-internal-guid-0588c9ab-7fff-a9c6-0c68-1ad299980217"id="docs-internal-guid-0588c9ab-7fff-a9c6-0c68-1ad299980217"></a>
8
8
9
9
As soon as Loop is running, you will be able to make use of the CLI. Depending on your installation, you will be able to run it simply by typing loop into your console, or navigate to where the binaries are stored and execute with `./loop`
10
10
@@ -14,6 +14,8 @@ We can start by requesting the latest Loop terms. The command `loop terms` shoul
14
14
15
15
You can also use the command `loop getparams` to see current fees, prepaid amounts and [autoloop](autoloop.md) settings.
16
16
17
+
18
+
17
19
### Loop In fees
18
20
19
21
We can also use the command `loop quote in 500000` to get a more precise quote for how much a swap would cost. For Loop In, we are making an on-chain transaction, for which we will have to pay the on-chain transaction fees. If we have enough satoshis in our on-chain LND wallet, Loop can give us a good estimate of these transaction fees as well. Either way, we can Loop In from our internal or external Bitcoin wallet.
@@ -30,19 +32,23 @@ The cost of sweeping the smart contract is quoted in satoshi as `htlc_sweep_fee_
30
32
31
33
You can customize the command `loop in <amount in satoshis>`. For example, you could specify the channel that the Lightning payment should arrive in using the `--last_hop` parameter. The last hop is identified by the public key of a node. Make sure that you have an active channel with this node and plenty of incoming capacity. You can also specify a label with `--label`.
32
34
33
-
If you are making the on-chain transaction from an external wallet, make sure to use the `--external` flag. You may set the transaction fees separately there too, or use the `--conf_target` value to a higher number for lower fees and longer processing times.
35
+
You may set the transaction fees separately using this command, or use the `--conf_target` value to a higher number for lower fees and longer processing times.
34
36
35
37
`loop in --last_hop 02e7a7d3c1e6055b7b7457d95e04d9bbd24f200fd4a58daca7beee7bc776e17440 --amt 295916`\
36
-
Once you run the command, you are quoted the upper bound of the fees for this transaction. Loop will now obtain a LSAT for 1 satoshi and initiate the swap. You are then presented with an ID for the swap and two HTLC smart contract addresses. You may make your on-chain transaction to either of these two addresses, though P2WSH (starting with bc1) is recommended for maximum efficiency. The payment needs to be the exact amount and carry an appropriate transaction fee. There is no time limit with regard to when the on-chain payment has to confirm, but keep in mind that if you specify a channel into which the off-chain funds are to be deposited, the state of that channel might change over the next day or two.
38
+
Once you run the command, you are quoted the upper bound of the fees for this transaction. Loop will now obtain a LSAT for 1 satoshi and initiate the swap.
37
39
38
40
You can monitor the status of your Loop In with the command loop monitor. It will give you updates about your transaction. As soon as your on-chain transaction has one confirmation on the Blockchain, you should receive your off-chain transaction into the channel you specified.
39
41
42
+
### External Loop In
43
+
44
+
You can fund your Loop In with funds from any external wallet using the command line interface using the `--external` flag.
45
+
46
+
Once you execute the `loop in` command, you are presented with two HTLC smart contract addresses in addition to the swap ID. You may make your on-chain transaction to either of these two addresses, though P2WSH (starting with bc1) is recommended for maximum efficiency. **The payment needs to be the exact amount and carry an appropriate transaction fee**. There is no time limit with regard to when the on-chain payment has to confirm, but keep in mind that if you specify a channel into which the off-chain funds are to be deposited, the state of that channel might change over the next day or two.
47
+
40
48
### Loop Out
41
49
42
50
The Loop Out command requires a minimum amount of satoshis, typically around 250,000 satoshis. This value may increase in times of high on-chain fees and can be obtained using the `loop terms` command. You can optionally also specify which channel you want to loop out of using the `--channel` flag together with the short channel ID.
43
51
44
-
By default, the on-chain transaction will arrive in your LND’s wallet. Alternatively, you can specify a Bitcoin address with the `--addr` flag.
45
-
46
52
The speed of your swap is highly influenced by your willingness to pay with regard to fees. You can influence these fees in various ways. If you specify the `--fast` flag, the Loop server will publish its on-chain transaction quickly, but at a higher fee.
47
53
48
54
Once this transaction is confirmed, you will need to sweep its address to your own wallet. This is usually done within 9 blocks, but can be done faster or slower by specifying the desired number of blocks with the `--conf_target` setting.
@@ -82,6 +88,10 @@ We will see two payments, first our 30,000 satoshi prepayment as specified in th
82
88
83
89
We received 993,198 satoshi in our on-chain address.
84
90
91
+
### External Loop Out
92
+
93
+
By default, the on-chain transaction will arrive in your LND’s wallet. Alternatively, you can specify the Bitcoin address of any external wallet with the `--addr` flag.
94
+
85
95
## Use parameters as a frequent user
86
96
87
97
We can set various parameters for our swaps with the command loop `setparams <options>`
0 commit comments