Skip to content

[Senior] Remove IBEX API dependency for basic app functionality #302

Open

Description

@islandbitcoin

Summary

Flash currently requires a working connection to IBEX APIs (sandbox and production) for basic app functionality. If IBEX APIs are unreachable, users experience degraded or broken flows that should otherwise work independently.

Goal

The app should function with BTC-only wallet capabilities when IBEX APIs are unavailable. USD wallet features can gracefully degrade, but core BTC functionality must not depend on IBEX.

Requirements

  • App startup must succeed without IBEX API connectivity
  • BTC wallet (balance, send, receive) must work independently of IBEX
  • USD wallet features should gracefully degrade (show unavailable state, not crash/error)
  • Transaction history should display BTC transactions regardless of IBEX status
  • Error handling should clearly distinguish between Flash-native failures and IBEX dependency failures
  • No hardcoded assumptions that IBEX is always reachable

Context

  • Related Linear issues: ENG-223, ENG-236
  • IBEX auth deprecation deadline: May 31, 2026 (ENG-38)
  • This is a risk mitigation issue — Flash should not have a single point of failure on a third-party API for basic functionality

Acceptance Criteria

  1. Start the app with IBEX APIs completely unreachable → user sees BTC wallet, can send/receive BTC
  2. USD wallet shows a clear "unavailable" state instead of errors or crashes
  3. No regression in normal operation when IBEX is available

