Federated Lightning addresses server.

Overview

Satdress

Federated Lightning Address Server

How to run

  1. Download the binary from the releases page (or compile with go build or go get)
  2. Set the following environment variables somehow (using example values from bitmia.com):
PORT=17422
DOMAIN=bitmia.com
SECRET=askdbasjdhvakjvsdjasd
SITE_OWNER_URL=https://t.me/qecez
[email protected]
SITE_NAME=Bitmia
  1. Start the app with ./satdress
  2. Serve the app to the world on your domain using whatever technique you're used to

Get help

Maybe ask for help on https://t.me/lnurl if you're in trouble.

Issues
  • Suggestion: Display test invoice with PIN embedded on /grab response page

    Suggestion: Display test invoice with PIN embedded on /grab response page

    Minor niggle but the unsettled 1 sat invoices generated during the testing of the registration are annoying.

    Further, could the test invoice include the PIN, and be displayed so that the registrant can pay it and receive a notice of the PIN in their transaction history.

    opened by HamishMacEwan 6
  • Feature request:  commando: support rune rate limiting

    Feature request: commando: support rune rate limiting

    Im using cln 0.11.2 When i craft the rune like this: lightning-cli commando-rune restrictions='["method=invoice","rate=30"]' I get an error after hitting submit: couldn't make an invoice with the given data: Not authorized: rate: is missing

    Without the rate part i get a different unrelated error as seen in #33 which makes me think satdress doesn't support rate limiting.

    opened by darthginger 4
  • Allow multiple comma-separated domains

    Allow multiple comma-separated domains

    The idea is that if you just upgrade to this version everything should work as before. However instead of just one domain you can now include a comma-seperated list in DOMAIN.

    Actually this is a group effort - I'd like to thank @aljazceru for the initiative and testing and @zwx00 for the CSS improvements (my change used to have a suffix-hack class).

    opened by fiksn 4
  • docker-compose.yml so it's super easy to deploy on server or test locally

    docker-compose.yml so it's super easy to deploy on server or test locally

    Not sure if this is needed, but I wrote this for deploying on my server so maybe someone else will find it helpful as well. It neatly bundles all the necessary configuration options and also persists the database in a docker volume.

    opened by raphjaph 4
  • Building docker image fails

    Building docker image fails

    Building the docker image results in an error:

    # github.com/fiatjaf/satdress
    ./main.go:54:3: undefined: makeinvoice
    The command '/bin/sh -c go get' returned a non-zero code: 2
    

    Complete log

    Step 1/17 : FROM golang:1.16.0-alpine AS builder
     ---> 696265badec1
    Step 2/17 : WORKDIR /opt/buid
     ---> Using cache
     ---> af91638ee08c
    Step 3/17 : COPY ./*.go ./*.html ./go.mod ./go.sum ./
     ---> bb45ddd60d2f
    Step 4/17 : COPY static ./static
     ---> cc33c258279e
    Step 5/17 : RUN apk add gcc musl-dev linux-headers
     ---> Running in 94cb0e11fce2
    fetch https://dl-cdn.alpinelinux.org/alpine/v3.13/main/x86_64/APKINDEX.tar.gz
    fetch https://dl-cdn.alpinelinux.org/alpine/v3.13/community/x86_64/APKINDEX.tar.gz
    (1/14) Upgrading musl (1.2.2-r0 -> 1.2.2-r1)
    (2/14) Installing libgcc (10.2.1_pre1-r3)
    (3/14) Installing libstdc++ (10.2.1_pre1-r3)
    (4/14) Installing binutils (2.35.2-r1)
    (5/14) Installing libgomp (10.2.1_pre1-r3)
    (6/14) Installing libatomic (10.2.1_pre1-r3)
    (7/14) Installing libgphobos (10.2.1_pre1-r3)
    (8/14) Installing gmp (6.2.1-r0)
    (9/14) Installing isl22 (0.22-r0)
    (10/14) Installing mpfr4 (4.1.0-r0)
    (11/14) Installing mpc1 (1.2.0-r0)
    (12/14) Installing gcc (10.2.1_pre1-r3)
    (13/14) Installing linux-headers (5.7.8-r0)
    (14/14) Installing musl-dev (1.2.2-r1)
    Executing busybox-1.32.1-r3.trigger
    OK: 134 MiB in 28 packages
    Removing intermediate container 94cb0e11fce2
     ---> fa6aca3099c4
    Step 6/17 : RUN go get
     ---> Running in b2917668ad00
    go: downloading github.com/cockroachdb/pebble v0.0.0-20210812144839-61318a019370
    go: downloading github.com/fiatjaf/go-lnurl v1.4.0
    go: downloading github.com/fiatjaf/makeinvoice v1.3.0
    go: downloading github.com/gorilla/mux v1.8.0
    go: downloading github.com/kelseyhightower/envconfig v1.4.0
    go: downloading github.com/lib/pq v1.10.2
    go: downloading github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646
    go: downloading github.com/rs/zerolog v1.23.0
    go: downloading github.com/tidwall/sjson v1.1.7
    go: downloading github.com/btcsuite/btcd v0.20.1-beta.0.20200515232429-9f0179fd2c46
    go: downloading github.com/tidwall/gjson v1.8.1
    go: downloading github.com/fiatjaf/eclair-go v0.2.1
    go: downloading github.com/fiatjaf/lightningd-gjson-rpc v1.4.0
    go: downloading github.com/lnpay/lnpay-go v1.1.0
    go: downloading github.com/tidwall/match v1.0.3
    go: downloading github.com/tidwall/pretty v1.1.0
    go: downloading github.com/gorilla/websocket v1.4.2
    go: downloading github.com/fiatjaf/ln-decodepay v1.0.0
    go: downloading github.com/lightningnetwork/lnd v0.10.1-beta
    go: downloading golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9
    go: downloading github.com/imroc/req v0.3.0
    go: downloading github.com/cockroachdb/errors v1.8.1
    go: downloading github.com/cockroachdb/redact v1.0.8
    go: downloading github.com/btcsuite/btcutil v1.0.2
    go: downloading github.com/davecgh/go-spew v1.1.1
    go: downloading github.com/go-errors/errors v1.0.1
    go: downloading github.com/cockroachdb/sentry-go v0.6.1-cockroachdb.2
    go: downloading github.com/cockroachdb/logtags v0.0.0-20190617123548-eb05cc24525f
    go: downloading golang.org/x/exp v0.0.0-20200513190911-00229845015e
    go: downloading github.com/DataDog/zstd v1.4.5
    go: downloading github.com/cespare/xxhash v1.1.0
    go: downloading github.com/cespare/xxhash/v2 v2.1.1
    go: downloading github.com/golang/snappy v0.0.3
    go: downloading github.com/klauspost/compress v1.11.7
    go: downloading golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4
    go: downloading github.com/miekg/dns v0.0.0-20171125082028-79bfde677fa8
    go: downloading golang.org/x/net v0.0.0-20201021035429-f5854403a974
    go: downloading github.com/gogo/protobuf v1.3.1
    go: downloading github.com/kr/pretty v0.1.0
    go: downloading github.com/pkg/errors v0.9.1
    go: downloading github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f
    go: downloading github.com/btcsuite/btcwallet v0.11.1-0.20200515224913-e0e62245ecbe
    go: downloading github.com/btcsuite/btcwallet/walletdb v1.3.1
    go: downloading github.com/kr/text v0.1.0
    go: downloading github.com/btcsuite/btcwallet/wallet/txauthor v1.0.0
    go: downloading github.com/btcsuite/btcwallet/wallet/txrules v1.0.0
    go: downloading github.com/btcsuite/btcwallet/wtxmgr v1.1.1-0.20200515224913-e0e62245ecbe
    go: downloading github.com/lightninglabs/gozmq v0.0.0-20191113021534-d20a764486bf
    go: downloading github.com/lightninglabs/neutrino v0.11.1-0.20200316235139-bffc52e8f200
    go: downloading github.com/btcsuite/btcwallet/wallet/txsizes v1.0.0
    go: downloading github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd
    go: downloading github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792
    go: downloading github.com/aead/siphash v1.0.1
    go: downloading github.com/kkdai/bstream v0.0.0-20181106074824-b3251f7901ec
    go: downloading github.com/lightningnetwork/lnd/queue v1.0.3
    go: downloading github.com/lightningnetwork/lnd/ticker v1.0.0
    # github.com/fiatjaf/satdress
    ./main.go:54:3: undefined: makeinvoice
    The command '/bin/sh -c go get' returned a non-zero code: 2
    
    
    opened by cryptoteun 4
  • commando: unknown parameter amount_msat

    commando: unknown parameter amount_msat

    Im trying out the new commando backend. Im using cln 0.11.2. I made the rune with lightning-cli commando-rune restrictions='["method=invoice"]' But i get this error after hitting submit: couldn't make an invoice with the given data: unknown parameter: amount_msat, this may be caused by a failure to autodetect key=value-style parameters. Please try using the -k flag and explicit key=value pairs of parameters.

    opened by darthginger 3
  • JSON API

    JSON API

    Small JSON API with POST, GET, PUT and DELETE operations, that allows to programmatically claim, update and delete a (federated) Lightning Address on a satdress server. Down below are some example requests done with curl.

    Claiming a username:

    curl --request POST \
    --url https://satdress.com/api/v1/claim \
    --data '{
        "name": "satoshi",
        "kind": "lnd",
        "host": "https://lnd.satdress.com:8080",
        "key": "invoicemacaroonkgCumHVZaeOCS+R",
        "pak": "",
        "waki": "",
        "pin": "",
        "minSendable": "1000",
        "maxSendable": "100000000"
    }'
    

    Response:

    {
        "ok": true,
        "message": "claimed [email protected]",
        "data": {
            "name": "satoshi",
            "pin": "49203e7b92a805daf7da74b1a39c0a7b02627c2cce523f4d26742c3539433238",
            "invoice": "lnbc10n1........"
        }
    }
    
    

    Authenticated request on an existing user:

    curl --request GET \
    --url https://satdress.com/api/v1/users/satoshi \
    --header 'X-Pin: 49203e7b92a805daf7da74b1a39c0a7b02627c2cce523f4d26742c3539433238'
    

    Response:

    {
        "ok": true,
        "message": "[email protected] found",
        "data": {
            "name": "satoshi",
            "kind": "lnd",
            "host": "https://lnd.satdress.com:8080",
            "key": "invoicemacaroonkgCumHVZaeOCS+R",
            "pak": "",
            "waki": "",
            "pin": "49203e7b92a805daf7da74b1a39c0a7b02627c2cce523f4d26742c3539433238'",
            "minSendable": "1000",
            "maxSendable": "100000000"
        }
    }
    

    The /api/v1/claim endpoint does not need any authentication (pin) but a /api/v1/users/{name} request has to be authenticated through a custom header (X-Pin). Would probably be cool to use JWTs here instead and put those in the Authentication header but I didn't want to change too much of the existing code base.

    This is my first try at writing a JSON API so I'm not sure about if I chose the correct data formats, if the authentication method I used is secure or if there are some other fatal flaws. For that reason I don't expect this to get merged but I would greatly appreciate any kind of feedback (positive or negative).

    What I find interesting about federated Lightning Address servers is that now anyone with a cool domain name could sell/rent out addresses. An API could make it easier to seamlessly integrate that feature into other wallets.

    opened by raphjaph 3
  • API endpoint

    API endpoint

    It would be great if the exact same form that is sent through the UI in order to claim a Lightning Address, could also be sent over a very simple JSON api. Something like "/api/v1/claim" or whatever you want to call it. This would allow services and wallets to program this on behalf of the customers/users.

    opened by andrerfneves 3
  • text/identifier and text/plain missing username

    text/identifier and text/plain missing username

    The json object seems to be missing the actual username: {"status":"OK","callback":"https://ln.fitti.io/.well-known/lnurlp/fitti","tag":"payRequest","maxSendable":100000000,"minSendable":1000,"metadata":"[[\"text/identifier\",\"@ln.fitti.io\"],[\"text/plain\",\"Satoshis to @ln.fitti.io.\"]]","commentAllowed":0}

    opened by Fittiboy 3
  • Upper case in

    Upper case in "Desired Username" means they cannot be found later.

    After creating User21952 it couldn't be found (though creating user21952 was blocked.)

    :~/bin/satdress$ PORT=17422 DOMAIN=merak-4.BitID.nz SECRET='SECRET' SITE_OWNER_URL=https://t.me/user21952 [email protected] SITE_NAME=BitID ./satdress
    <nil> DBG listening addr=0.0.0.0:17422
    <nil> DBG generating invoice backend={"Cert":"","Host":"https://lnbits.com","Key":"[]"} description_hash=[] msatoshi=1000
    <nil> DBG &{ lnbits https://lnbits.com []}
    <nil> DBG {"Name":"","Kind":"lnbits","Host":"https://lnbits.com","Key":"[]","Pak":"","Waki":""}
    <nil> ERR failed to get name error="pebble: not found" name=user21952
    
    

    This behaviour seems to depend on the payer's wallet.

    https://lightningdecoder.com/[email protected] fails but

    /send 1337 [email protected]

    succeeds:

    payaddress.co says:
    Payment received!
    

    However

    /send 1337 [email protected]

    fails payaddress.co lnurl error: failed to get name paywallstuff

    opened by HamishMacEwan 2
  • build github.com/fiatjaf/satdress: cannot find module for path embed

    build github.com/fiatjaf/satdress: cannot find module for path embed

    After:

    [email protected]:~/bin/satdress$ go build

    Error:

    build github.com/fiatjaf/satdress: cannot find module for path embed

    From:

    package main
    
    import (
    	"crypto/hmac"
    	"crypto/sha256"
    	_ "embed"
    	"encoding/hex"
    	"encoding/json"
    

    Any tips?

    opened by HamishMacEwan 2
  • .env parameters

    .env parameters

    PORT=17422 DOMAIN=bitmia.com SECRET=askdbasjdhvakjvsdjasd SITE_OWNER_URL=https://t.me/qecez [email protected] SITE_NAME=Bitmia

    What does SECRET means here? How do I find this secret?

    opened by akriot 3
  • Setting description in invoice params

    Setting description in invoice params

    Isn't the description also supposed to be set here?: https://github.com/fiatjaf/satdress/blob/5574a494edb36e88716107361522c8979e63ebac/makeinvoice.go#L67

    opened by hieblmi 1
  • Dockerize and create deploy button for Vercel support

    Dockerize and create deploy button for Vercel support

    Would be a great idea to make this a 2 step solution. You click the deploy button on the readme and it will spin up an instance of satdress for you given certain criteria (aka domain). Something for the future, but putting there so we don't forget. Could be Herkou as well!

    https://vercel.com/docs/more/deploy-button

    opened by andrerfneves 4
  • LNbits: satdress aborts (Assertion `sym != NULL' failed)

    LNbits: satdress aborts (Assertion `sym != NULL' failed)

    I try to connect my self-hosted satdress to LNbits, using the latest pre-built binary v0.2.1. I use the following settings, for "host" I tried https://lnbits.com, https://lnbits.com:80 and other settings.

    image

    When I click on "Submit", the satdress application immediately aborts:

    [email protected]:~/satdress$ ./satdress 
    <nil> DBG listening addr=0.0.0.0:17329
    <nil> DBG generating invoice backend={"Cert":"","Host":"https://lnbits.com","Key":"02686a9869144bbb9ee8b107be7a77b8"} description_hash=3b9428922ff81dbeb40d8d75d59360ca2b58c597ecbfb04230ff1b02036e6467 msatoshi=1000
    satdress: dl-call-libc-early-init.c:37: _dl_call_libc_early_init: Assertion `sym != NULL' failed.
    SIGABRT: abort
    PC=0xb18212 m=0 sigcode=18446744073709551610
    
    goroutine 0 [idle]:
    runtime: unknown pc 0xb18212
    stack: frame={sp:0x7ffdfbea4a50, fp:0x0} stack=[0x7ffdfb6a6d08,0x7ffdfbea5d40)
    00007ffdfbea4950:  0000000000000000  0000000000b9ede8 
    00007ffdfbea4960:  0000000000000000  0000000200000000 
    00007ffdfbea4970:  00007ffd10000000  0000000002da7d90
    ...
    

    see full log on Pastebin.com

    I also tried "host" without the protocol prefix: lnbits.com or lnbits.com:80. While the app does not abort, it shows the following error message:

    DBG generating invoice backend={"Cert":"","Host":"lnbits.com:80","Key":"02686a9869144bbb9ee8b107be7a77b8"} description_hash=3b9428922ff81dbeb40d8d75d59360ca2b58c597ecbfb04230ff1b02036e6467 msatoshi=1000
    
    opened by Stadicus 3
  • Suggestion: LNbits Node Backend Type accepts LNbits LNURLp string/link as Host

    Suggestion: LNbits Node Backend Type accepts LNbits LNURLp string/link as Host

    For LNbits Node Backend Type accept an LNbits LNURLp in the Host field and instead of synthesising the LNURLp parameters directly obtain them from:

    LNURL1DP68GURN8GHJ7MRWVF5HGUEWVDHK6TMVDE6HYMRS9ASHQ6F0WCCJ7MRWW4EXCTEHXQUQWSA9LF

    aka

    https://lnbits.com/lnurlp/api/v1/lnurl/708

    Returning

    {
      "callback": "https://lnbits.com/lnurlp/api/v1/lnurl/cb/708", 
      "maxSendable": 1337, 
      "metadata": "[[\"text/plain\", \"Lightning Address LNURLp\"]]", 
      "minSendable": 1337, 
      "tag": "payRequest"
    }
    

    This gives Lightning Address capability with LNbits configuration, handling and response allowing fixed or different range payments and webhooks.

    opened by HamishMacEwan 1
Releases(v0.7.0)
Owner
fiatjaf
vocês não têm nível
fiatjaf
a simple http server as replacement of python -m http.server

ser a simple http server as replacement of python -m http.server

Changkun Ou 4 Feb 16, 2022
OpenAPI specs for your Go server, generated at server runtime. No CLI, no code generation, and no HTTP

Overview "oas" is short for "OpenAPI Spec". Go package for generating OpenAPI docs at runtime. Non-features: No code generation. No CLI. No magic comm

Nelo Mitranim 0 Dec 3, 2021
A Language Server Protocol (LSP) server for Jsonnet

Jsonnet Language Server A Language Server Protocol (LSP) server for Jsonnet. Features Jump to definition self-support.mp4 dollar-support.mp4 Error/War

Grafana Labs 61 Aug 3, 2022
Go web server - A web server that can accept a GET request and serve a response.

go_web_server A web server that can accept a GET request and serve a response. Go is a great language for creating simple yet efficient web servers an

Gilbert Ngeno 0 Jan 3, 2022
:tophat: Small self-contained pure-Go web server with Lua, Markdown, HTTP/2, QUIC, Redis and PostgreSQL support

Web server with built-in support for QUIC, HTTP/2, Lua, Markdown, Pongo2, HyperApp, Amber, Sass(SCSS), GCSS, JSX, BoltDB (built-in, stores the databas

Alexander F. Rødseth 2k Jul 31, 2022
Fast, multi-platform web server with automatic HTTPS

a project Every site on HTTPS Caddy is an extensible server platform that uses TLS by default. Releases · Documentation · Get Help Menu Features Insta

Caddy 42k Aug 8, 2022
A simple SHOUTcast server.

DudelDu DudelDu is a simple audio/video streaming server using the SHOUTcast protocol. Features Supports various streaming clients: VLC, ServeStream,

Matthias Ladkau 136 Apr 20, 2022
A feature flag solution, with only a YAML file in the backend (S3, GitHub, HTTP, local file ...), no server to install, just add a file in a central system and refer to it. 🎛️

??️ go-feature-flag A feature flag solution, with YAML file in the backend (S3, GitHub, HTTP, local file ...). No server to install, just add a file i

Thomas Poignant 480 Aug 2, 2022
An XMPP server written in Go (Golang).

jackal An XMPP server written in Go. About jackal is a free, open-source, high performance XMPP server which aims to be known for its stability, simpl

Miguel Ángel Ortuño 1.3k Jul 27, 2022
A proxy server than converts JSON request bodies to protocol buffers

Welcome to Protoxy ?? What is Protoxy? Protoxy allows you to test your REST APIs that use Protocol Buffer serialization through Postman and other API

null 24 May 21, 2022
High-performance PHP application server, load-balancer and process manager written in Golang

[RR2-BETA] RoadRunner is an open-source (MIT licensed) high-performance PHP application server, load balancer, and process manager. It supports runnin

Spiral Scout 6.6k Aug 3, 2022
Fully featured and highly configurable SFTP server with optional FTP/S and WebDAV support - S3, Google Cloud Storage, Azure Blob

SFTPGo Fully featured and highly configurable SFTP server with optional FTP/S and WebDAV support, written in Go. Several storage backends are supporte

Nicola Murino 4.6k Aug 7, 2022
A RTP -> WebRTC broadcast server for Project Lightspeed.

Project Lightspeed WebRTC A RTP -> WebRTC server based on Pion written in Go. This server accepts RTP packets on port 65535 and broadcasts them via We

Garrett GRVY Graves 70 Jun 23, 2022
Heart 💜A high performance Lua web server with a simple, powerful API

Heart ?? A high performance Lua web server with a simple, powerful API. See the full documentation here. Overview Heart combines Go's fasthttp with Lu

Hyperspace Logistics 76 Jul 15, 2022
The Galène videoconferencing server

The Galène videoconferencing server

Juliusz Chroboczek 653 Aug 1, 2022
A push notification server written in Go (Golang).

A push notification micro server using Gin framework written in Go (Golang)

Bo-Yi Wu 6.5k Aug 2, 2022
KissLists is a very simple shared lists server

KissLists is a very simple shared lists server. with mobile optimised design basic theme support websockets messages sqlite database but no

Vincent Lark 38 Jul 29, 2022
⚡ A fast, lightweight, and secure chat protocol, client and server, written in Go.

⚡ A fast, lightweight, and secure chat protocol, client and server, written in Go.

Bolt 16 Jan 19, 2022
Demonstration of a browser connecting to Pion WebRTC without a signaling server.

Offline Browser Sync WebRTC without a signaling server! This repo demonstrates how you can connect two WebRTC proccesses without signaling. No configu

Pion 138 Jul 12, 2022