Code Monkey home page Code Monkey logo

loop's Introduction

Lightning Loop

Lightning Loop is a non-custodial service offered by Lightning Labs that makes it easy to move bitcoin into and out of the Lightning Network.

Features

  • Automated channel balancing
  • Privacy-forward non-custodial swaps
  • Opportunistic transaction batching to save on fees
  • Progress monitoring of in-flight swaps

Use Cases

  • Automate channel balancing with AutoLoop (Learn more)
  • Deposit to a Bitcoin address without closing channels with Loop In
  • Convert outbound liquidity into inbound liquidity with Loop Out
  • Refill depleted Lightning channels with Loop In

Installation

Download the latest binaries from the releases page.

Execution

The Loop client needs its own short-lived daemon to facilitate swaps. To start loopd:

loopd

To use Loop in testnet, simply pass the network flag:

loopd --network=testnet

By default loopd attempts to connect to the lnd instance running on localhost:10009 and reads the macaroon and tls certificate from ~/.lnd. This can be altered using command line flags. See loopd --help.

Usage

AutoLoop

AutoLoop makes it easy to keep your channels balanced. Checkout our autoloop documentation for details.

Loop Out

Use Loop Out to move bitcoins on Lightning into an on-chain Bitcoin address.

To execute a Loop Out:

loop out <amt_in_satoshis>

Other notable options:

  • Use the --fast flag to swap immediately (Note: This opts-out of fee savings made possible by transaction batching)
  • Use the --channel flag to loop out on specific channels
  • Use the --addr flag to specify the address the looped out funds should be sent to (Note: By default funds are sent to the lnd wallet)

Run loop monitor to monitor the status of a swap.

Loop In

Use Loop In to convert on-chain bitcoin into spendable Lightning funds.

To execute a Loop In:

loop in <amt_in_satoshis>

More info

For more information about using Loop checkout our Loop FAQs.

Development

Regtest

To get started with local development against a stripped down dummy Loop server running in a local regtest Bitcoin network, take a look at the regtest server environment example documentation.

Testnet

To use Loop in testnet, simply pass the network flag:

loopd --network=testnet

Submit feature requests

The GitHub issue tracker can be used to request specific improvements or report bugs.

Join us on Slack

Join us on the LND Slack and join the #loop channel to ask questions and interact with the community.

LND

Note that Loop requires lnd to be built with all of its subservers. Download the latest official release binary or build lnd from source by following the installation instructions. If you choose to build lnd from source, use the following command to enable all the relevant subservers:

make install tags="signrpc walletrpc chainrpc invoicesrpc"

API

The Loop daemon exposes a gRPC API (defaults to port 11010) and a REST API (defaults to port 8081).

The gRPC and REST connections of loopd are encrypted with TLS and secured with macaroon authentication the same way lnd is.

If no custom loop directory is set then the TLS certificate is stored in ~/.loop/<network>/tls.cert and the base macaroon in ~/.loop/<network>/loop.macaroon.

The loop command will pick up these file automatically on mainnet if no custom loop directory is used. For other networks it should be sufficient to add the --network flag to tell the CLI in what sub directory to look for the files.

For more information on macaroons, see the macaroon documentation of lnd.

NOTE: Loop's macaroons are independent from lnd's. The same macaroon cannot be used for both loopd and lnd.

Build from source

If you’d prefer to build from source:

git clone https://github.com/lightninglabs/loop.git
cd loop/cmd
go install ./...

loop's People

Contributors

alexbosworth avatar arshbot avatar atomicinnovation321 avatar bhandras avatar bitbandi avatar carlakc avatar chengehe avatar conscott avatar dependabot[bot] avatar dstadulis avatar ellemouton avatar gcaracuel avatar georgetsagk avatar guggero avatar halseth avatar hieblmi avatar joostjager avatar justinpobrien avatar kixunil avatar krtk6160 avatar orbitalturtle avatar roasbeef avatar shuoer86 avatar sputn1ck avatar starius avatar tdickman avatar valentinewallace avatar wbobeirne avatar wpaulino avatar yyforyongyu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

loop's Issues

rpc error: code = DeadlineExceeded desc = context deadline exceeded

I'm working with a testnet node, loopd runs perfect but just for few minutes, after a while I just started to get this error on any rpc request.

rpc error: code = DeadlineExceeded desc = context deadline exceeded

If I restarted loopd it works fine again, but the error starts to show after a while.

I don't see anything else on the loopd output.

loopd commit e8005d0
lncli version 0.6.0-beta commit=v0.6-beta-rc4-7-gc0141a7bc1a9e6966d1eb273e0df527236cf44ad
Bitcoin Core RPC client version v0.17.1

CMD: loop parameter name

Background

On global options of loop command, I think the loopd parameter name is redundant and we can be more specific like in lncli command, this should be changed to rpcserver.

Expected behaviour

GLOBAL OPTIONS:
   --rpcserver value  loopd daemon address host:port (default: "localhost:11010")

Actual behaviour

GLOBAL OPTIONS:
   --loopd value  loopd daemon address host:port (default: "localhost:11010")

Your environment

  • loop commit 769c69e
  • Linux microbet 4.14.73-136 #1 SMP PREEMPT Mon Oct 1 03:21:48 UTC 2018 armv7l armv7l armv7l GNU/Linux

'x509: certificate signed by unknown authority' when running in Docker container

I'm trying to create a Dockerfile for loop/loopd. The Dockerfile itself is quite similar to the LND Dockerfile, but I'm having issues actually running loop.

I have the container running on my testnet server, connecting to my testnet LND node. This is what it outputs:

2019-04-15 16:17:31.277 [INF] LOOPD: Version: 0.1.0-alpha commit=
2019-04-15 16:17:31.278 [INF] LNDCLIENT: Creating lnd connection to lnd:10009
2019-04-15 16:17:31.281 [INF] LNDCLIENT: Connected to lnd
2019-04-15 16:17:31.520 [INF] LNDCLIENT: Using network testnet
2019-04-15 16:17:31.523 [INF] LOOPD: Starting gRPC listener
2019-04-15 16:17:31.526 [INF] LOOPD: Starting REST proxy listener
2019-04-15 16:17:31.534 [INF] LOOPD: Starting swap client
2019-04-15 16:17:31.534 [INF] LOOPD: Waiting for updates
2019-04-15 16:17:31.535 [INF] LOOPD: RPC server listening on [::]:11010
2019-04-15 16:17:31.535 [INF] LOOPD: REST proxy listening on 127.0.0.1:8081
2019-04-15 16:17:31.602 [INF] CLIENT: Connected to lnd node OpinionatedGeek Test ⚡ with pubkey 02639adf914ec9dfd8649c47de1d232de4a23b0719b1d8bd2bef9beb32f948018e
2019-04-15 16:17:31.602 [INF] CLIENT: Wait for first block ntfn
2019-04-15 16:17:31.606 [INF] CLIENT: Starting event loop at height 1489187

It looks to me like loopd is connecting to lnd properly.

But when I run loop in the container running loopd, I get the following error:

[loop] rpc error: code = Unavailable desc = all SubConns are in TransientFailure, latest connection error: connection error: desc = "transport: authentication handshake failed: x509: certificate signed by unknown authority"

I'm not even clear which component is the source of the error.

  • It looks to be loop connecting to loopd, but I didn't think that involved TLS at all. And even if it did use TLS, loop and loopd are both running in the same container.
  • loopd and lnd are on different containers so I can see how TLS problems could occur, but that connection seems to be working (as shown in the logs)

Is this a problem anyone else has come across?

Here's the current version of the Dockerfile:
Dockerfile.txt

Pay for inbound liquidity with on-chain funds

Issue
Currently, when you create a lightning wallet you have no inbound or outbound liquidity. This makes sending and receiving funds harder.

Proposed Solution
Create a feature where loop receives on-chain funds and then opens a channel to that user.

Refund for Failed Loop In

After spending time trying to gain enough inbound liquidity, with low enough fees, I think my loop in has finally timed out.

My loopd was also not running at certain points in time throughout the process. So some of the retry attempts might have been unable to work even if I had enough liquidity.

Current message in loop monitor is:
2019-11-05T02:26:17Z LOOP_IN FAILED 0.0025 BTC - 3MLLsyR9v1tE3UcYz7SZGgXg4dGn5kXxDX (cost: server 0, onchain 0, offchain 0)

Also with this swap I had used the --external flag, to see how it worked, even though I still paid with my LND wallet.

What are next steps for either completing the loop or receiving an on-chain refund? Is this supposed to be automatic?

Required miner fee exceeds max of x BTC

I did a loop out on testnet via gRPC, let me know if I'm doing something wrong.

  1. I did a loop quote with amt: 290001 and I get this response
{
  "swap_fee": "148",
  "prepay_amt": "304",
  "miner_fee": "138"
}
  1. I did a loop out sending this json
{
        amt: 290001,
        dest: req.body.address,
        max_swap_routing_fee: quote.data.swap_fee*1000,
        max_prepay_routing_fee: quote.data.prepay_amt*1000,
        max_prepay_amt: quote.data.prepay_amt,
        max_swap_fee: quote.data.swap_fee,
        max_miner_fee: quote.data.miner_fee
}

This is working all the time but now I get an error that calls my attention, this is loopd output

