# harsh-singh-2023/vea-bft-implementation architecture

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

- Interactive diagram: https://gitdiagram.com/harsh-singh-2023/vea-bft-implementation
- Repository: https://github.com/harsh-singh-2023/vea-bft-implementation

## Overview

VEA-BFT is a federated healthcare learning simulation: hospitals train locally and submit encrypted, proven updates; validators verify and aggregate them through PBFT; a threshold committee decrypts the accepted aggregate, while a Solidity ledger anchors rounds for later replay. The graph also preserves documented committee rotation, noise-budget bootstrapping, evaluation, reporting, and dashboard capabilities. Edges follow the README and shown source references; unsampled internals are represented at supported paths without assuming their call details.

Main entry points: [`src/orchestrator/federation.ts`](https://github.com/harsh-singh-2023/vea-bft-implementation/blob/main/src/orchestrator/federation.ts) (Round Orchestrator), [`src/nodes/hospital.ts`](https://github.com/harsh-singh-2023/vea-bft-implementation/blob/main/src/nodes/hospital.ts) (Hospital Updates), [`src/nodes/validator.ts`](https://github.com/harsh-singh-2023/vea-bft-implementation/blob/main/src/nodes/validator.ts) (Validator Checks), [`src/chain/ledger.ts`](https://github.com/harsh-singh-2023/vea-bft-implementation/blob/main/src/chain/ledger.ts) (Ledger Client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_learning["Federated Learning"]
  node_dataset["Clinical Data Prep<br/>[dataset.ts]"]
  node_training["Local Logistic Training<br/>[logreg.ts]"]
  node_hospital["Hospital Updates<br/>[hospital.ts]"]
end

subgraph group_crypto["Privacy and Keys"]
  node_paillier["Paillier Encryption<br/>[paillier.ts]"]
  node_proofs["Update Proofs<br/>[sigma.ts]"]
  node_threshold["Threshold Decryption<br/>[threshold.ts]"]
  node_committee["Committee Members<br/>[committee.ts]"]
end

subgraph group_consensus["Validation and Ledger"]
  node_validator["Validator Checks<br/>[validator.ts]"]
  node_pbft["PBFT Consensus<br/>[pbft.ts]"]
  node_ledger_client["Ledger Client<br/>[ledger.ts]"]
  node_contract[("Round Ledger<br/>[VEABFTLedger.sol]")]
end

subgraph group_operations["Federation Operations"]
  node_federation["Round Orchestrator<br/>[federation.ts]"]
  node_store[("Content Store<br/>[contentStore.ts]")]
  node_protocol["Blob and Proposal Types<br/>[protocol.ts]"]
  node_rotation["Committee Resharing<br/>[threshold.ts]"]
  node_audit["Round Audit and Replay<br/>[federation.ts]"]
  node_bootstrap["Noise Budget Bootstrap<br/>[federation.ts]"]
end

subgraph group_evaluation["Evaluation and UI"]
  node_evaluate["Paper Evaluation<br/>[evaluate.ts]"]
  node_reports["SVG Reports<br/>[svg.ts]"]
  node_dashboard["Dashboard Server<br/>[server.ts]"]
end

node_hospital_actor(("Hospitals"))

node_hospital_actor -->|"submits updates"| node_hospital
node_federation -->|"loads prepared data"| node_dataset
node_hospital -->|"uses partitions"| node_dataset
node_hospital -->|"trains locally"| node_training
node_hospital -->|"encrypts updates"| node_paillier
node_hospital -->|"proves updates"| node_proofs
node_hospital -->|"stores submissions"| node_store
node_hospital -->|"records submissions"| node_ledger_client
node_federation -->|"coordinates"| node_hospital
node_federation -->|"coordinates"| node_validator
node_validator -->|"verifies updates"| node_proofs
node_validator -->|"reads blobs"| node_store
node_validator -->|"checks ledger state"| node_ledger_client
node_federation -->|"runs consensus"| node_pbft
node_federation -->|"anchors rounds"| node_ledger_client
node_ledger_client -->|"calls contract"| node_contract
node_federation -->|"configures store"| node_store
node_federation -->|"coordinates decryption"| node_committee
node_committee -->|"uses threshold shares"| node_threshold
node_federation -->|"rotates committee"| node_rotation
node_federation -->|"replays rounds"| node_audit
node_federation -->|"bootstraps budget"| node_bootstrap
node_federation -->|"uses blob types"| node_protocol
node_evaluate -->|"runs scenarios"| node_federation
node_evaluate -->|"loads datasets"| node_dataset
node_evaluate -->|"generates figures"| node_reports
node_dashboard -->|"serves federation"| node_federation

click node_federation "https://github.com/harsh-singh-2023/vea-bft-implementation/blob/main/src/orchestrator/federation.ts"
click node_dataset "https://github.com/harsh-singh-2023/vea-bft-implementation/blob/main/src/ml/dataset.ts"
click node_training "https://github.com/harsh-singh-2023/vea-bft-implementation/blob/main/src/ml/logreg.ts"
click node_hospital "https://github.com/harsh-singh-2023/vea-bft-implementation/blob/main/src/nodes/hospital.ts"
click node_paillier "https://github.com/harsh-singh-2023/vea-bft-implementation/blob/main/src/crypto/paillier.ts"
click node_proofs "https://github.com/harsh-singh-2023/vea-bft-implementation/blob/main/src/crypto/sigma.ts"
click node_threshold "https://github.com/harsh-singh-2023/vea-bft-implementation/blob/main/src/crypto/threshold.ts"
click node_committee "https://github.com/harsh-singh-2023/vea-bft-implementation/blob/main/src/nodes/committee.ts"
click node_validator "https://github.com/harsh-singh-2023/vea-bft-implementation/blob/main/src/nodes/validator.ts"
click node_pbft "https://github.com/harsh-singh-2023/vea-bft-implementation/blob/main/src/consensus/pbft.ts"
click node_ledger_client "https://github.com/harsh-singh-2023/vea-bft-implementation/blob/main/src/chain/ledger.ts"
click node_contract "https://github.com/harsh-singh-2023/vea-bft-implementation/blob/main/contracts/VEABFTLedger.sol"
click node_store "https://github.com/harsh-singh-2023/vea-bft-implementation/blob/main/src/storage/contentStore.ts"
click node_protocol "https://github.com/harsh-singh-2023/vea-bft-implementation/blob/main/src/protocol.ts"
click node_rotation "https://github.com/harsh-singh-2023/vea-bft-implementation/blob/main/src/crypto/threshold.ts"
click node_audit "https://github.com/harsh-singh-2023/vea-bft-implementation/blob/main/src/orchestrator/federation.ts"
click node_bootstrap "https://github.com/harsh-singh-2023/vea-bft-implementation/blob/main/src/orchestrator/federation.ts"
click node_evaluate "https://github.com/harsh-singh-2023/vea-bft-implementation/blob/main/src/cli/evaluate.ts"
click node_reports "https://github.com/harsh-singh-2023/vea-bft-implementation/blob/main/src/report/svg.ts"
click node_dashboard "https://github.com/harsh-singh-2023/vea-bft-implementation/blob/main/src/server/server.ts"

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_dataset,node_training,node_hospital toneBlue
class node_paillier,node_proofs,node_threshold,node_committee toneAmber
class node_validator,node_pbft,node_ledger_client,node_contract toneMint
class node_federation,node_store,node_protocol,node_rotation,node_audit,node_bootstrap toneRose
class node_evaluate,node_reports,node_dashboard,node_hospital_actor toneIndigo
```

## Components

### Federated Learning

- [Clinical Data Prep](https://github.com/harsh-singh-2023/vea-bft-implementation/blob/main/src/ml/dataset.ts): `src/ml/dataset.ts`
- [Local Logistic Training](https://github.com/harsh-singh-2023/vea-bft-implementation/blob/main/src/ml/logreg.ts): `src/ml/logreg.ts`
- [Hospital Updates](https://github.com/harsh-singh-2023/vea-bft-implementation/blob/main/src/nodes/hospital.ts): `src/nodes/hospital.ts`

### Privacy and Keys

- [Paillier Encryption](https://github.com/harsh-singh-2023/vea-bft-implementation/blob/main/src/crypto/paillier.ts): `src/crypto/paillier.ts`
- [Update Proofs](https://github.com/harsh-singh-2023/vea-bft-implementation/blob/main/src/crypto/sigma.ts): `src/crypto/sigma.ts`
- [Threshold Decryption](https://github.com/harsh-singh-2023/vea-bft-implementation/blob/main/src/crypto/threshold.ts): `src/crypto/threshold.ts`
- [Committee Members](https://github.com/harsh-singh-2023/vea-bft-implementation/blob/main/src/nodes/committee.ts): `src/nodes/committee.ts`

### Validation and Ledger

- [Validator Checks](https://github.com/harsh-singh-2023/vea-bft-implementation/blob/main/src/nodes/validator.ts): `src/nodes/validator.ts`
- [PBFT Consensus](https://github.com/harsh-singh-2023/vea-bft-implementation/blob/main/src/consensus/pbft.ts): `src/consensus/pbft.ts`
- [Ledger Client](https://github.com/harsh-singh-2023/vea-bft-implementation/blob/main/src/chain/ledger.ts): `src/chain/ledger.ts`
- [Round Ledger](https://github.com/harsh-singh-2023/vea-bft-implementation/blob/main/contracts/VEABFTLedger.sol): `contracts/VEABFTLedger.sol`

### Federation Operations

- [Round Orchestrator](https://github.com/harsh-singh-2023/vea-bft-implementation/blob/main/src/orchestrator/federation.ts): `src/orchestrator/federation.ts`
- [Content Store](https://github.com/harsh-singh-2023/vea-bft-implementation/blob/main/src/storage/contentStore.ts): `src/storage/contentStore.ts`
- [Blob and Proposal Types](https://github.com/harsh-singh-2023/vea-bft-implementation/blob/main/src/protocol.ts): `src/protocol.ts`
- [Committee Resharing](https://github.com/harsh-singh-2023/vea-bft-implementation/blob/main/src/crypto/threshold.ts): `src/crypto/threshold.ts`
- [Round Audit and Replay](https://github.com/harsh-singh-2023/vea-bft-implementation/blob/main/src/orchestrator/federation.ts): `src/orchestrator/federation.ts`
- [Noise Budget Bootstrap](https://github.com/harsh-singh-2023/vea-bft-implementation/blob/main/src/orchestrator/federation.ts): `src/orchestrator/federation.ts`

### Evaluation and UI

- [Paper Evaluation](https://github.com/harsh-singh-2023/vea-bft-implementation/blob/main/src/cli/evaluate.ts): `src/cli/evaluate.ts`
- [SVG Reports](https://github.com/harsh-singh-2023/vea-bft-implementation/blob/main/src/report/svg.ts): `src/report/svg.ts`
- [Dashboard Server](https://github.com/harsh-singh-2023/vea-bft-implementation/blob/main/src/server/server.ts): `src/server/server.ts`

### Other components

- **Hospitals**

## Connections

- Hospitals → Hospital Updates: submits updates (evidence: `README.md`)
- Round Orchestrator → Clinical Data Prep: loads prepared data (evidence: `src/orchestrator/federation.ts`)
- Hospital Updates → Clinical Data Prep: uses partitions (evidence: `src/nodes/hospital.ts`)
- Hospital Updates → Local Logistic Training: trains locally (evidence: `README.md`)
- Hospital Updates → Paillier Encryption: encrypts updates (evidence: `src/nodes/hospital.ts`)
- Hospital Updates → Update Proofs: proves updates (evidence: `src/nodes/hospital.ts`)
- Hospital Updates → Content Store: stores submissions (evidence: `src/nodes/hospital.ts`)
- Hospital Updates → Ledger Client: records submissions (evidence: `src/nodes/hospital.ts`)
- Round Orchestrator → Hospital Updates: coordinates (evidence: `README.md`)
- Round Orchestrator → Validator Checks: coordinates (evidence: `README.md`)
- Validator Checks → Update Proofs: verifies updates (evidence: `src/nodes/validator.ts`)
- Validator Checks → Content Store: reads blobs (evidence: `src/nodes/validator.ts`)
- Validator Checks → Ledger Client: checks ledger state (evidence: `src/nodes/validator.ts`)
- Round Orchestrator → PBFT Consensus: runs consensus (evidence: `src/orchestrator/federation.ts`)
- Round Orchestrator → Ledger Client: anchors rounds (evidence: `src/orchestrator/federation.ts`)
- Ledger Client → Round Ledger: calls contract (evidence: `src/chain/ledger.ts`)
- Round Orchestrator → Content Store: configures store (evidence: `src/orchestrator/federation.ts`)
- Round Orchestrator → Committee Members: coordinates decryption (evidence: `README.md`)
- Committee Members → Threshold Decryption: uses threshold shares (evidence: `src/nodes/committee.ts`)
- Round Orchestrator → Committee Resharing: rotates committee (evidence: `README.md`)
- Round Orchestrator → Round Audit and Replay: replays rounds (evidence: `README.md`)
- Round Orchestrator → Noise Budget Bootstrap: bootstraps budget (evidence: `README.md`)
- Round Orchestrator → Blob and Proposal Types: uses blob types (evidence: `src/orchestrator/federation.ts`)
- Paper Evaluation → Round Orchestrator: runs scenarios (evidence: `src/cli/evaluate.ts`)
- Paper Evaluation → Clinical Data Prep: loads datasets (evidence: `src/cli/evaluate.ts`)
- Paper Evaluation → SVG Reports: generates figures (evidence: `src/cli/evaluate.ts`)
- Dashboard Server → Round Orchestrator: serves federation (evidence: `src/server/server.ts`)
