# chainapsis/vizor-wallet architecture

> Architecture diagram of the GitHub repository chainapsis/vizor-wallet, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/chainapsis/vizor-wallet
- Repository: https://github.com/chainapsis/vizor-wallet

## Overview

Vizor is a self-custody Zcash wallet: users create or import a wallet, synchronize it, manage addresses and balances, then receive, shield, or send ZEC. The available tree is weighted toward Rust wallet logic and native platform integrations; the Flutter UI and several Rust API implementations are not present in the supplied tree, so the graph represents those capabilities at the nearest supported source boundary. It also includes the documented voting capability and the substantial iOS migration-outbox subsystem. Dashed edges indicate relationships not established by the supplied excerpts or source references.

Main entry points: [`ios/Runner/BackgroundMigrationManager.swift`](https://github.com/chainapsis/vizor-wallet/blob/main/ios/Runner/BackgroundMigrationManager.swift) (Migration manager), [`ios/Runner/BackgroundMigrationPreparationManager.swift`](https://github.com/chainapsis/vizor-wallet/blob/main/ios/Runner/BackgroundMigrationPreparationManager.swift) (Migration preparation), [`ios/Runner/BackgroundMigrationOutboxRunner.swift`](https://github.com/chainapsis/vizor-wallet/blob/main/ios/Runner/BackgroundMigrationOutboxRunner.swift) (Outbox runner), [`ios/Runner/BackgroundMigrationOutboxChannel.swift`](https://github.com/chainapsis/vizor-wallet/blob/main/ios/Runner/BackgroundMigrationOutboxChannel.swift) (Outbox channel)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_wallet["Wallet operations"]
  node_wallet_api["Wallet API<br/>[wallet.rs]"]
  node_wallet_keys["Keys and accounts<br/>[keys.rs]"]
  node_wallet_addresses["Addresses<br/>[addresses.rs]"]
  node_wallet_db[("Wallet database<br/>[db.rs]")]
  node_wallet_transactions["Transactions<br/>[transactions.rs]"]
  node_transparent_cache[("Transparent cache")]
  node_keystone["Keystone accounts<br/>[keystone.rs]"]
end

subgraph group_sync["Sync and privacy"]
  node_wallet_sync["Wallet sync<br/>[sync.rs]"]
  node_sync_engine["Sync engine<br/>[mod.rs]"]
  node_network_privacy["Network privacy<br/>[network_privacy.rs]"]
end

subgraph group_voting["Voting"]
  node_voting_api["Voting API<br/>[voting.rs]"]
  node_voting_session["Voting sessions<br/>[voting_session.rs]"]
  node_voting_network["Voting transports<br/>[network_clients.rs]"]
end

subgraph group_native["Native integrations"]
  node_ledger["Ledger integration<br/>[mod.rs]"]
  node_ios_ledger["iOS Ledger handler"]
  node_ios_lightwallet["Native lightwalletd"]
end

subgraph group_migration["Background migration"]
  node_migration_manager["Migration manager"]
  node_migration_prep["Migration preparation"]
  node_migration_runner["Outbox runner"]
  node_migration_store[("Outbox store")]
  node_migration_gate["Execution gate"]
  node_migration_channel["Outbox channel"]
end

node_user(("Wallet user"))

node_user -.->|"creates and manages"| node_wallet_api
node_user -.->|"checks sync"| node_wallet_sync
node_user -.->|"imports accounts"| node_keystone
node_user -.->|"sends and shields"| node_wallet_transactions
node_wallet_api -.->|"uses keys"| node_wallet_keys
node_wallet_sync -.->|"runs sync"| node_sync_engine
node_wallet_transactions -.->|"persists transactions"| node_wallet_db
node_wallet_addresses -.->|"stores addresses"| node_wallet_db
node_voting_api -->|"constructs transports"| node_voting_network
node_voting_api -->|"uses routing policy"| node_network_privacy
node_voting_session -->|"uses voting API"| node_voting_api
node_voting_network -->|"routes traffic"| node_network_privacy
node_migration_manager -->|"coordinates preparation"| node_migration_prep
node_migration_manager -->|"reads and writes"| node_migration_store
node_migration_manager -->|"controls execution"| node_migration_gate
node_migration_manager -->|"exposes outbox channel"| node_migration_channel
node_migration_prep -->|"coordinates migration"| node_migration_manager
node_migration_prep -->|"checks execution gate"| node_migration_gate
node_migration_prep -->|"uses client"| node_ios_lightwallet
node_migration_runner -->|"submits transactions"| node_ios_lightwallet
node_migration_runner -->|"loads and saves"| node_migration_store
node_migration_runner -->|"acquires run gate"| node_migration_gate
node_migration_channel -->|"accesses outbox"| node_migration_store
node_migration_channel -->|"dispatches work"| node_migration_runner

click node_wallet_api "https://github.com/chainapsis/vizor-wallet/blob/main/rust/src/api/wallet.rs"
click node_wallet_keys "https://github.com/chainapsis/vizor-wallet/blob/main/rust/src/wallet/keys.rs"
click node_wallet_addresses "https://github.com/chainapsis/vizor-wallet/blob/main/rust/src/wallet/addresses.rs"
click node_wallet_sync "https://github.com/chainapsis/vizor-wallet/blob/main/rust/src/api/sync.rs"
click node_sync_engine "https://github.com/chainapsis/vizor-wallet/blob/main/rust/src/wallet/sync_engine/mod.rs"
click node_wallet_db "https://github.com/chainapsis/vizor-wallet/blob/main/rust/src/wallet/db.rs"
click node_wallet_transactions "https://github.com/chainapsis/vizor-wallet/blob/main/rust/src/wallet/sync/transactions.rs"
click node_transparent_cache "https://github.com/chainapsis/vizor-wallet/blob/main/rust/src/wallet/transparent_receive_cache.rs"
click node_keystone "https://github.com/chainapsis/vizor-wallet/blob/main/rust/src/wallet/keystone.rs"
click node_ledger "https://github.com/chainapsis/vizor-wallet/blob/main/rust/src/wallet/ledger/mod.rs"
click node_network_privacy "https://github.com/chainapsis/vizor-wallet/blob/main/rust/src/network_privacy.rs"
click node_voting_api "https://github.com/chainapsis/vizor-wallet/blob/main/rust/src/api/voting.rs"
click node_voting_session "https://github.com/chainapsis/vizor-wallet/blob/main/rust/src/api/voting_session.rs"
click node_voting_network "https://github.com/chainapsis/vizor-wallet/blob/main/rust/src/wallet/voting/network_clients.rs"
click node_ios_ledger "https://github.com/chainapsis/vizor-wallet/blob/main/ios/Runner/LedgerMobileHandler.swift"
click node_ios_lightwallet "https://github.com/chainapsis/vizor-wallet/blob/main/ios/Runner/NativeLightwalletdClient.swift"
click node_migration_manager "https://github.com/chainapsis/vizor-wallet/blob/main/ios/Runner/BackgroundMigrationManager.swift"
click node_migration_prep "https://github.com/chainapsis/vizor-wallet/blob/main/ios/Runner/BackgroundMigrationPreparationManager.swift"
click node_migration_runner "https://github.com/chainapsis/vizor-wallet/blob/main/ios/Runner/BackgroundMigrationOutboxRunner.swift"
click node_migration_store "https://github.com/chainapsis/vizor-wallet/blob/main/ios/Runner/BackgroundMigrationOutboxStore.swift"
click node_migration_gate "https://github.com/chainapsis/vizor-wallet/blob/main/ios/Runner/BackgroundMigrationOutboxExecutionGate.swift"
click node_migration_channel "https://github.com/chainapsis/vizor-wallet/blob/main/ios/Runner/BackgroundMigrationOutboxChannel.swift"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_wallet_api,node_wallet_keys,node_wallet_addresses,node_wallet_db,node_wallet_transactions,node_transparent_cache,node_keystone,node_user toneBlue
class node_wallet_sync,node_sync_engine,node_network_privacy toneAmber
class node_voting_api,node_voting_session,node_voting_network toneMint
class node_ledger,node_ios_ledger,node_ios_lightwallet toneRose
class node_migration_manager,node_migration_prep,node_migration_runner,node_migration_store,node_migration_gate,node_migration_channel toneIndigo
```

## Components

### Wallet operations

- [Wallet API](https://github.com/chainapsis/vizor-wallet/blob/main/rust/src/api/wallet.rs): `rust/src/api/wallet.rs`
- [Keys and accounts](https://github.com/chainapsis/vizor-wallet/blob/main/rust/src/wallet/keys.rs): `rust/src/wallet/keys.rs`
- [Addresses](https://github.com/chainapsis/vizor-wallet/blob/main/rust/src/wallet/addresses.rs): `rust/src/wallet/addresses.rs`
- [Wallet database](https://github.com/chainapsis/vizor-wallet/blob/main/rust/src/wallet/db.rs): `rust/src/wallet/db.rs`
- [Transactions](https://github.com/chainapsis/vizor-wallet/blob/main/rust/src/wallet/sync/transactions.rs): `rust/src/wallet/sync/transactions.rs`
- [Transparent cache](https://github.com/chainapsis/vizor-wallet/blob/main/rust/src/wallet/transparent_receive_cache.rs): `rust/src/wallet/transparent_receive_cache.rs`
- [Keystone accounts](https://github.com/chainapsis/vizor-wallet/blob/main/rust/src/wallet/keystone.rs): `rust/src/wallet/keystone.rs`

### Sync and privacy

- [Wallet sync](https://github.com/chainapsis/vizor-wallet/blob/main/rust/src/api/sync.rs): `rust/src/api/sync.rs`
- [Sync engine](https://github.com/chainapsis/vizor-wallet/blob/main/rust/src/wallet/sync_engine/mod.rs): `rust/src/wallet/sync_engine/mod.rs`
- [Network privacy](https://github.com/chainapsis/vizor-wallet/blob/main/rust/src/network_privacy.rs): `rust/src/network_privacy.rs`

### Voting

- [Voting API](https://github.com/chainapsis/vizor-wallet/blob/main/rust/src/api/voting.rs): `rust/src/api/voting.rs`
- [Voting sessions](https://github.com/chainapsis/vizor-wallet/blob/main/rust/src/api/voting_session.rs): `rust/src/api/voting_session.rs`
- [Voting transports](https://github.com/chainapsis/vizor-wallet/blob/main/rust/src/wallet/voting/network_clients.rs): `rust/src/wallet/voting/network_clients.rs`

### Native integrations

- [Ledger integration](https://github.com/chainapsis/vizor-wallet/blob/main/rust/src/wallet/ledger/mod.rs): `rust/src/wallet/ledger/mod.rs`
- [iOS Ledger handler](https://github.com/chainapsis/vizor-wallet/blob/main/ios/Runner/LedgerMobileHandler.swift): `ios/Runner/LedgerMobileHandler.swift`
- [Native lightwalletd](https://github.com/chainapsis/vizor-wallet/blob/main/ios/Runner/NativeLightwalletdClient.swift): `ios/Runner/NativeLightwalletdClient.swift`

### Background migration

- [Migration manager](https://github.com/chainapsis/vizor-wallet/blob/main/ios/Runner/BackgroundMigrationManager.swift): `ios/Runner/BackgroundMigrationManager.swift`
- [Migration preparation](https://github.com/chainapsis/vizor-wallet/blob/main/ios/Runner/BackgroundMigrationPreparationManager.swift): `ios/Runner/BackgroundMigrationPreparationManager.swift`
- [Outbox runner](https://github.com/chainapsis/vizor-wallet/blob/main/ios/Runner/BackgroundMigrationOutboxRunner.swift): `ios/Runner/BackgroundMigrationOutboxRunner.swift`
- [Outbox store](https://github.com/chainapsis/vizor-wallet/blob/main/ios/Runner/BackgroundMigrationOutboxStore.swift): `ios/Runner/BackgroundMigrationOutboxStore.swift`
- [Execution gate](https://github.com/chainapsis/vizor-wallet/blob/main/ios/Runner/BackgroundMigrationOutboxExecutionGate.swift): `ios/Runner/BackgroundMigrationOutboxExecutionGate.swift`
- [Outbox channel](https://github.com/chainapsis/vizor-wallet/blob/main/ios/Runner/BackgroundMigrationOutboxChannel.swift): `ios/Runner/BackgroundMigrationOutboxChannel.swift`

### Other components

- **Wallet user**

## Connections

- Wallet user → Wallet API: creates and manages
- Wallet user → Wallet sync: checks sync
- Wallet user → Keystone accounts: imports accounts
- Wallet user → Transactions: sends and shields
- Wallet API → Keys and accounts: uses keys
- Wallet sync → Sync engine: runs sync
- Transactions → Wallet database: persists transactions
- Addresses → Wallet database: stores addresses
- Voting API → Voting transports: constructs transports (evidence: `rust/src/api/voting.rs`)
- Voting API → Network privacy: uses routing policy (evidence: `rust/src/api/voting.rs`)
- Voting sessions → Voting API: uses voting API (evidence: `rust/src/api/voting_session.rs`)
- Voting transports → Network privacy: routes traffic (evidence: `rust/src/wallet/voting/network_clients.rs`)
- Migration manager → Migration preparation: coordinates preparation (evidence: `ios/Runner/BackgroundMigrationManager.swift`)
- Migration manager → Outbox store: reads and writes (evidence: `ios/Runner/BackgroundMigrationManager.swift`)
- Migration manager → Execution gate: controls execution (evidence: `ios/Runner/BackgroundMigrationManager.swift`)
- Migration manager → Outbox channel: exposes outbox channel (evidence: `ios/Runner/BackgroundMigrationManager.swift`)
- Migration preparation → Migration manager: coordinates migration (evidence: `ios/Runner/BackgroundMigrationPreparationManager.swift`)
- Migration preparation → Execution gate: checks execution gate (evidence: `ios/Runner/BackgroundMigrationPreparationManager.swift`)
- Migration preparation → Native lightwalletd: uses client (evidence: `ios/Runner/BackgroundMigrationPreparationManager.swift`)
- Outbox runner → Native lightwalletd: submits transactions (evidence: `ios/Runner/BackgroundMigrationOutboxRunner.swift`)
- Outbox runner → Outbox store: loads and saves (evidence: `ios/Runner/BackgroundMigrationOutboxRunner.swift`)
- Outbox runner → Execution gate: acquires run gate (evidence: `ios/Runner/BackgroundMigrationOutboxRunner.swift`)
- Outbox channel → Outbox store: accesses outbox (evidence: `ios/Runner/BackgroundMigrationOutboxChannel.swift`)
- Outbox channel → Outbox runner: dispatches work (evidence: `ios/Runner/BackgroundMigrationOutboxChannel.swift`)
