Liquidity Swaps

A how-to liquidity video would be popular, Paul :grinning:

1 Like

Yes, I’ve got a video planned to do a deep-dive into my current level of understanding on Lightning. Might be a mini-series, but the idea would be to start with setting up two linked nodes (CLN to support Lightning Offers, linked to LND as the primary node), clearing up inbound liquidity via Boltz, balancing the channel between CLN and LND nodes, pipeline for using the setup to add forward privacy to KYC bitcoin, and connecting up Alby Hub, establishing a lightning address, integrating with Alby Go for lightning on-the-go, and integrating with Nostr.

2 Likes

Yep. I’m looking forward to that for sure. I got off on the wrong foot with liquidity. @paul I really appreciate the one on one yesterday afternoon. Head is swimming a little though. I did get a grasp of some of it but in the interim I broke my ability to sign from RTL to CL so I could control the login to the swap I got myself into.

Today I’m going to continue to figure out how to add my CL channel as a peer in LND. I just gotta make sure I do it right because now I have 1,000,000 sats on the line (don’t wanna lose them puppies).

Cant figure out why the LND node wont show up at 1ml but the CL node does. 1ml reports my CL node so I guess I first have to claim it and then move forward.

Question if I may: When I do a backup are the sats in LND and CL also in the backup?

Any-who. If you want a guinea pig I’ll offer up any help I can.

Thanks again. Most appreciated.

To make your node visible on 1ML, usually you just need to wait a while for your node to propagate the network. Note that you must have at least one public channel before your node will show up in the gossip data. An easy alternative would be to just add 1ML’s node as a peer, and then they’ll definitely know about you:

0217890e3aad8d35bc054f43acc00084b25229ecff0ab68debd82883ad65ee8266@66.109.24.41:9735

Yes, when you do a general StartOS backup for your server, as long as you make sure the the Core Lightning and LND services are also checked, then restoring from the backup will fully restore your lightning nodes (with the balances, channels, etc)

1 Like

Yep. Gotcha on the back-up procedure.

From what I can gather is I do not need to claim my node on 1ml unless I want to broadcast and promote it. Check

For the record LND has been running for 12 months so that’s why I’m confused about it not being seen but regardless of that the CL node is recognized so from what I gather is I can add the CL node as a peer from LND using RTL. Check.

This is were my notes fell apart…should the peer I open between myself be 580,000 sats or is that the channel I would open? See Paul…that is what 65+ and wiser does to you. :wink:

EDIT: Correction…just add 1ml as peer and “do it later”. Check

I’m going to take a shot at this as I see it. No harm no foul in trying. Cant really break anything.

Thank you sir.

ps - I pounder if I may be getting a head of your mini series :thinking:

To summarize the basic architecture:

Core Lightning node with one channel
– 60,000 sats, connected to your LND node

LND node with two channels
– 60,000 sats, connected to your Core Lightning node (same channel mentioned above)
– 500,000 sats, connected to ACINQ

Of course, you will have more channels besides the ones above, but these are needed for the basic architecture.

That 60,000 sat channel between your two nodes can be opened from either end. You can go into Core Lightning and open the channel up from it to your LND node for 60,000 sats. Or you can go into Ride The Lightning (which we configured to point at your LND node) and open a channel up from it to your Core Lightning node for 60,000 sats. Since I think you mentioned you are able to see your Core Lightning node on 1ML, the second option will probably be the simplest.

That 500,000 sat channel to ACINQ should be opened up from your LND node (using Ride The Lightning), and not from your Core Lightning node.

Once all of the channel open transactions have been mined and there have been enough confirmations so that the channels appear active, then you will open some inbound liquidity on your 500,000 sat channel with ACINQ. This can be done going to Boltz.exchange to do a swap from Lightning to Bitcoin. For the receive address, you typically would use a cold storage address (if you’ve got your hardware wallet set up), otherwise just send it to a software wallet that you own (could even be the wallet on your Lightning node if you prefer)

2 Likes

I watched a podcast interview with Jack Dorsey earlier, he was asked what would he change about the bitcoin world if he could? He said Lightning. “It’s not bad,” he said, “it’s just… challenging.” :stuck_out_tongue_closed_eyes:

Haha, nice one! Personally, I disagree with Dorsey about changing it though. I think it just needs to have a better UX built on top of the underlying structure. Nearly everything that consumes my time managing my lightning nodes could be easily automated behind the scenes, while keeping the system non-custodial and self-sovereign.

2 Likes

A bit a challenge for a “newbie operator” but the consumer lightning wallets are a breeze. Here my invoice now please pay me.

This deep dive self-sovereign path is a touch more intricate. Since Paul opened my eyes about building liquidity between my self with my LND node and C-Lightning node he put me on a path to “learn it der’nt”. Now - what Paul said about management…that sounds “fun”. :thinking:

@paul - thanks for the short an sweet description above. Helped immensely. Just waiting on ACINQ. The only thing puzzling is the open channel from LND to CL shows:
Untitled-12

But it’ll get worked out. A work in progress: One step at a time. Any-who it’s coming together and probably would have taken 6 months for me to figure this out on my own. :+1:

That is exactly what you want – 60,000 sats of inbound liquidity on the Core Lightning side. This channel will be a route for payments outside of your Core Lightning node (Ocean payouts, for example) to flow into your Core Lightning node (by way of your LND node). In the distant future, once this channel starts filling up with all your mining rewards, you simply move those 60,000 sats back over to the LND side again like they are now, by creating an invoice from LND, and paying it from Core Lightning.

1 Like

C-lightning log when I try and send to LND:

