# maryam957/iiot_decentralized_identity_management_framework architecture

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

- Interactive diagram: https://gitdiagram.com/maryam957/iiot_decentralized_identity_management_framework
- Repository: https://github.com/maryam957/iiot_decentralized_identity_management_framework

## Overview

This is a single-zone decentralized identity framework for simulated Industrial IoT devices. Its main workflow queues device arrivals, registers authenticated identities, finalizes them into epoch-bound Merkle batches, offers temporary access before finalization, then verifies permanent membership and applies revocation-aware resource policy. The simulation package coordinates that lifecycle using a virtual clock. The graph includes the documented security and access branches; several implementation details are unsampled, so uncertain wiring is omitted.

Main entry points: [`phase1/fog_node.py`](https://github.com/maryam957/iiot_decentralized_identity_management_framework/blob/main/phase1/fog_node.py) (Fog node), [`simulation/simulator.py`](https://github.com/maryam957/iiot_decentralized_identity_management_framework/blob/main/simulation/simulator.py) (Simulation controller), [`phase3/authorization.py`](https://github.com/maryam957/iiot_decentralized_identity_management_framework/blob/main/phase3/authorization.py) (Resource authorization), [`phase2/token_service.py`](https://github.com/maryam957/iiot_decentralized_identity_management_framework/blob/main/phase2/token_service.py) (Token service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_sim["Lifecycle simulation"]
  node_simulator["Simulation controller<br/>[simulator.py]"]
  node_clock["Virtual clock<br/>[clock.py]"]
  node_epoch["Epoch manager<br/>[epoch_manager.py]"]
  node_agent["Device agent<br/>[device_agent.py]"]
end

subgraph group_registration["Registration and anchoring"]
  node_device["Device identity<br/>[device.py]"]
  node_fog["Fog node<br/>[fog_node.py]"]
  node_store[("Identity and epoch store<br/>[fog_node.py]")]
  node_merkle["Merkle tree and proofs<br/>[merkle.py]"]
end

subgraph group_temporary["Temporary access"]
  node_token["Token service<br/>[token_service.py]"]
  node_provisional_policy["Provisional policy"]
end

subgraph group_permanent["Permanent access"]
  node_verification["Identity verification<br/>[verification.py]"]
  node_authorization["Resource authorization<br/>[authorization.py]"]
  node_permanent_policy["Permanent access policy<br/>[authorization.py]"]
end

node_device_actor(("IIoT device"))

node_device_actor -->|"arrives"| node_simulator
node_simulator -->|"reads time"| node_clock
node_simulator -->|"registers and finalizes"| node_epoch
node_epoch -->|"registers agent"| node_agent
node_agent -->|"registers identity"| node_device
node_device -->|"submits registration"| node_fog
node_fog -->|"writes identity data"| node_store
node_fog -->|"builds batch tree"| node_merkle
node_merkle -->|"returns root and proofs"| node_fog
node_fog -->|"stores roots and proofs"| node_store
node_epoch -->|"checks pending batch"| node_store
node_simulator -->|"issues and validates tokens"| node_token
node_token -->|"reads identity and revocation"| node_store
node_token -->|"checks provisional access"| node_provisional_policy
node_simulator -->|"requests permanent access"| node_authorization
node_authorization -->|"verifies membership"| node_verification
node_verification -->|"retrieves proof and root"| node_fog
node_fog -->|"reads epoch records"| node_store
node_authorization -->|"checks device revocation"| node_token
node_authorization -->|"reads device role"| node_store
node_authorization -->|"checks resource operation"| node_permanent_policy

click node_simulator "https://github.com/maryam957/iiot_decentralized_identity_management_framework/blob/main/simulation/simulator.py"
click node_clock "https://github.com/maryam957/iiot_decentralized_identity_management_framework/blob/main/simulation/clock.py"
click node_epoch "https://github.com/maryam957/iiot_decentralized_identity_management_framework/blob/main/simulation/epoch_manager.py"
click node_agent "https://github.com/maryam957/iiot_decentralized_identity_management_framework/blob/main/simulation/device_agent.py"
click node_device "https://github.com/maryam957/iiot_decentralized_identity_management_framework/blob/main/phase1/device.py"
click node_fog "https://github.com/maryam957/iiot_decentralized_identity_management_framework/blob/main/phase1/fog_node.py"
click node_store "https://github.com/maryam957/iiot_decentralized_identity_management_framework/blob/main/phase1/fog_node.py"
click node_merkle "https://github.com/maryam957/iiot_decentralized_identity_management_framework/blob/main/phase1/merkle.py"
click node_token "https://github.com/maryam957/iiot_decentralized_identity_management_framework/blob/main/phase2/token_service.py"
click node_provisional_policy "https://github.com/maryam957/iiot_decentralized_identity_management_framework/blob/main/phase2/provisional_access.py"
click node_verification "https://github.com/maryam957/iiot_decentralized_identity_management_framework/blob/main/phase3/verification.py"
click node_authorization "https://github.com/maryam957/iiot_decentralized_identity_management_framework/blob/main/phase3/authorization.py"
click node_permanent_policy "https://github.com/maryam957/iiot_decentralized_identity_management_framework/blob/main/phase3/authorization.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_simulator,node_clock,node_epoch,node_agent toneBlue
class node_device,node_fog,node_store,node_merkle toneAmber
class node_token,node_provisional_policy toneMint
class node_verification,node_authorization,node_permanent_policy toneRose
class node_device_actor toneIndigo
```

## Components

### Lifecycle simulation

- [Simulation controller](https://github.com/maryam957/iiot_decentralized_identity_management_framework/blob/main/simulation/simulator.py): `simulation/simulator.py`
- [Virtual clock](https://github.com/maryam957/iiot_decentralized_identity_management_framework/blob/main/simulation/clock.py): `simulation/clock.py`
- [Epoch manager](https://github.com/maryam957/iiot_decentralized_identity_management_framework/blob/main/simulation/epoch_manager.py): `simulation/epoch_manager.py`
- [Device agent](https://github.com/maryam957/iiot_decentralized_identity_management_framework/blob/main/simulation/device_agent.py): `simulation/device_agent.py`

### Registration and anchoring

- [Device identity](https://github.com/maryam957/iiot_decentralized_identity_management_framework/blob/main/phase1/device.py): `phase1/device.py`
- [Fog node](https://github.com/maryam957/iiot_decentralized_identity_management_framework/blob/main/phase1/fog_node.py): `phase1/fog_node.py`
- [Identity and epoch store](https://github.com/maryam957/iiot_decentralized_identity_management_framework/blob/main/phase1/fog_node.py): `phase1/fog_node.py`
- [Merkle tree and proofs](https://github.com/maryam957/iiot_decentralized_identity_management_framework/blob/main/phase1/merkle.py): `phase1/merkle.py`

### Temporary access

- [Token service](https://github.com/maryam957/iiot_decentralized_identity_management_framework/blob/main/phase2/token_service.py): `phase2/token_service.py`
- [Provisional policy](https://github.com/maryam957/iiot_decentralized_identity_management_framework/blob/main/phase2/provisional_access.py): `phase2/provisional_access.py`

### Permanent access

- [Identity verification](https://github.com/maryam957/iiot_decentralized_identity_management_framework/blob/main/phase3/verification.py): `phase3/verification.py`
- [Resource authorization](https://github.com/maryam957/iiot_decentralized_identity_management_framework/blob/main/phase3/authorization.py): `phase3/authorization.py`
- [Permanent access policy](https://github.com/maryam957/iiot_decentralized_identity_management_framework/blob/main/phase3/authorization.py): `phase3/authorization.py`

### Other components

- **IIoT device**

## Connections

- IIoT device → Simulation controller: arrives
- Simulation controller → Virtual clock: reads time
- Simulation controller → Epoch manager: registers and finalizes
- Epoch manager → Device agent: registers agent
- Device agent → Device identity: registers identity
- Device identity → Fog node: submits registration
- Fog node → Identity and epoch store: writes identity data
- Fog node → Merkle tree and proofs: builds batch tree
- Merkle tree and proofs → Fog node: returns root and proofs
- Fog node → Identity and epoch store: stores roots and proofs
- Epoch manager → Identity and epoch store: checks pending batch
- Simulation controller → Token service: issues and validates tokens
- Token service → Identity and epoch store: reads identity and revocation
- Token service → Provisional policy: checks provisional access
- Simulation controller → Resource authorization: requests permanent access
- Resource authorization → Identity verification: verifies membership
- Identity verification → Fog node: retrieves proof and root
- Fog node → Identity and epoch store: reads epoch records
- Resource authorization → Token service: checks device revocation
- Resource authorization → Identity and epoch store: reads device role
- Resource authorization → Permanent access policy: checks resource operation