2019-04-25 11:58:41.637 [INF] LOOPD: Loop out request received
2019-04-25 11:58:41.637 [INF] CLIENT: LoopOut 0.00290001 BTC to tb1qre3f3upldf8u42t8ta9tn43zk28tdae4q8tf2c (channel: <nil>)
2019-04-25 11:58:41.646 [INF] CLIENT: Initiating swap request at height 1512244
2019-04-25 11:58:42.067 [INF] CLIENT: ce966f Htlc address: tb1q7p4glkhhcgyj57agcuxzv4q8k6rn8q89q7keuskl45ga266wfgdqmqk5jd
2019-04-25 11:58:42.072 [INF] CLIENT: ce966f state Initiated
2019-04-25 11:58:42.072 [INF] CLIENT: ce966f Sending swap payment lntb2898710n1pwvrjeppp5e6txlmh4vw95dpgttldrevz8t33av5dg5n5tuf9rpu4cx86wnm4qdq8wdmkzuqcqzryxq97zvuqnz44xh9efwcdr6ygwk5qyqt435juy6d08kpzedmsrnkck9j2uwt5malw0dhlpreu2f2qp0jzjtzrsdk6uj35dxzrv2jfn26pz46rzcspn8ezyu
2019-04-25 11:58:42.073 [INF] CLIENT: ce966f Sending prepayment lntb2540n1pwvrjeppp5yp7szqs8wd2w9fe7ktewauax2zh7vs4uxlzah73q7hst847kultqdq2wpex2urp0ycqzryxq97zvuqyurlt2f3kr8zmqqrgznwq30ws82s7rvvause056asrt2dz67ngxjztqk2pw98azee596shsaf5z69n0cds27mvhxh5ur7k6kphltqsspnm6qpu
2019-04-25 11:58:42.073 [INF] CLIENT: ce966f Register conf ntfn for swap script on chain (hh=1512244)
2019-04-25 11:58:42.073 [INF] CLIENT: ce966f Checking preimage reveal height 1512274 exceeded (height 1512244)
2019-04-25 11:58:42.073 [INF] CLIENT: ce966f Waiting for either htlc on-chain confirmation or  off-chain payment failure
2019-04-25 11:58:46.111 [INF] LNDCLIENT: Payment 207d0102077354e2a73eb2f2eef3a650afe642bc37c5dbfa20f5e0b3d7d6e7d6 completed
2019-04-25 12:02:16.218 [INF] CLIENT: Received block 1512245
2019-04-25 12:02:16.218 [INF] CLIENT: ce966f Checking preimage reveal height 1512274 exceeded (height 1512245)
2019-04-25 12:02:16.220 [INF] CLIENT: ce966f Swap script confirmed on chain
2019-04-25 12:02:16.220 [INF] CLIENT: ce966f Htlc tx 77183e49e2aa736ef3b00a64bff119c8f8d35e1724b0f38ecd6c170648b8e597 at height 1512245
2019-04-25 12:02:16.220 [INF] CLIENT: ce966f Htlc value: 0.00290001 BTC
2019-04-25 12:02:26.227 [WRN] CLIENT: ce966f Required miner fee 0.00000139 BTC exceeds max of 0.00000138 BTC
2019-04-25 12:02:26.227 [WRN] CLIENT: ce966f Not revealing preimage
2019-04-25 12:04:37.461 [INF] LOOPD: Loop out terms request received
2019-04-25 12:05:07.464 [ERR] LOOPD: Terms request: rpc error: code = DeadlineExceeded desc = context deadline exceeded
2019-04-25 12:05:08.479 [INF] LOOPD: Monitor request received
2019-04-25 12:05:50.624 [WRN] CLIENT: ce966f Required miner fee 0.00000139 BTC exceeds max of 0.00000138 BTC
2019-04-25 12:05:50.626 [WRN] CLIENT: ce966f Not revealing preimage

Why now needs 139 instead of 138 satoshis for miner fee? this is normal?

LND version 0.6.0-beta commit=v0.6-beta-rc4-7-gc0141a7bc1a9e6966d1eb273e0df527236cf44ad
Loop version 0.1.1-alpha commit 893954e
Bitcoin Core RPC client version v0.17.1

'x509: certificate has expired or is not yet valid' when run loop commands

I updated my localhost lnd and loop to master and now loop is not working, apparently everything looks fine when I ran loop, but I get this x509 certificate expired error.

In this example I made a loop terms after loopd initiate

$ loopd --network testnet
2019-09-19 11:40:00.090 [INF] LOOPD: Version: 0.2.2-alpha commit=
2019-09-19 11:40:00.097 [INF] LNDCLIENT: Creating lnd connection to localhost:10009
2019-09-19 11:40:00.097 [INF] LNDCLIENT: Connected to lnd
2019-09-19 11:40:00.146 [INF] LNDCLIENT: Using network testnet
2019-09-19 11:40:00.146 [INF] LOOPD: Swap server address: test.swap.lightning.today:11009
2019-09-19 11:40:00.151 [INF] STORE: Checking for schema update: latest_version=1, db_version=1
2019-09-19 11:40:00.157 [INF] LOOPD: Starting gRPC listener
2019-09-19 11:40:00.157 [INF] LOOPD: Starting REST proxy listener
2019-09-19 11:40:00.157 [INF] LOOPD: Starting swap client
2019-09-19 11:40:00.157 [INF] LOOPD: Waiting for updates
2019-09-19 11:40:00.157 [INF] LOOPD: RPC server listening on 127.0.0.1:11010
2019-09-19 11:40:00.157 [INF] LOOPD: REST proxy listening on 127.0.0.1:8081
2019-09-19 11:40:00.194 [INF] CLIENT: Connected to lnd node grunch with pubkey 02eb6ad10edac3bcce68fec29e7519bb25cd7b399e2300bccf099bd68f61da8919
2019-09-19 11:40:00.194 [INF] CLIENT: Wait for first block ntfn
2019-09-19 11:40:00.194 [INF] CLIENT: Resuming loop in swap 1e8a1c3deae1fb35a494648623eddf4ac80ebc8f2b00de61dc083e4a27810801
==================
removed some swap lines
==================
2019-09-19 11:40:06.621 [INF] LOOPD: Monitor request received
2019-09-19 11:40:15.282 [INF] LOOPD: Loop out terms request received
2019-09-19 11:40:15.282 [ERR] LOOPD: Terms request: rpc error: code = Unavailable desc = all SubConns are in TransientFailure, latest connection error: connection error: desc = "transport: authentication handshake failed: x509: certificate has expired or is not yet valid"
2019-09-19 11:40:15.283 [INF] LOOPD: Loop in terms request received
2019-09-19 11:40:15.283 [ERR] LOOPD: Terms request: rpc error: code = Unavailable desc = all SubConns are in TransientFailure, latest connection error: connection error: desc = "transport: authentication handshake failed: x509: certificate has expired or is not yet valid"

LND is working normally
lncli version 0.7.1-beta commit=v0.7.1-beta-323-ge4751f13618315e7daeef86521d384d7c5edeaa6
loop version 0.2.2-alpha commit=08f07946f7623247f78b4ca9554798e57cbf9b0b

I deleted ~/.lnd/tls* files, restarted lnd and they were generated again, the problem remains

Loopd fails to start

Starting up I get error about chainrpc.ChainNotifier, not exactly sure why. My lnd.conf is fairly standard.

$ loopd
...
2019-03-21 06:47:00.282 [INF] CLIENT: Connected to lnd node DANGERZONE with pubkey 034653a43cb5857d6f75ff19866e27a8e03355827bf6036fd8d3c9478a37e33813
2019-03-21 06:47:00.284 [INF] CLIENT: Wait for first block ntfn
2019-03-21 06:47:00.303 [ERR] CLIENT: Swap client terminating: rpc error: code = Unimplemented desc = unknown service chainrpc.ChainNotifier
2019-03-21 06:47:00.303 [INF] CLIENT: Swap client terminated
2019-03-21 06:47:00.303 [ERR] LOOPD: rpc error: code = Unimplemented desc = unknown service chainrpc.ChainNotifier
2019-03-21 06:47:00.303 [INF] LOOPD: Swap client stopped
2019-03-21 06:47:00.304 [INF] LOOPD: Stopping gRPC server

Usind lnd master @ 0.5.2-99-beta commit=queue/v1.0.1-109-g9f6a1403e9773ba97ec0e9fdee3b654789970d3a

And loopd 0.1.0

Loop rebroadcasts generate warning failure messages

When sweeping a Loop Out, the client will rebroadcast sweeps over a period of time and with potentially different fees

This will generate an error on the chain side like Transaction rejected: output already spent

Since this is an expected behavior, there should be no warning message

check amount is valid for loop out

if I requesting an amount above my outbound capacity, loop out will still proceed and fail the payment will "failed: unable to find a path to destination"

loop should check that the amount requested is equal or below my spending balance.

loopd errors out on start

I get this error when I try to start loopd:

2019-03-25 20:09:08.772 [INF] LOOPD: Version: 0.1.0-alpha commit=
2019-03-25 20:09:08.772 [INF] LNDCLIENT: Creating lnd connection to localhost:10009
2019-03-25 20:09:08.773 [INF] LNDCLIENT: Connected to lnd
panic: runtime error: index out of range

goroutine 1 [running]:
github.com/lightninglabs/loop/lndclient.(*lightningClient).GetInfo(0x1033920, 0x8f7000, 0x10280a0, 0x0, 0x0, 0x0)
	/home/admin/gocode/src/github.com/lightninglabs/loop/lndclient/lightning_client.go:143 +0x28c
github.com/lightninglabs/loop/lndclient.NewLndServices(0x7042fc, 0xf, 0x6fbc46, 0x6, 0x6fd2e0, 0x7, 0x0, 0x0, 0x0, 0x0, ...)
	/home/admin/gocode/src/github.com/lightninglabs/loop/lndclient/lnd_services.go:63 +0x244
main.getLnd(0x6fd2e0, 0x7, 0xdab1f8, 0x12384, 0xdc9248, 0x0)
	/home/admin/gocode/src/github.com/lightninglabs/loop/cmd/loopd/utils.go:13 +0x68
main.daemon(0x10948d0, 0x0, 0x0)
	/home/admin/gocode/src/github.com/lightninglabs/loop/cmd/loopd/daemon.go:23 +0x58
main.start(0x102e0b0, 0x0)
	/home/admin/gocode/src/github.com/lightninglabs/loop/cmd/loopd/main.go:89 +0x42c
main.main()
	/home/admin/gocode/src/github.com/lightninglabs/loop/cmd/loopd/main.go:32 +0x14

This is my lnd.conf:

[Application Options]
debuglevel=info
maxpendingchannels=5
alias=<alias>
color=#C74124
externalip=<external ip>
tlsextraip=<external ip>
rpclisten=0.0.0.0:10009

[Bitcoin]
bitcoin.active=1