2025-06-23T17:00:09-06:00 {“level”:“error”,“message”:“\tFailed: We could not find a usable set of paths. The shortest path is 902330x2713x0, but 902330x2713x0/0 layer auto.localchans says max is 0msat”,“timestamp”:“2025-06-23 23:00:09:09”}

That’s because the outbound liquidity is already on the LND side, based on your screenshot (since you opened it from the LND side). That means, on the Core Lightning side it is all inbound liquidity. You won’t need to do the step of sending liquidity from Core Lightning to LND until some time in the distant future after you have mined a lot of rewards and the liquidity starts to fill up on the Core Lightning side.

Now if you are trying to balance your other channels on your Core Lightning node (not the channel with your LND node), then you are likely running into Core Lightning’s routing issues (which of course is why I recommended using LND as your primary lightning node in the first place). You can try sending in smaller chunks, or enabling xpay to see if it can find a route.

Ultimately, I would suggest not fighting with it, and simply close any other channels as their outbound liquidity fills up on the Core Lightning side, and just leave the one channel with your LND node as the single channel on your Core Lightning node. All of your main channels should be on your LND node, so that Core Lightning is only used for Ocean mining (over the one single channel)

Yep. Understand and I’m completely on board with LND as primary node.

I was just testing running for future - I’ll flesh out all other channels I have on C-lightning. The only one I have reservation about closing is the triangle swap, which I should have never gotten into. Just hate to drop it out as it would make me feel like an ass for not completing an agreement. I’ll work on it in my own head. Never the less…your advice is rock sold.

BTW - right now it looks like the swap channel is where the Ocean payout is being handled from what I can tell. I’ll have to pay close attention to balance change

Thanks bud.

It probably won’t hurt anything to keep the triangle swap channel(s). Just treat the sats there as locked up as long as you stay in the agreement. As that one fills up, the other members of the triangle will balance their channels, which will likey result in periodic changes to the liquidity on your LND channel (since that is one of the channels which reaches outside of the triangle). Any time your channel with the LND node fills up, that is when you would do the step to send liquidity from the Core Lightning side to the LND side (to free up room for your Ocean payouts). The rest is just noise (sats will move around between channels as transactions traverse through your nodes).

1 Like

BTW, if you really need to get some of the sats out of that channel and you want to try xpay before resorting to closing the channel, that can be enabled via: Services > Core Lightning > Config > Advanced > Experimental Features > Xpay. Try enabling that, and making the invoices in smaller chunks. That will usually get around Core Lightning’s routing problems.

The Xpay option worked for me when I had routing issues.

Newbie Q for Paul - If I opened an LND to LND channel with Greg for payment routing, once the channel was open could he add liquidity on his side or would opening a channel in reverse be better or the same thing?

Although Xpay is active in the setup the route didn’t work as expected. I have since figured the freaking thing out (with much assistance for Paul). LND, RTL and Alby are now working. I’ll test Alby when I move a few miners back to Braiins to make sure the lightning payout is working from that pool to my Alby wallet address.

Adding a second channel from the other direction is one way (though it costs a base layer transaction fee). Another way that is entirely over lightning (so low-fee and instantaneous) is a circular rebalance. Either of you could initiate this.

If Greg were to initiate it, he would go to his list of channels in RTL, and under Actions next to his ACINQ channel, he would select “Circular Rebalance”. He would input the amount to rebalance and select your channel for “Receive from Peer”. He would select a max fee rate and click Rebalance. Behind the scenes, this would create an invoice to himself with a route that goes out through the ACINQ channel and back in through his channel with your node. The end result (from his node’s perspective) is outbound liquidity reducing on the ACINQ channel and increasing on your channel.

If you initiated the circular rebalance, the process would look similar, except you would select your channel with his node in the first step, and then select another channel (with ACINQ, etc) for Receive From Peer.

Top of the morning to you @paul

No were to put this really so I’ll ask here. I see my private channel in CL is down. The log shows this:

2025-06-27T07:07:02-06:00 2025-06-27T13:07:02.611Z INFO 039d56f3db41cb3a870d1f12c832c727a8b2abc68f3d64563d9234fe7206fd4744-channeld-chan#16: Peer connection lost
2025-06-27T07:07:02-06:00 2025-06-27T13:07:02.611Z INFO 039d56f3db41cb3a870d1f12c832c727a8b2abc68f3d64563d9234fe7206fd4744-chan#16: Peer transient failure in CHANNELD_NORMAL: channeld: Owning subdaemon channeld died (62208)
2025-06-27T07:17:48-06:00 2025-06-27T13:17:48.843Z INFO 02628fa1fab09c2a8aefa44aeac5a7f2e8bdbc6592c4f35705bd4df1ff5133aea4-channeld-chan#14: Peer connection lost
2025-06-27T07:17:48-06:00 2025-06-27T13:17:48.844Z INFO 02628fa1fab09c2a8aefa44aeac5a7f2e8bdbc6592c4f35705bd4df1ff5133aea4-chan#14: Peer transient failure in CHANNELD_NORMAL: channeld: Owning subdaemon channeld died (62208)
2025-06-27T07:28:21-06:00 2025-06-27T13:28:21.544Z INFO 02abb8c4a2d97453d2540edf334e83436ab7584cc42d475a2e2f88c46390ea9055-channeld-chan#19: Peer connection lost

That is the only channel down? Is this a CL thing? Should I be concerned?

Thanks

ps - Actually I see it is the Start9 HQ peer connection itself. Not on my end I don’t think. Disregard. I’ll see if it works itself out. Sorry

Fletcher - do you want me to help you out with this? Glad to if you need it.