Problem
The SilentPaymentIndexer currently connects to the indexer over clearnet via IndexerHttpClient, which uses a basic fetch wrapper (util/fetch.ts) with no proxy support. The indexer is available as a Tor hidden service, but there is no mechanism to route requests through Tor.
This leaks metadata — the user's IP address is exposed to the indexer server on every call to /transactions/height/:height, /silent-block/latest-height, and /health.
Current Architecture
SilentPaymentIndexer (blue_modules/SilentPaymentIndexer.ts) creates an IndexerHttpClient with a plain baseUrl
IndexerHttpClient (helpers/silent-payments/IndexerHttpClient.ts) calls fetch() directly with no proxy/agent configuration
SilentPaymentIndexerConfig (helpers/silent-payments/types.ts) has no fields for Tor/proxy settings
- The codebase already has passive
.onion awareness in BlueElectrum.ts (extended timeouts for onion peers) and class/lnurl.ts (onion URL detection), but no active SOCKS proxy integration
Requirements
- Route
IndexerHttpClient HTTP requests through a SOCKS5 proxy to reach the indexer's .onion address
- Extend
SilentPaymentIndexerConfig to accept Tor/proxy configuration (e.g., SOCKS5 host/port, .onion base URL)
- Handle longer latency inherent to Tor (adjust default timeouts for onion connections)
- Fail gracefully if the Tor proxy is unavailable (with a clear error, optionally falling back to clearnet based on user preference)
- Ensure compatibility with React Native's networking layer (react-native-tcp-socket is already a dependency)
Relevant Files
blue_modules/SilentPaymentIndexer.ts — indexer wrapper
helpers/silent-payments/IndexerHttpClient.ts — HTTP client (needs proxy support)
helpers/silent-payments/types.ts — config type definitions
util/fetch.ts — fetch wrapper (may need SOCKS agent support)
Problem
The
SilentPaymentIndexercurrently connects to the indexer over clearnet viaIndexerHttpClient, which uses a basicfetchwrapper (util/fetch.ts) with no proxy support. The indexer is available as a Tor hidden service, but there is no mechanism to route requests through Tor.This leaks metadata — the user's IP address is exposed to the indexer server on every call to
/transactions/height/:height,/silent-block/latest-height, and/health.Current Architecture
SilentPaymentIndexer(blue_modules/SilentPaymentIndexer.ts) creates anIndexerHttpClientwith a plain baseUrlIndexerHttpClient(helpers/silent-payments/IndexerHttpClient.ts) callsfetch()directly with no proxy/agent configurationSilentPaymentIndexerConfig(helpers/silent-payments/types.ts) has no fields for Tor/proxy settings.onionawareness inBlueElectrum.ts(extended timeouts for onion peers) andclass/lnurl.ts(onion URL detection), but no active SOCKS proxy integrationRequirements
IndexerHttpClientHTTP requests through a SOCKS5 proxy to reach the indexer's .onion addressSilentPaymentIndexerConfigto accept Tor/proxy configuration (e.g., SOCKS5 host/port, .onion base URL)Relevant Files
blue_modules/SilentPaymentIndexer.ts— indexer wrapperhelpers/silent-payments/IndexerHttpClient.ts— HTTP client (needs proxy support)helpers/silent-payments/types.ts— config type definitionsutil/fetch.ts— fetch wrapper (may need SOCKS agent support)