zeus-lightning-reference

Explains Bitcoin Lightning and ecash protocols as implemented in the Zeus codebase.

Updated Sep 2, 2026
One-click install
npx skills add https://github.com/aswin-dev-debug/Ai-Finance-analyzer --skill zeus-lightning-reference-aswin-dev-debug
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: zeus-lightning-reference
Source: https://github.com/aswin-dev-debug/Ai-Finance-analyzer/tree/main/lib/zeus-contrib/zeus/.claude/skills/zeus-lightning-reference
Command: npx skills add https://github.com/aswin-dev-debug/Ai-Finance-analyzer --skill zeus-lightning-reference-aswin-dev-debug

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Developers reading or modifying the Zeus wallet codebase often know React Native but not Lightning protocol theory (or vice versa), making funds-touching code hard to understand and risky to change. This Skill maps each protocol concept to the exact Zeus file that implements it, including Zeus-specific quirks and verified constants. ## Core Features & Use Cases - Protocol-to-code mapping: Covers BOLT11 invoice decoding, MPP/AMP/keysend payments, LNURL flows, ZEUS Pay/Zaplocker, LSP integrations (Flow 2.0, LSPS0/1/7), Cashu ecash, Nostr Wallet Connect, Boltz swaps, and on-chain operations, each tied to concrete files like utils/Bolt11Utils.ts and stores/LSPStore.ts. - Zeus-specific gotchas: Documents load-bearing details such as the Bolt11 LRU cache with lazy secp256k1 getters, the max_parts default discrepancy, the CPFP output-index flip retry, and the merchant QR 500-character regex cap. - Input router documentation: Explains the detector ordering in utils/handleAnything.ts and the rules for safely adding new detectors. - Use Case: When reviewing a pull request that touches payment sending, load this Skill to understand why sendPaymentInternal defaults max_parts to '1' while the PaymentRequest screen passes '16', avoiding an accidental behavior change. ## Quick Start Ask the AI to explain how Zeus handles BOLT11 invoice decoding and what pitfalls to avoid when working with decoded invoice objects.

Frequently Asked Questions about zeus-lightning-reference

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How does Zeus decode BOLT11 Lightning invoices?

Zeus uses a hand-rolled decoder in utils/Bolt11Utils.ts with an LRU cache of 256 entries and lazy self-replacing getters for destination and signature fields. The lazy getters defer expensive secp256k1 public-key recovery until first access, so you must never spread or JSON.stringify a decoded invoice.

What is the difference between MPP and AMP payments in Lightning wallets?

MPP splits one payment across multiple routes, while AMP is LND's atomic variant that also works without an invoice. In Zeus, MPP requires LND v0.10.0+ and AMP requires v0.13.0+, and AMP is forced on when invoice feature bit 30 is required.

How does ZEUS Pay receive Lightning payments while the phone is offline?

ZEUS Pay uses the Zaplocker hodl-invoice scheme: the phone pre-generates 250 preimages and submits their hashes to zeuspay.com, which holds incoming HTLCs. When the app comes online, it redeems by creating an invoice with the fixed preimage, settling the held payment.

Does Zeus support Cashu ecash on all Lightning backends?

No, Cashu is only available on the embedded-lnd and ldk-node backends, gated by supportsCashuWallet(). The implementation uses the Cashu Dev Kit Rust FFI with its own SQLite database rather than the cashu-ts JavaScript library.

Why does the Zeus input router check Cashu tokens before LNURL?

The findlnurl function can match bech32-like substrings inside cashu tokens and misroute them, so handleAnything.ts detects web-wrapped Cashu tokens first. Detector order in the if/else chain is load-bearing, and new detectors should be placed as late as correctness allows.

When should I not use this Lightning domain reference?

Do not use it for backend capability matrices, settings defaults, storage migrations, architecture rationale, or debugging playbooks, which are covered by sibling Zeus skills. This reference only explains what protocols do and how Zeus implements them.