Conversation
WalkthroughThis PR simplifies the NHK (nullifier hiding key) API across the Aztec state migration wallet layer by replacing the multi-parameter Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@ts/aztec-state-migration/wallet/migration-account.ts`:
- Around line 92-95: getNhk currently returns the raw masterNullifierHidingKey
(from deriveKeys(getSecretKey())), which exposes a secret; replace this API so
the raw NHK never leaves the wallet boundary — e.g., remove/privatize getNhk and
add a wallet-side method (e.g., performWithNhk or deriveMigrationArtifact) that
calls deriveKeys(this.getSecretKey()), uses masterNullifierHidingKey only
internally to compute and return a safe derived artifact (HMAC/hash/blinded
token/commitment) required by the migration, or accepts a callback to operate on
the NHK inside the wallet and return only non-secret results; update callers to
use that new method instead of expecting the raw NHK from getNhk.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 3fc98d62-508c-4f9c-b125-855a82d2ffe3
📒 Files selected for processing (8)
docs/integration-guide.mddocs/security.mddocs/spec/mode-b-spec.mde2e-tests/migration-mode-b.test.tse2e-tests/nft-migration-mode-b.test.tse2e-tests/token-migration-mode-b.test.tsts/aztec-state-migration/wallet/migration-account.tsts/aztec-state-migration/wallet/migration-base-wallet.ts
Summary by CodeRabbit
Release Notes
Documentation
Refactor