Skip to content

[Bug]: msat-precision invoices fail to send (regular BOLT11 + LNURL pay/withdraw) #877

@piotr-iohk

Description

@piotr-iohk

What happened?

When invoice amounts include millisatoshis that are not a whole satoshi, payment handling is incorrect.

Observed from repro and user reports:

  • Regular BOLT11 invoices with valueMsat fail in app flows that should pay exact invoice amount.
  • LNURL-pay / LNURL-withdraw flows are also affected for msat-precision limits.
  • On Android specifically (LNURL case), the amount resolves to 0 for affected msat-precision flows.

This aligns with the original Slack report where invoice amount precision caused payment mismatch/failure.

Expected behavior

  • Regular BOLT11 invoice payments with msat precision should succeed.
  • LNURL-pay and LNURL-withdraw with msat-precision limits should preserve valid amount and execute.
  • Android should not collapse msat-precision LNURL amount to 0.

Steps to Reproduce

  1. Use regtest/local setup with active channel and spending balance.
  2. Reproduce regular invoice case via E2E @send_3 flow (invoices created with lnd.addInvoice({ valueMsat })).
  3. Try msat values like 222538, 222222, 500500.
  4. Reproduce LNURL-pay/LNURL-withdraw msat cases (fixed min == max msat values).
  5. Observe failure behavior (Android LNURL case shows amount as 0; regular invoice flow also fails for msat invoice handling).

Logs / Screenshots / Recordings

Screen.Recording.2026-03-31.at.11.42.51.mov

logs.zip

Bitkit Version

2.1.2

Device / OS

Android Emulator (sdk_gphone64_arm64), Android 13

Reproducibility

Always

Additional context

  • E2E coverage for this bug class is in bitkit-e2e-tests PR #140 and should pass after fix.
  • Coverage includes:
    • regular invoice msat cases in send.e2e.ts (@send_3)
    • LNURL pay/withdraw msat cases in lnurl.e2e.ts
  • It would be good to add unit-level tests in amount parsing/payment amount calculation paths to prevent regressions.

Similar issues check

Potentially related Android issues reviewed:

  • #790 (open) - Fail to send max / near max lightning payment
  • #764 (closed) - LNURL-pay fails with decoding error in Bitkit
  • #417 (open) - LNURL-pay comment not displayed on activity
  • #418 (closed) - LNURL-withdraw ... minWithdrawable == maxWithdrawable ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions