⚡ 🖥️ 👾 Host your own Lightning Address on LND

🖥️ 👾 Host your own Lightning Address on LND

Lighting Wallets like BlueWallet, Blixt and many more allow us to send sats to Lighting Addresses like [email protected]. We can hence pay without scanning the QR code of an invoice.

Pre-requisites

  • An existing Domain name and static ip address to express the lighting address(e.g. [email protected])
  • A public Lightning Network node with sufficient inbound liquidity to receive payments to your lightning address.
  • Golang installation
  • A Webserver and reverse proxy like Nginx or Caddy. (example setup instructions here)
  • Certbot to serve http over TLS. This is required since calls to the LNURLP are done via https. (example setup instructions here)

Install and Setup

Clone & Build

go install github.com/hieblmi/go-host-lnaddr@latest

Configuration config.json

  • "RPCHost": This is your lnd's REST/RPC host:port e.g. "https://localhost:8080"
  • "InvoiceMacaroonPath": "/path/to/invoice.macaroon"
  • "LightningAddress": Your preferred lightning address, mine is: [email protected] :-). This resolves to https://allmysats.com/.well-known/lnurlp/tips
  • "MinSendable": 1000,
  • "MaxSendable": 100000000,
  • "CommentAllowed": If set to 0 the sender to your address can't add a comment otherwise the number stands for the permitted number of characters.
  • "Tag": "payRequest",
  • "Metadata": "[["text/plain","Welcome to satsonlightning.com"],["text/identifier","[email protected]"]]",
  • "InvoiceCallback": "https://[YOUR_DOMAIN].com/invoice/" - this is the endpoint that will create the invoice
  • "AddressServerPort": 9990 - the port your reverse proxy points to

Run

./main --config config.json

Notes

This stuff is experimental. I appreciate your comments and if you have questions please feel free to reach out to [email protected]. I just recently setup my own address this way so feel free to send me some sats if you think this has been helpful to you.

[email protected]

