# mr-whoameye/efficient_file_integrity_verification_using_merkle-trees architecture

> Architecture diagram of the GitHub repository mr-whoameye/efficient_file_integrity_verification_using_merkle-trees, 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/mr-whoameye/efficient_file_integrity_verification_using_merkle-trees
- Repository: https://github.com/mr-whoameye/efficient_file_integrity_verification_using_merkle-trees

## Overview

This repository is a Merkle-tree file-integrity package with a Streamlit interactive visualizer. The principal workflow chunks file data, builds a hash tree, then supports block-proof verification, tamper localization, and incremental updates. The app also renders the tree and operation results. Relationships for core algorithms are supported by source excerpts; README documents the visualizer capabilities. The app excerpt is partial, so its detailed UI wiring is not fully represented.

Main entry points: [`app.py`](https://github.com/mr-whoameye/efficient_file_integrity_verification_using_merkle-trees/blob/master/app.py) (Visualizer), [`merkle/tree.py`](https://github.com/mr-whoameye/efficient_file_integrity_verification_using_merkle-trees/blob/master/merkle/tree.py) (Tree Builder), [`merkle/node.py`](https://github.com/mr-whoameye/efficient_file_integrity_verification_using_merkle-trees/blob/master/merkle/node.py) (Tree Nodes), [`merkle/proof.py`](https://github.com/mr-whoameye/efficient_file_integrity_verification_using_merkle-trees/blob/master/merkle/proof.py) (Proof Verify)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Interactive Demo"]
  node_dashboard["Visualizer<br/>[app.py]"]
end

subgraph group_integrity["Integrity Operations"]
  node_chunker["Block Chunker<br/>[chunker.py]"]
  node_tree["Tree Builder<br/>[tree.py]"]
  node_proof["Proof Verify<br/>[proof.py]"]
  node_tamper["Tamper Locator<br/>[tamper.py]"]
  node_updater["Block Updater<br/>[updater.py]"]
end

subgraph group_treecore["Tree Core"]
  node_node["Tree Nodes<br/>[node.py]"]
end

node_user(("User"))

node_user -->|"operates"| node_dashboard
node_dashboard -->|"chunks data"| node_chunker
node_dashboard -->|"builds tree"| node_tree
node_tree -->|"creates nodes"| node_node
node_dashboard -->|"verifies blocks"| node_proof
node_dashboard -->|"locates tampering"| node_tamper
node_dashboard -->|"updates blocks"| node_updater
node_proof -->|"reads tree"| node_tree
node_proof -->|"traverses nodes"| node_node
node_tamper -->|"compares trees"| node_tree
node_tamper -->|"descends nodes"| node_node
node_updater -->|"mutates tree"| node_tree
node_updater -->|"rehashes ancestors"| node_node

click node_dashboard "https://github.com/mr-whoameye/efficient_file_integrity_verification_using_merkle-trees/blob/master/app.py"
click node_chunker "https://github.com/mr-whoameye/efficient_file_integrity_verification_using_merkle-trees/blob/master/merkle/chunker.py"
click node_tree "https://github.com/mr-whoameye/efficient_file_integrity_verification_using_merkle-trees/blob/master/merkle/tree.py"
click node_node "https://github.com/mr-whoameye/efficient_file_integrity_verification_using_merkle-trees/blob/master/merkle/node.py"
click node_proof "https://github.com/mr-whoameye/efficient_file_integrity_verification_using_merkle-trees/blob/master/merkle/proof.py"
click node_tamper "https://github.com/mr-whoameye/efficient_file_integrity_verification_using_merkle-trees/blob/master/merkle/tamper.py"
click node_updater "https://github.com/mr-whoameye/efficient_file_integrity_verification_using_merkle-trees/blob/master/merkle/updater.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_dashboard,node_user toneBlue
class node_chunker,node_tree,node_proof,node_tamper,node_updater toneAmber
class node_node toneMint
```

## Components

### Interactive Demo

- [Visualizer](https://github.com/mr-whoameye/efficient_file_integrity_verification_using_merkle-trees/blob/master/app.py): `app.py`

### Integrity Operations

- [Block Chunker](https://github.com/mr-whoameye/efficient_file_integrity_verification_using_merkle-trees/blob/master/merkle/chunker.py): `merkle/chunker.py`
- [Tree Builder](https://github.com/mr-whoameye/efficient_file_integrity_verification_using_merkle-trees/blob/master/merkle/tree.py): `merkle/tree.py`
- [Proof Verify](https://github.com/mr-whoameye/efficient_file_integrity_verification_using_merkle-trees/blob/master/merkle/proof.py): `merkle/proof.py`
- [Tamper Locator](https://github.com/mr-whoameye/efficient_file_integrity_verification_using_merkle-trees/blob/master/merkle/tamper.py): `merkle/tamper.py`
- [Block Updater](https://github.com/mr-whoameye/efficient_file_integrity_verification_using_merkle-trees/blob/master/merkle/updater.py): `merkle/updater.py`

### Tree Core

- [Tree Nodes](https://github.com/mr-whoameye/efficient_file_integrity_verification_using_merkle-trees/blob/master/merkle/node.py): `merkle/node.py`

### Other components

- **User**

## Connections

- User → Visualizer: operates (evidence: `README.md`)
- Visualizer → Block Chunker: chunks data (evidence: `app.py`)
- Visualizer → Tree Builder: builds tree (evidence: `app.py`)
- Tree Builder → Tree Nodes: creates nodes (evidence: `merkle/tree.py`)
- Visualizer → Proof Verify: verifies blocks (evidence: `app.py`)
- Visualizer → Tamper Locator: locates tampering (evidence: `app.py`)
- Visualizer → Block Updater: updates blocks (evidence: `app.py`)
- Proof Verify → Tree Builder: reads tree (evidence: `merkle/proof.py`)
- Proof Verify → Tree Nodes: traverses nodes (evidence: `merkle/proof.py`)
- Tamper Locator → Tree Builder: compares trees (evidence: `merkle/tamper.py`)
- Tamper Locator → Tree Nodes: descends nodes (evidence: `merkle/tamper.py`)
- Block Updater → Tree Builder: mutates tree (evidence: `merkle/updater.py`)
- Block Updater → Tree Nodes: rehashes ancestors (evidence: `merkle/updater.py`)
