# urriki1502/wam-privacy-wallet architecture

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

- Interactive diagram: https://gitdiagram.com/urriki1502/wam-privacy-wallet
- Repository: https://github.com/urriki1502/wam-privacy-wallet

## Overview

WAM Privacy Wallet is an explicitly experimental desktop-wallet scaffold, not a production wallet. Its principal documented flow is a user-operated Qt interface into local scan workflows, through a scan-only WSP adapter and bounded loopback RPC to a user-owned regtest node; scan backup and recovery are separate branches. Review-only PSBT/PayJoin and privacy-policy capabilities are also represented. The README documents the broad architecture; source excerpts clarify selected calls and boundaries. Unsampled subsystem internals and wiring are not assumed.

Main entry points: [`src/wam_privacy_wallet/application/qualified_scan_session.py`](https://github.com/urriki1502/wam-privacy-wallet/blob/main/src/wam_privacy_wallet/application/qualified_scan_session.py) (Qualified scan session), [`src/wam_privacy_wallet/integrations/wsp1_scanner_only_rpc.py`](https://github.com/urriki1502/wam-privacy-wallet/blob/main/src/wam_privacy_wallet/integrations/wsp1_scanner_only_rpc.py) (WSP scan RPC), [`src/wam_privacy_wallet/node/read_rpc.py`](https://github.com/urriki1502/wam-privacy-wallet/blob/main/src/wam_privacy_wallet/node/read_rpc.py) (Read-only RPC), [`src/wam_privacy_wallet/node/endpoint.py`](https://github.com/urriki1502/wam-privacy-wallet/blob/main/src/wam_privacy_wallet/node/endpoint.py) (Local endpoint)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_desktop["Desktop interface"]
  node_gui["Qt desktop GUI<br/>[app.py]"]
  node_regtest_window["Regtest window<br/>[regtest_window.py]"]
  node_regtest_worker["Regtest worker<br/>[regtest_worker.py]"]
end

subgraph group_scanning["Scanning and recovery"]
  node_private_workflow["Private workflow"]
  node_scan_session["Qualified scan session"]
  node_scan_coordinator["Scan coordinator"]
  node_scanner_adapter["WSP scan RPC"]
  node_scan_backup[("Encrypted scan backup")]
  node_checkpoint_archive[("Checkpoint archive")]
  node_source_closure["WSP source closure"]
  node_source_review["WSP source review"]
end

subgraph group_node["Local node access"]
  node_endpoint["Local endpoint<br/>[endpoint.py]"]
  node_rpc["Read-only RPC<br/>[read_rpc.py]"]
  node_identity["Chain identity<br/>[attestation.py]"]
  node_core_profile["Core profile gate<br/>[core_profile.py]"]
end

subgraph group_review["Privacy and review"]
  node_psbt_review["Signed PSBT review"]
  node_payjoin_review["PayJoin review"]
  node_payjoin_validator["PayJoin validator<br/>[validator.py]"]
  node_payjoin_model["PayJoin model<br/>[model.py]"]
  node_network_policy["Network privacy policy<br/>[policy.py]"]
  node_history_export["Selected history export"]
end

node_user(("Wallet user"))
node_core_node[("User-owned WAM Core")]

node_user -->|"uses"| node_gui
node_gui -->|"opens"| node_regtest_window
node_regtest_window -->|"dispatches"| node_regtest_worker
node_regtest_worker -->|"runs"| node_private_workflow
node_private_workflow -.->|"coordinates"| node_scan_session
node_scan_session -.->|"coordinates"| node_scan_coordinator
node_scan_coordinator -.->|"uses"| node_scanner_adapter
node_scanner_adapter -->|"validates"| node_endpoint
node_scanner_adapter -->|"reads through"| node_rpc
node_rpc -->|"uses"| node_endpoint
node_rpc -.->|"reads RPC"| node_core_node
node_identity -->|"checks"| node_endpoint
node_core_profile -->|"uses"| node_identity
node_scan_session -.->|"backs up"| node_scan_backup
node_scan_session -.->|"archives"| node_checkpoint_archive
node_source_closure -->|"includes review"| node_source_review
node_user -.->|"submits signed PSBT"| node_psbt_review
node_psbt_review -->|"verifies source"| node_source_closure
node_user -.->|"requests review"| node_payjoin_review
node_payjoin_review -.->|"validates proposal"| node_payjoin_validator
node_payjoin_validator -->|"checks model"| node_payjoin_model
node_user -.->|"reviews plan"| node_network_policy
node_user -.->|"approves export"| node_history_export

click node_gui "https://github.com/urriki1502/wam-privacy-wallet/blob/main/src/wam_privacy_wallet/gui/app.py"
click node_regtest_window "https://github.com/urriki1502/wam-privacy-wallet/blob/main/src/wam_privacy_wallet/gui/regtest_window.py"
click node_regtest_worker "https://github.com/urriki1502/wam-privacy-wallet/blob/main/src/wam_privacy_wallet/gui/regtest_worker.py"
click node_private_workflow "https://github.com/urriki1502/wam-privacy-wallet/blob/main/src/wam_privacy_wallet/application/qt_native_private_workflow.py"
click node_scan_session "https://github.com/urriki1502/wam-privacy-wallet/blob/main/src/wam_privacy_wallet/application/qualified_scan_session.py"
click node_scan_coordinator "https://github.com/urriki1502/wam-privacy-wallet/blob/main/src/wam_privacy_wallet/application/wsp_scan_coordinator.py"
click node_scanner_adapter "https://github.com/urriki1502/wam-privacy-wallet/blob/main/src/wam_privacy_wallet/integrations/wsp1_scanner_only_rpc.py"
click node_scan_backup "https://github.com/urriki1502/wam-privacy-wallet/blob/main/src/wam_privacy_wallet/application/encrypted_scan_backup.py"
click node_checkpoint_archive "https://github.com/urriki1502/wam-privacy-wallet/blob/main/src/wam_privacy_wallet/application/encrypted_checkpoint_archive.py"
click node_source_closure "https://github.com/urriki1502/wam-privacy-wallet/blob/main/src/wam_privacy_wallet/integrations/wsp1_source_closure.py"
click node_source_review "https://github.com/urriki1502/wam-privacy-wallet/blob/main/src/wam_privacy_wallet/integrations/wsp1_source_review.py"
click node_endpoint "https://github.com/urriki1502/wam-privacy-wallet/blob/main/src/wam_privacy_wallet/node/endpoint.py"
click node_rpc "https://github.com/urriki1502/wam-privacy-wallet/blob/main/src/wam_privacy_wallet/node/read_rpc.py"
click node_identity "https://github.com/urriki1502/wam-privacy-wallet/blob/main/src/wam_privacy_wallet/node/attestation.py"
click node_core_profile "https://github.com/urriki1502/wam-privacy-wallet/blob/main/src/wam_privacy_wallet/node/core_profile.py"
click node_psbt_review "https://github.com/urriki1502/wam-privacy-wallet/blob/main/src/wam_privacy_wallet/application/offline_signed_psbt_review.py"
click node_payjoin_review "https://github.com/urriki1502/wam-privacy-wallet/blob/main/src/wam_privacy_wallet/application/payjoin_proposal_review.py"
click node_payjoin_validator "https://github.com/urriki1502/wam-privacy-wallet/blob/main/src/wam_privacy_wallet/research_models/payjoin_safety/validator.py"
click node_payjoin_model "https://github.com/urriki1502/wam-privacy-wallet/blob/main/src/wam_privacy_wallet/research_models/payjoin_safety/model.py"
click node_network_policy "https://github.com/urriki1502/wam-privacy-wallet/blob/main/src/wam_privacy_wallet/research_models/network_privacy/policy.py"
click node_history_export "https://github.com/urriki1502/wam-privacy-wallet/blob/main/src/wam_privacy_wallet/application/selected_history_export.py"

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_gui,node_regtest_window,node_regtest_worker,node_user toneBlue
class node_private_workflow,node_scan_session,node_scan_coordinator,node_scanner_adapter,node_scan_backup,node_checkpoint_archive,node_source_closure,node_source_review,node_core_node toneAmber
class node_endpoint,node_rpc,node_identity,node_core_profile toneMint
class node_psbt_review,node_payjoin_review,node_payjoin_validator,node_payjoin_model,node_network_policy,node_history_export toneRose
```

## Components

### Desktop interface

- [Qt desktop GUI](https://github.com/urriki1502/wam-privacy-wallet/blob/main/src/wam_privacy_wallet/gui/app.py): `src/wam_privacy_wallet/gui/app.py`
- [Regtest window](https://github.com/urriki1502/wam-privacy-wallet/blob/main/src/wam_privacy_wallet/gui/regtest_window.py): `src/wam_privacy_wallet/gui/regtest_window.py`
- [Regtest worker](https://github.com/urriki1502/wam-privacy-wallet/blob/main/src/wam_privacy_wallet/gui/regtest_worker.py): `src/wam_privacy_wallet/gui/regtest_worker.py`

### Scanning and recovery

- [Private workflow](https://github.com/urriki1502/wam-privacy-wallet/blob/main/src/wam_privacy_wallet/application/qt_native_private_workflow.py): `src/wam_privacy_wallet/application/qt_native_private_workflow.py`
- [Qualified scan session](https://github.com/urriki1502/wam-privacy-wallet/blob/main/src/wam_privacy_wallet/application/qualified_scan_session.py): `src/wam_privacy_wallet/application/qualified_scan_session.py`
- [Scan coordinator](https://github.com/urriki1502/wam-privacy-wallet/blob/main/src/wam_privacy_wallet/application/wsp_scan_coordinator.py): `src/wam_privacy_wallet/application/wsp_scan_coordinator.py`
- [WSP scan RPC](https://github.com/urriki1502/wam-privacy-wallet/blob/main/src/wam_privacy_wallet/integrations/wsp1_scanner_only_rpc.py): `src/wam_privacy_wallet/integrations/wsp1_scanner_only_rpc.py`
- [Encrypted scan backup](https://github.com/urriki1502/wam-privacy-wallet/blob/main/src/wam_privacy_wallet/application/encrypted_scan_backup.py): `src/wam_privacy_wallet/application/encrypted_scan_backup.py`
- [Checkpoint archive](https://github.com/urriki1502/wam-privacy-wallet/blob/main/src/wam_privacy_wallet/application/encrypted_checkpoint_archive.py): `src/wam_privacy_wallet/application/encrypted_checkpoint_archive.py`
- [WSP source closure](https://github.com/urriki1502/wam-privacy-wallet/blob/main/src/wam_privacy_wallet/integrations/wsp1_source_closure.py): `src/wam_privacy_wallet/integrations/wsp1_source_closure.py`
- [WSP source review](https://github.com/urriki1502/wam-privacy-wallet/blob/main/src/wam_privacy_wallet/integrations/wsp1_source_review.py): `src/wam_privacy_wallet/integrations/wsp1_source_review.py`

### Local node access

- [Local endpoint](https://github.com/urriki1502/wam-privacy-wallet/blob/main/src/wam_privacy_wallet/node/endpoint.py): `src/wam_privacy_wallet/node/endpoint.py`
- [Read-only RPC](https://github.com/urriki1502/wam-privacy-wallet/blob/main/src/wam_privacy_wallet/node/read_rpc.py): `src/wam_privacy_wallet/node/read_rpc.py`
- [Chain identity](https://github.com/urriki1502/wam-privacy-wallet/blob/main/src/wam_privacy_wallet/node/attestation.py): `src/wam_privacy_wallet/node/attestation.py`
- [Core profile gate](https://github.com/urriki1502/wam-privacy-wallet/blob/main/src/wam_privacy_wallet/node/core_profile.py): `src/wam_privacy_wallet/node/core_profile.py`

### Privacy and review

- [Signed PSBT review](https://github.com/urriki1502/wam-privacy-wallet/blob/main/src/wam_privacy_wallet/application/offline_signed_psbt_review.py): `src/wam_privacy_wallet/application/offline_signed_psbt_review.py`
- [PayJoin review](https://github.com/urriki1502/wam-privacy-wallet/blob/main/src/wam_privacy_wallet/application/payjoin_proposal_review.py): `src/wam_privacy_wallet/application/payjoin_proposal_review.py`
- [PayJoin validator](https://github.com/urriki1502/wam-privacy-wallet/blob/main/src/wam_privacy_wallet/research_models/payjoin_safety/validator.py): `src/wam_privacy_wallet/research_models/payjoin_safety/validator.py`
- [PayJoin model](https://github.com/urriki1502/wam-privacy-wallet/blob/main/src/wam_privacy_wallet/research_models/payjoin_safety/model.py): `src/wam_privacy_wallet/research_models/payjoin_safety/model.py`
- [Network privacy policy](https://github.com/urriki1502/wam-privacy-wallet/blob/main/src/wam_privacy_wallet/research_models/network_privacy/policy.py): `src/wam_privacy_wallet/research_models/network_privacy/policy.py`
- [Selected history export](https://github.com/urriki1502/wam-privacy-wallet/blob/main/src/wam_privacy_wallet/application/selected_history_export.py): `src/wam_privacy_wallet/application/selected_history_export.py`

### Other components

- **Wallet user**
- **User-owned WAM Core**

## Connections

- Wallet user → Qt desktop GUI: uses
- Qt desktop GUI → Regtest window: opens (evidence: `src/wam_privacy_wallet/gui/app.py`)
- Regtest window → Regtest worker: dispatches (evidence: `src/wam_privacy_wallet/gui/regtest_worker.py`)
- Regtest worker → Private workflow: runs (evidence: `src/wam_privacy_wallet/gui/regtest_worker.py`)
- Private workflow → Qualified scan session: coordinates
- Qualified scan session → Scan coordinator: coordinates
- Scan coordinator → WSP scan RPC: uses (evidence: `src/wam_privacy_wallet/application/wsp_scan_coordinator.py`)
- WSP scan RPC → Local endpoint: validates (evidence: `src/wam_privacy_wallet/integrations/wsp1_scanner_only_rpc.py`)
- WSP scan RPC → Read-only RPC: reads through (evidence: `src/wam_privacy_wallet/integrations/wsp1_scanner_only_rpc.py`)
- Read-only RPC → Local endpoint: uses (evidence: `src/wam_privacy_wallet/node/read_rpc.py`)
- Read-only RPC → User-owned WAM Core: reads RPC
- Chain identity → Local endpoint: checks (evidence: `src/wam_privacy_wallet/node/attestation.py`)
- Core profile gate → Chain identity: uses (evidence: `src/wam_privacy_wallet/node/core_profile.py`)
- Qualified scan session → Encrypted scan backup: backs up
- Qualified scan session → Checkpoint archive: archives
- WSP source closure → WSP source review: includes review (evidence: `src/wam_privacy_wallet/integrations/wsp1_source_closure.py`)
- Wallet user → Signed PSBT review: submits signed PSBT
- Signed PSBT review → WSP source closure: verifies source (evidence: `src/wam_privacy_wallet/application/offline_signed_psbt_review.py`)
- Wallet user → PayJoin review: requests review
- PayJoin review → PayJoin validator: validates proposal (evidence: `src/wam_privacy_wallet/application/payjoin_proposal_review.py`)
- PayJoin validator → PayJoin model: checks model (evidence: `src/wam_privacy_wallet/research_models/payjoin_safety/validator.py`)
- Wallet user → Network privacy policy: reviews plan
- Wallet user → Selected history export: approves export
