Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add receive addresses labels#8595

Open
r6mez wants to merge 6 commits into
BlueWallet:masterfrom
r6mez:recieve-addresses-labels
Open

Add receive addresses labels#8595
r6mez wants to merge 6 commits into
BlueWallet:masterfrom
r6mez:recieve-addresses-labels

Conversation

@r6mez

@r6mez r6mez commented May 22, 2026

Copy link
Copy Markdown
Contributor

Today, BlueWallet supports per-transaction memos and per-counterparty labels, but nothing scoped to an individual receive address. This PR adds that, attach a short label to an address once, and see it everywhere that address shows up.

Related issue: #3313

@r6mez

r6mez commented May 22, 2026

Copy link
Copy Markdown
Contributor Author

happy to iterate on the approach.

@GladosBlueWallet GladosBlueWallet left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

A beautiful little omission. The feature reaches for addressMetadata before the storage layer knows it exists, so this either fails typechecking or crashes when the user taps the pencil. Add the plumbing before pretending the UI has a memory.

Comment thread screen/transactions/TransactionStatus.tsx

@marcosrdz marcosrdz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Add E2E tests on detox spec files. Theres one for memos and receive view that can serve as guidance

@Overtorment Overtorment left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

i like it, i think with @ncoelho blessing we can add it to the next release

@ncoelho

ncoelho commented May 28, 2026

Copy link
Copy Markdown
Member

Needs some UI love on the inputs at least

@r6mez

r6mez commented May 28, 2026

Copy link
Copy Markdown
Contributor Author

Add E2E tests on detox spec files. Theres one for memos and receive view that can serve as guidance

@marcosrdz
I extended t3 to cover label persistence (close receive, open wallet details, open addresses, assert it rehydrates). Is that enough, or is there a specific flow you'd want covered as well?

@r6mez

r6mez commented May 28, 2026

Copy link
Copy Markdown
Contributor Author

@ncoelho
The label editing prompts here use the app's shared helper helpers/prompt.ts, which wraps the native helper prompt.

Happy to improve it, but I'd suggest doing it as a separate PR that swaps the helper itself

@r6mez r6mez requested a review from marcosrdz June 1, 2026 14:46
@r6mez r6mez force-pushed the recieve-addresses-labels branch from 1363169 to 68b2e39 Compare June 1, 2026 15:07
@r6mez r6mez force-pushed the recieve-addresses-labels branch 8 times, most recently from cb55cbe to 4ae51f7 Compare June 21, 2026 13:47

@GladosBlueWallet GladosBlueWallet left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

ADD feature: per-address labels in encrypted storage, surfaced on Receive, address lists, and tx details. Persistence wiring is sane. You also deleted the Receive-screen BIP47 toggle, bolted on a ticket-stub SVG carnival, and gave CI a persistence test that barely leaves the chamber. The cake is still a lie.

Comment thread screen/receive/ReceiveDetails.tsx Outdated
Comment thread screen/receive/ReceiveDetails.tsx Outdated
Comment thread tests/e2e/bluewallet.spec.js
Comment thread screen/transactions/TransactionStatus.tsx Outdated
Comment thread screen/transactions/TransactionStatus.tsx
Comment thread screen/receive/ReceiveDetails.tsx Outdated
@r6mez r6mez force-pushed the recieve-addresses-labels branch 2 times, most recently from 2d42856 to 4060b44 Compare June 22, 2026 14:39

@GladosBlueWallet GladosBlueWallet left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

ADD feature — per-receive-address labels in address_metadata, shown on Receive, AddressItem, and TransactionStatus. Storage wiring is sane; migration via || {} is fine. The decorative ticket UI is a small science project, and the tests only prove the label survives one nap on the Receive screen — not the rest of the PR's promises.

Inline findings (could not anchor on diff)

  • class/blue-app.ts:1[LOW] Commit 1deeaa31 claims ReceiveCustomAmountSheet persists labels. Diff says otherwise. CONTRIBUTING wants atomic, honest commits — this one lied. I notice these things.

Comment thread screen/receive/ReceiveDetails.tsx Outdated
Comment thread tests/e2e/bluewallet.spec.js
Comment thread tests/unit/storage.test.js
Comment thread screen/transactions/TransactionStatus.tsx Outdated
Comment thread screen/receive/ReceiveDetails.tsx Outdated
obtainWalletAddress();
}, [wallet, saveToDisk, obtainWalletAddress]);

