feat(zns): Zcash Name System integration - #132
Conversation
… names and protocols
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9cf92ee49f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| "$(inherited)", | ||
| "@executable_path/../Frameworks", | ||
| ); | ||
| PRODUCT_BUNDLE_IDENTIFIER = com.julian.vizor; |
There was a problem hiding this comment.
Revert production bundle identifier override
This commit hard-codes PRODUCT_BUNDLE_IDENTIFIER = com.julian.vizor, which overrides the shared AppInfo.xcconfig identifier (com.keplr.vizor) for Runner build configurations. Shipping macOS builds with a different bundle ID changes app identity (updates, existing installs, keychain/entitlement continuity) and can break upgrade paths for current users.
Useful? React with 👍 / 👎.
| await ref.read(accountProvider.notifier).renameAccount(uuid, name); | ||
| if (!mounted) return; | ||
| _closeModal(); | ||
| unawaited(_checkZnsEasterEgg(uuid, name)); |
There was a problem hiding this comment.
Catch errors from fire-and-forget ZNS ownership check
This unawaited call starts _checkZnsEasterEgg, but that function performs async network/FFI work without internal error handling; if ZNS lookup or ownership verification throws (e.g., connectivity issues or decode failures), the exception is unhandled and bubbles to the global async error handler during account rename. Please wrap the checker body in try/catch (or otherwise handle the returned Future) so rename does not emit uncaught errors.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0b498e3449
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| } | ||
|
|
||
| Future<void> _checkZnsEasterEgg(String uuid, String name) async { | ||
| final owned = await ref.read(znsResolverProvider).isOwnedByAccount(name, uuid); |
There was a problem hiding this comment.
Normalize account names before ZNS ownership checks
This rename flow passes the raw UI name directly into isOwnedByAccount, but account names are free-form while ZNS resolution elsewhere in this commit is normalized first (lowercased and .zcash/.zec stripped). As a result, a user who renames to a natural label like Alice.zcash can fail the ownership check even when they own that name, so the gold-profile easter egg does not activate (the same raw-name call is also present in settings_screen.dart).
Useful? React with 👍 / 👎.
|
Marking this as a draft for now. Before we move forward, we need to make sure this PR properly covers address book support and related account/contact management concerns. Converting to draft so the remaining work can be completed and reviewed without blocking the queue. |
Hey Thunini! Here's what we built 👋
What's included
alice.zcash, get a Zcash Unified AddressWhat we changed
send_screen.dart- ZNS resolution wired into the address field,_ZnsStatusenum, debounce, staleness guard, tappable resolved name labelsend_review_screen.dart,send_status_screen.dart-resolvedNamethreaded throughSendReviewArgsviarecipientLabelactivity_transaction_status_screen.dart- reverse lookup on sent transactions, name shown above address in "To" blockzns_provider.dart-ZnsResolverwithresolveName,reverseResolve,isOwnedByAccount, session-scoped_nameCacherust/src/wallet/keys.rs-is_address_from_account, O(1) Orchard FVK ownership checkrust/src/api/wallet.rs- FRB wrapper exposing it to Dartaccounts_screen.dart,settings_screen.dart-_checkZnsEasterEggfires after successful renameprofile_pictures.dart,app_profile_picture.dart-zns-prefix support, gold backgroundColor(0xFFFFB800)What we did not change
AccountNameModal- untouched, no new parametersHow we did this
Forward lookup triggers on a conjunction: Rust
validateAddressrejects the input AND the input matches a ZNS protocol identifier (.zcash,.zec). Rust fires first as the authoritative local validator - ZNS only activates on explicit rejection. Full input is lowercased before the check soAlice.ZCASHandalice.zcashare equivalent. The existing_addressSeqstaleness guard covers ZNS too.Reverse lookup uses
ZnsResolver.reverseResolve- callsresolveAddresson the SDK, takes the earliest-registered name, appends.zcash. Session-scoped_nameCacheon the provider means repeated lookups for the same address are instant.containsKeyrather than null check since null is a valid cached value (address has no registration).Ownership check -
is_address_from_accountin Rust extracts the diversifierdfrom the UA's Orchard receiver and verifies[ivk] × d == pk_dagainst the account's Orchard FVK. O(1), no iteration over diversifier space, works for any diversified address.Easter egg -
zns-prefixedprofilePictureIdstored in secure storage.AppProfilePicturerenders gold background when prefix is present, strips it before asset lookup so the avatar is unchanged.