* fix: limit LSP opening fees for JIT channel invoices
JIT channel invoices are now created with a maximum LSP opening fee
instead of no limit: the fee the LSP advertises in its LSPS2 opening fee
menu for the payment size, bounded by an absolute ceiling of 5000 sats
or 10% of the payment, whichever is greater. Invoice creation fails if
the LSP quotes a fee above this limit.
The minimum JIT payment size calculation now uses the same ceiling so
the advertised receivable range matches what invoice creation accepts.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* fix: validate invoice expiry range and guard LSPS2 cache reads
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
* fix: update bark onboarding and backup messaging for seed-based recovery
Since bark 0.6.0, offchain funds are recoverable from the mnemonic
alone via the seed-derived recovery mailbox. Remove the outdated
warnings that the recovery phrase is not sufficient, show the standard
recovery guidance for bark during onboarding, and expose the
seed-recovery scan result as a 'recoveryreport' custom node command so
users migrating to a new device can verify their funds were restored.
Closes#2512
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* fix: settle bark lightning receives in the new delivering state
bark 0.6.0 added a 'delivering' receive state between preimage reveal
and settlement. The receive claim handler only treated
'preimage-revealed' and 'settled' as paid, so claimed receives were
published without a preimage and the transactions service rejected the
settlement ('no preimage in payment'), leaving paid invoices pending
forever.
Recognize all states at or past preimage reveal via a receiveIsPaid
helper (a positive allowlist, so an unknown future state degrades to
pending rather than falsely settled), only mark the transaction settled
when the preimage is present, and prefer bark's own settled_at
timestamp when available.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* fix: replace import channels checkbox with LDK-specific warning
The 'I don't have another Alby Hub to migrate or open channels'
checkbox on the import recovery phrase screen only applied to LDK but
was required for every backend, and its claim that channel funds are
always lost is wrong when dynamic channel backups (VSS) are enabled.
Remove the checkbox and the channels bullet from the import screen and
show the caveat on the Security & Recovery page instead, only when a
mnemonic was imported and the LDK backend was chosen.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
* fix: fallback to outgoing payments in Phoenixd LookupInvoice
LookupInvoice only queried /payments/incoming/{hash}, returning 404 for
outgoing payments. This caused all outgoing Lightning payments to remain
permanently stuck as PENDING in Alby Hub.
The fix tries incoming first (preserving existing behavior), then falls
back to listing outgoing payments and matching by paymentHash.
Fixes#2442
* fix: amount and fees in phoenix payment to transaction
---------
Co-authored-by: Roland Bewick <roland.bewick@gmail.com>
Switch from polling node.NextEvent() every second to node.NextEventAsync(),
which parks the goroutine until an event arrives without blocking an OS
thread or an LDK thread, as LDK is migrating to async event handling.
Guard event handling with a mutex held by Shutdown() so in-flight handlers
finish before the node is stopped and destroyed, and drop events that
arrive after shutdown starts (LDK redelivers unhandled events on startup).
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Moves from bark 0.2.3 to 0.4.0, which changed the FFI surface:
- WalletOpen takes the network and a WalletOpenArgs, replacing WalletCreate
and the separate RunDaemon call.
- Bolt11Invoice takes an optional anti-DoS token, unused here.
- LightningReceiveStatus is now LightningReceiveState, reporting progress
via State rather than a PreimageRevealed bool.
Movements expose PaymentHash and sends expose a typed terminal state, so both
are read from those instead of the movement metadata JSON. A send movement that
is neither pending nor successful now resolves the SendPaymentSync waiter
instead of being ignored.
* feat: just in time channels with lsps2
* fix: clarify JIT receive channel fee
* fix: fees
* fix: fees 2
* fix: don't show low inbound when LSPS2 is active
* fix: remove the receive limit below the input if LSPS2 is being used
* fix: simplify
* fix: bring back fee % for outgoing
* fix: remove unneeded changes
* fix: typo
* fix: unneeded
* fix: don't show open first channel is LSPS2
* feat: clearer JIT channel fee copy on receive screen
* fix: add LSPS2 var info
* fix: don't duplicate JIT fee hint on create invoice form
* fix: make paymentDone a standard boolean
* fix: update to golang:1.26 in Dockerfile
* feat: read LSPS2 sources from channel suggestions, set minimum receive amount, update guide link
* docs: update LDK_LSPS2_ADDRESSES to be used as an override
* fix: only show minimum jit receive amount on validation error
* fix: add more detail to receive error when receiving low amounts with jit
* fix: do not use JIT when user has public channels
* feat: add option to disable JIT
* fix: isTrusted check, add jit property to event
* fix: do not require node restart for toggling JIT
* chore: simplify JIT alert
* chore: add guide link on node settings JIT description
* feat: fetch the lsp2info to have access to params like minimum/maximum payment size
* refactor: share single learn-more link across JIT fee hint branches
* fix: remove variable amount invoice support
* fix: use lsps2info for min payment size and remove channelPeerSuggestion usage of minimumChannelSize
* fix: only do amount validation according to lsps2Info values if jit is enabled in settings
* feat: add jit first payment fee alert on receive via lightning address
* fix: remove unnecessary conditional
* fix: ensure at least one sat is left over when opening JIT channel
* chore: remove hardcoded suggestions
* chore: rename JIT enabled config variable
* fix: ui checks when JIT is disabled
* fix: amount input validation message
* fix: formatting
---------
Co-authored-by: anon <anon@anon.com>
Co-authored-by: saunter <68239231+stackingsaunter@users.noreply.github.com>
Co-authored-by: fmar <fmar@fmar>
Co-authored-by: René Aaron <rene@twentyuno.net>
Co-authored-by: Roland Bewick <roland.bewick@gmail.com>
* fix: show confirmation progress when opening public channel from LSP
Public channels require 6 confirmations before they can be gossiped and
become usable (BOLT-7), but LDK accepts channels from trusted LSP peers
as 0-conf and reports ConfirmationsRequired as nil/0. As a result the
channel-opening screen rendered an indefinite blank loading spinner
instead of confirmation progress.
Override ConfirmationsRequired to 6 for announced channels so the UI
shows the "X/6 confirmations" progress card while the channel opens.
Fixes#2294
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore: remove unnecessary link in comment
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* fix: link Windows CNG libs for bark FFI
The bark FFI static library is built for the GNU/mingw target and embeds
Rust's getrandom/ring code, which references Windows CNG symbols such as
BCryptGenRandom. The upstream bark bindings only link -lbark_ffi_go, so the
mingw linker fails with "undefined reference to BCryptGenRandom".
cgo merges LDFLAGS across packages, so supply the missing Windows system
libraries from our own bark package without modifying the vendored module.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* fix: move cgo directive out of Go doc comment for bark windows
The descriptive comment block was contiguous with the import "C" line, so
the entire block became the cgo C preamble and the C compiler tried to parse
the prose (unknown type name 'The', stray quotes/backticks). Separate the Go
documentation from the cgo preamble with a blank line and keep only the #cgo
directive in a /* */ block immediately preceding import "C".
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* fix: link Windows CNG libs for bark via extldflags
cgo #cgo LDFLAGS directives from our package are ordered before the bark
module on the link line, so the single-pass mingw linker discards -lbcrypt
before it sees the undefined BCryptGenRandom reference from libbark_ffi_go.a.
Append the Windows system libraries via -extldflags instead, which places
them after -lbark_ffi_go so the linker can resolve the symbols.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* fix: link bark Windows CNG libs via CGO_LDFLAGS start-group
wails drops -ldflags=-extldflags, so the system libraries never reached the
external linker. Set them through CGO_LDFLAGS instead (read directly by cgo)
and wrap them with bark in a --start-group, so the linker re-scans the group
and resolves BCryptGenRandom regardless of library order.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* fix: gate bark backend to platforms with prebuilt FFI libs
The bark FFI bindings ship no native library for 32-bit ARM Linux, so the
armv6 build failed to link bark's own FFI symbols. Constrain the real bark
implementation to bark's supported platforms (darwin/linux amd64+arm64,
windows amd64) and add a stub for everything else that returns an
"unsupported" error if the bark backend is selected at runtime.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore: remove json tags from lnclient models
these should not be passed through the API directly
* fix: properly return not implemented errors
* fix: json tags on TLVRecord
* feat: add CLN as a lnclient backend
* feat: add hold invoice support for CLN backend
* fix: reduce CLN form to just addresses and lightning dir
* feat: add README for CLN grpc go code generation
* fix: cln backend does not support keysend with given preimages
* fix: hold invoice notifications in CLN backend
* fix: remove dead code in CLN backend from ListTransactions
* fix: env example CLN_ADDRESS_HOLD with different port to show it's a different service
* fix: cleanup of CLN ressources in all cases
* fix: cln backend's GetNetworkGraph only fetches specified nodeId's
* fix: cln backend: only advertise hold methods for nip47 if hold plugin enabled
* fix: cln's Shutdown should not stop CLN itself
* fix: relax the LND README line regarding env configuration
* fix: more nil checks in clnInvoiceToTransaction
* fix: prevent feerate overflow in CLN's RedeemOnchainFunds
* fix: don't access nil errors for empty reponses of certain CLN methods
* fix: nil instead of empty string in cln's GetNetworkGraph return types
* fix: nil checks for created_at in cln's clnInvoiceToTransaction
* fix: set minimum tls version to 1.2 for cln backend grpc connections
* fix: cln's subscribeOpenHoldInvoices doesn't give up as fast
* fix: deduplicate graph edges in cln's GetNetworkGraph
* fix: print the error string, not pointer address, in cln's ListChannels
* fix: remove cln's ListTransactions completely
* fix: use ListPeers instead of ListPeerChannels in cln's ListPeers
* feat: cln's MakeHoldInvoice supports minCltvExpiryDelta
* fix: use named return err in NewCLNService
* fix: cln listpeers log message
* fix: incorrect import
* fix: compile errors after rename
---------
Co-authored-by: Roland Bewick <roland.bewick@gmail.com>
* feat: add both Sat and Msat companion fields for all ambiguous balance/amount properties
* feat: add sat and msat companion fields to backend API responses
* chore: align frontend types and other missing fields
* chore: keep old formula for calculating total fee sat
* chore: remove unnecessary balance assignments in cashu and phoenix
* chore: add deprecated comment to non unit fields
* chore: rename callers and variable to specify units
* chore: remove msat fields for channel size and liquidity fields
* chore: drop msat fields from onchain channel size and liquidity responses
* chore: further changes
* chore: remove amount msat field onchain tx
* chore: remove msats from onchain balance response
* chore: remove msat fields for swaps
* chore: remove msat fields for punishment reserves
* chore: simplify rebalancing fee calculation
* chore: remove unnecessary fields
* chore: mark deprecated fields in frontend types
---------
Co-authored-by: im-adithya <imadithyavardhan@gmail.com>
* feat: add chain data source and address to about page
* fix: only show chainsource for ldk
* fix: redact chain-source address secrets and return complete bitcoind endpoint
* chore: make sanitize function readable and add tests
* fix: align ldk chain data source labels
---------
Co-authored-by: anon <anon@anon.com>
Co-authored-by: im-adithya <imadithyavardhan@gmail.com>
fixes#2065
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Improvements**
* Hold invoices now support an optional minimum CLTV expiry delta with
validation to ensure values stay within protocol limits, allowing finer
control over confirmation timeout behavior.
* **Chores**
* Updated a direct library dependency to a newer version.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
* fix: checks for ok status code in responses
* refactor: replacing native fetch with useSWR
* chore: remove url from logs
* chore: add phoenixd error logs for non-success responses
* chore: add use currencies hook
* chore: use loading from currencies hook and filter out btc
---------
Co-authored-by: im-adithya <imadithyavardhan@gmail.com>
* fix: intercept self hold payments based on invoice rather than payment hash
* fix: generate test invoices with long expiry
* fix: add timeout seconds for standard lnd payments
Transactions are listed from the database via transactionsService, not
from the LN backend. The LNClient.ListTransactions method was never
called and each backend's implementation was dead code.
Closes#2045
Co-authored-by: Joel Klabo <max@klabo.world>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
* feat: decouple ldk log
* fix: condition mapping correct levels
* fix: move LDK_LOG_LEVEL into LDK section
* fix: move ldk logger to be init in ldk service
* fix: higher is more verbose
* fix: missing 6 (trace)
* chore: address decouple ldk log feedback (#1924)
* fix: remove unneeded global variable
---------
Co-authored-by: Fmar <frnandu@gmail.com>
Co-authored-by: Roland <33993199+rolznz@users.noreply.github.com>
Co-authored-by: Roland Bewick <roland.bewick@gmail.com>
* feat: expose node URI address
* fix: remove duplicated toast
* chore: improve display of pubkey and uri on connections page advanced dropdown
* fix: use LDK_ANNOUNCEMENT_ADDRESSES instead of NODE_IPV6
---------
Co-authored-by: Roland Bewick <roland.bewick@gmail.com>
* feat: choose payment method when opening first channel (WIP)
* chore: update terms
* chore: consume lsp endpoint, display fees+LSP in manual channel flow, first channel ui improvements
* chore: improve handling of fee_credits payment method
* chore: add terms and description
* feat: add terms to manual increase incoming capacity flow
* chore: add error handling for get_info endpoint
* feat: allow alby account to pay for manual channel order
* chore: use consistent logging methods
* chore: rename lsp balance sats field to be consistent
* chore: update to use consistent field name for public key in auto channel request
* chore: rename channel suggestion url and type fields
* feat: support included payment method
* chore: update LDK startup peers
* chore: move non-oauth methods out of alby oauth service
* chore: improve terms around duration, only display duration in terms modal