Skip to content

Implement breez lightning address - #602

Merged
islandbitcoin merged 18 commits into
mainfrom
feat/breez-lightning-address
May 25, 2026
Merged

Implement breez lightning address#602
islandbitcoin merged 18 commits into
mainfrom
feat/breez-lightning-address

Conversation

@Nodirbek75

Copy link
Copy Markdown
Contributor

No description provided.

@Nodirbek75
Nodirbek75 marked this pull request as ready for review May 22, 2026 15:07
@Nodirbek75
Nodirbek75 requested a review from islandbitcoin May 22, 2026 15:08
@Nodirbek75 Nodirbek75 self-assigned this May 22, 2026
@linear

linear Bot commented May 22, 2026

Copy link
Copy Markdown

ENG-387

ENG-165

ENG-166

@islandbitcoin

islandbitcoin commented May 22, 2026

Copy link
Copy Markdown
Contributor
## Summary

This PR fixes the BTC/Breez external-wallet setup flow and the main manual-send edge case found during simulator testing.

### Fixes included

- Stabilized Breez external wallet setup: (352619d935a32285acb4d7b3e51e275d79365283)
  - waits for `updateExternalWallet(input: { lnurlp })` instead of treating it as fire-and-forget
  - stores the backend-returned BTC/external `walletId`
  - retries registration when `me.username` becomes available after Breez SDK init
  - prevents duplicate registration attempts
  - shows loading/error/retry states instead of surfacing raw `missing walletIds`

- Fixed manual username sends for USD → BTC-default recipients: (f0acdf2008981d0e67fc7e8d82480ef676293f1e)
  - when a sender’s default wallet is USD and the receiver’s default wallet is BTC/Breez, bare username entry now routes through LNURL (`username@<lnAddressHostname>`) instead of the USD intraledger mutation
  - USD → USD username sends still use the existing intraledger path
  - full lightning address sends continue to use the existing LNURL path

### User testing covered

Tested with:

- Pixel 9 Android simulator
- iPhone 17 simulator

Passing cases:

- External wallet pays Flash user with USD default
- External wallet pays Flash user with BTC default
- Flash BTC default pays Flash USD default
- Flash BTC default pays Flash BTC default
- Flash USD default pays Flash USD default
- Full lightning address works for USD → BTC-default recipient
- Manual bare username now works for USD → BTC-default recipient

### Known follow-up

There is still a separate edge case for non-manual entry points: QR/NFC/card flows that resolve to a bare Flash username may still route through the shared intraledger parser and fail for USD sender → BTC-default receiver.

Tracked separately in Linear: [ENG-399](https://linear.app/island-bitcoin/issue/ENG-399)

@islandbitcoin islandbitcoin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bugs fixes applied, ACK

islandbitcoin added a commit that referenced this pull request Jun 20, 2026
…NURL (ENG-399) (#646)

A bare Flash username scanned via QR that resolves to a recipient whose
default wallet is BTC/Breez previously failed when the sender's wallet was
USD: the shared parser treated it as PaymentType.Intraledger and the USD
send hit intraLedgerUsdPaymentSend against the recipient's BTC wallet,
failing with the generic support error.

Manual entry already handled this (PR #602) via a module-private
maybeResolveManualUsernameToLnurl. This:

- Extracts that helper into payment-destination/resolve-username-to-lnurl.ts
  so every entry point can share the routing decision (the ticket flags the
  duplicated-logic risk).
- Applies it in the QR-scan processInvoice via the same
  `maybeResolve... ?? parseDestination` pattern as manual entry, so a
  BTC-default recipient is re-routed through `username@lnAddressHostname`.
- Adds unit tests for the helper covering: non-intraledger pass-through,
  USD-recipient pass-through, self-payment, successful LNURL re-route, and
  the unreachable-lightning-address error.

Scope: QR is the only entry point that carries a bare username into a send.
NFC is receive/withdraw-only (rejects Send-direction, reads lnurl payloads
only) and the card flow always carries a Flashcard LNURL, so neither is
changed. The durable cross-entry-point fix is the backend resolveSendDestination
resolver (ENG-399 Phase 2), filed separately.

Co-authored-by: Dread <dread@example.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Enhancement] - Option to send to BTC wallet via lightning address For having Default BTC Wallet, enable Breez-SDK LNURL on PayCode Tab

3 participants