# julicraft44/lucycoinv2 architecture

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

- Interactive diagram: https://gitdiagram.com/julicraft44/lucycoinv2
- Repository: https://github.com/julicraft44/lucycoinv2

## Overview

Lucycoin is a Litecoin-derived cryptocurrency node and wallet, using scrypt proof of work with five-minute block targets and a 210,000-block subsidy halving. Its core workflow is to accept and validate transactions and blocks, maintain chain state, and communicate with peers; users can also interact through the Qt wallet and RPC interfaces. The graph reflects the sampled core references and README capabilities; several subsystem links are omitted or dashed where their runtime wiring was not shown.

Main entry points: [`src/main.cpp`](https://github.com/julicraft44/lucycoinv2/blob/main/src/main.cpp) (Chain and Mempool), [`src/qt/bitcoingui.cpp`](https://github.com/julicraft44/lucycoinv2/blob/main/src/qt/bitcoingui.cpp) (Wallet GUI), [`src/qt/walletmodel.cpp`](https://github.com/julicraft44/lucycoinv2/blob/main/src/qt/walletmodel.cpp) (Wallet Model), [`src/bitcoinrpc.cpp`](https://github.com/julicraft44/lucycoinv2/blob/main/src/bitcoinrpc.cpp) (RPC Server)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_core["Chain Core"]
  node_init["Node Startup<br/>[init.cpp]"]
  node_chain["Chain and Mempool<br/>[main.cpp]"]
  node_script["Script Validation<br/>[script.cpp]"]
  node_pow["Scrypt Proof of Work<br/>[scrypt.cpp]"]
  node_json["JSON Codec"]
end

subgraph group_network["Peer Network"]
  node_networking["Peer Networking<br/>[net.cpp]"]
  node_protocol["Wire Protocol<br/>[protocol.cpp]"]
end

subgraph group_wallet["Wallet Interfaces"]
  node_qt["Qt Application<br/>[bitcoin.cpp]"]
  node_gui["Wallet GUI<br/>[bitcoingui.cpp]"]
  node_clientmodel["Client Model<br/>[clientmodel.cpp]"]
  node_walletmodel["Wallet Model<br/>[walletmodel.cpp]"]
  node_send["Send Coins"]
  node_walletcore["Wallet Core<br/>[wallet.cpp]"]
  node_rpc["RPC Server<br/>[bitcoinrpc.cpp]"]
  node_rpcwallet["Wallet RPC<br/>[rpcwallet.cpp]"]
end

subgraph group_storage["Persistence"]
  node_blockdb[("Block Database<br/>[txdb.cpp]")]
  node_walletdb[("Wallet Database<br/>[walletdb.cpp]")]
  node_leveldb[("LevelDB Engine")]
end

node_user(("User"))

node_user -.->|"launches"| node_qt
node_user -.->|"requests RPC"| node_rpc
node_qt -.->|"starts UI"| node_gui
node_gui -.->|"displays status"| node_clientmodel
node_gui -.->|"uses wallet model"| node_walletmodel
node_walletmodel -.->|"supports sending"| node_send
node_walletmodel -.->|"delegates wallet actions"| node_walletcore
node_rpc -.->|"dispatches wallet calls"| node_rpcwallet
node_init -.->|"initializes"| node_chain
node_chain -.->|"validates scripts"| node_script
node_chain -.->|"checks proof of work"| node_pow
node_networking -.->|"exchanges messages"| node_protocol
node_chain -->|"uses peer state"| node_networking
node_chain -->|"uses block database"| node_blockdb
node_init -.->|"loads wallet"| node_walletcore
node_blockdb -.->|"stores chain data"| node_leveldb
node_walletdb -.->|"stores wallet data"| node_leveldb
node_rpc -.->|"uses JSON"| node_json

click node_qt "https://github.com/julicraft44/lucycoinv2/blob/main/src/qt/bitcoin.cpp"
click node_gui "https://github.com/julicraft44/lucycoinv2/blob/main/src/qt/bitcoingui.cpp"
click node_clientmodel "https://github.com/julicraft44/lucycoinv2/blob/main/src/qt/clientmodel.cpp"
click node_walletmodel "https://github.com/julicraft44/lucycoinv2/blob/main/src/qt/walletmodel.cpp"
click node_send "https://github.com/julicraft44/lucycoinv2/blob/main/src/qt/sendcoinsdialog.cpp"
click node_walletcore "https://github.com/julicraft44/lucycoinv2/blob/main/src/wallet.cpp"
click node_rpc "https://github.com/julicraft44/lucycoinv2/blob/main/src/bitcoinrpc.cpp"
click node_rpcwallet "https://github.com/julicraft44/lucycoinv2/blob/main/src/rpcwallet.cpp"
click node_init "https://github.com/julicraft44/lucycoinv2/blob/main/src/init.cpp"
click node_chain "https://github.com/julicraft44/lucycoinv2/blob/main/src/main.cpp"
click node_script "https://github.com/julicraft44/lucycoinv2/blob/main/src/script.cpp"
click node_pow "https://github.com/julicraft44/lucycoinv2/blob/main/src/scrypt.cpp"
click node_networking "https://github.com/julicraft44/lucycoinv2/blob/main/src/net.cpp"
click node_protocol "https://github.com/julicraft44/lucycoinv2/blob/main/src/protocol.cpp"
click node_blockdb "https://github.com/julicraft44/lucycoinv2/blob/main/src/txdb.cpp"
click node_walletdb "https://github.com/julicraft44/lucycoinv2/blob/main/src/walletdb.cpp"
click node_leveldb "https://github.com/julicraft44/lucycoinv2/tree/main/src/leveldb"
click node_json "https://github.com/julicraft44/lucycoinv2/blob/main/src/json/json_spirit_reader_template.h"

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_init,node_chain,node_script,node_pow,node_json,node_user toneBlue
class node_networking,node_protocol toneAmber
class node_qt,node_gui,node_clientmodel,node_walletmodel,node_send,node_walletcore,node_rpc,node_rpcwallet toneMint
class node_blockdb,node_walletdb,node_leveldb toneRose
```

## Components

### Chain Core

- [Node Startup](https://github.com/julicraft44/lucycoinv2/blob/main/src/init.cpp): `src/init.cpp`
- [Chain and Mempool](https://github.com/julicraft44/lucycoinv2/blob/main/src/main.cpp): `src/main.cpp`
- [Script Validation](https://github.com/julicraft44/lucycoinv2/blob/main/src/script.cpp): `src/script.cpp`
- [Scrypt Proof of Work](https://github.com/julicraft44/lucycoinv2/blob/main/src/scrypt.cpp): `src/scrypt.cpp`
- [JSON Codec](https://github.com/julicraft44/lucycoinv2/blob/main/src/json/json_spirit_reader_template.h): `src/json/json_spirit_reader_template.h`

### Peer Network

- [Peer Networking](https://github.com/julicraft44/lucycoinv2/blob/main/src/net.cpp): `src/net.cpp`
- [Wire Protocol](https://github.com/julicraft44/lucycoinv2/blob/main/src/protocol.cpp): `src/protocol.cpp`

### Wallet Interfaces

- [Qt Application](https://github.com/julicraft44/lucycoinv2/blob/main/src/qt/bitcoin.cpp): `src/qt/bitcoin.cpp`
- [Wallet GUI](https://github.com/julicraft44/lucycoinv2/blob/main/src/qt/bitcoingui.cpp): `src/qt/bitcoingui.cpp`
- [Client Model](https://github.com/julicraft44/lucycoinv2/blob/main/src/qt/clientmodel.cpp): `src/qt/clientmodel.cpp`
- [Wallet Model](https://github.com/julicraft44/lucycoinv2/blob/main/src/qt/walletmodel.cpp): `src/qt/walletmodel.cpp`
- [Send Coins](https://github.com/julicraft44/lucycoinv2/blob/main/src/qt/sendcoinsdialog.cpp): `src/qt/sendcoinsdialog.cpp`
- [Wallet Core](https://github.com/julicraft44/lucycoinv2/blob/main/src/wallet.cpp): `src/wallet.cpp`
- [RPC Server](https://github.com/julicraft44/lucycoinv2/blob/main/src/bitcoinrpc.cpp): `src/bitcoinrpc.cpp`
- [Wallet RPC](https://github.com/julicraft44/lucycoinv2/blob/main/src/rpcwallet.cpp): `src/rpcwallet.cpp`

### Persistence

- [Block Database](https://github.com/julicraft44/lucycoinv2/blob/main/src/txdb.cpp): `src/txdb.cpp`
- [Wallet Database](https://github.com/julicraft44/lucycoinv2/blob/main/src/walletdb.cpp): `src/walletdb.cpp`
- [LevelDB Engine](https://github.com/julicraft44/lucycoinv2/tree/main/src/leveldb): `src/leveldb`

### Other components

- **User**

## Connections

- User → Qt Application: launches
- User → RPC Server: requests RPC
- Qt Application → Wallet GUI: starts UI
- Wallet GUI → Client Model: displays status
- Wallet GUI → Wallet Model: uses wallet model
- Wallet Model → Send Coins: supports sending
- Wallet Model → Wallet Core: delegates wallet actions
- RPC Server → Wallet RPC: dispatches wallet calls
- Node Startup → Chain and Mempool: initializes
- Chain and Mempool → Script Validation: validates scripts
- Chain and Mempool → Scrypt Proof of Work: checks proof of work
- Peer Networking → Wire Protocol: exchanges messages
- Chain and Mempool → Peer Networking: uses peer state (evidence: `src/main.cpp`)
- Chain and Mempool → Block Database: uses block database (evidence: `src/main.cpp`)
- Node Startup → Wallet Core: loads wallet
- Block Database → LevelDB Engine: stores chain data
- Wallet Database → LevelDB Engine: stores wallet data
- RPC Server → JSON Codec: uses JSON
