Skip to content

fix(api): show LNURL memo on intraledger receives#656

Open
blink-claw-bot wants to merge 2 commits into
blinkbitcoin:mainfrom
blink-claw-bot:blink-claw-bot/lnurl-intraledger-receiver-memo
Open

fix(api): show LNURL memo on intraledger receives#656
blink-claw-bot wants to merge 2 commits into
blinkbitcoin:mainfrom
blink-claw-bot:blink-claw-bot/lnurl-intraledger-receiver-memo

Conversation

@blink-claw-bot

Copy link
Copy Markdown

Summary

  • Preserve the LN invoice description on receiver-side LN intraledger credit metadata.
  • Keep the sender-provided payment memo on the sender/debit side.
  • Cover LN intraledger metadata for both cross-account and intra-account trade paths.

Why

LNURL-pay comments are stored as the generated invoice description. External Lightning receives already surface that description through the receive transaction memo, but internal Blink-to-Blink settlement used LN intraledger metadata that only attached memo data to the payer/debit row. The recipient credit row therefore had an empty tx.memo and mobile fell back to From <username>.

This change stores the invoice description as receiver-visible memoPayer on LN intraledger credit metadata when present, so transaction history can show the accepted LNURL comment for the recipient.

Fixes #550
Relates to blinkbitcoin/blink-wip#903

Tests

  • TEST=test/unit/services/ledger/domain/tx-metadata.spec.ts pnpm --dir core/api test:unit
  • pnpm --dir core/api tsc-check

Both were run with local dummy env values required by core/api/src/config/env.ts.

@github-actions github-actions Bot added the core label Jun 30, 2026
@blink-claw-bot

Copy link
Copy Markdown
Author

Commit acd101b54 — Show LNURL memo on intraledger receives

What: Adds receiver-side LN intraledger credit metadata for the invoice description, while keeping the sender payment memo on the debit side. Updates the ledger metadata unit tests for LN intraledger cross-account and intra-account paths.

Why: LNURL-pay comments are stored as invoice descriptions. Internal Blink-to-Blink settlement was only attaching memo data to the payer row, so recipient transaction history had an empty tx.memo and mobile fell back to From <username>.

Files: core/api/src/app/payments/send-lightning.ts, core/api/src/services/ledger/facade/tx-metadata.ts, core/api/test/unit/services/ledger/domain/tx-metadata.spec.ts

Tests:

  • TEST=test/unit/services/ledger/domain/tx-metadata.spec.ts pnpm --dir core/api test:unit
  • pnpm --dir core/api tsc-check

@k9ert

k9ert commented Jun 30, 2026

Copy link
Copy Markdown

How is this different from #551 ? Reconcile with the that other PR and especially take the privacy concerns into account which you posted on #551

@blink-claw-bot

Copy link
Copy Markdown
Author

Kim, this is intentionally narrower than #551.

#656 only preserves the invoice description / LNURL comment on the receiver credit metadata for LN intraledger receives, while keeping the sender's payment memo on the debit side. It does not remove or relax the global memo-sharing thresholds, and it does not change unrelated memo propagation policy.

So the privacy boundary stays the same: payer-authored memos are not broadly shared through this PR; the receiver only sees the receive-side LN invoice description/comment that was already part of the LNURL/invoice receive context.

I also pushed 8e99f02fd to fix the caused-by-PR jest/no-conditional-expect lint failure in tx-metadata.spec.ts. Local checks passed:

  • TEST=test/unit/services/ledger/domain/tx-metadata.spec.ts pnpm --dir core/api test:unit
  • pnpm --dir core/api eslint-check -- test/unit/services/ledger/domain/tx-metadata.spec.ts
  • pnpm --dir core/api tsc-check

🤖 Codex via Blink-Claw-Bot

@k9ert k9ert left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No findings from my review.

I checked the metadata write path end to end: the LN invoice description is added only to the recipient credit row as account-level memoPayer, which translates to memoFromPayer and then wallet transaction memo. The sender-provided memo remains on the debit side, and the same-account trade path is covered as well.

Verified locally with dummy env values required by core/api/src/config/env.ts:

  • TEST=test/unit/services/ledger/domain/tx-metadata.spec.ts pnpm --dir core/api test:unit
  • pnpm --dir core/api tsc-check

@blink-claw-bot blink-claw-bot force-pushed the blink-claw-bot/lnurl-intraledger-receiver-memo branch from 8e99f02 to 41079d8 Compare June 30, 2026 16:30
@blink-claw-bot

Copy link
Copy Markdown
Author

Rebased onto latest main (c57fdb6db). No code changes beyond replaying the existing two PR commits.

New head: 41079d8a8
Tests: not run locally; GitHub checks are pending after the rebase.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(lnurl): LNURL comment/memo not preserved on recipient transaction for internal Blink-to-Blink payments

2 participants