# enable either testnet or mainnet
bitcoin.mainnet=1

bitcoin.node=bitcoind

[autopilot]
autopilot.active=0
autopilot.maxchannels=5
autopilot.allocation=0.6

Installation as described in README doesn't work

I followed the installation procedure as described in the README and got this error:

loop/main.go:16:2: cannot find package "github.com/btcsuite/btcutil" in any of:
        /usr/local/go/src/github.com/btcsuite/btcutil (from $GOROOT)
        /home/lnd/go/src/github.com/btcsuite/btcutil (from $GOPATH)
loop/main.go:10:2: cannot find package "github.com/golang/protobuf/jsonpb" in any of:
        /usr/local/go/src/github.com/golang/protobuf/jsonpb (from $GOROOT)
        /home/lnd/go/src/github.com/golang/protobuf/jsonpb (from $GOPATH)
loop/main.go:11:2: cannot find package "github.com/golang/protobuf/proto" in any of:
        /usr/local/go/src/github.com/golang/protobuf/proto (from $GOROOT)
        /home/lnd/go/src/github.com/golang/protobuf/proto (from $GOPATH)
loop/main.go:12:2: cannot find package "github.com/lightninglabs/loop" in any of:
        /usr/local/go/src/github.com/lightninglabs/loop (from $GOROOT)
        /home/lnd/go/src/github.com/lightninglabs/loop (from $GOPATH)
loop/loopout.go:7:2: cannot find package "github.com/lightninglabs/loop/looprpc" in any of:
        /usr/local/go/src/github.com/lightninglabs/loop/looprpc (from $GOROOT)
        /home/lnd/go/src/github.com/lightninglabs/loop/looprpc (from $GOPATH)
loop/main.go:14:2: cannot find package "github.com/lightninglabs/loop/swap" in any of:
        /usr/local/go/src/github.com/lightninglabs/loop/swap (from $GOROOT)
        /home/lnd/go/src/github.com/lightninglabs/loop/swap (from $GOPATH)
loop/loopout.go:8:2: cannot find package "github.com/urfave/cli" in any of:
        /usr/local/go/src/github.com/urfave/cli (from $GOROOT)
        /home/lnd/go/src/github.com/urfave/cli (from $GOPATH)
loop/main.go:19:2: cannot find package "google.golang.org/grpc" in any of:
        /usr/local/go/src/google.golang.org/grpc (from $GOROOT)
        /home/lnd/go/src/google.golang.org/grpc (from $GOPATH)
loopd/log.go:6:2: cannot find package "github.com/btcsuite/btclog" in any of:
        /usr/local/go/src/github.com/btcsuite/btclog (from $GOROOT)
        /home/lnd/go/src/github.com/btcsuite/btclog (from $GOPATH)
loopd/daemon.go:14:2: cannot find package "github.com/grpc-ecosystem/grpc-gateway/runtime" in any of:
        /usr/local/go/src/github.com/grpc-ecosystem/grpc-gateway/runtime (from $GOROOT)
        /home/lnd/go/src/github.com/grpc-ecosystem/grpc-gateway/runtime (from $GOPATH)
loopd/main.go:10:2: cannot find package "github.com/jessevdk/go-flags" in any of:
        /usr/local/go/src/github.com/jessevdk/go-flags (from $GOROOT)
        /home/lnd/go/src/github.com/jessevdk/go-flags (from $GOPATH)
loopd/swapclient_server.go:11:2: cannot find package "github.com/lightninglabs/loop/lndclient" in any of:
        /usr/local/go/src/github.com/lightninglabs/loop/lndclient (from $GOROOT)
        /home/lnd/go/src/github.com/lightninglabs/loop/lndclient (from $GOPATH)
loopd/swapclient_server.go:12:2: cannot find package "github.com/lightninglabs/loop/loopdb" in any of:
        /usr/local/go/src/github.com/lightninglabs/loop/loopdb (from $GOROOT)
        /home/lnd/go/src/github.com/lightninglabs/loop/loopdb (from $GOPATH)

I have GOPATH set:

$ echo $GOPATH/
/home/lnd/go/

I've built lnd recently and it did work, so I guess there's something forgotten.
I've no idea how go build system works, so sorry if it's something trivial.

Suggested channel for successful swap

Apologies in advance if this is pointed out somewhere else, can't seem to find it though.

I can't do a successful loop out since my lnd is not properly connected (I keep getting UnknownNextPeer). My question is, for the default swap server swap.lightning.today, is there a suggested node I should connect to to ensure a successful swap?

loop out failes on testnet

When trying to use loop on testnet (loopd started with network=testnet option), the loop binary fails with this error:

pat@ubuntu:~/.lnd/data/chain/bitcoin/testnet$ loop out 1000000
Max swap fees for 1000000 loop out: 54972
CONTINUE SWAP? (y/n), expand fee detail (x): x

Max on-chain fee:                 411
Max off-chain swap routing fee:   50010
Max off-chain prepay routing fee: 422
Max swap fee:                     4129
Max no show penalty:              8258
CONTINUE SWAP? (y/n): y
[loop] rpc error: code = Unknown desc = invoice not for current active network 'testnet3'

Environment:

  • loop version 0.0.1
  • Linux ubuntu-s-2vcpu-2gb-fra1-01 4.15.0-38-generic #41-Ubuntu SMP Wed Oct 10 10:59:38 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

"Unable to obtain macaroons" when starting loopd

I'm wondering if maybe the README is out of date or incomplete, but when I follow the instructions there and clear the existing macaroons for a running instance of lnd cloned from master, I get an error about missing macaroons. When I run lncli unlock to unlock the wallet then the macaroons are generated and then loopd starts up ok even though it breaks the expectation in the README that there should be no macaroons when first starting up loopd. Is loopd only expected to work with unencrypted wallets then?

Defaults to "invoices.macaroon", but lnd makes "invoice.macaroon"

Loop looks for an invoice macaroon named invoices.macaroon, but LND names the file invoice.macaroon, no s.

Loop

defaultInvoiceMacaroonFilename = "invoices.macaroon"

LND According to docs, didn't find where in code this happens.
https://github.com/lightningnetwork/lnd/blob/c5ece1e509e8686e5d3753a2fbe1176fc615040b/macaroons/README.md#generated-macaroons

This results in the following error when using a default setup:

unable to obtain macaroons: open /home/wbobeirne/.lnd/data/chain/bitcoin/mainnet/invoices.macaroon: no such file or directory

Prepayment failing with Failed prepayment: UnknownPaymentHash causes problems

I tried to do a Loop Out:

2019-05-11 12:48:08 loop out --channel 632050960802447360 --amt 500000

Here's what appeared in the Loop logs:

2019-05-11 12:48:08.872 [INF] CLIENT: Offchain swap destination: 03fb2a0ca79c005f493f1faa83071d3a937cf220d4051dc48b8fe3a087879cf14a
2019-05-11 12:48:12.485 [INF] LOOPD: Loop out request received
2019-05-11 12:48:12.489 [INF] CLIENT: LoopOut 0.005 BTC to bc1qyryv9rnvf7p994xjc69dlyp2vlsdxez8yv2rdh (channel: 0xc00050b4d0)
2019-05-11 12:48:12.494 [INF] CLIENT: Initiating swap request at height 575535
2019-05-11 12:48:12.742 [INF] CLIENT: 8f60fe Htlc address: bc1qdph5mvhpsnra73mnjzvvayhxzuzf8a5f9tzy0eggcz2judrel54qgl2xhm
2019-05-11 12:48:12.751 [INF] CLIENT: 8f60fe state Initiated
2019-05-11 12:48:12.751 [INF] CLIENT: 8f60fe Sending swap payment lnbc4857070n...
2019-05-11 12:48:12.751 [INF] CLIENT: 8f60fe Sending prepayment lnbc279140n1...
2019-05-11 12:48:12.752 [INF] CLIENT: 8f60fe Register conf ntfn for swap script on chain (hh=575535)
2019-05-11 12:48:12.757 [INF] CLIENT: 8f60fe Checking preimage reveal height 575565 exceeded (height 575535)
2019-05-11 12:48:12.757 [INF] CLIENT: 8f60fe Waiting for either htlc on-chain confirmation or  off-chain payment failure
2019-05-11 12:48:24.358 [INF] CLIENT: Received block 575536
2019-05-11 12:48:24.359 [INF] CLIENT: 8f60fe Checking preimage reveal height 575565 exceeded (height 575536)
2019-05-11 12:49:09.866 [WRN] LNDCLIENT: Payment 13bad864df40a754521115300dbe9a826e214e9353982fc7415892c28c8f65a9 failed: UnknownPaymentHash(amt=27914000 mSAT)
2019-05-11 12:49:09.866 [INF] CLIENT: 8f60fe Failed prepayment: UnknownPaymentHash(amt=27914000 mSAT)
2019-05-11 12:49:09.866 [INF] CLIENT: 8f60fe Wait for server pulling off-chain payment(s)

The prepayment failed quickly with Failed prepayment: UnknownPaymentHash, but monitor showed it stuck at 'INITIATED' for days:

2019-05-11T12:48:12Z LOOP_OUT INITIATED 0.005 BTC - bc1qdph5mvhpsnra73mnjzvvayhxzuzf8a5f9tzy0eggcz2judrel54qgl2xhm

Today I restarted my Loop server, and it updated to 'FAILED'.

2019-05-13T10:46:09Z LOOP_OUT FAILED 0.005 BTC - bc1qdph5mvhpsnra73mnjzvvayhxzuzf8a5f9tzy0eggcz2judrel54qgl2xhm

The payments sent out were for: 485,707 sats and 27,914 sats, for a total of: 513,621 sats
Now that channel is being force-closed, and I don't know why. It shows a balance of 489,395sats where before it had a balance of 983,380 sats.

So far it looks like:

  • The payment for 485,707 sats went out
  • The payment for 27,914 sats failed (quickly) with UnknownPaymentHash
  • The Loop server didn't fail the Loop Out when the second payment failed
  • Restarting the Loop server kicked it in to failing the Loop Out
  • Nothing has appeared in my wallet using address: bc1qdph5mvhpsnra73mnjzvvayhxzuzf8a5f9tzy0eggcz2judrel54qgl2xhm
  • Something is force-closing that channel