Comments
  • Invoice subscription via r_hash fails

    Invoice subscription via r_hash fails

    Hi @rkfg,

    I recently ran into an issue that seems to be preventing the invoice subscription via the invoice r_hash you added. This prevents the notification code from being triggered. This issue seemingly appeared without code changes from my end. When /v2/invoices/subscribe is run the invoice subscription response indicates &{Status:404 Not Found StatusCode:404......

    If you got a minute could you confirm if notifications are working for you? I could send you test payments to your lightningaddress.

  • Payment notifications

    Payment notifications

    It's currently hard to find if you've been paid. The only way is listing all paid invoices and look for those you don't remember creating yourself. A simple abstract notification interface with few implementations would be great to have (I might implement it myself if I find time). For example, it could be e-mail notification and http hook. I like how lightningtip does it. Shouldn't be hard to do.

  • Notifications and other minor things

    Notifications and other minor things

    This is currently WIP but mail notifications should work now. I plan to add HTTP as well. I extracted the make invoice dependency because it's not possible to get r_hash (that we need to subscribe to settlements) from the encoded invoice without admin macaroon and that's a dangerous requirement. Make invoice doesn't return r_hash even though the underlying REST API provides it so I made appropriate changes and removed the dead code that's not relevant to lnd (we don't support anything else anyway). This also greatly reduced the amount of dependencies to just gjson.

    I also fixed macaroon loading so it's not loaded from disk every time the invoice is created. Comments were previously completely ignored even when allowed in config. Now they're properly used in notifications. Added optional private channels hints (for nodes with no or small public channels), TLS certificate support (for REST API connection). Refactored repeating error reporting code.

    So it's a draft for now, feel free to test and review.

  • Prevent invoice spam

    Prevent invoice spam

    Right now nothing prevents someone from calling the callback https://site.com/invoice?amount=1000 unreasonably often and spam the system. @rkfg Do you think it would make sense to add a spam protection here like a Timeout/IPFilter etc.?

  • Add minimum amount for notification

    Add minimum amount for notification

    As per https://github.com/hieblmi/go-host-lnaddr/pull/6#issuecomment-945098227 here's a new option to only permit notifications (currently by mail) if the amount is above the threshold. You'll still be able to see all of them in the system log. Also I changed the amount type to uint64 because uint is 32 bit long and, while unlikely, big enough amount of sats might overflow it.

  • Config should provide paths to invoice.macaroon rather than the hexified macaroon itself

    Config should provide paths to invoice.macaroon rather than the hexified macaroon itself

    Currently the invoice macaroon is generated via: "InvoiceMacaroon": Generate the hex encoded invoice macaroon : xxd -ps -u -c 1000 $HOME/.lnd/data/chain/bitcoin/mainnet/invoice.macaroon

    This should be done in code.

  • Print message if instance of server is already running

    Print message if instance of server is already running

    Right now the server just exits without notification when an instance of go-host-lnaddr is already active. In case of an already active instance print an error log.

  • Tiered payment notifications

    Tiered payment notifications

    It would be nice to have tiered payment confirmation messages (0-10, 10-100, 100-1000, 1000-10000 sats etc.) instead of the generic "thank you" as well as notification templates using Go's text/template.

Proxy your Go Module`s Import Path from your own domain to a public host (e.g. github.com).

Go Modules Remote Import Path Proxy Proxy your Go Module`s Import Path from your own domain to a public host (e.g. github.com). For example Uber (buil

Nov 2, 2021
Serverless Lightning Address server

Addressless Put a Lightning Address "server" on a serverless host like Vercel. The code is heavily borrowed from satdress, minus the federated part. T

Aug 29, 2022
Yet another TCP Port Scanner, but lightning faster.

Fast TCP Port Scanner A highly concurrent TCP port scanner. Run Tests with Code Coverage (Linux) go test -cover Compile (Linux) go build -v -o fglps R

Jul 23, 2022
LNC is a lightning network capital management tool built for routing nodes.

LNC is a lightning network capital management tool built for routing nodes.

Dec 21, 2021
JPRQ Customizer is a customizer that helps to use the JPRQ server code and make it compatible with your own server with custom subdomain and domain
JPRQ Customizer is a customizer that helps to use the JPRQ server code and make it compatible with your own server with custom subdomain and domain

JPRQ Customizer is a customizer that helps to use the JPRQ server code and make it compatible with your own server with custom subdomain and domain.You can upload the generated directory to your web server and expose user localhost to public internet. You can use this to make your local machine a command center for your ethical hacking purpose ;)

Jan 19, 2022
Go pkg for returning your public facing IP address.

#publicip This package returns the public facing IP address of the calling client (a la https://icanhazip.com, but from Go!) Author James Polera james

Nov 21, 2022
Gopi - Simple API for get geo information about your IP Address, Build by go-fiber

gopi Simple API to get information from your IP Address Idea This idea come from IP zxq and literaly i clone it How to download GeoIP2 ? Remember to c

May 27, 2022
Automatically update your Windows hosts file with the WSL2 VM IP address

Automatically update your Windows hosts file with the WSL2 VM IP address

Jan 9, 2023
Get ip address with Golang on your computer/system

Get IP Address with Golang Get IP address(es) with go-lang is a simple command line tool to get your IP address vpn, internal, external, etc. Usage ge

Sep 5, 2022
EasyAgent is an infrastructure component, applied to manage the life-cycle of services on the remote host.
EasyAgent is an infrastructure component, applied to manage the life-cycle of services on the remote host.

Easyagent English | 中文 介绍 easyagent是在袋鼠云内部广泛使用的基础架构组件,最佳应用场景包括ELK体系beats等数据采集器的管控和配置管理、数栈体系自动化部署等 基本原理 easyagent主要有sidecar和server两个组件,sidecar部署在主机端,si

Nov 24, 2022
LazySSH is an SSH server that acts as a jump host only, and dynamically starts temporary virtual machines.

LazySSH is an SSH server that acts as a jump host only, and dynamically starts temporary virtual machines. If you find yourself briefly starti

Dec 11, 2022
Receive phone calls from anybody on the Web. Or host a telephony server yourself.
Receive phone calls from anybody on the Web. Or host a telephony server yourself.

WebCall WebRTC Telephony Server Browser based telephony over E2E-encrypted P2P-links with very high audio quality. WebCall is lightweight and easy to

Jan 5, 2023
The rest api that can manage the iptables rules of the remote host

fiewall-api firewall api是基于firewalld来远程管理iptables规则的rest-api,无需部署agent Features 指定一个主机ip,让这个主机上的iptables增加一个规则 处理单个IP或CIDR范围(xx.xx.xx.xx/mask,mac,inte

Mar 24, 2022
Ping library for Golang with multi-host support

pingo Fast and lightweight ping library for Golang with multi-host support. Features ICMP sockets: UDP port 0 means "let the kernel pick a free number

Nov 9, 2022
apache dubbo gateway,L7 proxy,virtual host,k8s ingress controller.
apache dubbo gateway,L7 proxy,virtual host,k8s ingress controller.

apache dubbo gateway,L7 proxy,virtual host,k8s ingress controller.

Jul 22, 2022
Application wirtten in GO to check if the port on the remote host is open

portcheck A simple Pod that get API POST request with port type and number with a target's IP address and checks if the destination port is available

Nov 26, 2021
Simple ssh client for persistent host info.
Simple ssh client for persistent host info.

zssh Simple ssh cli for persistent hosts information. Getting started (1) Go get and install $ go get -u github.com/zacscoding/zssh/... $ zssh --help

Dec 19, 2021
Observe host metrics collector Written in Go

Observe Host Metrics Collector Experimental collector and forwarder of host metr

Jan 4, 2022
Ffind - A tool to find files of interest on a compromised host during a penetration test
Ffind - A tool to find files of interest on a compromised host during a penetration test

ffind ffind is a tool to find files of interest on a compromised host during a p

Jul 25, 2022