Skip to content

#108 Feature: Implement Lightning Address#113

Open
andycreed0x wants to merge 11 commits into
developfrom
108-jan3-ln-address
Open

#108 Feature: Implement Lightning Address#113
andycreed0x wants to merge 11 commits into
developfrom
108-jan3-ln-address

Conversation

@andycreed0x

@andycreed0x andycreed0x commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

Purpose

Implement Lightning Address support for JAN3/AQUA users. Closes #108 Feature: Implement Lightning Address.

Each user gets a Lightning Address (username@domain) backed by a rotating pool of Liquid receive addresses registered with the AQUA backend. The wallet↔account binding is maintained via a fingerprint hash.

Main Changes

  • ✨ Added jan3_user_info — fetch account profile; auto-tops-up LN address pool when active
  • ✨ Added jan3_enable_lightning_address — toggle LN-address delivery; populates address pool on enable
  • ✨ Added jan3_ln_check_username / jan3_purchase_ln_username — check availability and buy/update a Lightning Address username (funded via signed L-BTC tx)
  • ✨ Added jan3_rebind_wallet — re-register the wallet↔account binding (fingerprint + email hash)
  • ♻️ Expanded Jan3AccountsManager with register_ln_addresses, ensure_ln_pool, rebind_wallet, purchase_ln_username
  • 🗃️ WalletData gains next_address_index for sequential, non-reusing address handouts
  • ✅ Tests for all new tools, manager methods, CLI commands, and storage migration

Checklist

  • No hardcoded values (they should go in constants.py, .env, or our database)
  • Added/updated tests (if necessary)
  • Added/updated relevant documentation (if necessary)

@andycreed0x andycreed0x marked this pull request as ready for review July 3, 2026 17:36
@andycreed0x

Copy link
Copy Markdown
Collaborator Author

Changes made on top of the LN Addresses branch

  • Ported CLI commands for everything that was already implemented in the MCP.
  • Unified aqua_* and jan3_* tools. The old branch had independently re-unified the same account/session logic that develop already rewrote in JAN3 Account creation through captchaless login #101, so a rebase would have produced conflicts across every account file and ~2,300 test lines — and still left a two-manager split to clean up. It was faster and cleaner to re-port just the net-new LN logic (~600 lines) directly onto develop's unified Jan3AccountsManager.
  • Implemented jan3_rebind_wallet tool — redirects the LN address to a new wallet.
  • Automatic Liquid address pool refill for LN addresses, instead of prompting the user.
  • Peek address logic. Some flows always require a fresh address; others can reuse an existing one. This distinction matters: if too many unused addresses accumulate, the agent can easily hit Blockstream's rate limit just from wallet sync operations.
  • Wallet identification now uses the descriptor fingerprint in addition to the wallet name.
  • Cleaned up incorrect password assumptions — Claude had assumed a password was required for all operations, including address generation.
  • Cleaned up incorrect payment assumption — Claude had assumed the user needed to pay to obtain their first LN address.
  • LN address purchase flow now prompts the user before proceeding, and accepts both USDT and LBTC. Previously it ran silently with incomplete fields.

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.

1 participant