Builder's Guide
  • Welcome to the Builder's Guide to the LND Galaxy!
  • The Lightning Network
    • Overview
    • Payment Channels
      • Lifecycle of a Payment Channel
      • Watchtowers
      • Understanding Sweeping
      • Etymology
    • The Gossip Network
      • Identifying Good Peers on the Lightning Network
    • Pathfinding
      • Finding routes in the Lightning Network
      • Channel Fees
      • Multipath Payments (MPP)
    • Lightning Network Invoices
      • Understanding Lightning Invoices
    • Making Payments
      • The Payment Cycle
      • Timelocks
      • ⭐Hashed Timelock Contract (HTLC)
      • Payment Etymology
      • ⭐What Makes a Good Routing Node
      • Understanding Submarine Swaps
      • Instant Submarine Swaps
    • Liquidity
      • ⭐Understanding Liquidity
      • Managing Liquidity on the Lightning Network
      • Liquidity Management for Lightning Merchants
      • How to Get Inbound Capacity on the Lightning Network
      • Lightning Service Provider
    • L402: Lightning HTTP 402 Protocol
      • Macaroons
      • L402
      • 📋Protocol Specification
      • Implementations and Links
    • Taproot Assets
      • Taproot Assets Protocol
      • Taproot Assets on Lightning
      • Edge Nodes
      • Taproot Assets Trustless Swap
      • FAQ
      • Glossary
  • Lightning Network Tools
    • LND
      • 🛠️Get Started
      • lnd.conf
      • First Steps With LND
      • Wallet Management
      • Sending Payments
      • Atomic Multi-path Payments (AMP)
      • Receiving Payments
      • Unconfirmed Bitcoin Transactions
      • Channel Fees
      • Inbound Channel Fees
      • Macaroons
      • Configuring Watchtowers
      • Pathfinding
      • Blinded Paths
      • Key Import
      • Secure Your Lightning Network Node
      • Configuration of a Routing Node
      • Quick Tor Setup
      • Configuring Tor
      • Enable ‘Neutrino mode’ in Bitcoin Core
      • Send Messages With Keysend
      • Partially Signed Bitcoin Transactions
      • Bulk onchain actions with PSBTs
      • Sweeper
      • Debugging LND
      • Fuzzing LND
      • LND API documentation
      • Channel Acceptor
      • RPC Middleware Interceptor
      • HTLC Interceptor
      • NAT Traversal
      • Recovery: Planning for Failure
      • Migrating LND
      • Disaster recovery
      • Contribute to LND
    • Lightning Terminal
      • What is Lightning Terminal?
      • 🛠️Get litd
      • Run litd
      • Integrating litd
      • Demo: Litd Speed Run
      • Connect to Terminal
      • Recommended Channels
      • Rankings
      • Health Checks
      • Liquidity Report
      • Opening Lightning Network Channels
      • Managing Channel Liquidity
      • Autofees
      • AutoOpen
      • LND Accounts
      • Loop and Lightning Terminal
      • Loop Fees
      • Pool and Lightning Terminal
      • Command Line Interface
      • Troubleshooting
      • Lightning Node Connect: Under the hood
      • LNC Node Package
      • LITD API Documentation
      • Privacy and Security
      • Privacy Policy
      • Terms of Use
    • Loop
      • 🛠️Get Started
      • The Loop CLI
      • Autoloop
      • Static Loop In Addresses
      • Instant Loop Outs
      • Peer with Loop
      • Loop API Documentation
    • Pool
      • Overview
      • Quickstart
      • 🛠️Installation
      • First Steps
      • Accounts
      • Orders and Asks
      • Sidecar Channels
      • Zero-confirmation Channels
      • Channel Leases
      • Batch Execution
      • Account Recovery
      • Pool API Documentation
      • FAQs
    • Taproot Assets
      • Get Started
      • First Steps
      • Taproot Assets Channels
      • Asset Decimal Display
      • Become an Edge Node
      • RFQ
      • Collectibles
      • Universes
      • Asset Loop
      • Debugging Tapd
      • Multisignature
      • Minting Assets With an External Signer
      • Lightning Polar
      • Operational Safety Guidelines
      • Taproot Assets API Documentation
    • Aperture
      • ⚒️Get Aperture
      • LNC Backend
      • LNC Mailbox
      • Pricing
    • Faraday
      • 🛠️Get Started
      • The Faraday CLI
      • Faraday API Documentation
  • LAPPs
    • Guides
      • Use Polar to Build Your First LAPP
        • Setup: Local Cluster with Polar
        • Setup: Run the Completed App
        • Setup: Run the App Without LND
      • Add Features
        • Feature 1: Connect to LND
        • Feature 2: Display Node Alias and Balance
        • Feature 3: Sign and Verify Posts
        • Feature 4: Modify Upvote Action
      • Make Your own LNC-powered Application
    • Next Steps
  • Community Resources
    • Resource List
    • Lightning Bulb 💡
    • Glossary
    • FAQ