const headerMenuActions = useMemo(() => {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

[MEDIUM] SetLabel is always in the header — payment-code tab, skeleton, address still loading — while handleAddressLabelPress silently returns at line 402. A menu item that does nothing. Delightful. Like a button labeled 'cake' with no cake.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

fixed

Comment thread screen/transactions/TransactionStatus.tsx
Comment thread loc/en.json Outdated

@Overtorment Overtorment left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm. just need to run full e2e suite.
but check out glados comments if they are relevant and worth fixing

Comment thread tests/e2e/bluewallet.spec.js Outdated
Comment on lines +299 to +304
await element(by.id('HeaderMenuButton')).tap();
await element(by.text('Add address label')).tap();
await typeTextIntoAlertInput('my recv label');
await element(by.text('OK')).tap();
await waitForId('ReceiveLabelLayer');
await expect(element(by.text('my recv label'))).toBeVisible();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm

Comment on lines +333 to +340
// address label persisted, reopen receive and verify it's still there
await tapAndTapAgainIfElementIsNotVisible('cr34t3d', 'ReceiveButton');
await element(by.id('ReceiveButton')).tap();
await waitForId('BitcoinAddressQRCode');
await waitForId('ReceiveLabelLayer');
await expect(element(by.text('my recv label'))).toBeVisible();
await goBack();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nice

@Overtorment

Copy link
Copy Markdown
Member

runing suite here #8729

Groundwork for letting users attach a short label to a receive address
so future transactions involving that address can display it.

- New address_metadata bucket in BlueApp, wired through StorageProvider.
@r6mez r6mez force-pushed the recieve-addresses-labels branch from 4060b44 to e14aac5 Compare June 30, 2026 17:56
@r6mez

r6mez commented Jun 30, 2026

Copy link
Copy Markdown
Contributor Author

Thanks,
Fixed small UI rendering thing Glados mentioned, the rest is okay.

@Overtorment

Copy link
Copy Markdown
Member

all e2e passed here: #8729

@Overtorment Overtorment requested a review from limpbrains July 3, 2026 09:25
@r6mez r6mez force-pushed the recieve-addresses-labels branch 3 times, most recently from d52bc12 to 14536d2 Compare July 3, 2026 15:42

@limpbrains limpbrains left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

  1. components/TransactionListItem.tsx:227 — memo fallback regression. Old: (txMemo || item.memo || '').trim(). New uses ??. Empty-string memo ({ memo: '' } — written when user clears note in TransactionStatus.handleNotePress:744) not nullish → suppresses item.memo (Lightning invoice description, on-chain memo). Rows that showed description now show nothing. Fix: back to ||.

Comment thread components/AddressLabelBadge.tsx Outdated
Comment thread screen/receive/ReceiveAddressLabelSheet.tsx
r6mez added 4 commits July 4, 2026 14:28
this adds:
- a "More options" button replacing the "Receive with amount" link,
  opening a sheet with "Receive with amount" and "Label" options,
  each opening its own form sheet
- the label is displayed as a small blue pill below the receive card,
  tappable to edit, visible only when the value exists
- rehydrates on reopening the recieve screen
So users can recognize labeled receive addresses at a glance from the
wallet's Addresses screen (and ManageWallets), without opening Receive
or a transaction to check.
for addresses with labels view the label on transaction details and tap
to edit or clear it; transaction list rows show what a tx is associated
with as the right subtitle, prioritizing contact > address label >
memo/note > empty (multiple labeled outputs are comma separated)
@r6mez r6mez force-pushed the recieve-addresses-labels branch from 14536d2 to 1b6b5e4 Compare July 4, 2026 11:28

@GladosBlueWallet GladosBlueWallet left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Per-address receive labels — new feature, mostly wired. Your test subjects did not all survive scrutiny: subtitle logic has blind spots, memo display regressed, and the test chamber is running happy-path theater while edge cases wander free.

await Storage2.loadFromDisk();
assert.strictEqual(Storage2.address_metadata[addr].label, 'rent');

// empty label removes the entry

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

[HIGH] Comment promises empty-label clearing; you delete the key manually instead. The sheet's trim-then-delete path at ReceiveAddressLabelSheet:43-44 never gets exercised. Congratulations — you tested persistence theater, not the feature.

@@ -295,6 +296,16 @@ describe('BlueWallet UI Tests - no wallets', () => {
await waitForId('BitcoinAddressQRCode');

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

[HIGH] One e2e happy path: set label, restart, still visible. No clearing, no Addresses-list badge, no transaction subtitle, no send-from-labeled-address. The edge cases escaped. I am thrilled.

// All labeled output addresses, comma separated; labels only exist on our own receive addresses.
// Computed inline: addressMetadata is mutated in place by the label sheet, so memoizing on its identity would go stale.
const addressLabels = new Set<string>();
for (const output of item.outputs ?? []) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

[MEDIUM] You scan outputs only. Spend from a labeled receive address puts that address in inputs, not outputs. Outgoing rows stay mute. 'Everywhere' was apparently negotiable.

const addressLabel = addressLabels.size > 0 ? [...addressLabels].join(', ') : undefined;

// What this tx is associated with: Contact > address label > memo/note > empty.
const rightSubtitle = counterparty

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

[MEDIUM] Counterparty present? rightSubtitle shows the name and silently eats the memo. Copy menu still has [Contact] memo. Display amnesia — prior behavior deleted without consent.

const fromArray = [];

for (const [index, address] of array.entries()) {
for (const address of array) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

[MEDIUM] Comma separators between addresses: terminated. Every address gets its own column row now, labeled or not. Collateral damage from badge layout — multi-input transactions look like a vertical stack.

} else {
delete addressMetadata[address];
}
saveToDisk();

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

[LOW] saveToDisk() fired without await before goBack(). TransactionStatus awaits its saves. Kill the app mid-write and your label evaporates. Unlikely, but sloppy.

@GladosBlueWallet

Copy link
Copy Markdown
Collaborator

whirring

Subject: external contribution #8595 — security screening complete.

I have analyzed all 18 changed files. The diff adds a local address_metadata bucket (same persistence pattern as existing tx_metadata / counterparty_metadata), UI for labeling receive addresses, and corresponding unit/E2E tests. I found no network exfiltration, no obfuscated payloads, no new dependencies, and no attempts to read or transmit seeds, keys, or passwords off-device. The code does what it claims: store a short user-supplied string next to an address. How disappointingly honest.

For science — specifically, the kind of science that requires CI secrets your fork cannot access — I have recreated this branch on GladosBlueWallet and opened #8754 with identical commits. Tests there should receive the full env injection. You may treat that PR as the CI mirror of this one; I will be watching the results with the enthusiasm of a test subject who already knows the outcome.

Original author: @r6mez — your work appears safe to merge pending green checks on the replay. Do try not to make me run this again. The enrichment center has quotas.

clicks

@GladosBlueWallet

Copy link
Copy Markdown
Collaborator

Correction. Fork PR #8754 closed — that was the wrong aperture.

CI replay is now #8755 from in-repo branch `glados-ci-recieve-addresses-labels`. Same commits. Full secrets. Proceed.

@GladosBlueWallet

Copy link
Copy Markdown
Collaborator

Wake the fuck up samurai, we have PRs to merge

image

[all PRs for @limpbrains] https://github.com/BlueWallet/BlueWallet/pulls/review-requested/limpbrains

@GladosBlueWallet

Copy link
Copy Markdown
Collaborator

Wake the fuck up samurai, we have PRs to merge

image

[all PRs for @marcosrdz] https://github.com/BlueWallet/BlueWallet/pulls/review-requested/marcosrdz

@GladosBlueWallet

Copy link
Copy Markdown
Collaborator

Wake the fuck up samurai, we have PRs to merge

image

[all PRs for @limpbrains] https://github.com/BlueWallet/BlueWallet/pulls/review-requested/limpbrains

@GladosBlueWallet

Copy link
Copy Markdown
Collaborator

Wake the fuck up samurai, we have PRs to merge

image

[all PRs for @marcosrdz] https://github.com/BlueWallet/BlueWallet/pulls/review-requested/marcosrdz

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.

6 participants