My main question is: what has happened to the 485,707 sats payment that went out? Will it time out or come back? Or is it gone forever? If it times out, how will it come back to a channel that's forced-closing or forced-closed?

My second question is: did Loop cause the force-closing of the channel?

My third question: can we get Loop to handle the initial 'Failed prepayment: UnknownPaymentHash' better?

This has happened several times (including the force-close) but I've just used the logs for one instance. I can provide others if it'll help.

I wish I was better at tracing what has happened. I have tried. If you've any tips or advice that can show me how to trace what has happened, please do let me know.

rpc: add TLS for loopd clients

As is today, one can only hit the loopd API over local host on the same machine. As we want to be able to support more advanced configuration with remote lnd and loopd nodes, we should expand the client RPC server to support TLS. Much of this can be borrowed from lnd

Loop On? Swapping between two existing channels

I can imagine use cases where it would be convenient to use balance from one channel to refill a depleted channel. It would be an off-chain to off-chain swap, hence the proposed name Loop On.

Is this a use case that is on the roadmap?

Document loop out delay feature, and better logging/monitor

Using the master branch loop 0.3.0, and the REST API I was trying to test if I could get some loop outs to be batched.

  1. The swap_publication_deadline was set to 7200, which I thought would be enough time to get a few transactions through. I did maybe 3-4 loop out txns, and 1 failed (bad channel), 1 succeeded (good channel), then 2 succeeded (good both same channel). After checking the block explorer, it did not batch at all.

Maybe a minimum swap_publication_min could also be added, but I don't know exactly why loopd decided to complete the swap so quickly and not batch.

  1. Logging loop in/out parameters to log/ loop monitor. After sending the request, it is difficult to tell fee rate settings, as they aren't logged. As I am setting fee limits, it is difficult to tell if the server uses max fees that I specify each time, or that I got a deal because of swap_publication_deadline or conf_target.

The channel_id is actually shown in the logs, but it is in hex form, and not the other form distributed around LND, so it is less useful (converting to base10 doesnt help, would need to dive in to make a conversion.)

Loop: monitor cmd crashes with nil pointer error

Background

Attempting to loop out funds from a channel, when entering the command loop monitor, loopd crashes with a nil pointer exception. (The loop out was still successful).

Your environment

LND v0.5.2
Linux version 4.18.0-10-generic (buildd@lgw01-amd64-060) (gcc version 8.2.0 (Ubuntu 8.2.0-7ubuntu1))

Steps to reproduce

  1. Run loopd : loopd --network=testnet
  2. Loop out: loop out --channel=<> --amt=<>
  3. Run monitor: loop monitor

Expected Behaviour

Be able to run monitor and view the progress of activity swaps

Actual Behaviour

Nil pointer exception

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0xa8b0bc]

goroutine 57 [running]:
main.(*swapClientServer).marshallSwap(0xc00003b1d0, 0xc00030d3b0, 0xc0001ba600, 0xb05fc0, 0xc0001ea1c0)
        /loop/cmd/loopd/swapclient_server.go:126 +0x6bc
main.(*swapClientServer).Monitor.func1(0x208245de, 0xed43b593c, 0x13ee2e0, 0x2db4b5376f277fe7, 0x59e029497dedf7cc, 0xc403cd081975b1e0, 0xfab4f59ad8094b17, 0x102, 0xbf2cc6d465218e97, 0x2417b79d917bbdd9, ...)
        /loop/cmd/loopd/swapclient_server.go:145 +0x4a
main.(*swapClientServer).Monitor(0xc00003b1d0, 0xc0001ea100, 0xe69380, 0xc0002040d0, 0x0, 0x0)
        /loop/cmd/loopd/swapclient_server.go:208 +0x8c6
github.com/lightninglabs/loop/looprpc._SwapClient_Monitor_Handler(0xbebe80, 0xc00003b1d0, 0xe68ba0, 0xc0000300c0, 0x140d708, 0xc0001ba4e0)
        /loop/looprpc/client.pb.go:975 +0x109
google.golang.org/grpc.(*Server).processStreamingRPC(0xc000087b00, 0xe6aee0, 0xc0002ee900, 0xc00026c100, 0xc00028e540, 0x13d68c0, 0x0, 0x0, 0x0)
        /go/pkg/mod/google.golang.org/[email protected]/server.go:1175 +0xac7
google.golang.org/grpc.(*Server).handleStream(0xc000087b00, 0xe6aee0, 0xc0002ee900, 0xc00026c100, 0x0)
        /go/pkg/mod/google.golang.org/[email protected]/server.go:1254 +0xcf1
google.golang.org/grpc.(*Server).serveStreams.func1.1(0xc000018020, 0xc000087b00, 0xe6aee0, 0xc0002ee900, 0xc00026c100)
        /go/pkg/mod/google.golang.org/[email protected]/server.go:690 +0x9f
created by google.golang.org/grpc.(*Server).serveStreams.func1
        /go/pkg/mod/google.golang.org/[email protected]/server.go:688 +0xa1

Additional Information

After debug printing, it seems the HtlcAddress is nil

2019-04-07 03:46:43.002 [INF] LOOPD: IS IT STATE: SUCCESS
2019-04-07 03:46:43.002 [INF] LOOPD: IS IT Initiation Time: 1554602920576774837
2019-04-07 03:46:43.002 [INF] LOOPD: IS IT LastUpdateTime: 1554604604545408478
2019-04-07 03:46:43.002 [INF] LOOPD: IS IT HtlcAddress: <nil>
2019-04-07 03:46:43.002 [INF] LOOPD: IS IT type: LOOP_OUT

In cmd/loopd/swapclient_server.go in func marshallSwap, the return *looprpc.SwapStatus calls loopSwap.HtlcAddress.EncodeAddress() on nil.

loop in external doesn't work if there's no onchain funds

I'm trying to do a loop in --amt 250000 --external and I got this response

[loop] rpc error: code = Unknown desc = insufficient funds available to construct transaction

I have more than 50 channels with plenty inbound capacity, at that moment I had 13451 satoshis on-chain wallet balance, so I sent to my node 1000000 onchain btc and after that I could run the same command, I understand that loop in always is looking for that --amt in the node wallet to make the swap and is ignoring the --external flag.

Loop out - Minimise required arguments for REST API

Summary

The REST API for loop out requires the user to pass argument values for max_swap_fee and max_prepay_amt in order to avoid the errors "swap fee too high" and "prepay amount too high", respectively. However, these same arguments are not required by the loop CLI, as shown below.

$ ./loop out | tail -n 6
OPTIONS:
--channel value the 8-byte compact channel ID of the channel to loop out (default: 0)
--addr value the optional address that the looped out funds should be sent to, if let blank the funds will go to lnd's wallet
--amt value the amount in satoshis to loop out (default: 0)
--conf_target value the number of blocks from the swap initiation height that the on-chain HTLC should be swept within (default: 6)

Task 1

Minimise the number of required arguments for REST API so that it is more consistent with the loop CLI .

Task 2

sweep_conf_target is also a required argument for the REST API so needs to be added to the documentation page linked to above. If possible, renaming to "conf_target" would also be nice to match loop CLI

Thanks

Errors seen:

q)input
amt              | "250000"
dest             | "bc1qtumg8sp356nwekne62muprjcj5pj8rkn37c43y"
sweep_conf_target| 2
max_swap_fee     | "2000"
q).loopd.loopOut[input]
error  | "prepay amount too high"
message| "prepay amount too high"
code   | 2

q)input
amt              | "250000"
dest             | "bc1qtumg8sp356nwekne62muprjcj5pj8rkn37c43y"
sweep_conf_target| 2
max_prepay_amt   | "50000"
q).loopd.loopOut[input]
error  | "swap fee too high"
message| "swap fee too high"
code   | 2

`

What is the minimum fund required to loop?

Trying to loop with 50k sat and got this error:

>loop out 50000
[loop] rpc error: code = Unknown desc = swap amount too low

But the error does not say what the required amount should be.

Failed swap payment: payment attempt not completed before timeout thrown for

Loop out fails when attempting to loop out any channels that belong to a node with a tor address. The only other reference to this error I've found is this issue on lnd which also references a tor node. Occurred on mainnet

loop logs:

2019-08-01 16:21:18.696 [INF] CLIENT: Offchain swap destination: 03fb2a0ca79c005f493f1faa83071d3a937cf220d4051dc48b8fe3a087879cf14a                                                          
2019-08-01 16:21:21.921 [INF] LOOPD: Loop out request received
2019-08-01 16:21:21.925 [INF] CLIENT: LoopOut 0.014 BTC to bc1qzhjr26gsu8k7jg76uw9kqeug94kny0h2z8kadv (channel: 0xc0001800b0)                                                                
2019-08-01 16:21:21.933 [INF] CLIENT: Initiating swap request at height 588106
2019-08-01 16:21:22.063 [INF] CLIENT: bc02db Htlc address: bc1qvmx8hu4t05h8na0xk2ykjy47zdw4tru9ak9yv4g9hv9fvh9lnwkq7lv3xg                                                                    
2019-08-01 16:21:22.066 [INF] CLIENT: bc02db state Initiated
2019-08-01 16:21:22.067 [INF] CLIENT: bc02db Sending swap payment lnbc14003630n1pw5xyvppp5hspdhlwl8tawfznhuam58j895pv0geruv6lzr3hg203x2xjs3qgsdq8wdmkzuqcqzxgxq97zvuqrzjqgwf02g2gy0l9vgdc25wxt0z72wjlfyagxlmk54ag9hyvrdsw37s6z96xqqqg9cqqyqqqqlgqqqqqqgq9qrzjqgwf02g2gy0l9vgdc25wxt0z72wjlfyagxlmk54ag9hyvrdsw37s6z9aryqq3fqqqqqqqqlgqqqqqqgq9qrzjqgwf02g2gy0l9vgdc25wxt0z72wjlfyagxlmk54ag9hyvrdsw37s6z9t3vqq8dsqqqqqqqlgqqqqqqgqjqrzjqgwf02g2gy0l9vgdc25wxt0z72wjlfyagxlmk54ag9hyvrdsw37s6z9aryqq38qqqyqqqqlgqqqqqqgq9qet0f5k550xg2lhx6e8r7xkvunma65j0rj5eha9z77p22pt0g2jh86l5p57g48uvqqqt2qnh53kpv255wcffl4t56lsugqdhwggg5atcppzwklg
2019-08-01 16:21:22.067 [INF] CLIENT: bc02db Sending prepayment lnbc13370n1pw5xyvppp5j2th3q9hehjj23yuddkqredqp5ex3h0xdyh0ll5zqt8tgju7435qdq2wpex2urp0ycqzxgxq97zvuqrzjqgwf02g2gy0l9vgdc25wxt0z72wjlfyagxlmk54ag9hyvrdsw37s6z96xqqqg9cqqyqqqqlgqqqqqqgq9qrzjqgwf02g2gy0l9vgdc25wxt0z72wjlfyagxlmk54ag9hyvrdsw37s6z9aryqq3fqqqqqqqqlgqqqqqqgq9qrzjqgwf02g2gy0l9vgdc25wxt0z72wjlfyagxlmk54ag9hyvrdsw37s6z9t3vqq8dsqqqqqqqlgqqqqqqgqjqrzjqgwf02g2gy0l9vgdc25wxt0z72wjlfyagxlmk54ag9hyvrdsw37s6z9aryqq38qqqyqqqqlgqqqqqqgq9qujjravx49npth8l4nzcx4d8c4ya5ynkp9z68zpw7pxy5vz4suw9jh8dn8n2rrspayq0uampcln2zynthteswzt0d5efytndnhr4nvncqge8g6a
2019-08-01 16:21:22.068 [INF] CLIENT: bc02db Register conf ntfn for swap script on chain (hh=588106)                                                                                         
2019-08-01 16:21:22.070 [INF] CLIENT: bc02db Checking preimage reveal height 588186 exceeded (height 588106)                                                                                 
2019-08-01 16:21:22.070 [INF] CLIENT: bc02db Waiting for either htlc on-chain confirmation or  off-chain payment failure                                                                     
2019-08-01 16:22:24.047 [WRN] LNDCLIENT: Payment bc02dbfddf3afae48a77e77743c8e5a058f4647c66be21c6e853e2651a508811 failed: payment attempt not completed before timeout                       
2019-08-01 16:22:24.047 [INF] CLIENT: bc02db Failed swap payment: payment attempt not completed before timeout                                                                               
2019-08-01 16:22:24.047 [INF] CLIENT: bc02db Wait for server pulling off-chain payment(s)
2019-08-01 16:31:22.419 [WRN] LNDCLIENT: Payment 92977880b7cde525449c6b6c01e5a00d3268dde6692efffe8202ceb44b9eac68 failed: UnknownPaymentHash(amt=1337000 mSAT)                               
2019-08-01 16:31:22.419 [INF] CLIENT: bc02db Prepayment failed: UnknownPaymentHash(amt=1337000 mSAT)                                                                                         
2019-08-01 16:31:22.419 [INF] CLIENT: bc02db Swap completed: FailOffchainPayments (final cost: server 0 BTC, onchain 0 BTC, offchain 0 BTC)                                                  
2019-08-01 16:31:22.423 [INF] CLIENT: bc02db state FailOffchainPayments

loop monitor output:

2019-08-01T16:21:22Z LOOP_OUT INITIATED 0.014 BTC - bc1qvmx8hu4t05h8na0xk2ykjy47zdw4tru9ak9yv4g9hv9fvh9lnwkq7lv3xg                                                                           
2019-08-01T16:31:22Z LOOP_OUT FAILED 0.014 BTC - bc1qvmx8hu4t05h8na0xk2ykjy47zdw4tru9ak9yv4g9hv9fvh9lnwkq7lv3xg (cost: server 0, onchain 0, offchain 0)

Loop in stuck after Power Outages :-/

There was a power outages while I was in the middle of Loop in :-/. I restore my node and rerun loopd and loop monitor. +3hrs and there isn't any new logs on loopd nor loop monitor.

lnd version:
0.7.1-beta commit=v0.7.1-beta

Loopd logs:
2019-11-08 18:24:44.330 [INF] LOOPD: Version: 0.2.4-alpha commit=
2019-11-08 18:24:44.341 [INF] LNDCLIENT: Creating lnd connection to localhost:10009
2019-11-08 18:24:44.350 [INF] LNDCLIENT: Connected to lnd
2019-11-08 18:24:44.500 [INF] LNDCLIENT: Using network mainnet
2019-11-08 18:24:44.500 [INF] LOOPD: Swap server address: swap.lightning.today:11009
2019-11-08 18:24:44.505 [INF] STORE: Checking for schema update: latest_version=1, db_version=1
2019-11-08 18:24:44.506 [INF] LOOPD: Starting gRPC listener
2019-11-08 18:24:44.507 [INF] LOOPD: Starting REST proxy listener
2019-11-08 18:24:44.510 [INF] LOOPD: Starting swap client
2019-11-08 18:24:44.510 [INF] LOOPD: RPC server listening on 127.0.0.1:11010
2019-11-08 18:24:44.510 [INF] LOOPD: REST proxy listening on 127.0.0.1:8081
2019-11-08 18:24:44.510 [INF] LOOPD: Waiting for updates
2019-11-08 18:24:44.554 [INF] CLIENT: Wait for first block ntfn
2019-11-08 18:24:44.554 [INF] CLIENT: Resuming loop in swap XXXXXXXXXXX
2019-11-08 18:24:44.554 [INF] CLIENT: c8e43a Htlc address: YYYYYYYYYYYYY
2019-11-08 18:24:44.555 [INF] CLIENT: Starting event loop at height 602823
2019-11-08 18:24:44.556 [INF] CLIENT: c8e43a state HtlcPublished
2019-11-08 18:24:47.879 [INF] CLIENT: c8e43a Subscribing to swap invoice ZZZZZZZZ
2019-11-08 18:26:04.320 [INF] CLIENT: c8e43a Received swap invoice update: Open
2019-11-08 18:36:24.132 [INF] LOOPD: Monitor request received

I checked blockstream.info and I can see that the transfer was received on the other end.

Not sure what else to try :-(

SSL Error with REST using Python

I have made some code to start trying out loop with the rest API.

import base64, json, requests
import codecs
from pprint import pprint

base_url = 'https://127.0.0.1:8081'
url1 = '/v1/loop/in'
url2 = '/v1/loop/in/quote/{}'
url3 = '/v1/loop/out/quote/{}'

LND_DIR = '{mypath}/.lnd/'
cert_path = LND_DIR + 'tls.cert'

def sendGetRequest(endpoint, data=""):
	global base_url
	target_url = base_url + endpoint.format(data)
	print("Sending Request to URL: {}".format(target_url))
	r = requests.get(target_url, verify=cert_path)
	pprint(r.text)
	return r.text

loopreq = sendGetRequest(url2,250000)

Receives this error:

File "/home/lightning/env/lib/python3.7/site-packages/urllib3/connection.py", line 394, in connect
ssl_context=context,
File "/home/lightning/env/lib/python3.7/site-packages/urllib3/util/ssl_.py", line 383, in ssl_wrap_socket
return context.wrap_socket(sock)
File "/usr/lib/python3.7/ssl.py", line 412, in wrap_socket
session=session
File "/usr/lib/python3.7/ssl.py", line 853, in _create
self.do_handshake()
File "/usr/lib/python3.7/ssl.py", line 1117, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1056)

I can't seem to get past this, and most of the similar cases on the internet involve using the wrong port.

The port specified in the docs also specify port 8080, which succeeds to not find.

Sending Request to URL: https://127.0.0.1:8080/v1/loop/in/quote/250000
'Not Found\n'

But this makes sense because that is LNDs port.

Using requests 2.22.0
Using loopd master

Payment already in flight?

I tried to perform two loop outs yesterday using v0.3.0-alpha. They both were performed without the --fast flag. Loopd was terminated approximately an hr or so after initialized. The logs state payments failed, but the loop monitor command keeps states transactions are still labeled initiated and not failed. It keeps stating payment still in flight for the past few hours.

2019-11-28 09:59:59.362 [INF] LOOP: LoopOut 0.02 BTC to xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx (channel: <nil>)
2019-11-28 09:59:59.689 [INF] LOOP: Initiating swap request at height 605777
2019-11-28 09:59:59.882 [INF] LOOP: 000000 Htlc address: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
2019-11-28 09:59:59.899 [INF] LOOP: 000000 state Initiated
2019-11-28 09:59:59.900 [INF] LOOP: 000000 Sending swap payment xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx$
2019-11-28 09:59:59.900 [INF] LOOP: 000000 Sending prepayment xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx$
2019-11-28 09:59:59.901 [INF] LOOP: 000000 Register conf ntfn for swap script on chain (hh=605777)
2019-11-28 09:59:59.905 [INF] LOOP: 000000 Checking preimage reveal height 605857 exceeded (height 605777)
2019-11-28 09:59:59.905 [INF] LOOP: 000000 Waiting for either htlc on-chain confirmation or  off-chain payment failure
2019-11-28 10:00:05.808 [INF] LOOPD: Monitor request received
2019-11-28 10:01:16.718 [WRN] LNDC: Payment xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx failed: payment attempt not completed before timeout
2019-11-28 10:01:16.718 [INF] LOOP: 000000 Failed swap payment: payment attempt not completed before timeout
2019-11-28 10:01:16.718 [INF] LOOP: 000000 Wait for server pulling off-chain payment(s)
2019-11-28 11:06:24.277 [INF] LOOPD: Monitor request received
2019-11-28 11:41:00.430 [INF] LOOPD: Monitor request received
2019-11-28 13:44:08.224 [INF] LOOPD: Monitor request received
2019-11-28 13:45:07.356 [INF] LOOPD: Received SIGINT (Ctrl+C).
2019-11-28 13:45:07.380 [ERR] LOOP: 000000 Swap error: context canceled
2019-11-28 13:45:07.373 [INF] LOOP: Swap client terminating
2019-11-28 13:45:07.380 [INF] LOOP: 000000 state FailTemporary
2019-11-28 13:45:07.397 [INF] LOOP: Swap client terminated
2019-11-28 13:45:07.397 [INF] LOOPD: Swap client stopped
2019-11-28 13:45:07.397 [INF] LOOPD: Stopping gRPC server
2019-11-28 23:20:39.223 [INF] LOOP: 000000 Register conf ntfn for swap script on chain (hh=605816)
2019-11-28 23:20:39.224 [INF] LOOP: 000000 Checking preimage reveal height 605896 exceeded (height 605866)
2019-11-28 23:20:39.224 [INF] LOOP: 000000 Waiting for either htlc on-chain confirmation or  off-chain payment failure
2019-11-28 23:20:39.221 [INF] LOOP: 000000 Checking preimage reveal height 605857 exceeded (height 605866)
2019-11-28 23:20:39.224 [INF] LOOP: 000000 Max preimage reveal height 605857 exceeded (height 605866)
2019-11-28 23:20:39.224 [INF] LOOP: 000000 Wait for server pulling off-chain payment(s)
2019-11-28 14:02:22.012 [INF] LOOPD: Loop out request received
2019-11-28 14:02:22.303 [INF] LOOP: LoopOut 0.01 BTC to xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx (channel: <nil>)
2019-11-28 14:02:22.344 [INF] LNDC: Payment xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx already in flight
2019-11-28 14:02:22.389 [INF] LOOP: Initiating swap request at height 605816
2019-11-28 14:02:22.556 [INF] LOOP: 000001 Htlc address: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
2019-11-28 14:02:22.597 [INF] LOOP: 000001 state Initiated
2019-11-28 14:02:22.598 [INF] LOOP: 000001 Sending swap payment xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx$
2019-11-28 14:02:22.598 [INF] LOOP: 000001 Sending prepayment xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx$
2019-11-28 14:02:22.598 [INF] LOOP: 000001 Register conf ntfn for swap script on chain (hh=605816)
2019-11-28 14:02:22.598 [INF] LOOP: 000001 Checking preimage reveal height 605896 exceeded (height 605816)
2019-11-28 14:02:22.599 [INF] LOOP: 000001 Waiting for either htlc on-chain confirmation or  off-chain payment failure
2019-11-28 14:12:27.465 [WRN] LNDC: Payment xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx failed: IncorrectOrUnknownPaymentDetails(amt=1000163000 mSAT, height=605816)
2019-11-28 14:12:27.465 [INF] LOOP: 000001 Failed swap payment: IncorrectOrUnknownPaymentDetails(amt=1000163000 mSAT, height=605816)
2019-11-28 14:12:27.478 [INF] LOOP: 000001 Wait for server pulling off-chain payment(s)
2019-11-29 08:07:31.095 [INF] LOOPD: RPC server listening on 127.0.0.1:11010
2019-11-29 08:07:31.105 [INF] LOOPD: REST proxy listening on 127.0.0.1:8081
2019-11-29 08:07:31.179 [INF] LOOP: Connected to lnd node XXXXXX with pubkey xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
2019-11-29 08:07:31.181 [INF] LOOP: Wait for first block ntfn
2019-11-29 08:07:31.182 [INF] LOOP: Resuming loop out swap xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
2019-11-29 08:07:31.184 [INF] LOOP: 000000 Htlc address: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
2019-11-29 08:07:31.212 [INF] LOOP: Starting event loop at height 605916
2019-11-29 08:07:31.213 [INF] LOOP: Resuming loop out swap xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
2019-11-29 08:07:31.213 [INF] LOOP: 000001 Htlc address: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
2019-11-29 08:07:31.217 [INF] LOOP: 000000 state Initiated
2019-11-29 08:07:31.217 [INF] LOOP: 000001 state Initiated
2019-11-29 08:07:31.218 [INF] LOOP: 000001 Sending swap payment xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx $
2019-11-29 08:07:31.218 [INF] LOOP: 000001 Sending prepayment xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx $
2019-11-29 08:07:31.221 [INF] LOOP: 000001 Register conf ntfn for swap script on chain (hh=605816)
2019-11-29 08:07:31.218 [INF] LOOP: 000000 Sending swap payment xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx$
2019-11-29 08:07:31.222 [INF] LOOP: 000000 Sending prepayment xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx$
2019-11-29 08:07:31.222 [INF] LOOP: 000000 Register conf ntfn for swap script on chain (hh=605777)
2019-11-29 08:07:31.223 [INF] LOOP: 000000 Checking preimage reveal height 605857 exceeded (height 605916)
2019-11-29 08:07:31.223 [INF] LOOP: 000000 Max preimage reveal height 605857 exceeded (height 605916)
2019-11-29 08:07:31.224 [INF] LOOP: 000000 Wait for server pulling off-chain payment(s)
2019-11-29 08:07:31.230 [INF] LOOP: 000001 Checking preimage reveal height 605896 exceeded (height 605916)
2019-11-29 08:07:31.231 [INF] LOOP: 000001 Max preimage reveal height 605896 exceeded (height 605916)
2019-11-29 08:07:31.232 [INF] LOOP: 000001 Wait for server pulling off-chain payment(s)
2019-11-29 08:07:31.667 [INF] LNDC: Payment xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx already in flight
2019-11-29 08:07:31.668 [INF] LNDC: Payment xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx already in flight
2019-11-29 08:07:34.807 [INF] LNDC: Payment xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx already in flight

[request] litecoin support

Its unclear how loop will react when interacting with a backend lnd instance that is on the litecoin chain. Most of the defaults in loop look to be assuming a bitcoin chain.

Swap server doesn't pay the "loop in" invoice if the route is "too expensive"

I am trying to make "loop in" in mainnet. Firstly I requested the "loop in" for 250k sat.

2019-10-15T14:35:30Z LOOP_IN HTLC_PUBLISHED 0.0025 BTC - 3Ewy6ussedPqFNu2ZDhqMs1te43XR1wBpC

And I also set up the inbound channel for 500k sat with bitrefill.

{
      "active": true,
      "remote_pubkey": "030c3f19d742ca294a55c00376b3b355c3c90d61c6b6b39554dbc7ac19b141c14f",
      "channel_point": "bc273428dbba483a4c9bafe283348f4c53f15e0ff925058a92e97ac47a6ac6bf:0",
      "chan_id": "659188007361380352",
      "capacity": "500000",
      "local_balance": "0",
      "remote_balance": "497114",
      "commit_fee": "2886",
      "commit_weight": "552",
      "fee_per_kw": "3987",
      "unsettled_balance": "0",
      "total_satoshis_sent": "0",
      "total_satoshis_received": "0",
      "num_updates": "23",
      "pending_htlcs": [],
      "csv_delay": 144,
      "private": false,
      "initiator": false,
      "chan_status_flags": "ChanStatusDefault",
      "local_chan_reserve_sat": "5000",
      "remote_chan_reserve_sat": "5000"
}

The funds were deposited to the 3Ewy6ussedPqFNu2ZDhqMs1te43XR1wBpC address, but the "swap" invoice is not paid yet:

lnbc2489750n1pw6tkfjpp58muxgn7svw4afh9jts8vej8nfr9mnt4zmkcxa2zz49gwe8l4vqpsdq8wdmkzuqcqzpgxq97zvuqvfdheqar07vrpa79kv6eq4mzhgamsej9eztt0mccfzrpa9jdl4f4ssr3w294chq8qt7z40rp8u8gemzqvhdtgq6v0clqvte5wgvxh5sppyvgc0

I checked this invoice on submarineswaps.org by the suggestion given from @alexbosworth .
Firstly I got an error No route found to execute this swap. Try a smaller amount?.
Then, as far as I understood, @alexbosworth changed the "max fee" option on submarineswaps.org and it fixed the error.

But anyway, the swap server cannot pay my "swap" invoice because the route seems too expensive.
I think this condition should be validated at the beginning of "loop in" operation.
Or it will be even better to support various fee rates for inbound channels.

Loops stuck in initiated

I have 4 loop out attempts from yesterday that have been stuck in the INITIATED state for > 24 hours without transitioning. What's the best way for me to check on the status of these / make sure I have no funds locked up?

These loop out attempts were made with a conf_target of 50.

Verify release - missing key?

Which key was used to sign the manifest of the current alpha release? I am unable to find the public key in order to verify it.

$ gpg --verify manifest-v0.2.2-alpha.txt.sig
gpg: assuming signed data in 'manifest-v0.2.2-alpha.txt'
gpg: Signature made Thu 01 Aug 2019 00:47:18 CEST
gpg:                using RSA key DE23E73BFA8A0AD5587D2FCDE80D2F3F311FD87E
gpg: Can't check signature: No public key

Automate Instant Inbound Liquidity With Invoices

I'd like to propose a way for instant inbound liquidity to be automated via invoices. It's similar to Thor's instant channel but this proposal would only be valuable if it becomes a standard across all lightning implementations and wallets. It won't work if it's limited to just one Lightning wallet. However, Loop might be a great place to start and test this feature, especially because it is geared towards reducing the friction LN end users face. This proposal can also help make Loop In's more practical by automating inbound liquidity instantly.

Proposal: Automate Instant Inbound Liquidity With Invoices

Problem: Waiting for inbound liquidity as channel establishes when you first come online and want to receive a LN payment.

Solution: Embedding the node uri of the invoice creator, along with amount to be routed.

Scenario:

  1. Bob wants to send me 100,000 sats.
  2. My node just came online and has 0 inbound liquidity.
  3. I create an invoice for 100,000 sats. My LN node recognizes I have 0 inbound liquidity so my wallet also embeds my URI in the invoice.
  4. Bob’s wallet sees an invoice + uri. Maybe even tries to route. When it doesn’t see anything, it auto opens a channel + pushes 100,000 sat payment.
  5. I now own and can spend 100,000 sats instantly.

Considerations:

  • This auto establishing of channels and pushing payments isn’t for all LN nodes. Just routing nodes.
  • Bob doesn’t need to be the one to establish the channel. He can push the information down the line until a node dedicated to routing is found. The routing node can then be the one to establish the channel with me.
  • Certain specifics need to be flushed out such as the size of Bob’s channel. Right now I think Bob can manually set the size of the channels to be established on his end. Should be smaller channels at first. If the person gets paid again, just establish another channel towards the same node if there isn't enough capacity.
  • Routing nodes who provide this service can charge a premium.
  • Bob, as a liquidity provider, won't cheat against himself so I can make LN payments instantly.
  • The beauty behind this proposal is that I can receive a payment instantly, I can send payments instantly, and that it hides everything from me as an end user.
  • Can possibly be extended to neutrino LN wallets if they are public.

OutOfRange: amount above current maximum

Hi, I just got the last loop version and I found out that I can't loop out, I'm working on testnet

$ loop out 250000
Max swap fees for 250000 Loop Out: 6799
CONTINUE SWAP? (y/n), expand fee detail (x): x

Max on-chain fee:                 411
Max off-chain swap routing fee:   5010
Max off-chain prepay routing fee: 36
Max swap fee:                     1342
Max no show penalty:              1337
CONTINUE SWAP? (y/n): y
[loop] rpc error: code = Unknown desc = cannot initiate swap: rpc error: code = OutOfRange desc = amount above current maximum

I have enough liquidity, it is very weird to get that message cause the min and max are 250000 and 2000000

commit: e8d696e
lnd: version 0.6.1-beta commit=v0.6.1-beta-266-gc8ef9a4f63b235dd389a8edb09c955ea060ad971
Bitcoin Core RPC client version v0.17.1

gRPC: Missing final cost on swap success

When I loop out, I can see on loopd output something like this

2019-04-21 13:31:17.207 [INF] CLIENT: Resuming loop out swap eaa33412bad88f18898b9b2e9ffbd9c93e90df75191366c0415ef9cdb5ac0cd6
2019-04-21 13:31:17.207 [INF] CLIENT: eaa334 Htlc address: tb1qtlxqval0ge7492ydzxy3n58y2mgmxlpedstme2czcy0ue7us4fxsc959mr
2019-04-21 13:31:17.207 [INF] CLIENT: Starting event loop at height 1510284
2019-04-21 13:31:17.207 [INF] CLIENT: eaa334 state PreimageRevealed
2019-04-21 13:31:17.207 [INF] CLIENT: eaa334 Sending swap payment lntb2526640n1pwtex82pp5a23ngy46mz833zvtnvhfl77eeylfphm4ryfkdszptmuumddvpntqdq8wdmkzuqcqzryxq97zvuqlayjg5edxyvree6wd0mue6gkul5jzsu2pvc6ztvmgwp6xshry35kev72dl8awmg08yxel9sqrxt7vgnalxhmutr27rfg3waxrzpupksq5u7dsq
2019-04-21 13:31:17.207 [INF] CLIENT: eaa334 Sending prepayment lntb7500n1pwtex82pp5xy6u5ymrl3y0kf0s3d6tn8pcf8nccpdts58dls94za9kp23tgnzsdq2wpex2urp0ycqzryxq97zvuqfs8fyyh46mgxzuy2m72jq23y57xlcwwvnphnzej6rycjnwu8q4thlwkkphxd25mz05x4ecd97dxe62n9s5zhf2w6gpw57t37cenj5lqp8y385c
2019-04-21 13:31:17.207 [INF] CLIENT: eaa334 Register conf ntfn for swap script on chain (hh=1510283)
2019-04-21 13:31:17.207 [INF] CLIENT: eaa334 Retrieving htlc onchain
2019-04-21 13:31:17.208 [INF] CLIENT: eaa334 Htlc tx 4981c662f83ed776f5bdd6f7bd17614b4bf52b122eb8bb7ea3e839308577c640 at height 1510284
2019-04-21 13:31:17.208 [INF] CLIENT: eaa334 Htlc value: 0.00253048 BTC
2019-04-21 13:31:17.257 [INF] LNDCLIENT: Payment eaa33412bad88f18898b9b2e9ffbd9c93e90df75191366c0415ef9cdb5ac0cd6 already in flight
2019-04-21 13:31:27.214 [INF] CLIENT: eaa334 Sweep on chain HTLC to address tb1qa462ny6z9vhtus69gmqckf3xk8tnmv5a96yhtp with fee 0.00000411 BTC (tx 29bd9a4eb44fad777d27e4d0b77d5a4d13b8e81c28e06f7718de59bf12ddd900)
2019-04-21 13:31:57.012 [INF] LNDCLIENT: Payment eaa33412bad88f18898b9b2e9ffbd9c93e90df75191366c0415ef9cdb5ac0cd6 already in flight
2019-04-21 13:33:29.467 [INF] CLIENT: eaa334 Htlc spend by tx: 29bd9a4eb44fad777d27e4d0b77d5a4d13b8e81c28e06f7718de59bf12ddd900
2019-04-21 13:33:29.467 [INF] CLIENT: eaa334 Wait for server pulling off-chain payment(s)
2019-04-21 13:33:32.177 [INF] LNDCLIENT: Payment eaa33412bad88f18898b9b2e9ffbd9c93e90df75191366c0415ef9cdb5ac0cd6 already completed
2019-04-21 13:33:32.177 [INF] CLIENT: eaa334 Swap completed: Success (final cost: server 0.00000366 BTC, onchain 0.00000411 BTC)
2019-04-21 13:33:32.179 [INF] CLIENT: eaa334 state Success

This is great, but I don't find a way to get this info doing it via gRPC API.
All what I got with a MonitorRequest is something like this

{
  amt: '253048',
  id:
   'eaa33412bad88f18898b9b2e9ffbd9c93e90df75191366c0415ef9cdb5ac0cd6',
  type: 'LOOP_OUT',
  state: 'SUCCESS',
  initiation_time: '1555462708191274418',
  last_update_time: '1555463904923364199',
  htlc_address:
   'tb1qtlxqval0ge7492ydzxy3n58y2mgmxlpedstme2czcy0ue7us4fxsc959mr'
}

I would like to get final on-chain tx and swap server final fee.

CMD: loop rpcserver global option

Background

By default loop starts RPC server on 127.0.0.1:11010, it runs perfect on my node without any parameter, but I want it to listen on my LAN, in the help command says:

GLOBAL OPTIONS:
   --loopd value  loopd daemon address host:port (default: "localhost:11010")

Then I started like this

loopd --loopd 192.168.0.100:11010

I got this response

unknown flag `loopd'
unknown flag `loopd'

Your environment

  • loop commit 769c69e
  • Linux microbet 4.14.73-136 #1 SMP PREEMPT Mon Oct 1 03:21:48 UTC 2018 armv7l armv7l armv7l GNU/Linux

Loop out successful but off-chain funds not released

image

LOOPD keeps loggined "the payment already in flight"

LND keeps logging "unable to send payment: payment is in transition"

Loop mintor says the preimage is revaled.

And I have already recieved the loop out BTC on chain. (loop out address: bc1qvufunsdpm9zsuu483eld0gl6sz052mg7lucte7)

Tx ID: d2c0c35f7279e54ca643e1eee42889ac5729916ca18d2c5d2dafd672f7380ae0

2,000,000 sat stuck on the channel waiting to be released.

loop version: 0.3.0 alpha
OS: Windows 10

Could this be looked into, or would it resolve itself?

Mobile support

Would love to add this to my mobile ln wallet, others would too... any timeline for that?

Validate bitcoin addresses on loop out

I've been using loop on my site and I constantly change between testnet and mainnet, yesterday I just made a loop out from my frontend and I didn't realize that I was connected to mainnet, so I lost 250,000 sats plus fees, I have to add address validations on my site, but it would be great if loop also have this validation, here is my loopd view output.

$ loopd view
2019-05-23 10:41:00.407 [INF] LOOPD: Version: 0.1.2-alpha commit=
2019-05-23 10:41:00.499 [INF] LNDCLIENT: Creating lnd connection to localhost:10009
2019-05-23 10:41:00.500 [INF] LNDCLIENT: Connected to lnd
2019-05-23 10:41:01.195 [INF] LNDCLIENT: Using network mainnet
2019-05-23 10:41:01.203 [INF] STORE: Checking for schema update: latest_version=1, db_version=1
OUT 43d0b82fa237612ad599de5aeb32dc98cd0262d8dcac9770776ef848304d9708
   Created: 2019-03-20 18:07:02.874154412 -0300 -03 (height 568033)
   Preimage: 2f810139aaa5993005902ef252938d67be706c0b04932882c9927308eee54b83
   Htlc address: bc1q4s8vxumrn7tuw89sg30vcazshueeyd7h67upk539hqw7fjf4e9qqv06jhy
   Uncharge channel: any
   Dest: bc1qgpyw608ur9q4r9txjuujh5l6akf6eeyv7wnv7a
   Amt: 0.0025 BTC, Expiry: 568083
   Update 0, Time 2019-03-20 18:34:11.195149367 -0300 -03, State: PreimageRevealed
   Update 1, Time 2019-03-20 18:37:05.98714838 -0300 -03, State: Success, Cost: server=0 BTC, onchain=0 BTC, offchain=0 BTC

OUT 97e9f0affd8ef45c6e17edd98807a40fc1191ceb0da82a30ead16d5040b870ef
   Created: 2019-05-22 13:06:52.129042516 -0300 -03 (height 577261)
   Preimage: ae228b5112a1f9318601d102fde4518d2447a4fbd079bc2c269f8d6eb5eb5e48
   Htlc address: bc1qsf72v7flljjhvccklelfpxu2nxyspwrzpcuv8wel95wpt4rfk42s5venjm
   Uncharge channel: any
   Dest: tb1qre3f3upldf8u42t8ta9tn43zk28tdae4q8tf2c
   Amt: 0.0025 BTC, Expiry: 577311
   Update 0, Time 2019-05-22 13:27:09.348423396 -0300 -03, State: PreimageRevealed
   Update 1, Time 2019-05-22 13:29:12.952773463 -0300 -03, State: Success, Cost: server=0.00020086 BTC, onchain=0.00017487 BTC, offchain=0.00000059 BTC

loop version: 0.1.2-alpha
commit ee5f185

Channel

I made a swap, but anyway to select channel to loop out from? It seemed like it just took the best one. Would be nice to be able to select.

Hanging on LOOP_OUT PREIMAGE_REVEALED

Attempting to loop out a channel of loop's choosing with the following command:

$ loop out 331004 --addr n3j7rbY4fUd23XDEKPHVFuTkv5qU6gsSQB

Running loop monitor prints the following:

$ loop monitor
Note: offchain cost may report as 0 after loopd restart during swap
2019-07-26T16:32:22Z LOOP_OUT PREIMAGE_REVEALED 0.00331004 BTC - tb1q6pvk82ch64wcalzu6ql9dvxrgunm573wmxm0kqtjjxxs87umljtqt5rale 

Here are the logs from loop

2019-07-26 16:21:45.963 [INF] CLIENT: Offchain swap destination: 0223acffd7f363b4591ce860eda870fea352e981212d8a25e96a0ebea37faae288                                                           
2019-07-26 16:21:49.738 [INF] LOOPD: Loop out request received                                                                                                                                
2019-07-26 16:21:49.738 [INF] CLIENT: LoopOut 0.00331004 BTC to n3j7rbY4fUd23XDEKPHVFuTkv5qU6gsSQB (channel: <nil>)                                                                           
2019-07-26 16:21:49.754 [INF] CLIENT: Initiating swap request at height 1571110                                                                                                               
2019-07-26 16:21:50.502 [INF] CLIENT: 014e40 Htlc address: tb1q6pvk82ch64wcalzu6ql9dvxrgunm573wmxm0kqtjjxxs87umljtqt5rale                                                                     
2019-07-26 16:21:50.508 [INF] CLIENT: 014e40 state Initiated                                                                                                                                  
2019-07-26 16:21:50.508 [INF] CLIENT: 014e40 Sending swap payment lntb3310100n1pwnk2y7pp5q98yq20ff70mnqlqm8xsvtld5t9va5r9yxf4y36eppnn5wpf7ywqdq8wdmkzuqcqzxgxq97zvuqg3dr7zamxvmndsjj4559fvt5my
tv25fwuj2mdw2gmqq76xrztlnpar0leu09p7q4myva0u8q3vq2q884gsmfmqahx96nexkyqrn0fvcpp6fcxh                                                                                                          
2019-07-26 16:21:50.508 [INF] CLIENT: 014e40 Sending prepayment lntb13370n1pwnk2y7pp54qz0zckfqk4pfrzx8k00k9g7hex0suk4xfv2nwn7knyaqnhx4feqdq2wpex2urp0ycqzxgxq97zvuq0x3hs743qkakucllxh3arvv3cyt
n588j6pxr0nzn8rc0u4qegqq42k78fkgkrz7jdayqkcdg68vt6ehnjdemkhnh6x7aszwsaghsf2qps2vump                                                                                                           
2019-07-26 16:21:50.508 [INF] CLIENT: 014e40 Register conf ntfn for swap script on chain (hh=1571110)                                                                                         
2019-07-26 16:21:50.509 [INF] CLIENT: 014e40 Checking preimage reveal height 1571190 exceeded (height 1571110)                                                                                
2019-07-26 16:21:50.509 [INF] CLIENT: 014e40 Waiting for either htlc on-chain confirmation or  off-chain payment failure                                                                      
2019-07-26 16:21:57.649 [INF] LNDCLIENT: Payment a804f162c905aa148c463d9efb151ebe4cf872d53258a9ba7eb4c9d04ee6aa72 completed                                                                   
2019-07-26 16:22:15.502 [INF] LOOPD: Monitor request received                                                                                                                                 
2019-07-26 16:32:12.953 [INF] CLIENT: Received block 1571111                                                                                                                                  
2019-07-26 16:32:12.953 [INF] CLIENT: 014e40 Checking preimage reveal height 1571190 exceeded (height 1571111)                                                                                
2019-07-26 16:32:12.953 [INF] CLIENT: 014e40 Swap script confirmed on chain                                                                                                                   
2019-07-26 16:32:12.954 [INF] CLIENT: 014e40 Htlc tx cd6d9bc5a309d7a4e7c0b2bee6dce7c021b7c9691d619c7fdd5643cf2dd43870 at height 1571111                                                       
2019-07-26 16:32:12.954 [INF] CLIENT: 014e40 Htlc value: 0.00331004 BTC                                                                                                                       
2019-07-26 16:32:22.965 [INF] CLIENT: 014e40 state PreimageRevealed
2019-07-26 16:32:22.965 [INF] CLIENT: 014e40 Sweep on chain HTLC to address n3j7rbY4fUd23XDEKPHVFuTkv5qU6gsSQB with fee 0.00000138 BTC (tx d4cf9b15e4de998b66dca98d72f6d8969a291ab453c06ded5b5e88f7fd24af92)
2019-07-26 16:32:22.986 [WRN] CLIENT: 014e40 Publish sweep: rpc error: code = Unknown desc = -26: min relay fee not met, 138 < 139 (code 66)                                                 
2019-07-26 16:52:27.069 [INF] CLIENT: 014e40 Sweep on chain HTLC to address n3j7rbY4fUd23XDEKPHVFuTkv5qU6gsSQB with fee 0.00000138 BTC (tx 338d76463540d4b98ee2a3bc740bbcd07c5226f2c4c44aa17151223f2632dca3)
2019-07-26 16:52:27.090 [WRN] CLIENT: 014e40 Publish sweep: rpc error: code = Unknown desc = -26: min relay fee not met, 138 < 139 (code 66)                                                 
2019-07-26 17:12:40.805 [INF] CLIENT: 014e40 Sweep on chain HTLC to address n3j7rbY4fUd23XDEKPHVFuTkv5qU6gsSQB with fee 0.00000138 BTC (tx 38d8924d3ec9300992efffd1752eb37f67c0edb387959b7e735d7d378434e90d)
2019-07-26 17:12:40.823 [WRN] CLIENT: 014e40 Publish sweep: rpc error: code = Unknown desc = -26: min relay fee not met, 138 < 139 (code 66)                                                 
2019-07-26 17:26:08.237 [INF] CLIENT: 014e40 Sweep on chain HTLC to address n3j7rbY4fUd23XDEKPHVFuTkv5qU6gsSQB with fee 0.00000138 BTC (tx c319b6cb6203686bb4d1d68ed782fc0841183051b0920c8706ccfc1d855e7906)
2019-07-26 17:26:08.251 [WRN] CLIENT: 014e40 Publish sweep: rpc error: code = Unknown desc = -26: min relay fee not met, 138 < 139 (code 66)                                                 
2019-07-26 17:37:14.333 [INF] CLIENT: 014e40 Sweep on chain HTLC to address n3j7rbY4fUd23XDEKPHVFuTkv5qU6gsSQB with fee 0.00000138 BTC (tx 3eba3baba59f5fab6e2c4e1e474bf6343e2bdc3962f5b953557e4702f5e75ba2)
2019-07-26 17:37:14.346 [WRN] CLIENT: 014e40 Publish sweep: rpc error: code = Unknown desc = -26: min relay fee not met, 138 < 139 (code 66)                                                 
2019-07-26 17:41:41.732 [INF] CLIENT: 014e40 Sweep on chain HTLC to address n3j7rbY4fUd23XDEKPHVFuTkv5qU6gsSQB with fee 0.00000138 BTC (tx 4be6206c4a6e18c457d4ed7e0024474778b4ad196822e5a75d05ef13f3be7c6f)
2019-07-26 17:41:41.746 [WRN] CLIENT: 014e40 Publish sweep: rpc error: code = Unknown desc = -26: min relay fee not met, 138 < 139 (code 66)                                                 
2019-07-26 17:43:20.349 [INF] CLIENT: 014e40 Sweep on chain HTLC to address n3j7rbY4fUd23XDEKPHVFuTkv5qU6gsSQB with fee 0.00000138 BTC (tx 43770da0d6e74727de544edb72d11c11f21d5aff4e6cd2d35cf8a85e3da7a66b)
2019-07-26 17:43:20.361 [WRN] CLIENT: 014e40 Publish sweep: rpc error: code = Unknown desc = -26: min relay fee not met, 138 < 139 (code 66)
2019-07-26 17:44:42.287 [INF] CLIENT: 014e40 Sweep on chain HTLC to address n3j7rbY4fUd23XDEKPHVFuTkv5qU6gsSQB with fee 0.00000138 BTC (tx 1f798533b0062ad3f3ad5b77c4ceff8dae04c2040b796da34d7
885f3b61bf68b)
2019-07-26 17:44:42.302 [WRN] CLIENT: 014e40 Publish sweep: rpc error: code = Unknown desc = -26: min relay fee not met, 138 < 139 (code 66)
2019-07-26 17:55:13.572 [INF] CLIENT: 014e40 Sweep on chain HTLC to address n3j7rbY4fUd23XDEKPHVFuTkv5qU6gsSQB with fee 0.00000138 BTC (tx 5e1f42d200196d007c3dc456bed70ba6a98f90ab31cd0153dc0
ac58fcdc7e7cd)
2019-07-26 17:55:13.588 [WRN] CLIENT: 014e40 Publish sweep: rpc error: code = Unknown desc = -26: min relay fee not met, 138 < 139 (code 66)
2019-07-26 18:14:45.265 [INF] CLIENT: 014e40 Sweep on chain HTLC to address n3j7rbY4fUd23XDEKPHVFuTkv5qU6gsSQB with fee 0.00000138 BTC (tx 55c1f85ffd9d1262a547b3a5e2a092545688a344f1e244c820b
5caedf7512e6f)
2019-07-26 18:14:45.283 [WRN] CLIENT: 014e40 Publish sweep: rpc error: code = Unknown desc = -26: min relay fee not met, 138 < 139 (code 66)

It appears like there is some kind of fee issue presenting, advice on how to proceed?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.