# chronos-vault/chronos-vault-contracts architecture

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

- Interactive diagram: https://gitdiagram.com/chronos-vault/chronos-vault-contracts
- Repository: https://github.com/chronos-vault/chronos-vault-contracts

## Overview

Trinity Protocol is a multi-chain consensus and cross-chain vault system, with an exit-batch keeper as a key off-chain service. The documented user flow is cross-chain activity being validated by 2-of-3 consensus and applied to vault, bridge, or exit-settlement operations. The keeper listens for Arbitrum exit requests, batches them into Merkle roots, stores tree data, submits batches to L1, and monitors challenges. Some chain-level relationships are documented capabilities rather than source-verified calls; the graph cites the README for those links.

Main entry points: [`contracts/ethereum`](https://github.com/chronos-vault/chronos-vault-contracts/tree/main/contracts/ethereum) (Arbitrum Consensus), [`keeper/src/index.ts`](https://github.com/chronos-vault/chronos-vault-contracts/blob/main/keeper/src/index.ts) (Keeper Runtime), [`keeper/src/services/L1Submitter.ts`](https://github.com/chronos-vault/chronos-vault-contracts/blob/main/keeper/src/services/L1Submitter.ts) (L1 Submitter), [`keeper/src/services/BatchManager.ts`](https://github.com/chronos-vault/chronos-vault-contracts/blob/main/keeper/src/services/BatchManager.ts) (Batch Manager)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_chain["Chain Programs"]
  node_arb["Arbitrum Consensus"]
  node_solvalidator["Solana Validator"]
  node_tonconsensus["TON Consensus"]
end

subgraph group_vaultbridge["Vaults And Bridges"]
  node_solvault["Solana Vault<br/>[chronos_vault.rs]"]
  node_solbridge["Solana Bridge"]
  node_tonvault["TON Vault<br/>[ChronosVault.ts]"]
  node_tonbridge["TON CVT Bridge<br/>[CVTBridge.ts]"]
end

subgraph group_keeper["Exit Batch Keeper"]
  node_keeper["Keeper Runtime<br/>[index.ts]"]
  node_events["Exit Event Monitor<br/>[EventMonitor.ts]"]
  node_batches["Batch Manager<br/>[BatchManager.ts]"]
  node_storage["Merkle Storage<br/>[StorageService.ts]"]
  node_submitter["L1 Submitter<br/>[L1Submitter.ts]"]
  node_challenge["Challenge Monitor"]
  node_analytics["Keeper Analytics<br/>[Analytics.ts]"]
end

subgraph group_ops["Relayers And Token"]
  node_vesting["Solana Vesting<br/>[lib.rs]"]
  node_cvt["CVT Token"]
  node_relayers["Validator Relayers"]
end

node_user(("Cross-Chain User"))
node_ipfs[("IPFS")]
node_arweave[("Arweave")]
node_arbitrumchain(("Arbitrum Network"))
node_ethereum(("Ethereum L1"))
node_safe["Gnosis Safe"]

node_user -->|"initiates activity"| node_arb
node_arb -->|"cross-chain consensus"| node_solvalidator
node_solvalidator -->|"cross-chain consensus"| node_tonconsensus
node_tonconsensus -->|"cross-chain consensus"| node_arb
node_arb -->|"authorizes vault actions"| node_solvault
node_arb -->|"supports atomic swaps"| node_solbridge
node_arb -->|"authorizes vault actions"| node_tonvault
node_arb -->|"supports bridge operations"| node_tonbridge
node_user -->|"uses token vesting"| node_vesting
node_user -->|"uses CVT token"| node_cvt
node_relayers -.->|"submit proofs"| node_arb
node_keeper -->|"starts monitor"| node_events
node_keeper -->|"starts batching"| node_batches
node_keeper -->|"initializes submitter"| node_submitter
node_keeper -->|"starts monitor"| node_challenge
node_keeper -->|"creates analytics"| node_analytics
node_events -->|"listens for exits"| node_arbitrumchain
node_batches -->|"stores Merkle tree"| node_storage
node_storage -->|"writes tree data"| node_ipfs
node_storage -->|"writes tree data"| node_arweave
node_batches -->|"submits batch"| node_submitter
node_submitter -->|"sends batch transaction"| node_ethereum
node_submitter -->|"signs via Safe"| node_safe
node_challenge -->|"records resolution"| node_analytics

click node_arb "https://github.com/chronos-vault/chronos-vault-contracts/tree/main/contracts/ethereum"
click node_solvalidator "https://github.com/chronos-vault/chronos-vault-contracts/blob/main/contracts/solana/trinity_validator.rs"
click node_tonconsensus "https://github.com/chronos-vault/chronos-vault-contracts/blob/main/contracts/ton/wrappers/TrinityConsensus.ts"
click node_solvault "https://github.com/chronos-vault/chronos-vault-contracts/blob/main/contracts/solana/chronos_vault.rs"
click node_solbridge "https://github.com/chronos-vault/chronos-vault-contracts/blob/main/contracts/solana/cross_chain_bridge.rs"
click node_tonvault "https://github.com/chronos-vault/chronos-vault-contracts/blob/main/contracts/ton/wrappers/ChronosVault.ts"
click node_tonbridge "https://github.com/chronos-vault/chronos-vault-contracts/blob/main/contracts/ton/wrappers/CVTBridge.ts"
click node_vesting "https://github.com/chronos-vault/chronos-vault-contracts/blob/main/contracts/solana/vesting_program/src/lib.rs"
click node_cvt "https://github.com/chronos-vault/chronos-vault-contracts/tree/main/contracts/solana/cvt_token"
click node_relayers "https://github.com/chronos-vault/chronos-vault-contracts/blob/main/contracts/validators/trinity-relayer-service.ts"
click node_keeper "https://github.com/chronos-vault/chronos-vault-contracts/blob/main/keeper/src/index.ts"
click node_events "https://github.com/chronos-vault/chronos-vault-contracts/blob/main/keeper/src/services/EventMonitor.ts"
click node_batches "https://github.com/chronos-vault/chronos-vault-contracts/blob/main/keeper/src/services/BatchManager.ts"
click node_storage "https://github.com/chronos-vault/chronos-vault-contracts/blob/main/keeper/src/services/StorageService.ts"
click node_submitter "https://github.com/chronos-vault/chronos-vault-contracts/blob/main/keeper/src/services/L1Submitter.ts"
click node_challenge "https://github.com/chronos-vault/chronos-vault-contracts/blob/main/keeper/src/services/ChallengeMonitor.ts"
click node_analytics "https://github.com/chronos-vault/chronos-vault-contracts/blob/main/keeper/src/services/Analytics.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_arb,node_solvalidator,node_tonconsensus,node_user toneBlue
class node_solvault,node_solbridge,node_tonvault,node_tonbridge,node_ipfs,node_arweave toneAmber
class node_keeper,node_events,node_batches,node_storage,node_submitter,node_challenge,node_analytics toneMint
class node_vesting,node_cvt,node_relayers toneRose
class node_arbitrumchain,node_ethereum,node_safe toneIndigo
```

## Components

### Chain Programs

- [Arbitrum Consensus](https://github.com/chronos-vault/chronos-vault-contracts/tree/main/contracts/ethereum): `contracts/ethereum`
- [Solana Validator](https://github.com/chronos-vault/chronos-vault-contracts/blob/main/contracts/solana/trinity_validator.rs): `contracts/solana/trinity_validator.rs`
- [TON Consensus](https://github.com/chronos-vault/chronos-vault-contracts/blob/main/contracts/ton/wrappers/TrinityConsensus.ts): `contracts/ton/wrappers/TrinityConsensus.ts`

### Vaults And Bridges

- [Solana Vault](https://github.com/chronos-vault/chronos-vault-contracts/blob/main/contracts/solana/chronos_vault.rs): `contracts/solana/chronos_vault.rs`
- [Solana Bridge](https://github.com/chronos-vault/chronos-vault-contracts/blob/main/contracts/solana/cross_chain_bridge.rs): `contracts/solana/cross_chain_bridge.rs`
- [TON Vault](https://github.com/chronos-vault/chronos-vault-contracts/blob/main/contracts/ton/wrappers/ChronosVault.ts): `contracts/ton/wrappers/ChronosVault.ts`
- [TON CVT Bridge](https://github.com/chronos-vault/chronos-vault-contracts/blob/main/contracts/ton/wrappers/CVTBridge.ts): `contracts/ton/wrappers/CVTBridge.ts`

### Exit Batch Keeper

- [Keeper Runtime](https://github.com/chronos-vault/chronos-vault-contracts/blob/main/keeper/src/index.ts): `keeper/src/index.ts`
- [Exit Event Monitor](https://github.com/chronos-vault/chronos-vault-contracts/blob/main/keeper/src/services/EventMonitor.ts): `keeper/src/services/EventMonitor.ts`
- [Batch Manager](https://github.com/chronos-vault/chronos-vault-contracts/blob/main/keeper/src/services/BatchManager.ts): `keeper/src/services/BatchManager.ts`
- [Merkle Storage](https://github.com/chronos-vault/chronos-vault-contracts/blob/main/keeper/src/services/StorageService.ts): `keeper/src/services/StorageService.ts`
- [L1 Submitter](https://github.com/chronos-vault/chronos-vault-contracts/blob/main/keeper/src/services/L1Submitter.ts): `keeper/src/services/L1Submitter.ts`
- [Challenge Monitor](https://github.com/chronos-vault/chronos-vault-contracts/blob/main/keeper/src/services/ChallengeMonitor.ts): `keeper/src/services/ChallengeMonitor.ts`
- [Keeper Analytics](https://github.com/chronos-vault/chronos-vault-contracts/blob/main/keeper/src/services/Analytics.ts): `keeper/src/services/Analytics.ts`

### Relayers And Token

- [Solana Vesting](https://github.com/chronos-vault/chronos-vault-contracts/blob/main/contracts/solana/vesting_program/src/lib.rs): `contracts/solana/vesting_program/src/lib.rs`
- [CVT Token](https://github.com/chronos-vault/chronos-vault-contracts/tree/main/contracts/solana/cvt_token): `contracts/solana/cvt_token`
- [Validator Relayers](https://github.com/chronos-vault/chronos-vault-contracts/blob/main/contracts/validators/trinity-relayer-service.ts): `contracts/validators/trinity-relayer-service.ts`

### Other components

- **Cross-Chain User**
- **IPFS**
- **Arweave**
- **Arbitrum Network**
- **Ethereum L1**
- **Gnosis Safe**

## Connections

- Cross-Chain User → Arbitrum Consensus: initiates activity
- Arbitrum Consensus → Solana Validator: cross-chain consensus
- Solana Validator → TON Consensus: cross-chain consensus
- TON Consensus → Arbitrum Consensus: cross-chain consensus
- Arbitrum Consensus → Solana Vault: authorizes vault actions
- Arbitrum Consensus → Solana Bridge: supports atomic swaps
- Arbitrum Consensus → TON Vault: authorizes vault actions
- Arbitrum Consensus → TON CVT Bridge: supports bridge operations
- Cross-Chain User → Solana Vesting: uses token vesting
- Cross-Chain User → CVT Token: uses CVT token
- Validator Relayers → Arbitrum Consensus: submit proofs
- Keeper Runtime → Exit Event Monitor: starts monitor (evidence: `keeper/src/index.ts`)
- Keeper Runtime → Batch Manager: starts batching (evidence: `keeper/src/index.ts`)
- Keeper Runtime → L1 Submitter: initializes submitter (evidence: `keeper/src/index.ts`)
- Keeper Runtime → Challenge Monitor: starts monitor (evidence: `keeper/src/index.ts`)
- Keeper Runtime → Keeper Analytics: creates analytics (evidence: `keeper/src/index.ts`)
- Exit Event Monitor → Arbitrum Network: listens for exits
- Batch Manager → Merkle Storage: stores Merkle tree (evidence: `keeper/src/services/BatchManager.ts`)
- Merkle Storage → IPFS: writes tree data (evidence: `keeper/src/services/StorageService.ts`)
- Merkle Storage → Arweave: writes tree data (evidence: `keeper/src/services/StorageService.ts`)
- Batch Manager → L1 Submitter: submits batch (evidence: `keeper/src/services/BatchManager.ts`)
- L1 Submitter → Ethereum L1: sends batch transaction (evidence: `keeper/src/services/L1Submitter.ts`)
- L1 Submitter → Gnosis Safe: signs via Safe (evidence: `keeper/src/services/L1Submitter.ts`)
- Challenge Monitor → Keeper Analytics: records resolution (evidence: `keeper/src/services/ChallengeMonitor.ts`)
