Skip to content

[BUG] CLI wallet: a restored account cannot rediscover pre-existing notes (no historical note-discovery path) #24486

Description

@1ll-main

What are you trying to do?

Restore a wallet after losing its database while keeping the account keys — the classic "restore
from seed on a new machine" scenario — and see the account's pre-existing private-note balances
again. Currently the restored wallet shows 0 for all prior balances, permanently: the fresh PXE
only discovers notes from registration onward, and there appears to be no CLI-exposed way to scan
history (no --from-block, no rescan command).

Code Reference

# 1. account accrues private balances in some contract (readable via a utility balance_of)
aztec-wallet simulate my_balance -ca <addr> -c <artifact> --args <account> -f accounts:test0
# -> e.g. 123400

# 2. simulate device loss
rm -rf ~/.aztec/wallet

# 3. recreate the wallet with the same (deterministic test) keys and re-register everything
aztec-wallet import-test-accounts
aztec-wallet register-contract <addr> <artifact>
aztec-wallet register-sender <counterparty>      # every counterparty, incl. self and the contract

# 4. balances read 0 and stay 0; the notes exist on-chain but are never rediscovered
aztec-wallet simulate my_balance -ca <addr> -c <artifact> --args <account> -f accounts:test0
# -> 0

Aztec Version

4.4.0

OS

Linux (Ubuntu, x86_64)

Browser (if relevant)

N/A (CLI)

Node Version

v24.12.0

Additional Context

If historical discovery is supported at the PXE/SDK level, exposing it through the CLI wallet
(a rescan/--sync-from option on account/contract registration) would make recovery testable.
If it is not yet supported, flagging it as a known limitation would help builders plan; as it
stands, wallet-state loss silently strands funds. Reproduces deterministically.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions