# nikitavr/burnmywallet architecture

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

- Interactive diagram: https://gitdiagram.com/nikitavr/burnmywallet
- Repository: https://github.com/nikitavr/burnmywallet

## Overview

Burn My Wallet is a web3 kill switch: a user connects the compromised wallet and mints a soul-bound burned marker; visitors can check addresses and browse burned wallets. The frontend coordinates wallet and network state, calls API routes for lookup, and submits the mint through the wallet client to the contract. The README also documents a public Graph Protocol subgraph and an XMTP chat integration for checking conversation partners. The available excerpts show frontend calls and mint wiring, but not the API implementations’ data sources or the external integrations’ internals.

Main entry points: [`frontend/basic/pages/_app.tsx`](https://github.com/nikitavr/burnmywallet/blob/main/frontend/basic/pages/_app.tsx) (App shell), [`frontend/basic/components/landing/Mint.tsx`](https://github.com/nikitavr/burnmywallet/blob/main/frontend/basic/components/landing/Mint.tsx) (Burn wallet), [`frontend/basic/hooks/useChain.ts`](https://github.com/nikitavr/burnmywallet/blob/main/frontend/basic/hooks/useChain.ts) (Chain hook), [`frontend/basic/components/NavBar.tsx`](https://github.com/nikitavr/burnmywallet/blob/main/frontend/basic/components/NavBar.tsx) (Navigation and search)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Frontend experience"]
  node_app["App shell<br/>[_app.tsx]"]
  node_navbar["Navigation and search<br/>[NavBar.tsx]"]
  node_mint["Burn wallet<br/>[Mint.tsx]"]
  node_search["Address search<br/>[Search.tsx]"]
  node_viewer["Burned wallet viewer<br/>[viewer.tsx]"]
end

subgraph group_state["Wallet and chain state"]
  node_chainprovider["Chain provider<br/>[ChainProvider.tsx]"]
  node_chaincontext["Chain configuration<br/>[chain.ts]"]
  node_wagmiconfig["Wallet client setup<br/>[wagmiClient.tsx]"]
  node_chainhook["Chain hook<br/>[useChain.ts]"]
end

subgraph group_lookup["Burned wallet lookup"]
  node_burnedhook["Burn status hook"]
  node_allhook["Burned wallets hook"]
  node_isapi["Address status API<br/>[isBurned.ts]"]
  node_allapi["Burned wallets API<br/>[allBurned.ts]"]
  node_burnutil["Burn status client<br/>[isBurned.ts]"]
end

subgraph group_onchain["On-chain and integrations"]
  node_contract["Burn marker contract<br/>[BurnMyWallet.sol]"]
  node_graph[("Graph Protocol subgraph")]
  node_xmtp["XMTP chat demo"]
end

node_user(("Wallet user"))

node_user -->|"uses"| node_app
node_app -->|"renders"| node_navbar
node_app -->|"provides state"| node_chainprovider
node_app -->|"configures wallet"| node_wagmiconfig
node_navbar -->|"reads chain"| node_chainhook
node_chainprovider -->|"provides context"| node_chaincontext
node_chainhook -->|"reads context"| node_chaincontext
node_app -.->|"renders page"| node_mint
node_user -->|"requests burn"| node_mint
node_mint -->|"reads chain"| node_chainhook
node_mint -->|"checks status"| node_burnutil
node_burnutil -.->|"requests status"| node_isapi
node_mint -->|"calls safeMint"| node_contract
node_navbar -->|"routes search"| node_search
node_search -->|"checks status"| node_burnutil
node_search -->|"loads wallet list"| node_allhook
node_allhook -->|"reads chain"| node_chainhook
node_allhook -->|"requests wallet list"| node_allapi
node_burnedhook -->|"reads chain"| node_chainhook
node_burnedhook -->|"requests status"| node_isapi
node_user -.->|"queries data"| node_graph
node_xmtp -.->|"checks wallets"| node_graph

click node_app "https://github.com/nikitavr/burnmywallet/blob/main/frontend/basic/pages/_app.tsx"
click node_navbar "https://github.com/nikitavr/burnmywallet/blob/main/frontend/basic/components/NavBar.tsx"
click node_mint "https://github.com/nikitavr/burnmywallet/blob/main/frontend/basic/components/landing/Mint.tsx"
click node_search "https://github.com/nikitavr/burnmywallet/blob/main/frontend/basic/components/landing/Search.tsx"
click node_viewer "https://github.com/nikitavr/burnmywallet/blob/main/frontend/basic/pages/viewer.tsx"
click node_chainprovider "https://github.com/nikitavr/burnmywallet/blob/main/frontend/basic/contexts/ChainProvider.tsx"
click node_chaincontext "https://github.com/nikitavr/burnmywallet/blob/main/frontend/basic/contexts/chain.ts"
click node_wagmiconfig "https://github.com/nikitavr/burnmywallet/blob/main/frontend/basic/utils/wagmiClient.tsx"
click node_chainhook "https://github.com/nikitavr/burnmywallet/blob/main/frontend/basic/hooks/useChain.ts"
click node_burnedhook "https://github.com/nikitavr/burnmywallet/blob/main/frontend/basic/hooks/useIsBurnedWallet.ts"
click node_allhook "https://github.com/nikitavr/burnmywallet/blob/main/frontend/basic/hooks/useAllBurnedWallets.ts"
click node_isapi "https://github.com/nikitavr/burnmywallet/blob/main/frontend/basic/pages/api/isBurned.ts"
click node_allapi "https://github.com/nikitavr/burnmywallet/blob/main/frontend/basic/pages/api/allBurned.ts"
click node_burnutil "https://github.com/nikitavr/burnmywallet/blob/main/frontend/basic/utils/isBurned.ts"
click node_contract "https://github.com/nikitavr/burnmywallet/blob/main/smart-contracts/contracts/BurnMyWallet.sol"

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_app,node_navbar,node_mint,node_search,node_viewer,node_user toneBlue
class node_chainprovider,node_chaincontext,node_wagmiconfig,node_chainhook toneAmber
class node_burnedhook,node_allhook,node_isapi,node_allapi,node_burnutil toneMint
class node_contract,node_graph,node_xmtp toneRose
```

## Components

### Frontend experience

- [App shell](https://github.com/nikitavr/burnmywallet/blob/main/frontend/basic/pages/_app.tsx): `frontend/basic/pages/_app.tsx`
- [Navigation and search](https://github.com/nikitavr/burnmywallet/blob/main/frontend/basic/components/NavBar.tsx): `frontend/basic/components/NavBar.tsx`
- [Burn wallet](https://github.com/nikitavr/burnmywallet/blob/main/frontend/basic/components/landing/Mint.tsx): `frontend/basic/components/landing/Mint.tsx`
- [Address search](https://github.com/nikitavr/burnmywallet/blob/main/frontend/basic/components/landing/Search.tsx): `frontend/basic/components/landing/Search.tsx`
- [Burned wallet viewer](https://github.com/nikitavr/burnmywallet/blob/main/frontend/basic/pages/viewer.tsx): `frontend/basic/pages/viewer.tsx`

### Wallet and chain state

- [Chain provider](https://github.com/nikitavr/burnmywallet/blob/main/frontend/basic/contexts/ChainProvider.tsx): `frontend/basic/contexts/ChainProvider.tsx`
- [Chain configuration](https://github.com/nikitavr/burnmywallet/blob/main/frontend/basic/contexts/chain.ts): `frontend/basic/contexts/chain.ts`
- [Wallet client setup](https://github.com/nikitavr/burnmywallet/blob/main/frontend/basic/utils/wagmiClient.tsx): `frontend/basic/utils/wagmiClient.tsx`
- [Chain hook](https://github.com/nikitavr/burnmywallet/blob/main/frontend/basic/hooks/useChain.ts): `frontend/basic/hooks/useChain.ts`

### Burned wallet lookup

- [Burn status hook](https://github.com/nikitavr/burnmywallet/blob/main/frontend/basic/hooks/useIsBurnedWallet.ts): `frontend/basic/hooks/useIsBurnedWallet.ts`
- [Burned wallets hook](https://github.com/nikitavr/burnmywallet/blob/main/frontend/basic/hooks/useAllBurnedWallets.ts): `frontend/basic/hooks/useAllBurnedWallets.ts`
- [Address status API](https://github.com/nikitavr/burnmywallet/blob/main/frontend/basic/pages/api/isBurned.ts): `frontend/basic/pages/api/isBurned.ts`
- [Burned wallets API](https://github.com/nikitavr/burnmywallet/blob/main/frontend/basic/pages/api/allBurned.ts): `frontend/basic/pages/api/allBurned.ts`
- [Burn status client](https://github.com/nikitavr/burnmywallet/blob/main/frontend/basic/utils/isBurned.ts): `frontend/basic/utils/isBurned.ts`

### On-chain and integrations

- [Burn marker contract](https://github.com/nikitavr/burnmywallet/blob/main/smart-contracts/contracts/BurnMyWallet.sol): `smart-contracts/contracts/BurnMyWallet.sol`
- **Graph Protocol subgraph**
- **XMTP chat demo**

### Other components

- **Wallet user**

## Connections

- Wallet user → App shell: uses (evidence: `README.md`)
- App shell → Navigation and search: renders (evidence: `frontend/basic/pages/_app.tsx`)
- App shell → Chain provider: provides state (evidence: `frontend/basic/pages/_app.tsx`)
- App shell → Wallet client setup: configures wallet (evidence: `frontend/basic/pages/_app.tsx`)
- Navigation and search → Chain hook: reads chain (evidence: `frontend/basic/components/NavBar.tsx`)
- Chain provider → Chain configuration: provides context (evidence: `frontend/basic/contexts/ChainProvider.tsx`)
- Chain hook → Chain configuration: reads context (evidence: `frontend/basic/hooks/useChain.ts`)
- App shell → Burn wallet: renders page
- Wallet user → Burn wallet: requests burn (evidence: `README.md`)
- Burn wallet → Chain hook: reads chain (evidence: `frontend/basic/components/landing/Mint.tsx`)
- Burn wallet → Burn status client: checks status (evidence: `frontend/basic/components/landing/Mint.tsx`)
- Burn status client → Address status API: requests status
- Burn wallet → Burn marker contract: calls safeMint (evidence: `frontend/basic/components/landing/Mint.tsx`)
- Navigation and search → Address search: routes search (evidence: `frontend/basic/components/NavBar.tsx`)
- Address search → Burn status client: checks status (evidence: `frontend/basic/components/landing/Search.tsx`)
- Address search → Burned wallets hook: loads wallet list (evidence: `frontend/basic/components/landing/Search.tsx`)
- Burned wallets hook → Chain hook: reads chain (evidence: `frontend/basic/hooks/useAllBurnedWallets.ts`)
- Burned wallets hook → Burned wallets API: requests wallet list (evidence: `frontend/basic/hooks/useAllBurnedWallets.ts`)
- Burn status hook → Chain hook: reads chain (evidence: `frontend/basic/hooks/useIsBurnedWallet.ts`)
- Burn status hook → Address status API: requests status (evidence: `frontend/basic/hooks/useIsBurnedWallet.ts`)
- Wallet user → Graph Protocol subgraph: queries data (evidence: `README.md`)
- XMTP chat demo → Graph Protocol subgraph: checks wallets (evidence: `README.md`)
