# ssi-hf-research/mmd-blockchain-agent architecture

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

- Interactive diagram: https://gitdiagram.com/ssi-hf-research/mmd-blockchain-agent
- Repository: https://github.com/ssi-hf-research/mmd-blockchain-agent

## Overview

This repository combines an Aries-style agent with a Hyperledger Fabric traceability application. The runtime agent supports DID connections and out-of-band invitations, proof exchange and revocation, ledger access, wallet-backed credentials, and message transport; the tree also shows Fabric contracts and application clients for products, quality assurance, standards, and alert rules. The excerpts show selected service-to-repository and initialization relationships, but not the full application wiring or the contract clients’ behavior. Consequently, the Fabric capability branches are represented without guessed call paths.

Main entry points: [`src/main/kotlin/org/hyperledger/ariesframework/agent/Agent.kt`](https://github.com/ssi-hf-research/mmd-blockchain-agent/blob/main/src/main/kotlin/org/hyperledger/ariesframework/agent/Agent.kt) (Aries agent), [`src/main/kotlin/org/hyperledger/ariesframework/connection/ConnectionService.kt`](https://github.com/ssi-hf-research/mmd-blockchain-agent/blob/main/src/main/kotlin/org/hyperledger/ariesframework/connection/ConnectionService.kt) (Connection exchange), [`src/main/kotlin/org/hyperledger/ariesframework/connection/DidExchangeService.kt`](https://github.com/ssi-hf-research/mmd-blockchain-agent/blob/main/src/main/kotlin/org/hyperledger/ariesframework/connection/DidExchangeService.kt) (DID exchange), [`src/main/kotlin/org/hyperledger/ariesframework/oob/OutOfBandService.kt`](https://github.com/ssi-hf-research/mmd-blockchain-agent/blob/main/src/main/kotlin/org/hyperledger/ariesframework/oob/OutOfBandService.kt) (Out-of-band invitations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_agent["Agent runtime"]
  node_agent["Aries agent<br/>[Agent.kt]"]
  node_wallet[("Wallet<br/>[Wallet.kt]")]
  node_transport["Message transport<br/>[MessageReceiver.kt]"]
end

subgraph group_identity["Identity workflows"]
  node_connections["Connection exchange"]
  node_didexchange["DID exchange"]
  node_outofband["Out-of-band invitations"]
  node_connectionrecords[("Connection records")]
end

subgraph group_ledger["Ledger and proofs"]
  node_proofs["Proof exchange<br/>[ProofService.kt]"]
  node_revocation["Revocation support"]
  node_anoncreds["Anoncreds service"]
  node_ledgerservice["Ledger service<br/>[LedgerService.kt]"]
end

subgraph group_traceability["Traceability contracts"]
  node_productcontract["Product contract<br/>[ProductContract.js]"]
  node_productclient["Product application<br/>[app-listener.js]"]
  node_qacontract["Quality contract"]
  node_qaclient["QA applications<br/>[honey-qa.js]"]
  node_honeycontract["Honey standards"]
  node_olivecontract["Olive oil standards"]
  node_alertcontract["Alert control"]
end

node_operator(("Agent operator"))
node_fabric[("Fabric network")]

node_operator -.->|"operates"| node_agent
node_agent -->|"initializes"| node_wallet
node_agent -->|"creates"| node_connections
node_agent -->|"creates"| node_didexchange
node_agent -->|"creates"| node_outofband
node_agent -->|"initializes optionally"| node_ledgerservice
node_connections -->|"saves and updates"| node_connectionrecords
node_connections -->|"publishes events"| node_agent
node_didexchange -->|"saves and updates"| node_connectionrecords
node_didexchange -->|"publishes events"| node_agent
node_outofband -->|"publishes events"| node_agent
node_proofs -->|"publishes events"| node_agent
node_revocation -->|"fetches registry data"| node_ledgerservice
node_productclient -.->|"invokes"| node_productcontract
node_productcontract -.->|"records product data"| node_fabric
node_qaclient -.->|"invokes"| node_qacontract
node_qacontract -.->|"records QA data"| node_fabric
node_honeycontract -.->|"stores standards"| node_fabric
node_olivecontract -.->|"stores standards"| node_fabric
node_alertcontract -.->|"stores alert rules"| node_fabric

click node_agent "https://github.com/ssi-hf-research/mmd-blockchain-agent/blob/main/src/main/kotlin/org/hyperledger/ariesframework/agent/Agent.kt"
click node_wallet "https://github.com/ssi-hf-research/mmd-blockchain-agent/blob/main/src/main/kotlin/org/hyperledger/ariesframework/wallet/Wallet.kt"
click node_transport "https://github.com/ssi-hf-research/mmd-blockchain-agent/blob/main/src/main/kotlin/org/hyperledger/ariesframework/agent/MessageReceiver.kt"
click node_connections "https://github.com/ssi-hf-research/mmd-blockchain-agent/blob/main/src/main/kotlin/org/hyperledger/ariesframework/connection/ConnectionService.kt"
click node_didexchange "https://github.com/ssi-hf-research/mmd-blockchain-agent/blob/main/src/main/kotlin/org/hyperledger/ariesframework/connection/DidExchangeService.kt"
click node_outofband "https://github.com/ssi-hf-research/mmd-blockchain-agent/blob/main/src/main/kotlin/org/hyperledger/ariesframework/oob/OutOfBandService.kt"
click node_connectionrecords "https://github.com/ssi-hf-research/mmd-blockchain-agent/blob/main/src/main/kotlin/org/hyperledger/ariesframework/connection/repository/ConnectionRecord.kt"
click node_proofs "https://github.com/ssi-hf-research/mmd-blockchain-agent/blob/main/src/main/kotlin/org/hyperledger/ariesframework/proofs/ProofService.kt"
click node_revocation "https://github.com/ssi-hf-research/mmd-blockchain-agent/blob/main/src/main/kotlin/org/hyperledger/ariesframework/proofs/RevocationService.kt"
click node_anoncreds "https://github.com/ssi-hf-research/mmd-blockchain-agent/blob/main/src/main/kotlin/org/hyperledger/ariesframework/anoncreds/AnoncredsService.kt"
click node_ledgerservice "https://github.com/ssi-hf-research/mmd-blockchain-agent/blob/main/src/main/kotlin/org/hyperledger/ariesframework/ledger/LedgerService.kt"
click node_productcontract "https://github.com/ssi-hf-research/mmd-blockchain-agent/blob/main/chaincode/tsp/javascript/product-contract/chaincode/ProductContract.js"
click node_productclient "https://github.com/ssi-hf-research/mmd-blockchain-agent/blob/main/chaincode/tsp/javascript/product-contract/application/app-listener.js"
click node_qacontract "https://github.com/ssi-hf-research/mmd-blockchain-agent/blob/main/chaincode/tsp/javascript/quality-assurance-contract/chaincode/QualityAssuranceContract.js"
click node_qaclient "https://github.com/ssi-hf-research/mmd-blockchain-agent/blob/main/chaincode/tsp/javascript/quality-assurance-contract/application/honey-qa.js"
click node_honeycontract "https://github.com/ssi-hf-research/mmd-blockchain-agent/blob/main/chaincode/tsp/javascript/standard-honey-contract/chaincode/StandardHoneyContract.js"
click node_olivecontract "https://github.com/ssi-hf-research/mmd-blockchain-agent/blob/main/chaincode/tsp/javascript/standard-olive-oil-contract/chaincode/StandardOliveOilContract.js"
click node_alertcontract "https://github.com/ssi-hf-research/mmd-blockchain-agent/blob/main/chaincode/tsp/javascript/alert-control-contract/chaincode/AlertControlContract.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_agent,node_wallet,node_transport toneBlue
class node_connections,node_didexchange,node_outofband,node_connectionrecords,node_fabric toneAmber
class node_proofs,node_revocation,node_anoncreds,node_ledgerservice toneMint
class node_productcontract,node_productclient,node_qacontract,node_qaclient,node_honeycontract,node_olivecontract,node_alertcontract toneRose
class node_operator toneIndigo
```

## Components

### Agent runtime

- [Aries agent](https://github.com/ssi-hf-research/mmd-blockchain-agent/blob/main/src/main/kotlin/org/hyperledger/ariesframework/agent/Agent.kt): `src/main/kotlin/org/hyperledger/ariesframework/agent/Agent.kt`
- [Wallet](https://github.com/ssi-hf-research/mmd-blockchain-agent/blob/main/src/main/kotlin/org/hyperledger/ariesframework/wallet/Wallet.kt): `src/main/kotlin/org/hyperledger/ariesframework/wallet/Wallet.kt`
- [Message transport](https://github.com/ssi-hf-research/mmd-blockchain-agent/blob/main/src/main/kotlin/org/hyperledger/ariesframework/agent/MessageReceiver.kt): `src/main/kotlin/org/hyperledger/ariesframework/agent/MessageReceiver.kt`

### Identity workflows

- [Connection exchange](https://github.com/ssi-hf-research/mmd-blockchain-agent/blob/main/src/main/kotlin/org/hyperledger/ariesframework/connection/ConnectionService.kt): `src/main/kotlin/org/hyperledger/ariesframework/connection/ConnectionService.kt`
- [DID exchange](https://github.com/ssi-hf-research/mmd-blockchain-agent/blob/main/src/main/kotlin/org/hyperledger/ariesframework/connection/DidExchangeService.kt): `src/main/kotlin/org/hyperledger/ariesframework/connection/DidExchangeService.kt`
- [Out-of-band invitations](https://github.com/ssi-hf-research/mmd-blockchain-agent/blob/main/src/main/kotlin/org/hyperledger/ariesframework/oob/OutOfBandService.kt): `src/main/kotlin/org/hyperledger/ariesframework/oob/OutOfBandService.kt`
- [Connection records](https://github.com/ssi-hf-research/mmd-blockchain-agent/blob/main/src/main/kotlin/org/hyperledger/ariesframework/connection/repository/ConnectionRecord.kt): `src/main/kotlin/org/hyperledger/ariesframework/connection/repository/ConnectionRecord.kt`

### Ledger and proofs

- [Proof exchange](https://github.com/ssi-hf-research/mmd-blockchain-agent/blob/main/src/main/kotlin/org/hyperledger/ariesframework/proofs/ProofService.kt): `src/main/kotlin/org/hyperledger/ariesframework/proofs/ProofService.kt`
- [Revocation support](https://github.com/ssi-hf-research/mmd-blockchain-agent/blob/main/src/main/kotlin/org/hyperledger/ariesframework/proofs/RevocationService.kt): `src/main/kotlin/org/hyperledger/ariesframework/proofs/RevocationService.kt`
- [Anoncreds service](https://github.com/ssi-hf-research/mmd-blockchain-agent/blob/main/src/main/kotlin/org/hyperledger/ariesframework/anoncreds/AnoncredsService.kt): `src/main/kotlin/org/hyperledger/ariesframework/anoncreds/AnoncredsService.kt`
- [Ledger service](https://github.com/ssi-hf-research/mmd-blockchain-agent/blob/main/src/main/kotlin/org/hyperledger/ariesframework/ledger/LedgerService.kt): `src/main/kotlin/org/hyperledger/ariesframework/ledger/LedgerService.kt`

### Traceability contracts

- [Product contract](https://github.com/ssi-hf-research/mmd-blockchain-agent/blob/main/chaincode/tsp/javascript/product-contract/chaincode/ProductContract.js): `chaincode/tsp/javascript/product-contract/chaincode/ProductContract.js`
- [Product application](https://github.com/ssi-hf-research/mmd-blockchain-agent/blob/main/chaincode/tsp/javascript/product-contract/application/app-listener.js): `chaincode/tsp/javascript/product-contract/application/app-listener.js`
- [Quality contract](https://github.com/ssi-hf-research/mmd-blockchain-agent/blob/main/chaincode/tsp/javascript/quality-assurance-contract/chaincode/QualityAssuranceContract.js): `chaincode/tsp/javascript/quality-assurance-contract/chaincode/QualityAssuranceContract.js`
- [QA applications](https://github.com/ssi-hf-research/mmd-blockchain-agent/blob/main/chaincode/tsp/javascript/quality-assurance-contract/application/honey-qa.js): `chaincode/tsp/javascript/quality-assurance-contract/application/honey-qa.js`
- [Honey standards](https://github.com/ssi-hf-research/mmd-blockchain-agent/blob/main/chaincode/tsp/javascript/standard-honey-contract/chaincode/StandardHoneyContract.js): `chaincode/tsp/javascript/standard-honey-contract/chaincode/StandardHoneyContract.js`
- [Olive oil standards](https://github.com/ssi-hf-research/mmd-blockchain-agent/blob/main/chaincode/tsp/javascript/standard-olive-oil-contract/chaincode/StandardOliveOilContract.js): `chaincode/tsp/javascript/standard-olive-oil-contract/chaincode/StandardOliveOilContract.js`
- [Alert control](https://github.com/ssi-hf-research/mmd-blockchain-agent/blob/main/chaincode/tsp/javascript/alert-control-contract/chaincode/AlertControlContract.js): `chaincode/tsp/javascript/alert-control-contract/chaincode/AlertControlContract.js`

### Other components

- **Agent operator**
- **Fabric network**

## Connections

- Agent operator → Aries agent: operates
- Aries agent → Wallet: initializes (evidence: `src/main/kotlin/org/hyperledger/ariesframework/agent/Agent.kt`)
- Aries agent → Connection exchange: creates (evidence: `src/main/kotlin/org/hyperledger/ariesframework/agent/Agent.kt`)
- Aries agent → DID exchange: creates (evidence: `src/main/kotlin/org/hyperledger/ariesframework/agent/Agent.kt`)
- Aries agent → Out-of-band invitations: creates (evidence: `src/main/kotlin/org/hyperledger/ariesframework/agent/Agent.kt`)
- Aries agent → Ledger service: initializes optionally (evidence: `src/main/kotlin/org/hyperledger/ariesframework/agent/Agent.kt`)
- Connection exchange → Connection records: saves and updates (evidence: `src/main/kotlin/org/hyperledger/ariesframework/connection/ConnectionService.kt`)
- Connection exchange → Aries agent: publishes events (evidence: `src/main/kotlin/org/hyperledger/ariesframework/connection/ConnectionService.kt`)
- DID exchange → Connection records: saves and updates (evidence: `src/main/kotlin/org/hyperledger/ariesframework/connection/DidExchangeService.kt`)
- DID exchange → Aries agent: publishes events (evidence: `src/main/kotlin/org/hyperledger/ariesframework/connection/DidExchangeService.kt`)
- Out-of-band invitations → Aries agent: publishes events (evidence: `src/main/kotlin/org/hyperledger/ariesframework/oob/OutOfBandService.kt`)
- Proof exchange → Aries agent: publishes events (evidence: `src/main/kotlin/org/hyperledger/ariesframework/proofs/ProofService.kt`)
- Revocation support → Ledger service: fetches registry data (evidence: `src/main/kotlin/org/hyperledger/ariesframework/proofs/RevocationService.kt`)
- Product application → Product contract: invokes
- Product contract → Fabric network: records product data
- QA applications → Quality contract: invokes
- Quality contract → Fabric network: records QA data
- Honey standards → Fabric network: stores standards
- Olive oil standards → Fabric network: stores standards
- Alert control → Fabric network: stores alert rules
