# boli-project/bolivarcoin architecture

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

- Interactive diagram: https://gitdiagram.com/boli-project/bolivarcoin
- Repository: https://github.com/boli-project/bolivarcoin

## Overview

##### Main Components

a) Core Network Layer:
- P2P Network (Port 3893)
- RPC Interface (Port 3563)
- ZMQ Notification System

b) Consensus Layer:
- X11 Mining Algorithm
- Block Processing
- Transaction Validation
- Masternode System

c) Wallet Layer:
- Key Management
- Transaction Creation
- Wallet Database
- User Interface (Qt-based)

d) Data Storage:
- Blockchain Storage
- UTXO Set
- Wallet Data
- Masternode List

##### Component Relationships

**[User Interface Layer]**
- ↕
**[Wallet Layer] ←→ [Core Network Layer]**
- ↕               ↕
**[Data Storage] ←→ [Consensus Layer]**

##### Specific Implementation Details

Specialized components:
- PrivateSend functionality
- InstantSend feature
- Masternode management
- Governance system
- Budget system

##### External Interfaces

Connections to:
- Mining pools (X11 algorithm)
- Block explorers
- Masternode operators
- Regular nodes

##### Data Flow Indicators

- Block propagation
- Transaction broadcasting
- Masternode communications
- Consensus messaging
- Wallet synchronization

##### Technical Specifications

Parameters:
- Block time: 180 seconds
- Maximum supply: 25,000,000 BOLI
- Block reward distribution
- Port numbers

##### Security Boundaries

Highlight:
- Cryptographic boundaries
- Network security zones
- Trusted computing base
- Key storage areas

##### Storage Layer (Blockchain, UTXO)

Use standardized symbols:
- Processes: Rectangles
- External entities: Clouds

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph UI["User Interface Layer"]
        QtGUI["Qt GUI Interface"]:::ui
    end

    subgraph WL["Wallet Layer"]
        WalletCore["Wallet Core"]:::wallet
        KeyMgmt["Key Management"]:::security
        WalletDB["Wallet Database"]:::storage
    end

    subgraph NL["Network Layer"]
        P2P["P2P Network\n(Port 3893)"]:::network
        RPC["RPC Interface\n(Port 3563)"]:::network
        ZMQ["ZMQ Notifications"]:::network
    end

    subgraph CL["Consensus Layer"]
        Mining["X11 Mining"]:::consensus
        BlockVal["Block Processing\n& Validation"]:::consensus
        TxVal["Transaction\nValidation"]:::consensus
        MN["Masternode\nSystem"]:::consensus
    end

    subgraph SF["Special Features"]
        PS["PrivateSend"]:::feature
        IS["InstantSend"]:::feature
        GOV["Governance"]:::feature
    end

    subgraph DS["Data Storage Layer"]
        BC["Blockchain\nStorage"]:::storage
        UTXO["UTXO Set"]:::storage
        MNList["Masternode List"]:::storage
    end

    subgraph EX["External Interfaces"]
        MP["Mining Pools"]:::external
        BE["Block Explorers"]:::external
        MO["Masternode\nOperators"]:::external
        RN["Regular Nodes"]:::external
    end

    %% Connections
    QtGUI <--> WalletCore
    WalletCore <--> KeyMgmt
    WalletCore <--> WalletDB
    WalletCore <--> P2P
    P2P <--> RPC
    P2P <--> ZMQ
    P2P <--> BlockVal
    BlockVal <--> Mining
    BlockVal <--> TxVal
    BlockVal <--> MN
    MN <--> MNList
    BlockVal <--> BC
    TxVal <--> UTXO
    P2P <--> PS
    P2P <--> IS
    MN <--> GOV
    P2P <--> MP
    P2P <--> BE
    P2P <--> MO
    P2P <--> RN

    %% Click events
    click QtGUI "https://github.com/BOLI-Project/BolivarCoin/tree/master/src/qt/"
    click P2P "https://github.com/BOLI-Project/BolivarCoin/blob/master/src/net.cpp"
    click RPC "https://github.com/BOLI-Project/BolivarCoin/tree/master/src/rpc/"
    click ZMQ "https://github.com/BOLI-Project/BolivarCoin/tree/master/src/zmq/"
    click BlockVal "https://github.com/BOLI-Project/BolivarCoin/blob/master/src/validation.cpp"
    click Mining "https://github.com/BOLI-Project/BolivarCoin/blob/master/src/pow.cpp"
    click MN "https://github.com/BOLI-Project/BolivarCoin/blob/master/src/masternode.cpp"
    click TxVal "https://github.com/BOLI-Project/BolivarCoin/blob/master/src/txmempool.cpp"
    click WalletCore "https://github.com/BOLI-Project/BolivarCoin/blob/master/src/wallet/wallet.cpp"
    click KeyMgmt "https://github.com/BOLI-Project/BolivarCoin/blob/master/src/wallet/crypter.cpp"
    click WalletDB "https://github.com/BOLI-Project/BolivarCoin/blob/master/src/wallet/walletdb.cpp"
    click BC "https://github.com/BOLI-Project/BolivarCoin/blob/master/src/txdb.cpp"
    click UTXO "https://github.com/BOLI-Project/BolivarCoin/blob/master/src/coins.cpp"
    click MNList "https://github.com/BOLI-Project/BolivarCoin/blob/master/src/masternodeman.cpp"
    click PS "https://github.com/BOLI-Project/BolivarCoin/blob/master/src/privatesend.cpp"
    click IS "https://github.com/BOLI-Project/BolivarCoin/blob/master/src/instantx.cpp"
    click GOV "https://github.com/BOLI-Project/BolivarCoin/blob/master/src/governance.cpp"

    %% Styling
    classDef ui fill:#2196F3,stroke:#000,stroke-width:2px
    classDef wallet fill:#1976D2,stroke:#000,stroke-width:2px
    classDef security fill:#F44336,stroke:#000,stroke-width:2px
    classDef network fill:#4CAF50,stroke:#000,stroke-width:2px
    classDef consensus fill:#FFC107,stroke:#000,stroke-width:2px
    classDef storage fill:#9C27B0,stroke:#000,stroke-width:2px
    classDef feature fill:#FF9800,stroke:#000,stroke-width:2px
    classDef external fill:#78909C,stroke:#000,stroke-width:2px
```
