Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

https://github.com/shocknet/Lightning.Pub

Enable WebApps from your Lightning node.
https://github.com/shocknet/Lightning.Pub

bitcoin lightning lightning-network nostr payments wallet

Last synced: 26 days ago
JSON representation

Enable WebApps from your Lightning node.

Lists

README

        

![Lightning.Pub](https://github.com/shocknet/Lightning.Pub/raw/master/pub_logo.png)

![GitHub last commit](https://img.shields.io/github/last-commit/shocknet/Lightning.Pub?style=flat-square)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)
[![Chat](https://img.shields.io/badge/chat-on%20Telegram-blue?style=flat-square)](https://t.me/ShockBTC)
![X (formerly Twitter) Follow](https://img.shields.io/twitter/follow/ShockBTC?style=flat-square&logo=bitcoin)

### Don't just run a Lightning Node, run a Lightning Pub.

"Pub" is a [Nostr](https://nostr.info)-native account system designed to make running Lightning infrastructure for your friends/family/customers easier than previously thought possible.

It may come as a surprise that the biggest hurdle to more Uncle Jim nodes hasn't been with Bitcoin/Lightning node management itself, as we've seen liquidity easily automated even in unreliable environments like mobile nodes.

It's the legacy baggage of traditional Client-Server web infrastructure, things like IP4, Reverse Proxies, DNS, Firewalls and SSL certificates, all of which require a personal configuration that is a hurdle for most.

Tor as a workaround has proven too slow and unreliable, and a dead-end for clearnet-web usecases. Bxlt12, being a re-implementation of Tor, appears destined for the same fate.

Pub solves these challenges with a P2P-like design that is also web-friendly, by implementing a full RPC that is Nostr-native. Being Nostr-native eliminates the complexity of configuring your node like a server by using commodity Nostr relays. These relays, unlike LNURL proxies, are trustless by nature of Nostr's own encryption spec (NIP44).

Additionally, support for optional services are integrated into Pub for operators seeking backward compatibility with legacy LNURLs and Lightning Addresses.

By solving the networking and programability hurdles, Pub provides Lightning with a 3rd Layer that enables node-runners and Uncle Jims to more easily bring their personal network into Bitcoin's permissionless economy. In doing so, Pub runners can keep the Lightning Network decentralized, with custodial scaling that is free of fiat rails, large banks, and other forms of high-time-preference shitcoinery.

#### Features:

- Wrapper for [`LND`](https://github.com/lightningnetwork/lnd/releases) that can serve accounts over LNURL and NOSTR
- A growing number of [methods](https://github.com/shocknet/Lightning.Pub/blob/master/proto/autogenerated/client.md)
- Accounting SubLayers for Application Pools and Users
- A fee regime allows applications owners to monetize users, or node operators to host distinctly monetized applications.

![Accounts](https://github.com/shocknet/Lightning.Pub/raw/master/accounting_layers.png)

- Connecting via ShockWallet is as easy as pasting an nprofile
- Or use a link to share your nprofile with friends and family

Connect Wallet Invite Guests

#### Planned
- [ ] A management dashboard is actively being integrated into [ShockWallet](https://github.com/shocknet/wallet2)
- [ ] Nostr native "offers" (successor to LNURL-Pay, Lightning Address, Bxlt12)
- [ ] Automated Channels
- [ ] Bootstrap Peering (Passive "LSP")
- [ ] Event Notifications
- [ ] Swap integration
- [ ] High-Availabilty / Clustering

Dashboard Wireframe:

Pub Dashboard

> [!IMPORTANT]
> ShockWallet and Lightning.Pub are free software. If you would like to see continued development, please show your [**support**](https://github.com/sponsors/shocknet) 😊

License

> [!WARNING]
> While this software has been used in a high-profile production environment for over a year, it should still be considered bleeding edge. Special care has been taken to mitigate the risk of drainage attacks, which is a common risk to all Lightning API's. An integrated Watchdog service will terminate spends if it detects a discrepency between LND and the database, for this reason **IT IS NOT RECOMMENDED TO USE PUB ALONGSIDE OTHER ACCOUNT SYSTEMS**. While we give the utmost care and attention to security, **the internet is an adversarial environment and SECURITY/RELIABILITY ARE NOT GUARANTEED- USE AT YOUR OWN RISK**.

## Umbrel Installation

Coming Soon

## Desktop Installation

Coming Soon

## Docker

`docker pull ghcr.io/shocknet/lightning-pub:latest`

## Manual CLI Installation

#### Notes:
* Use of a reverse proxy is only required if you wish to serve LNURLs
* The service defaults to port `1776`
* Requires [Node.js](https://nodejs.org) >=18.x
* Commands for your specific OS may differ slightly, Ubuntu/Debian used for example

#### Steps:
1) Run [LND](https://github.com/lightningnetwork/lnd/releases) if you aren't already

*Example mainnet startup*:

```
./lnd --bitcoin.active --bitcoin.mainnet --bitcoin.node=neutrino --neutrino.addpeer=neutrino.shock.network --feeurl=https://nodes.lightning.computer/fees/v1/btc-fee-estimates.json
```

2) Download and Install Lightning.Pub

* `git clone https://github.com/shocknet/Lightning.Pub`

* `cd Lightning.Pub && npm i`

3) Configure values to env file as desired
* `cp env.example .env && nano .env`

5) `npm start`

- A default "wallet" application pool will be automatically created, if you wish to create other app pools:

* `curl -XPOST -H 'Authorization: Bearer defined_in_ADMIN_TOKEN_env' -H "Content-type: application/json" -d '{"name":"ExampleApplicationPoolName"}' 'http://localhost:8080/api/admin/app/add'`

5) Connect with [wallet2](https://github.com/shocknet/wallet2) using the wallet nprofile that gets logged at startup.
> [!NOTE]
> Connecting with wallet will create an account on the node, it will not show or have access to the full LND balance