Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shocknet/bridgelet
LNURL bridge for NIP-69
https://github.com/shocknet/bridgelet
bitcoin lightning lightning-network lnurl nostr payments
Last synced: 4 months ago
JSON representation
LNURL bridge for NIP-69
- Host: GitHub
- URL: https://github.com/shocknet/bridgelet
- Owner: shocknet
- License: agpl-3.0
- Created: 2024-09-08T14:01:51.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-09-10T17:22:36.000Z (5 months ago)
- Last Synced: 2024-09-27T13:23:27.959Z (4 months ago)
- Topics: bitcoin, lightning, lightning-network, lnurl, nostr, payments
- Language: TypeScript
- Homepage: https://demo.nip69.dev
- Size: 38.1 KB
- Stars: 3
- Watchers: 0
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# Bridgelet
A minimalist LNURL-P and Lightning Address bridge that leverages [NIP-69](https://demo.nip69.dev) to fetch invoices from Lightning nodes that don't otherwise have the requisite networking.
## Getting Started
This project uses [Bun](https://bun.sh/). You can install it with this one-liner:
```
curl -fsSL https://bun.sh/install | bash
```Then,
1. Clone the repository:
```
git clone https://github.com/shocknet/bridgelet.git && cd bridgelet
```2. Install dependencies:
```
bun install
```3. Create a `config.json`:
```
cp config.json.example config.json
```
```json
{
"domain": "your-domain.com",
"port": 3000,
"aliases": {
"bob": {
"nip69": "noffer1...",
"nostrPubkey": "optional_pubkey"
}
}
}
```4. Start the server:
```
bun start
```### Reverse Proxy Configuration
You'll need an SSL cert, Caddy is suggested as it handles Certbot automatically. Simply add an "A" record pointing at your server IP from wherever you manage DNS for your domain.
Example Caddyfile directive:
```
your-domain.com {
reverse_proxy localhost:3000
}
```## API Reference
### 1. LNURL-pay Endpoint
```
GET /.well-known/lnurlp/:username
```
Initiates the LNURL-pay flow for a specific user. Returns a JSON object with payment details.### 2. NIP-69 Offer Handling
```
POST /nip69
```
Handy utility for getting an invoice from any valid NIP-69 offer. Expects a JSON payload with `offer` and `amount` fields. Returns an invoice upon successful processing.Example using curl:
```bash
curl -X POST \
https://bridgelet.nip69.dev/nip69 \
-H 'Content-Type: application/json' \
-d '{"offer": "", "amount": 10000}'
```### License
You're encouraged to fork this project and add your own authentication, admin routes, a proper database etc.