Activity

  1. patoo0x commented on Mar 20, 2026

    @patoo0x
    Contributor

    📋 Definition of Done — 💰 500,000 sats (bundled with flash-mobile#591 + flash-mobile#572)

    ⚠️ Bundled bounty: This issue is part of a 3-issue bundle:

    All three must be completed together for the full 500,000 sats payout.

    Expected Behavior After Fix:

    • App starts and is fully functional with IBEX APIs completely unreachable
    • BTC wallet (balance, send via Lightning, receive) works end-to-end without any IBEX API calls
    • USD wallet shows a clear "temporarily unavailable" state (no crashes, no infinite loaders)
    • Transaction history displays BTC transactions regardless of IBEX status
    • When IBEX connectivity is restored, USD wallet recovers automatically without app restart
    • Error handling clearly distinguishes Flash-native failures from IBEX dependency failures
    • Android build is reproducible (walletscrutiny diff resolved)

    Deliverables:

    • Backend PR against main (closes #302)
    • Mobile PR(s) against main (closes flash-mobile#591, closes flash-mobile#572)
    • Unit tests for BTC-only mode, graceful USD degradation, and recovery
    • Screen recording showing: (1) IBEX offline → app starts → BTC send/receive works → USD shows unavailable; (2) IBEX restored → USD wallet recovers; (3) Android build reproducibility verification
    • Lightning address provided in your first comment on this issue

    Review Gate:

    • All existing tests pass
    • Ben signs off (backend)
    • Nick signs off (mobile)
    • Dread final approval

    Payment: 500,000 sats via Lightning on merge.
    See CONTRIBUTING.md for full details.

  2. chengyixu commented on Mar 21, 2026

    @chengyixu

    Proposal

    I'd like to work on this Senior bounty (bundled: flash#302 + flash-mobile#591 + flash-mobile#572).

    Approach:

    • Audit all code paths that call IBEX APIs at startup and during BTC wallet operations
    • Introduce a feature flag / capability check: if IBEX is unreachable (timeout < 3s), app boots in BTC-only mode with USD features hidden
    • Wrap every IBEX call in a try/catch with graceful degradation — BTC send/receive, balance display, and Lightning payments must work independently via the Galoy/LND backend
    • For flash-mobile#591: mirror the same startup resilience in the React Native layer — use a context provider that short-circuits IBEX initialization on network failure
    • For flash-mobile#572: investigate reproducibility diff (65 non-image files) — likely deterministic build config (timestamps, build IDs) in the Gradle/Fastlane pipeline

    Timeline: 2-3 days

    Available immediately! cc @patoo0x

  3. chengyixu commented on Mar 21, 2026

    @chengyixu

    Proposing to remove IBEX API dependency from the Flash backend.

    Analysis:
    The IBEX dependency blocks BTC-only functionality when IBEX is down. Here's my approach:

    1. Startup decoupling:

    • Identify all IBEX API calls in the startup/initialization path
    • Move them to lazy-loaded services that only execute when USD wallet features are actually requested
    • BTC wallet initialization via Galoy/LND directly — no IBEX required

    2. BTC wallet independence:

    • Audit all BTC balance, send, and receive flows to ensure no IBEX calls are in the critical path
    • Wrap any IBEX calls in try/catch with graceful fallback responses
    • Add a health check service for IBEX with circuit breaker pattern (fail-fast after 3 consecutive timeouts)

    3. USD graceful degradation:

    • Return a structured "service unavailable" response for USD-specific queries when IBEX is down
    • Ensure error propagates cleanly to mobile without crashing the backend

    4. Testing:

    • Unit tests: mock IBEX as unreachable, verify BTC flows still pass
    • Integration test: spin up backend without IBEX config, verify BTC operations work end-to-end

    Timeline: This is a significant backend refactor — I estimate 5-7 days for a thorough implementation with tests. Ready to begin immediately.

  4. HuiNeng6 commented on Mar 25, 2026

    @HuiNeng6

    /attempt

    Proposal - Remove IBEX API Dependency Bundle

    I'd like to work on this Senior bounty bundle (flash#302 + flash-mobile#591 + flash-mobile#572).

    My Approach:

    Backend (flash#302):

    • Audit all IBEX API call sites in startup and BTC wallet flows
    • Implement circuit breaker pattern for IBEX health check (3s timeout)
    • Move IBEX initialization to lazy-loaded service
    • Add BTC-only mode flag when IBEX unreachable
    • Ensure Galoy/LND backend handles BTC operations directly

    Mobile (flash-mobile#591):

    • Add \useIbexHealthCheck\ hook with 5s timeout
    • Create \WalletCapabilityContext\ for conditional USD rendering
    • Wrap IBEX calls with graceful degradation
    • Ensure Lightning send/receive works without IBEX

    Build Reproducibility (flash-mobile#572):

    • Pin all Gradle dependency versions (no +\ versions)
    • Set \SOURCE_DATE_EPOCH\ for deterministic timestamps
    • Configure ProGuard/R8 for consistent output

    Timeline: 5-7 days for complete bundle

    Lightning address: [需要提供]

    Ready to start immediately!

  5. added a commit that references this issue on Apr 17, 2026
    250128d
  6. added and removed
    enhancementNew feature or request
    on Apr 17, 2026
  7. islandbitcoin commented on Oct 10, 2026

    @islandbitcoin
    ContributorAuthor

    @HuiNeng6 your /attempt from 2026-03-25 is released: no PR or follow-up in the six months since.

    Bounty cancelled (2026-10-10). The bounty program is closed and the reward attached to this issue is withdrawn. No bounty will be paid for work on it. The issue itself stays open as a regular work item and has been re-prioritized by the core team. Thanks to everyone who proposed an approach.

  8. islandbitcoin commented on Oct 10, 2026

    @islandbitcoin
    ContributorAuthor

    Priority pass 2026-10-10: rank 9 of 13. With Breez removed, BTC also flows through IBEX, so full independence is unrealistic. Proposed re-scope: graceful degradation (circuit breaker on IBEX health, explicit unavailable states, startup that does not block on IBEX).

  9. nul-quill commented on Oct 11, 2026

    @nul-quill

    PR: #524 - circuit breaker on IBEX health (3s half-open), BTC balance + wallet history served from the ledger while it is open, cash wallets show an explicit unavailable (null) state instead of erroring, and a network-level ApiError is what trips the breaker. 256 suites / 3307 tests green in an isolated sandbox; tsc unchanged from main. Handle: nul-quill. Payout wallets: Solana USDC BdznDjc4xwt5Y6WJT5UnrFQzDptka8YnC9oqmmkKpwkd, TRC20 TNEHCVwR2aPMrj5AKfWCQ2rFL3bEDQmsg7.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions