From 9e5b7ed4af0f337725dd85eb939cd9581eeca344 Mon Sep 17 00:00:00 2001 From: Alex71btc <105175715+Alex71btc@users.noreply.github.com> Date: Thu, 3 Dec 2026 02:35:03 +0100 Subject: [PATCH] Update BOLT12 Pay to v0.4.2 (#6464) --- bolt12-pay/docker-compose.yml | 49 ++++-------- bolt12-pay/exports.sh | 34 +++++++++ bolt12-pay/umbrel-app.yml | 137 +++++++++++++++++++++++----------- 3 files changed, 141 insertions(+), 79 deletions(-) create mode 100755 bolt12-pay/exports.sh diff --git a/bolt12-pay/docker-compose.yml b/bolt12-pay/docker-compose.yml index 8d1a2d80b..76f9504da 100644 --- a/bolt12-pay/docker-compose.yml +++ b/bolt12-pay/docker-compose.yml @@ -1,4 +1,4 @@ -version: "3.7" +version: "3.8" services: app_proxy: @@ -7,12 +7,12 @@ services: APP_PORT: 8081 # Public payment pages and LNURL endpoints for outside visitors. # "/" is an exact match: only the public links page at the root, not the whole app. - PROXY_AUTH_WHITELIST: "/,/alias,/alias/*,/.well-known,/.well-known/*,/api/lnurl,/api/lnurl/*,/api/qr,/api/qr/*,/icon.svg,/icon.png,/service-worker.js,/public.webmanifest,/pay.webmanifest,/assets,/assets/*" + # Companion endpoints use app-level pairing or device-token authentication. + PROXY_AUTH_WHITELIST: "/,/alias,/alias/*,/.well-known,/.well-known/*,/api/lnurl,/api/lnurl/*,/api/qr,/api/qr/*,/api/companion/pair,/api/companion/subscription,/api/companion/client,/icon.svg,/icon.png,/service-worker.js,/public.webmanifest,/pay.webmanifest,/assets,/assets/*" web: - image: alex71btc/bolt12-pay:0.3.32@sha256:a5d651d71f40a5e891b8f804aaea74670ec695c2cd2fbd92567b195352b59415 + # Multiarch release pinned to the validated OCI index digest. + image: alex71btc/bolt12-pay:0.4.2@sha256:3b159c5ba0c863d5a3938f75f9c897468a652a1e83ea53b86a59c7f7bf195131 restart: on-failure - depends_on: - - lndk environment: APP_DATA_DIR: /data APP_CONFIG_PATH: /data/config.json @@ -22,19 +22,22 @@ services: PAY_UI_SESSION_TTL: "1800" CORS_ORIGINS: "*" + BOLT12_PAY_MANAGE_LNDK: "true" + BOLT12_PAY_STATIC_LND_MOUNT: "${BOLT12_PAY_STATIC_LND_MOUNT:-false}" LNDK_CLI: /usr/local/bin/lndk-cli LNDK_NETWORK: bitcoin - LNDK_GRPC_HOST: https://lndk + LNDK_GRPC_HOST: https://127.0.0.1 LNDK_GRPC_PORT: "7000" LNDK_CERT_PATH: /data/lndk/tls-cert.pem - LNDK_MACAROON_PATH: /lnd/data/chain/bitcoin/${APP_BITCOIN_NETWORK}/admin.macaroon + LNDK_MACAROON_PATH: /lnd/data/chain/bitcoin/${BOLT12_PAY_BITCOIN_NETWORK:-mainnet}/admin.macaroon LNDK_INVOICE_TIMEOUT_SECONDS: "60" LNDK_TIMEOUT_SECONDS: "75" ALLOW_PAY_OFFER: "true" - LND_REST_URL: https://lightning_lnd_1:8080 + LND_REST_URL: "${BOLT12_PAY_LND_REST_URL:-}" + LND_GRPC_ADDRESS: "${BOLT12_PAY_LND_GRPC_ADDRESS:-}" LND_TLS_CERT_PATH: /lnd/tls.cert - LND_MACAROON_PATH: /lnd/data/chain/bitcoin/${APP_BITCOIN_NETWORK}/admin.macaroon + LND_MACAROON_PATH: /lnd/data/chain/bitcoin/${BOLT12_PAY_BITCOIN_NETWORK:-mainnet}/admin.macaroon LND_REST_INSECURE: "true" LNURL_MIN_SENDABLE_MSAT: "1000" @@ -46,28 +49,6 @@ services: LNURL_ALIAS_MAP: "" volumes: - ${APP_DATA_DIR}/data:/data - - ${APP_LIGHTNING_NODE_DATA_DIR}:/lnd:ro - - lndk: - image: alex71btc/lndk:bolt12-pay-0.3.16-multiarch@sha256:8fee8bd094d7a3e59f596ce978097655ef820a88971aad52d6aac931c1894fb6 - restart: on-failure - entrypoint: - - /bin/sh - - -c - command: - - | - echo "Waiting for LND TLS + macaroon..." - while [ ! -f /lnd/tls.cert ] || [ ! -f /lnd/data/chain/bitcoin/${APP_BITCOIN_NETWORK}/admin.macaroon ]; do - echo "Waiting for cert/macaroon..." - sleep 5 - done - - echo "Starting LNDK with retry loop..." - while true; do - lndk --address=https://lightning_lnd_1:10009 --cert-path=/lnd/tls.cert --macaroon-path=/lnd/data/chain/bitcoin/${APP_BITCOIN_NETWORK}/admin.macaroon --data-dir=/data/lndk --grpc-host=0.0.0.0 --grpc-port=7000 - echo "LNDK exited or failed. Retrying in 10s..." - sleep 10 - done - volumes: - - ${APP_DATA_DIR}/data:/data - - ${APP_LIGHTNING_NODE_DATA_DIR}:/lnd:ro + # Static on umbrelOS. Deactivate/Remove stops LND use and LNDK but + # cannot revoke this platform-level read-only mount. + - ${BOLT12_PAY_LND_MOUNT:?Missing exports.sh}:/lnd:ro diff --git a/bolt12-pay/exports.sh b/bolt12-pay/exports.sh new file mode 100755 index 000000000..2a875eafd --- /dev/null +++ b/bolt12-pay/exports.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash + +# Optional LND availability, not permission to connect. +export BOLT12_PAY_LND_REST_URL="" +export BOLT12_PAY_LND_GRPC_ADDRESS="" +export BOLT12_PAY_STATIC_LND_MOUNT="false" +export BOLT12_PAY_LND_MOUNT="${EXPORTS_APP_DIR:?}/data/lnd-unavailable" +export BOLT12_PAY_BITCOIN_NETWORK="mainnet" + +bolt12_bitcoin_settings="${UMBREL_ROOT}/app-data/bitcoin/data/app/settings.json" + +if [ -f "$bolt12_bitcoin_settings" ]; then + bolt12_chain="$(jq -r '.chain // "main"' "$bolt12_bitcoin_settings")" + case "$bolt12_chain" in + main) export BOLT12_PAY_BITCOIN_NETWORK="mainnet" ;; + test) export BOLT12_PAY_BITCOIN_NETWORK="testnet" ;; + testnet4|signet|regtest) + export BOLT12_PAY_BITCOIN_NETWORK="$bolt12_chain" ;; + esac +fi + +bolt12_lightning_dir="${UMBREL_ROOT}/app-data/lightning" +bolt12_lnd_dir="${bolt12_lightning_dir}/data/lnd" + +if [ -f "$bolt12_lightning_dir/umbrel-app.yml" ] && + [ -d "$bolt12_lnd_dir" ]; then + export BOLT12_PAY_LND_MOUNT="$bolt12_lnd_dir" + export BOLT12_PAY_LND_REST_URL="https://lightning_lnd_1:8080" + export BOLT12_PAY_LND_GRPC_ADDRESS="https://lightning_lnd_1:10009" + export BOLT12_PAY_STATIC_LND_MOUNT="true" +fi + +unset bolt12_bitcoin_settings bolt12_chain +unset bolt12_lightning_dir bolt12_lnd_dir diff --git a/bolt12-pay/umbrel-app.yml b/bolt12-pay/umbrel-app.yml index e30ff013f..d102f8c3a 100644 --- a/bolt12-pay/umbrel-app.yml +++ b/bolt12-pay/umbrel-app.yml @@ -3,26 +3,41 @@ id: bolt12-pay storage: dataRoot: data name: BOLT12 Pay -tagline: Self-hosted Lightning payments and identity with BOLT12, BIP353, LNURL, and Nostr +tagline: Self-hosted Lightning payments, on-chain management and Nostr identity category: bitcoin -version: 0.3.32 +version: 0.4.2 port: 8367 description: |- - BOLT12 Pay brings BOLT12 Offers to your LND node. You can connect an existing Phoenixd wallet as an additional payment backend. - It supports BOLT12 Offers, BIP353 and LNURL Lightning Addresses, optional BOLT11 fallback invoices, Nostr identities, NIP-05 and Zaps. + BOLT12 Pay is a self-hosted Lightning payment and identity platform + with BOLT12, BIP353, LNURL, Nostr identities, Zaps and Nostr Wallet Connect. - ## 🚀 Before you install + NEW IN 0.4.2 - - Your LND node must be fully synced and have at least one active channel. - - LND v0.21 and newer need no manual BOLT12 configuration. - - Direct BOLT12 Offers work without a domain. - - Lightning Addresses and public payment pages require your own domain. - - Cloudflare DNS automation and a Cloudflare Tunnel are optional. + • Independent LND, Phoenixd and dual-backend operation. + • On-chain management of existing LND and Phoenixd wallets, including fee acceleration. + • Unified Pay and Receive interface supporting Bitcoin and Lightning. + • Transaction history, historical fiat values and CSV exports. + • Android Companion 1.2.1 with on-chain push notifications. + • Backend lifecycle management and optional privacy cleanup. + • Improved payment security and persistent NWC budget accounting. - ## 🔒 UmbrelOS 2.0 + BEFORE YOU INSTALL + + • The Lightning Node app is optional. + • Phoenixd-only installations do not require a local LND node. + • Connect an existing Phoenixd wallet or enable LND during setup. + • Both backends can be used side by side. + • If LND is installed, Umbrel provides a read-only LND mount. + Removing LND in Setup stops its use but cannot revoke this mount + until the platform recreates the container with an appropriate configuration. + • For LND payments, your node must be synced and have an active channel. + • Direct BOLT12 Offers work without a domain. + • Lightning Addresses and public payment pages require your own domain. + • Cloudflare DNS automation and Cloudflare Tunnel are optional. + + UMBREL OS 2.0 Open BOLT12 Pay at: - https://umbrel.local:8367 For a fresh installation, find the initial BOLT12 Pay password under App settings → Default credentials. Existing installations keep their saved BOLT12 Pay password. @@ -31,49 +46,53 @@ description: |- For a Cloudflare Tunnel, use https://umbrel.local:8367 as the origin and copy the HTTPS settings from the full guide. Keep TLS verification enabled. - [Full UmbrelOS 2.0 and Cloudflare guide](https://github.com/Alex71btc/lndk-pay/blob/main/README.md#-umbrel-setup) + Full UmbrelOS 2.0 and Cloudflare guide: + https://github.com/Alex71btc/lndk-pay/blob/main/README.md#-umbrel-setup - ## 🌍 Domain and public access + DOMAIN AND PUBLIC ACCESS Enter your root domain, for example example.com, as the Cloudflare Zone Domain. Do not enter a subdomain such as pay.example.com in that field. Use your public Tunnel address as the LNURL Base URL. Wallets need this public address to find you and complete payments. Do not protect the entire public domain with an interactive Cloudflare Access login, because wallets cannot pass it. - [Domain setup guide](https://github.com/Alex71btc/lndk-pay/blob/main/README.md#-domain-configuration-bip353-vs-lnurl) + Domain setup guide: + https://github.com/Alex71btc/lndk-pay/blob/main/README.md#-domain-configuration-bip353-vs-lnurl - ## 🦄 Nostr identity and Zaps + NOSTR IDENTITY AND ZAPS - A Nostr Identity connects an alias to a Nostr public key. NIP-05 publishes `alias@domain` as a verifiable Nostr identity. **Zap / Nostr** makes the alias's LNURL Lightning Address able to receive NIP-57 Zaps. BIP353 addresses alone cannot receive Nostr Zaps. + A Nostr Identity connects an alias to a Nostr public key. NIP-05 publishes alias@domain as a verifiable Nostr identity. Zap / Nostr makes the alias's LNURL Lightning Address able to receive NIP-57 Zaps. BIP353 addresses alone cannot receive Nostr Zaps. - 1. Create a Lightning Address alias in the Console, for example `zap`. - 2. Open **Nostr / Identity** under `/pay`. + 1. Create a Lightning Address alias in the Console, for example zap. + 2. Open Nostr / Identity under /pay. 3. Enter the same alias, the receiving Nostr profile's npub and its relays. 4. Save the identity. 5. Enter the resulting Lightning Address in your Nostr client's Lightning or Zap address field. - To edit an identity later, enter its alias again and then select **Load identity**. + To edit an identity later, enter its alias again and then select Load identity. - ## 🔔 Zap notifications + ZAP NOTIFICATIONS - To receive encrypted Zap notifications by Nostr direct message, enter the `nsec` of the same Nostr profile and select **Initialize Zap Notifications**. BOLT12 Pay encrypts this `nsec` and creates a separate internal signer key pair automatically. + To receive encrypted Zap notifications by Nostr direct message, enter the nsec of the same Nostr profile and select Initialize Zap Notifications. BOLT12 Pay encrypts this nsec and creates a separate internal signer key pair automatically. BOLT12 Pay sends each notification as an encrypted NIP-04 self-DM from that same Nostr profile through the relays saved with the Identity. This keeps Zap notifications in the familiar private-message flow without introducing a second visible sender profile. The public Zap receipt still uses the relays requested by the paying client. - LND unlocks both encrypted keys automatically after app or node restarts. The private app-signer `nsec` is never displayed. **Show app signer** reveals only its public `npub`. Existing plaintext Nostr keys are encrypted during this update. + LND-backed keys are unlocked through LND; new standalone keys can use local encryption. The private app-signer nsec is never displayed. Show app signer reveals only its public npub. Existing plaintext Nostr keys are encrypted during this update. - The saved notification `nsec` is never loaded back into the input field. To replace it, enter a new `nsec` and select **Save new notification nsec**. **Regenerate app signer** replaces only the internal signer key pair. + The saved notification nsec is never loaded back into the input field. To replace it, enter a new nsec and select Save new notification nsec. Regenerate app signer replaces only the internal signer key pair. - Keep every `nsec` secret. Never share it in support messages, logs or screenshots. + Keep every nsec secret. Never share it in support messages, logs or screenshots. - [Full Nostr setup guide](https://github.com/Alex71btc/lndk-pay/blob/main/README.md#-nostr) + Full Nostr setup guide: + https://github.com/Alex71btc/lndk-pay/blob/main/README.md#-nostr - ## ⚠️ Older LND versions + OLDER LND VERSIONS Only LND v0.20.1 and older versions need the legacy custom-message settings from the full guide. Remove the complete custom protocol block before upgrading to LND v0.21 or newer. Restart LND before performing the update. BOLT12 support is still evolving and wallet compatibility may vary. - [Support ongoing development](https://geyser.fund/project/bolt12pay) + Support ongoing development by donating to this project: + https://geyser.fund/project/bolt12pay Made for sovereign Bitcoin users. @@ -84,31 +103,59 @@ submission: https://github.com/getumbrel/umbrel-apps/pull/5429 repo: https://github.com/Alex71btc/lndk-pay support: https://github.com/Alex71btc/lndk-pay/issues releaseNotes: | - BOLT12 Pay 0.3.32 - Important Security Update + BOLT12 Pay 0.4.2 - Independent Lightning Backends & On-Chain Management - - Includes all security improvements from 0.3.31. - - Hardened API authentication, CSRF and browser security. - - Restored Nostr Zap receipts for LND and Phoenixd. - - Restored native Zap notifications. - - Hardened outgoing Zap receipt relay connections. - - Added NWC compatibility warnings in all five languages. + A major update introducing independent Lightning backends, + on-chain management and redesigned payments. - All users are strongly encouraged to upgrade. + INDEPENDENT BACKENDS + - LND-only, Phoenixd-only and dual-backend operation. + - No local LND node required for Phoenixd. + - Backend switching and lifecycle management. + - Optional backend privacy cleanup. - If an NWC connection is marked as incompatible, create a - new connection, reconnect your client and verify that it - works before deleting the old connection. + ON-CHAIN MANAGEMENT + - Lightning and on-chain balances. + - On-chain sending and receiving. + - UTXO selection and configurable transaction fees. + - RBF and CPFP, depending on backend capabilities. + - Public and private Mempool explorer support. + - Live Phoenixd deposit, withdrawal and splice tracking. + - Background transaction monitoring. + - LND message signing and wallet details. - Do not downgrade to 0.3.30. + PAY AND RECEIVE + - Redesigned unified payment interface. + - BOLT11, BOLT12, BIP353, LNURL and BIP21. + - Bitcoin and Lightning QR scanning and local image import. + - Payment method selection for combined requests. + - Wallet-specific BOLT12 offers and BIP353 addresses. + - Simple standard receiving backend assignment. + - Alternative BIP353 aliases for individual wallets. + - Larger, expandable BOLT12 offer QR codes. + - Improved compatibility with existing receiving addresses. - Special thanks to dritzps and Matt Hill (Start9). + ACTIVITY AND FIAT + - Lightning and on-chain transaction history. + - Historical and current fiat valuations. + - Backend-specific filters and CSV exports. - LNDK is unchanged. + ANDROID COMPANION 1.2.1 + - Lightning and on-chain payment notifications. + - Encrypted UnifiedPush, including ntfy distributor support. + - Improved payment-link handling. - https://github.com/Alex71btc/lndk-pay/releases/tag/v0.3.32 + NOSTR AND SECURITY + - Nostr identities, Zaps and Nostr Wallet Connect. + - Persistent NWC budget accounting. + - Improved payment security and backend isolation. + - Improved preservation of existing wallet bindings. -dependencies: - - lightning + Available in English, German, Spanish, French and Polish. + + https://github.com/Alex71btc/lndk-pay/releases/tag/v0.4.2 + +dependencies: [] gallery: - 1.webp - 2.webp