STORY
Tournament project: Una-connect The safest way to connect your LN node
AUTHOR
Joined 2022.07.28
DATE
VOTES
sats
COMMENTS

Tournament project: Una-connect The safest way to connect your LN node

Few months ago, I had an idea in mind called Una-connect (twitter link).

But first, Una is a Lightning node wrapper I initially created in Node js. The goal was to have a unique API for all LN backends like LND, CLN, Eclair and other applications like lnbits and LndHub.

This wrapper uses a direct connection to LN nodes, like REST API provided by LND or unix socket for CLN. It's great when developing a local app, but you may want to not share your LN node informations. Furthermore, if you are running a node at home (umbrel, citadel, mynode etc), you probably only have Tor. Una supports Tor, but it's a slow solution.

Announcing Una-connect

Una-connect is a new way to control your node remotely without exposing your node informations/credentials.

The initial idea was to use websocket (see twitter link above) because it's a 2 way-communication protocol, so your node can connect to a server without latency, even if it's behind tor.
This idea was good, but all services (for example alby) would have to create a websocket server for this use case only. It's too complicated for just doing LN communication.

Then I remembered Nostr. Nostr also uses websocket for communication, so LN node can connect to this network in the same way as my first idea.
The good news with Nostr is that services don't need to create a websocket server since Nostr is already up and running.

Una-connect uses encrypted direct message (NIP-04) to communicate securely between LN node and service. Thanks to a configuration file, only specified Nostr public keys (services public keys) can control your node.

una-connect schema

Another good news is, because Nostr is an open protocol, you can use any client that implements NIP-04 to control your node using Una-connect!

Una-connect usage in astral.ninja

For example, for a service like Alby, instead of providing your Umbrel LND credentials (url, port, macaroon), you would just have to provide a unique Nostr public key. Using Una-connect, services will never know to what node they are connected to.

Una-connect is open source and available on Github

Only payInvoice and createInvoice actions are available for now (more should come soon)