Resolve ZcashNames (.zec) in Zcash send and tx history#6000
Resolve ZcashNames (.zec) in Zcash send and tx history#6000
Conversation
| import { reverseResolveZnsAddress } from '../util/zns' | ||
|
|
||
| const cache = new Map<string, string | null>() | ||
| const inflight = new Map<string, Promise<string | null>>() |
There was a problem hiding this comment.
Module-level ZNS caches never cleared on logout
Low Severity
The module-level cache and inflight maps in useZnsName.ts and the znsClient singleton in zns.ts persist across logout/login with no exported clear function. Per the module-level-cache-bugs rule, module-level caches must reset on logout/login.
Additional Locations (1)
Triggered by project rule: Bugbot Review Rules
Reviewed by Cursor Bugbot for commit 0ccd68b. Configure here.
|
Action item — not blocking this PR, but blocks the ZNS claim UX While testing, the Root cause is upstream of this PR, in
ZIP-321 spec: https://zips.z.cash/zip-0321 — memo is Suggested fix (separate PR in Two options:
Repro: scan the claim QR from zcashnames.com → send → block explorer → decrypt outgoing shielded memo with sender FVK/OVK → expect |
0ccd68b to
b48db4d
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
There are 3 total unresolved issues (including 1 from previous review).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit b48db4d. Configure here.
| this.checkIfZnsName(name) && | ||
| this.props.coreWallet.currencyInfo.pluginId === 'zcash' | ||
| ) { | ||
| address = await this.fetchZnsAddress(name) |
There was a problem hiding this comment.
AddressModal drops ZNS name on submit
High Severity
When resolving .zec names, AddressModal returns the resolved Zcash address instead of the original .zec input. This differs from Zano alias handling, causing the original .zec name to be lost and not propagated to spendTarget.otherParams or metadata.name for transaction metadata.
Reviewed by Cursor Bugbot for commit b48db4d. Configure here.
| export const reverseResolveZnsAddress = async ( | ||
| address: string | ||
| ): Promise<string | null> => { | ||
| const regs = await getZns().resolveAddress(address, 1, 0) |
There was a problem hiding this comment.
Reversed parameters make reverse ZNS lookup always empty
High Severity
The resolveAddress SDK method signature is (address, offset, limit), but the call passes (address, 1, 0) — meaning offset=1 and limit=0. A limit of zero returns zero results, so reverseResolveZnsAddress always returns null. The correct call is resolveAddress(address, 0, 1) to fetch the first result. This silently breaks the entire reverse-lookup display path: useZnsName never resolves a name, so .zec names never appear on the transaction list or details screen.
Reviewed by Cursor Bugbot for commit b48db4d. Configure here.


CHANGELOG
Does this branch warrant an entry to the CHANGELOG?
Dependencies
noneRequirements
If you have made any visual changes to the GUI. Make sure you have:
Description
Asana: https://app.asana.com/1/9976422036640/project/1213880789473005/task/1214252169890166
Adds ZcashNames (ZNS) — like ENS but for Zcash — to the Zcash send flow and transaction display.
alice.zec(or any.zecname) inAddressTile2/AddressModalfor a Zcash wallet resolves it to the registered unified address. Mirrors the existing ENS / Unstoppable Domains / Zano-alias hooks. Silent fallback toparseUrion miss.useZnsNamehook async-resolves Zcash recipient addresses to their registered.zecname (with in-memory cache + in-flight dedupe) and renders it on the transaction list row and the transaction details screen when no metadata name is set.spendTarget.otherParams.znsNameand is propagated intometadata.nameon broadcast — same pattern aszanoAlias/fioAddress.zcashname-sdk@^0.7.2. Noreact-native-zcashor native code changes. The SDK ships pure-JS deps (bech32,@noble/ed25519); both are added to the JesttransformIgnorePatternswhitelist so the test suite still loads them.Pre-existing lint warnings in
TransactionListRow.tsxare addressed in the first commit so the file can be removed from the warning suppression list cleanly. Verified locally withyarn prepare,yarn lint, andyarn test. Device-level UI verification pending.Note
Medium Risk
Adds new Zcash-specific name-resolution paths and a new third-party SDK dependency, which can affect send address handling and transaction labeling if resolution or caching behaves unexpectedly.
Overview
Adds ZcashNames (ZNS) support so users can enter
.zecnames when sending Zcash and see resolved names in transaction UI.Forward resolution is integrated into
AddressTile2andAddressModal, persisting the original.zecinput viaspendTarget.otherParams.znsNameand displaying it in send tiles/notes. Reverse resolution is added via a newuseZnsNamehook (with in-memory cache and in-flight dedupe) and used byTransactionListRowandTransactionDetailsSceneas a fallback label when no metadata name exists.Introduces
zcashname-sdk(and Jest transform exceptions forzcashname-sdk/@noble/ed25519) plus a small refactor inTransactionListRowto remove prior lint-suppression entries; updates the changelog accordingly.Reviewed by Cursor Bugbot for commit b48db4d. Bugbot is set up for automated code reviews on this repo. Configure here.