Create Custodial LND Accounts With Lightning Terminal

Custodial LND accounts

Share this article

The Lightning Network has become the go-to layer for the average bitcoiner due to its ability to provide relatively reliable, cheap payments with instant settlement. These attributes make the Lightning Network ideal for everyday commerce and value exchange.

We can make some assumptions about how the adoption of Lightning grows by looking at some avaialble metrics. There are currently over 5000 BTC locked in the Lightning Network via over 72 000 channels and over 15 000 nodes.

State of the Lightning Network – Source: Mempool.Space

Public capacity growth, channel sizes, and the number of nodes give us metrics to gauge Lightning’s ongoing adoption, but it doesn’t tell the whole story of how Lightning is used.

One reason would be that most adopters of the Lightning Network are not broadcasting directly to it but using a custodian that provides access to Lightning rails. To use the Lightning Network without third parties, you need to run your own node, commit Bitcoin into a channel and manage the inbound and outbound capacity as you send and receive payments.

Instead of dealing with the startup costs and maintenance, many Lightning users opt for custodial services that obfuscate this complexity and provide a user with a slick UI that allows them to send and receive payments via a 3rd party node and channels. Third-party nodes and channels might be frowned upon because they introduce custodial risk, but that doesn’t mean you should shy away from it completely; the implementation clearly has market value and has its merits.

Convenience has a cost.

People are willing to trade custody for convenience, but they need not hand over their custody to a company but rather to someone they know and trust. The Lightning Network is supported by a host of open-source projects that give users more control if they want it.

Lightning allows you to manage payment routing for yourself or on behalf of others, the same way many custodial wallets do for their customers. If you’re using the LND, the most popular of the Lightning implementations, you can turn to tools like Lightning Terminal and use their litd (Lightning Terminal Daemon) and LNC (Lightning Node Connect) to set up Lightning wallets for friends and family.

How Lightning accounts work.

Using litd, Lightning Network node runners can create virtual off-chain accounts on top of their LND node, each with their own macaroon and spending rules, such as spending limits or expiration date.

The accounts feature does not validate whether the sum of all account balances is smaller or equal to the channel balance held in the underlying LND node. A user who uses such an account enters a trust relationship with the node operator regarding the availability of the funds and the node.

The account balances are tracked and enforced by LND.

Features of account-restricted macaroons.

When an account-restricted macaroon is used, the RPC middleware interceptor enforces the following rules:

  • Any payment made by a custodial/restricted user account is deducted from an account’s virtual balance (the full amount, including off-chain routing fees).
  • If a payment (or the sum of multiple in-flight payments) exceeds the account’s virtual balance, it is denied.
  • The on-chain balance of any RPC responses, such as the `WalletBalance` RPC, is always shown as `0`. A custodial/restricted user shouldn’t be able to see what on-chain balance is available to the node operator, as an account can only spend off-chain balances.
  • The off-chain balance (e.g. the response returned by the `ChannelBalance` RPC) always reflects the account’s virtual balance and not the node’s overall channel balance (and any remote balances are always shown as `0`).
  • The list of active/pending/closed channels is always returned empty. The custodial/restricted user should not need to care (or even know) about channels and their internal workings.
  • The list of payments and invoices is filtered only to return payments/invoices created or paid by the account.
  • Invoices created by an account are mapped to that account. If/when such a mapped invoice is paid, the amount is credited to that account’s virtual balance.

Connecting Lightning accounts to a wallet.

  • Install Lightning Terminal on your Lightning node.
  • Under settings, head to Custodial Account
  • Add the permissions you want the account to have, IE view activity, and send and receive.
  • Add a balance if you would like to test the account.
  • Create the account.
Setting custom permissions for custodial accounts

Connecting your Lightning node and multiple wallets.

Lightning Node Connect (LNC) is a novel mechanism to create an end-to-end encrypted connection between a Lightning Network node. This is where macaroons are baked, requests and data are forwarded between node and user, and where the connection to the proxy server is made.

