# ghostrider1092/coincync architecture

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

- Interactive diagram: https://gitdiagram.com/ghostrider1092/coincync
- Repository: https://github.com/ghostrider1092/coincync

## Overview

CoinCync is a privacy-first, RandomX proof-of-work cryptocurrency and reference node, with wallet, mining, explorer, and operator tooling. The principal workflow is: a wallet creates a private transaction, submits it to a node, and the node relays it, validates candidate blocks, updates chain state, and persists the result. The graph also preserves documented mining and explorer capabilities, plus consensus, networking, and storage layers. Relationships are limited to README statements and source-index references; unsampled runtime wiring is not assumed.

Main entry points: [`src/chain.rs`](https://github.com/ghostrider1092/coincync/blob/main/src/chain.rs) (Chain state machine), [`src/bin/node.rs`](https://github.com/ghostrider1092/coincync/blob/main/src/bin/node.rs) (Node runtime), [`src/consensus/validation.rs`](https://github.com/ghostrider1092/coincync/blob/main/src/consensus/validation.rs) (Block validation), [`src/rpc/server.rs`](https://github.com/ghostrider1092/coincync/blob/main/src/rpc/server.rs) (RPC server)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_wallet_ui["Wallet and interfaces"]
  node_wallet["Wallet operations<br/>[mod.rs]"]
  node_wallet_send["Private transaction send<br/>[send.rs]"]
  node_explorer["Chain explorer<br/>[11-router.js]"]
end

subgraph group_node_chain["Node and chain"]
  node_node_runtime["Node runtime<br/>[node.rs]"]
  node_chain["Chain state machine<br/>[chain.rs]"]
  node_mempool["Transaction mempool<br/>[mempool.rs]"]
  node_rpc["RPC server<br/>[server.rs]"]
end

subgraph group_consensus_privacy["Consensus and privacy"]
  node_consensus["Block validation<br/>[validation.rs]"]
  node_pow["RandomX proof of work<br/>[pow.rs]"]
  node_crypto["Privacy cryptography<br/>[mod.rs]"]
  node_emission["Supply emission<br/>[mod.rs]"]
end

subgraph group_network_mining["Network and mining"]
  node_network["Peer networking<br/>[peer_manager.rs]"]
  node_bootstrap["Peer bootstrap<br/>[bootstrap.rs]"]
  node_miner["Block mining<br/>[mod.rs]"]
  node_rig["Mining rig<br/>[main.rs]"]
end

subgraph group_state_storage["State and storage"]
  node_db[("Persistent database<br/>[mod.rs]")]
  node_snapshot["Chain snapshots<br/>[mod.rs]"]
  node_config["Runtime configuration<br/>[config.rs]"]
end

node_wallet_user(("Wallet user"))
node_node_operator(("Node operator"))

node_wallet_user -->|"manages funds"| node_wallet
node_wallet -->|"prepares sends"| node_wallet_send
node_wallet_send -.->|"submits transactions"| node_rpc
node_node_operator -->|"runs node"| node_node_runtime
node_node_runtime -.->|"runs chain"| node_chain
node_chain -->|"validates blocks"| node_consensus
node_chain -->|"persists chain state"| node_db
node_chain -->|"uses transactions"| node_mempool
node_mempool -->|"checks chain state"| node_chain
node_consensus -->|"verifies work"| node_pow
node_consensus -->|"checks privacy proofs"| node_crypto
node_consensus -->|"applies emission"| node_emission
node_node_runtime -.->|"runs networking"| node_network
node_network -->|"bootstraps peers"| node_bootstrap
node_rpc -->|"serves chain queries"| node_chain
node_rpc -->|"serves mempool queries"| node_mempool
node_snapshot -->|"exports or imports"| node_chain
node_snapshot -->|"copies database"| node_db
node_node_runtime -.->|"loads configuration"| node_config
node_miner -.->|"computes proof of work"| node_pow
node_rig -.->|"mines for node"| node_miner
node_explorer -.->|"queries chain data"| node_rpc

click node_wallet "https://github.com/ghostrider1092/coincync/blob/main/src/wallet/mod.rs"
click node_wallet_send "https://github.com/ghostrider1092/coincync/blob/main/src/wallet/send.rs"
click node_explorer "https://github.com/ghostrider1092/coincync/blob/main/src/explorer/app/11-router.js"
click node_node_runtime "https://github.com/ghostrider1092/coincync/blob/main/src/bin/node.rs"
click node_chain "https://github.com/ghostrider1092/coincync/blob/main/src/chain.rs"
click node_mempool "https://github.com/ghostrider1092/coincync/blob/main/src/mempool.rs"
click node_rpc "https://github.com/ghostrider1092/coincync/blob/main/src/rpc/server.rs"
click node_consensus "https://github.com/ghostrider1092/coincync/blob/main/src/consensus/validation.rs"
click node_pow "https://github.com/ghostrider1092/coincync/blob/main/src/consensus/pow.rs"
click node_crypto "https://github.com/ghostrider1092/coincync/blob/main/src/crypto/mod.rs"
click node_emission "https://github.com/ghostrider1092/coincync/blob/main/src/emission/mod.rs"
click node_network "https://github.com/ghostrider1092/coincync/blob/main/src/network/node/peer_manager.rs"
click node_bootstrap "https://github.com/ghostrider1092/coincync/blob/main/src/network/bootstrap.rs"
click node_miner "https://github.com/ghostrider1092/coincync/blob/main/src/mining/mod.rs"
click node_db "https://github.com/ghostrider1092/coincync/blob/main/src/db/mod.rs"
click node_snapshot "https://github.com/ghostrider1092/coincync/blob/main/src/snapshot/mod.rs"
click node_config "https://github.com/ghostrider1092/coincync/blob/main/src/config.rs"
click node_rig "https://github.com/ghostrider1092/coincync/blob/main/crates/coincync-rig/src/main.rs"

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_wallet,node_wallet_send,node_explorer,node_wallet_user toneBlue
class node_node_runtime,node_chain,node_mempool,node_rpc toneAmber
class node_consensus,node_pow,node_crypto,node_emission toneMint
class node_network,node_bootstrap,node_miner,node_rig toneRose
class node_db,node_snapshot,node_config,node_node_operator toneIndigo
```

## Components

### Wallet and interfaces

- [Wallet operations](https://github.com/ghostrider1092/coincync/blob/main/src/wallet/mod.rs): `src/wallet/mod.rs`
- [Private transaction send](https://github.com/ghostrider1092/coincync/blob/main/src/wallet/send.rs): `src/wallet/send.rs`
- [Chain explorer](https://github.com/ghostrider1092/coincync/blob/main/src/explorer/app/11-router.js): `src/explorer/app/11-router.js`

### Node and chain

- [Node runtime](https://github.com/ghostrider1092/coincync/blob/main/src/bin/node.rs): `src/bin/node.rs`
- [Chain state machine](https://github.com/ghostrider1092/coincync/blob/main/src/chain.rs): `src/chain.rs`
- [Transaction mempool](https://github.com/ghostrider1092/coincync/blob/main/src/mempool.rs): `src/mempool.rs`
- [RPC server](https://github.com/ghostrider1092/coincync/blob/main/src/rpc/server.rs): `src/rpc/server.rs`

### Consensus and privacy

- [Block validation](https://github.com/ghostrider1092/coincync/blob/main/src/consensus/validation.rs): `src/consensus/validation.rs`
- [RandomX proof of work](https://github.com/ghostrider1092/coincync/blob/main/src/consensus/pow.rs): `src/consensus/pow.rs`
- [Privacy cryptography](https://github.com/ghostrider1092/coincync/blob/main/src/crypto/mod.rs): `src/crypto/mod.rs`
- [Supply emission](https://github.com/ghostrider1092/coincync/blob/main/src/emission/mod.rs): `src/emission/mod.rs`

### Network and mining

- [Peer networking](https://github.com/ghostrider1092/coincync/blob/main/src/network/node/peer_manager.rs): `src/network/node/peer_manager.rs`
- [Peer bootstrap](https://github.com/ghostrider1092/coincync/blob/main/src/network/bootstrap.rs): `src/network/bootstrap.rs`
- [Block mining](https://github.com/ghostrider1092/coincync/blob/main/src/mining/mod.rs): `src/mining/mod.rs`
- [Mining rig](https://github.com/ghostrider1092/coincync/blob/main/crates/coincync-rig/src/main.rs): `crates/coincync-rig/src/main.rs`

### State and storage

- [Persistent database](https://github.com/ghostrider1092/coincync/blob/main/src/db/mod.rs): `src/db/mod.rs`
- [Chain snapshots](https://github.com/ghostrider1092/coincync/blob/main/src/snapshot/mod.rs): `src/snapshot/mod.rs`
- [Runtime configuration](https://github.com/ghostrider1092/coincync/blob/main/src/config.rs): `src/config.rs`

### Other components

- **Wallet user**
- **Node operator**

## Connections

- Wallet user → Wallet operations: manages funds (evidence: `README.md`)
- Wallet operations → Private transaction send: prepares sends (evidence: `src/wallet/mod.rs`)
- Private transaction send → RPC server: submits transactions
- Node operator → Node runtime: runs node (evidence: `README.md`)
- Node runtime → Chain state machine: runs chain
- Chain state machine → Block validation: validates blocks (evidence: `src/chain.rs`)
- Chain state machine → Persistent database: persists chain state (evidence: `src/chain.rs`)
- Chain state machine → Transaction mempool: uses transactions (evidence: `src/chain.rs`)
- Transaction mempool → Chain state machine: checks chain state (evidence: `src/mempool.rs`)
- Block validation → RandomX proof of work: verifies work (evidence: `src/consensus/mod.rs`)
- Block validation → Privacy cryptography: checks privacy proofs
- Block validation → Supply emission: applies emission
- Node runtime → Peer networking: runs networking
- Peer networking → Peer bootstrap: bootstraps peers (evidence: `src/network/node/peer_manager.rs`)
- RPC server → Chain state machine: serves chain queries (evidence: `src/rpc/server.rs`)
- RPC server → Transaction mempool: serves mempool queries (evidence: `src/rpc/server.rs`)
- Chain snapshots → Chain state machine: exports or imports (evidence: `src/snapshot/mod.rs`)
- Chain snapshots → Persistent database: copies database (evidence: `src/snapshot/mod.rs`)
- Node runtime → Runtime configuration: loads configuration
- Block mining → RandomX proof of work: computes proof of work
- Mining rig → Block mining: mines for node
- Chain explorer → RPC server: queries chain data
