# tarikchafiq/ioe-blockchain-trust-layer architecture

> Architecture diagram of the GitHub repository tarikchafiq/ioe-blockchain-trust-layer, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/tarikchafiq/ioe-blockchain-trust-layer
- Repository: https://github.com/tarikchafiq/ioe-blockchain-trust-layer

## Overview

This repository is supplementary material for an IoE edge-anchored blockchain trust layer, not a standalone service. Its principal workflow is gateway-enrolled devices, policy-controlled access, batched reading commitments anchored on-chain, and energy-offer settlement; the README also documents meter-attested settlement and Besu deployment/load evaluation. Contract implementations were not excerpted, so contract-to-contract and runtime details are limited to explicitly documented relationships. The diagram includes major documented capabilities, but omits the manuscript reproduction machinery and test infrastructure.

Main entry points: [`scripts/besu_deploy.js`](https://github.com/tarikchafiq/ioe-blockchain-trust-layer/blob/main/scripts/besu_deploy.js) (Besu Deployment), [`contracts/AnchorRegistry.sol`](https://github.com/tarikchafiq/ioe-blockchain-trust-layer/blob/main/contracts/AnchorRegistry.sol) (Anchor Registry), [`scripts/besu_load.js`](https://github.com/tarikchafiq/ioe-blockchain-trust-layer/blob/main/scripts/besu_load.js) (Besu Load Runner), [`contracts/IoERegistry.sol`](https://github.com/tarikchafiq/ioe-blockchain-trust-layer/blob/main/contracts/IoERegistry.sol) (IoE Registry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_trust["Device Trust"]
  node_registry["IoE Registry<br/>[IoERegistry.sol]"]
  node_access["Access Policy<br/>[AccessPolicy.sol]"]
end

subgraph group_anchor["Anchoring"]
  node_anchor_registry["Anchor Registry<br/>[AnchorRegistry.sol]"]
  node_merkle["Merkle Toolkit<br/>[merkle.js]"]
end

subgraph group_market["Energy Market"]
  node_energy_market["Energy Market<br/>[EnergyMarket.sol]"]
  node_attested_market["Attested Market<br/>[EnergyMarketV2.sol]"]
end

subgraph group_evaluation["Network Evaluation"]
  node_baselines["Baseline Contracts<br/>[Baseline.sol]"]
  node_strong_baselines["Stronger Baselines<br/>[Baselines2.sol]"]
  node_besu_network{{"Besu QBFT"}}
  node_besu_deploy["Besu Deployment<br/>[besu_deploy.js]"]
  node_besu_load["Besu Load Runner<br/>[besu_load.js]"]
end

node_gateway(("Gateway"))

node_gateway -.->|"enrolls devices"| node_registry
node_gateway -.->|"manages policies"| node_access
node_gateway -.->|"anchors batches"| node_anchor_registry
node_merkle -->|"builds commitments"| node_anchor_registry
node_gateway -.->|"settles offers"| node_energy_market
node_gateway -.->|"attests delivery"| node_attested_market
node_besu_deploy -->|"deploys contracts"| node_besu_network
node_besu_load -->|"submits transactions"| node_besu_network
node_besu_deploy -->|"deploys"| node_registry
node_besu_deploy -->|"deploys"| node_anchor_registry
node_besu_deploy -->|"deploys"| node_baselines
node_besu_load -->|"submits anchors"| node_anchor_registry
node_besu_load -->|"submits readings"| node_baselines

click node_registry "https://github.com/tarikchafiq/ioe-blockchain-trust-layer/blob/main/contracts/IoERegistry.sol"
click node_access "https://github.com/tarikchafiq/ioe-blockchain-trust-layer/blob/main/contracts/AccessPolicy.sol"
click node_anchor_registry "https://github.com/tarikchafiq/ioe-blockchain-trust-layer/blob/main/contracts/AnchorRegistry.sol"
click node_merkle "https://github.com/tarikchafiq/ioe-blockchain-trust-layer/blob/main/scripts/merkle.js"
click node_energy_market "https://github.com/tarikchafiq/ioe-blockchain-trust-layer/blob/main/contracts/EnergyMarket.sol"
click node_attested_market "https://github.com/tarikchafiq/ioe-blockchain-trust-layer/blob/main/contracts/EnergyMarketV2.sol"
click node_baselines "https://github.com/tarikchafiq/ioe-blockchain-trust-layer/blob/main/contracts/Baseline.sol"
click node_strong_baselines "https://github.com/tarikchafiq/ioe-blockchain-trust-layer/blob/main/contracts/Baselines2.sol"
click node_besu_network "https://github.com/tarikchafiq/ioe-blockchain-trust-layer/tree/main/testbed"
click node_besu_deploy "https://github.com/tarikchafiq/ioe-blockchain-trust-layer/blob/main/scripts/besu_deploy.js"
click node_besu_load "https://github.com/tarikchafiq/ioe-blockchain-trust-layer/blob/main/scripts/besu_load.js"

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_registry,node_access toneBlue
class node_anchor_registry,node_merkle toneAmber
class node_energy_market,node_attested_market toneMint
class node_baselines,node_strong_baselines,node_besu_network,node_besu_deploy,node_besu_load toneRose
class node_gateway toneIndigo
```

## Components

### Device Trust

- [IoE Registry](https://github.com/tarikchafiq/ioe-blockchain-trust-layer/blob/main/contracts/IoERegistry.sol): `contracts/IoERegistry.sol`
- [Access Policy](https://github.com/tarikchafiq/ioe-blockchain-trust-layer/blob/main/contracts/AccessPolicy.sol): `contracts/AccessPolicy.sol`

### Anchoring

- [Anchor Registry](https://github.com/tarikchafiq/ioe-blockchain-trust-layer/blob/main/contracts/AnchorRegistry.sol): `contracts/AnchorRegistry.sol`
- [Merkle Toolkit](https://github.com/tarikchafiq/ioe-blockchain-trust-layer/blob/main/scripts/merkle.js): `scripts/merkle.js`

### Energy Market

- [Energy Market](https://github.com/tarikchafiq/ioe-blockchain-trust-layer/blob/main/contracts/EnergyMarket.sol): `contracts/EnergyMarket.sol`
- [Attested Market](https://github.com/tarikchafiq/ioe-blockchain-trust-layer/blob/main/contracts/EnergyMarketV2.sol): `contracts/EnergyMarketV2.sol`

### Network Evaluation

- [Baseline Contracts](https://github.com/tarikchafiq/ioe-blockchain-trust-layer/blob/main/contracts/Baseline.sol): `contracts/Baseline.sol`
- [Stronger Baselines](https://github.com/tarikchafiq/ioe-blockchain-trust-layer/blob/main/contracts/Baselines2.sol): `contracts/Baselines2.sol`
- [Besu QBFT](https://github.com/tarikchafiq/ioe-blockchain-trust-layer/tree/main/testbed): `testbed`
- [Besu Deployment](https://github.com/tarikchafiq/ioe-blockchain-trust-layer/blob/main/scripts/besu_deploy.js): `scripts/besu_deploy.js`
- [Besu Load Runner](https://github.com/tarikchafiq/ioe-blockchain-trust-layer/blob/main/scripts/besu_load.js): `scripts/besu_load.js`

### Other components

- **Gateway**

## Connections

- Gateway → IoE Registry: enrolls devices (evidence: `README.md`)
- Gateway → Access Policy: manages policies (evidence: `README.md`)
- Gateway → Anchor Registry: anchors batches (evidence: `README.md`)
- Merkle Toolkit → Anchor Registry: builds commitments
- Gateway → Energy Market: settles offers (evidence: `README.md`)
- Gateway → Attested Market: attests delivery (evidence: `README.md`)
- Besu Deployment → Besu QBFT: deploys contracts (evidence: `scripts/besu_deploy.js`)
- Besu Load Runner → Besu QBFT: submits transactions (evidence: `scripts/besu_load.js`)
- Besu Deployment → IoE Registry: deploys (evidence: `scripts/besu_deploy.js`)
- Besu Deployment → Anchor Registry: deploys (evidence: `scripts/besu_deploy.js`)
- Besu Deployment → Baseline Contracts: deploys (evidence: `scripts/besu_deploy.js`)
- Besu Load Runner → Anchor Registry: submits anchors (evidence: `scripts/besu_load.js`)
- Besu Load Runner → Baseline Contracts: submits readings (evidence: `scripts/besu_load.js`)
