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: about 12 hours ago
JSON representation
Enable WebApps from your Lightning node.
- Host: GitHub
- URL: https://github.com/shocknet/lightning.pub
- Owner: shocknet
- License: agpl-3.0
- Created: 2019-10-17T12:51:39.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2024-05-28T11:55:28.000Z (6 months ago)
- Last Synced: 2024-05-29T02:46:13.741Z (6 months ago)
- Topics: bitcoin, lightning, lightning-network, nostr, payments, wallet
- Language: TypeScript
- Homepage: https://shock.network
- Size: 46.9 MB
- Stars: 44
- Watchers: 3
- Forks: 10
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# Lightning.Pub
![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.
Lightning payments open the door to a new internet, but because of UX challenges with sovereignty we've seen a much slower uptake than we should for something so amazing.
It may come as a surprise that the biggest hurdle to more adoption via Family and SMB Lightning nodes hasn't been with Bitcoin/Lightning node management itself, as we've seen that liquidity is easily automated, but rather the legacy baggage of traditional Client-Server web infrastructure. Things like IP4, Reverse Proxies, DNS, Firewalls and SSL certificates, all 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. Mobile node are easy but channels for every device is expensive and unscalable, and the UX that suffers from the limitations of the node not being an always-online server.
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, Busineses, 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.
## Table of Contents
- [Features](#features)
- [Planned Features](#planned-features)
- [Installation](#installation)
- [One-Line Deployment](#one-line-deployment)
- [Docker Installation](#docker-installation)
- [Manual CLI Installation](#manual-cli-installation)
- [Usage Notes](#usage-notes)
- [Misc](#support-development)## 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)
- Automated Channels
- Receives quotes from multiple LSPs including Zeus, Voltage, and Flashsats
- Bootstrap Peering
- A pub node may trust another pub node until it can afford a channel
- 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
## Planned Features
- [x] A management dashboard is actively being integrated into [ShockWallet](https://github.com/shocknet/wallet2)
- [x] NIP-69 Nostr native "offers"
- [ ] P2P "LSP" coordination for channel batching over Nostr
- [ ] Event Notifications
- [ ] Swap integration
- [ ] High-Availabilty / ClusteringDashboard Wireframe:
## Installation
### One-Line Deployment
Paste one-line and have a Pub node in under 2 minutes. It uses neutrino so you can run it on a $5 VPS or old laptop.
This method installs all dependencies and creates systemd entries. It has been tested only in Ubuntu/Debian x64 environments, but is general enough that it should work on any linux system with systemd.
Mac support is rough'd in, but completely untested. Help wanted.
To start, run the following command:
```ssh
sudo wget -qO- https://deploy.lightning.pub | sudo bash
```It should look like this in a minute or so
![One-Line Deployment](https://raw.githubusercontent.com/shocknet/Lightning.Pub/master/one-liner.png)
Please report any issues to the [issue tracker](https://github.com/shocknet/Lightning.Pub/issues).
#### Automatic updates
These are controversial to push by default and we're leaning against it. You can however add the line to cron to run it periodically and it will handle updating.
### Docker Installation
1. Pull the Docker image:
```ssh
docker pull ghcr.io/shocknet/lightning-pub:latest
```2. Run the Docker container:
```ssh
docker run -d \
--name lightning-pub \
--network host \
-p 1776:1776 \
-p 1777:1777 \
-v /path/to/local/data:/app/data \
-v $HOME/.lnd:/root/.lnd \
ghcr.io/shocknet/lightning-pub:latest
```
Network host is used so the service can reach a local LND via localhost. LND is assumed to be under the users home folder, update this location as needed.### Manual CLI Installation
1. Run [LND](https://github.com/lightningnetwork/lnd/releases) if you aren't already:
```ssh
./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:
```ssh
git clone https://github.com/shocknet/Lightning.Pub && cd Lightning.Pub && npm i
```3. Configure values in the env file:
```ssh
cp env.example .env && nano .env
```4. Start the service:
```ssh
npm start
```## Usage Notes
Connect with [wallet2](https://github.com/shocknet/wallet2) using the wallet admin string that gets logged at startup. The nprofile of the node can also be used to send invitation links to guests.
Note that connecting with wallet will create an account on the node, it will not show or have access to the full LND balance.
Additional docs are WIP at [docs.shock.network](https://docs.shock.network)
## Support Development
> [!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) 😊## Warning
> [!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**.