Once you have set up the custodial accounts you want to offer your friends and family, head over to Lightning Node Connect.

Create a new session under “Lightning Node Connect,” give it a name and select “Custom” under permissions, then choose “Custodial Account” in the next window.

This will create a custom pairing phrase that can be passed to wallets like Alby or Zeus.

Connect with Alby wallet.

  • The pairing phrase (typically 10 English words long) is copied to your clipboard.
  • Once you have the phrase, head over to Alby wallet.
  • Select add account.
  • Select connect LND with LNC.
  • Paste your pairing phrase.
  • Click continue.
Connecting your LND with LNC to Alby

Connect with Zeus wallet.

Lightning Terminal custodial wallets are compatible with Zeus wallet

Why would you want a custodial Lightning account?

The following use cases are a great way to experiment with the LND account system and give you an idea of how they can work in various situations.  

Be the custodian of your community.

Lightning is a technically demanding implementation, you can’t walk away from it like you can with on-chain Bitcoin, and it needs to be managed constantly. The average person might not be ready for that level of involvement, so a tech-savvy person in the family or community can offer up their Lightning node a way to interact with Lightning. In this instance, you would manage the node’s liquidity and provide the capital for the channels. 

You can onboard your friends, family or community members by creating an account, locking a macaroon to that account and then scanning a QR code with a Lightning wallet on the community member’s smartphone or computer. 

Anyone running a custom macaroon via your node will have an account that you manage; they can send and receive funds and not have to worry about the technical aspects of Lightning.

Subaccounts for apps and devices. 

There are many ways to interact with Lightning, and keeping track of them all becomes much easier with an account-based system. You could set up an account that interacts with your bolt card and another that interacts with a browser extension like Alby.

That amount could be enforced by the account so the NFC device or browser extension doesn’t have to keep track of its spending actions.

 An account can be shared between extensions installed in different browsers, so if you’d like, you could connect the same account to Alby and your Bolt Card or keep them separate; it really is up to how you prefer to manage your bookkeeping. 

Isolate accounts and funds for security purposes. 

A service running multiple applications on top of a single LND node to limit the damage from a single application being faulty, an account-based model limits the access to your node and funds. 

Source larger pools of liquidity. 

Suppose you wish to run a routing node, but you don’t have enough liquidity to make the yield worthwhile. You can manage the funds for different family and community members by running an account model. 

You get to manage the total pool of liquidity, open and close channels to try and secure a better return for yourself on the capital held on your node, while the users of your node get to enjoy quick and cheap payments. 

As long as you can route payments for them, you also get to benefit from routing fees, so having accounts will ensure you have a lot more traffic coming through your node. 

Do your own research.

If you want to learn more about Uncle Jim Lightning Nodes, use this article as a jumping-off point and don’t trust what we say as the final say. Take the time to research, check out their official resources below or review other articles and videos tackling the topic.

Are you a Bitcoin and Lightning fan?

Have you been using Lightning to make micro-payments? Stream sats or engage with apps? Which app is your favourite? Do you run a Lightning node? Have you tried all the forms of Lightning payments? Which one do you prefer?

Let us know in the comments down below.

Disclaimer: This article should not be taken as, and is not intended to provide any investment advice. It is for educational and entertainment purposes only. As of the time posting, the writers may or may not have holdings in some of the coins or tokens they cover. Please conduct your own thorough research before investing in any cryptocurrency, as all investments contain risk. All opinions expressed in these articles are my own and are in no way a reflection of the opinions of The Bitcoin Manual

Leave a Reply

Related articles

You may also be interested in

Onion Bomb Attack On Lightning

What Is An Onion Bomb DoS Attack?

The Lightning Network, the most popular scaling solution for Bitcoin, has not only created additional transactional capacity but also new business models, but it’s not

full block ordinals

What Are Full Block Ordinals?

Ordinals have given the Bitcoin community much to think about. Some say they make Bitcoin fun, and others say they’re spam. Personally, I don’t need

Cookie policy
We use our own and third party cookies to allow us to understand how the site is used and to support our marketing campaigns.