Skip to content

Commit 6bfa128

Browse files
Leo Weesegitbook-bot
Leo Weese
authored andcommitted
GITBOOK-338: change request with no subject merged in GitBook
1 parent 7ec97c7 commit 6bfa128

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

Diff for: lightning-network-tools/loop/the-loop-cli.md

+15-5
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Understand fees in Lightning Loop and get the most out of it
44

55
# The Loop CLI
66

7-
## Using Loop <a href="docs-internal-guid-0588c9ab-7fff-a9c6-0c68-1ad299980217" id="docs-internal-guid-0588c9ab-7fff-a9c6-0c68-1ad299980217"></a>
7+
## Using Loop <a href="#docs-internal-guid-0588c9ab-7fff-a9c6-0c68-1ad299980217" id="docs-internal-guid-0588c9ab-7fff-a9c6-0c68-1ad299980217"></a>
88

99
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`
1010

@@ -14,6 +14,8 @@ We can start by requesting the latest Loop terms. The command `loop terms` shoul
1414

1515
You can also use the command `loop getparams` to see current fees, prepaid amounts and [autoloop](autoloop.md) settings.
1616

17+
18+
1719
### Loop In fees
1820

1921
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_
3032

3133
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`.
3234

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.
3436

3537
`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.
3739

3840
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.
3941

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+
4048
### Loop Out
4149

4250
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.
4351

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-
4652
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.
4753

4854
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
8288

8389
We received 993,198 satoshi in our on-chain address.
8490

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+
8595
## Use parameters as a frequent user
8696

8797
We can set various parameters for our swaps with the command loop `setparams <options>`

0 commit comments

Comments
 (0)