# bitnodes/bitnodespro architecture

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

- Interactive diagram: https://gitdiagram.com/bitnodes/bitnodespro
- Repository: https://github.com/bitnodes/bitnodespro

## Overview

BitNodesPro Core is an experimental peer-to-peer digital currency node, with command-line/RPC and Qt wallet interfaces. Its principal workflow is to receive transactions and blocks from peers, validate and track them in chain and spendable-coin state, persist that state, and expose wallet/network status or payment operations. Distinct subsystems include peer networking, consensus and chain state, wallet/key management, masternode services, RPC, and the Qt client. The excerpts show selected validation, database and UI details; several subsystem links below are documented only by imports or README-level behavior, so uncertain links are omitted or dashed.

Main entry points: [`src/main.cpp`](https://github.com/bitnodes/bitnodespro/blob/master/src/main.cpp) (Chain validation), [`src/qt/bitnodespro.cpp`](https://github.com/bitnodes/bitnodespro/blob/master/src/qt/bitnodespro.cpp) (Qt wallet), [`src/qt/clientmodel.cpp`](https://github.com/bitnodes/bitnodespro/blob/master/src/qt/clientmodel.cpp) (Client model), [`src/net.cpp`](https://github.com/bitnodes/bitnodespro/blob/master/src/net.cpp) (P2P transport)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interfaces["User interfaces"]
  node_qt_app["Qt wallet<br/>[bitnodespro.cpp]"]
  node_client_model["Client model<br/>[clientmodel.cpp]"]
  node_rpc_server["RPC server<br/>[rpcserver.cpp]"]
  node_rpc_methods["RPC methods<br/>[rpcwallet.cpp]"]
end

subgraph group_network["Peer network"]
  node_p2p_transport["P2P transport<br/>[net.cpp]"]
  node_chain_config["Network parameters<br/>[chainparams.cpp]"]
end

subgraph group_ledger["Ledger and consensus"]
  node_transaction_model["Transaction model<br/>[transaction.cpp]"]
  node_block_model["Block model<br/>[block.cpp]"]
  node_script_engine["Script engine<br/>[interpreter.cpp]"]
  node_mempool["Transaction pool<br/>[txmempool.cpp]"]
  node_chain_validation["Chain validation<br/>[main.cpp]"]
end

subgraph group_wallet["Wallet and services"]
  node_masternodes["Masternode management<br/>[masternodeman.h]"]
  node_wallet_core["Wallet operations<br/>[wallet.cpp]"]
  node_keys["Keys and keystore<br/>[keystore.cpp]"]
end

subgraph group_storage["Persistence"]
  node_coin_state[("Spendable coin state<br/>[coins.cpp]")]
  node_chain_database[("Chain database<br/>[txdb.cpp]")]
  node_leveldb[("LevelDB engine<br/>[db_impl.cc]")]
end

node_user(("User"))
node_rpc_clients(("RPC clients"))
node_peers(("Peer nodes"))

node_user -.->|"uses"| node_qt_app
node_rpc_clients -.->|"requests"| node_rpc_server
node_peers -->|"exchange messages"| node_p2p_transport
node_qt_app -.->|"displays status"| node_client_model
node_client_model -->|"reads peer status"| node_p2p_transport
node_client_model -->|"reads chain status"| node_chain_validation
node_rpc_server -.->|"dispatches"| node_rpc_methods
node_p2p_transport -.->|"delivers blocks"| node_chain_validation
node_chain_validation -->|"uses services"| node_masternodes
node_chain_validation -.->|"validates"| node_transaction_model
node_chain_validation -.->|"processes"| node_block_model
node_chain_validation -.->|"checks scripts"| node_script_engine
node_chain_validation -->|"adds transactions"| node_mempool
node_chain_validation -->|"updates state"| node_coin_state
node_chain_validation -->|"initializes database"| node_chain_database
node_chain_database -.->|"stores records"| node_leveldb
node_chain_validation -->|"uses parameters"| node_chain_config
node_wallet_core -.->|"uses keys"| node_keys
node_rpc_methods -.->|"serves wallet calls"| node_wallet_core
node_qt_app -.->|"wallet actions"| node_wallet_core

click node_qt_app "https://github.com/bitnodes/bitnodespro/blob/master/src/qt/bitnodespro.cpp"
click node_client_model "https://github.com/bitnodes/bitnodespro/blob/master/src/qt/clientmodel.cpp"
click node_rpc_server "https://github.com/bitnodes/bitnodespro/blob/master/src/rpcserver.cpp"
click node_rpc_methods "https://github.com/bitnodes/bitnodespro/blob/master/src/rpcwallet.cpp"
click node_p2p_transport "https://github.com/bitnodes/bitnodespro/blob/master/src/net.cpp"
click node_chain_config "https://github.com/bitnodes/bitnodespro/blob/master/src/chainparams.cpp"
click node_transaction_model "https://github.com/bitnodes/bitnodespro/blob/master/src/primitives/transaction.cpp"
click node_block_model "https://github.com/bitnodes/bitnodespro/blob/master/src/primitives/block.cpp"
click node_script_engine "https://github.com/bitnodes/bitnodespro/blob/master/src/script/interpreter.cpp"
click node_mempool "https://github.com/bitnodes/bitnodespro/blob/master/src/txmempool.cpp"
click node_chain_validation "https://github.com/bitnodes/bitnodespro/blob/master/src/main.cpp"
click node_masternodes "https://github.com/bitnodes/bitnodespro/blob/master/src/masternodeman.h"
click node_wallet_core "https://github.com/bitnodes/bitnodespro/blob/master/src/wallet.cpp"
click node_keys "https://github.com/bitnodes/bitnodespro/blob/master/src/keystore.cpp"
click node_coin_state "https://github.com/bitnodes/bitnodespro/blob/master/src/coins.cpp"
click node_chain_database "https://github.com/bitnodes/bitnodespro/blob/master/src/txdb.cpp"
click node_leveldb "https://github.com/bitnodes/bitnodespro/blob/master/src/leveldb/db/db_impl.cc"

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_qt_app,node_client_model,node_rpc_server,node_rpc_methods,node_user,node_rpc_clients toneBlue
class node_p2p_transport,node_chain_config toneAmber
class node_transaction_model,node_block_model,node_script_engine,node_mempool,node_chain_validation toneMint
class node_masternodes,node_wallet_core,node_keys toneRose
class node_coin_state,node_chain_database,node_leveldb,node_peers toneIndigo
```

## Components

### User interfaces

- [Qt wallet](https://github.com/bitnodes/bitnodespro/blob/master/src/qt/bitnodespro.cpp): `src/qt/bitnodespro.cpp`
- [Client model](https://github.com/bitnodes/bitnodespro/blob/master/src/qt/clientmodel.cpp): `src/qt/clientmodel.cpp`
- [RPC server](https://github.com/bitnodes/bitnodespro/blob/master/src/rpcserver.cpp): `src/rpcserver.cpp`
- [RPC methods](https://github.com/bitnodes/bitnodespro/blob/master/src/rpcwallet.cpp): `src/rpcwallet.cpp`

### Peer network

- [P2P transport](https://github.com/bitnodes/bitnodespro/blob/master/src/net.cpp): `src/net.cpp`
- [Network parameters](https://github.com/bitnodes/bitnodespro/blob/master/src/chainparams.cpp): `src/chainparams.cpp`

### Ledger and consensus

- [Transaction model](https://github.com/bitnodes/bitnodespro/blob/master/src/primitives/transaction.cpp): `src/primitives/transaction.cpp`
- [Block model](https://github.com/bitnodes/bitnodespro/blob/master/src/primitives/block.cpp): `src/primitives/block.cpp`
- [Script engine](https://github.com/bitnodes/bitnodespro/blob/master/src/script/interpreter.cpp): `src/script/interpreter.cpp`
- [Transaction pool](https://github.com/bitnodes/bitnodespro/blob/master/src/txmempool.cpp): `src/txmempool.cpp`
- [Chain validation](https://github.com/bitnodes/bitnodespro/blob/master/src/main.cpp): `src/main.cpp`

### Wallet and services

- [Masternode management](https://github.com/bitnodes/bitnodespro/blob/master/src/masternodeman.h): `src/masternodeman.h`
- [Wallet operations](https://github.com/bitnodes/bitnodespro/blob/master/src/wallet.cpp): `src/wallet.cpp`
- [Keys and keystore](https://github.com/bitnodes/bitnodespro/blob/master/src/keystore.cpp): `src/keystore.cpp`

### Persistence

- [Spendable coin state](https://github.com/bitnodes/bitnodespro/blob/master/src/coins.cpp): `src/coins.cpp`
- [Chain database](https://github.com/bitnodes/bitnodespro/blob/master/src/txdb.cpp): `src/txdb.cpp`
- [LevelDB engine](https://github.com/bitnodes/bitnodespro/blob/master/src/leveldb/db/db_impl.cc): `src/leveldb/db/db_impl.cc`

### Other components

- **User**
- **RPC clients**
- **Peer nodes**

## Connections

- User → Qt wallet: uses
- RPC clients → RPC server: requests
- Peer nodes → P2P transport: exchange messages
- Qt wallet → Client model: displays status
- Client model → P2P transport: reads peer status (evidence: `src/qt/clientmodel.cpp`)
- Client model → Chain validation: reads chain status (evidence: `src/qt/clientmodel.cpp`)
- RPC server → RPC methods: dispatches
- P2P transport → Chain validation: delivers blocks
- Chain validation → Masternode management: uses services (evidence: `src/main.cpp`)
- Chain validation → Transaction model: validates
- Chain validation → Block model: processes
- Chain validation → Script engine: checks scripts
- Chain validation → Transaction pool: adds transactions (evidence: `src/main.cpp`)
- Chain validation → Spendable coin state: updates state (evidence: `src/main.cpp`)
- Chain validation → Chain database: initializes database (evidence: `src/main.cpp`)
- Chain database → LevelDB engine: stores records
- Chain validation → Network parameters: uses parameters (evidence: `src/main.cpp`)
- Wallet operations → Keys and keystore: uses keys
- RPC methods → Wallet operations: serves wallet calls
- Qt wallet → Wallet operations: wallet actions