Powered by GitBook
On this page
  • A smooth user experience
  • Additional Features
  • Make use of LNC in your application
  • Install NPM package
  • Import package
  • Best practices
  • Demo application
  • Install the demo application
  • Connect your node
  • Things to do:

Was this helpful?

  1. Lightning Network Tools
  2. Lightning Terminal

LNC Node Package

Use NPM to download and install the LNC node package and enable your application to connect directly to your users' nodes via Lightning Node Connect.

PreviousLightning Node Connect: Under the hoodNextPrivacy and Security

Last updated 2 days ago

Was this helpful?

Lightning Node Connect (LNC) is a protocol that allows a node operator to safely and easily connect to a web or mobile application. LNC does not require the node to expose any ports. Instead, the application and the node are connected through a proxy server called the mailbox. The connection between node and application are end-to-end encrypted.

A smooth user experience

1. User generates pairing phrase in their node

The user may be behind a NAT or firewall and does not need to expose ports. They may specify limited conditions, such as ‘read-only’ or ‘administrator.’

It is also possible to select a custom mailbox. This will then also have to be specified in the application.

2. User enters pairing phrase into the application they want to connect to and chooses a password

A pairing phrase typically consists of 10 English words which can be copied, written or scanned via a QR code. The password is used to encrypt the connection details in the browser’s storage or the device

3. A persistent connection is established directly between the node and the application

All connections are end-to-end encrypted and the mailbox is unable to see the contents of the packages transmitted between node and application

4. Subsequent connections require only the user’s password

The long-term Diffie-Hellman key is decrypted using the password and a second handshake is used to reestablish and verify the connection

Additional Features

Through Lightning Node Connect a user may access their node in addition to liquidity services like Loop and Pool.

Make use of LNC in your application

lnc-web

Install NPM package

npm install @lightninglabs/lnc-web

Import package

import LNC from ‘@lightninglabs/lnc-web’

Best practices

The credentials, such as the long-term Diffie-Hellman keys should be encrypted at rest with a solid password of the user’s choosing.

Demo application

The LNC-web demo React application can be quickly installed on your local machine using NPM. It lets you connect to your own node via Lightning Node Connect by providing only the Pairing Phrase from litd. The app shows you basic information obtained through the “getinfo” RPC call, showing alias, pubkey, active and inactive channels as well as synchronization status.

Install the demo application

1. We will fetch the lnc-web repository from github and navigate into the directory with the command:

git clone https://github.com/lightninglabs/lnc-web.git

cd lnc-web/demos/connect-demo

2. We will install the demo app with the command:

npm install

3. We can run the app now and navigate to it in our browser

npm start

Connect your node

1. We will obtain the pairing phrase through litd. This can be done through the command line or the GUI

litcli --lndtlscertpath ~/.lit/tls.cert sessions add --label="LNC Demo" --type admin

1. We will copy the pairing phrase and keep it ready for the next step

2. Finally, we can connect the LNC Demo by opening the app in our browser at localhost:3000, click on the ‘Connect’ button at the top right and enter our pairing phrase. We will also have to specify a password.

4. We can close this page and come back to it anytime. Our credentials are stored locally in encrypted form. Upon reconnection our password is used to decrypt our connection details and re-authenticate the session with litd on our node.

Things to do:

  • Enable LNC as a connection method in your app or wallet

LNC works natively with WebAssembly applications (Wasm). To make use of LNC on the web, set up the open source NPM module by configuring it with a pairing phrase (supplied by the user), a mailbox and your application’s Wasm binary.

This package is right for you if you are developing a web application, such as WebAssembly. Your users will typically navigate to a website, where the lnc package and wasm are loaded into their browser. Have a look at for references.

To connect your node, your node needs to run LND and litd. You can from , or install it using your Lightning software bundle of choice, for example Lightning Terminal in Umbrel.

Check out the relevant code in the project’s

Read more: Lightning Node Connect: Under the hood
available here
Lightning Terminal
get litd
source here
readme
Watch: Introducing LNC-web