How hylmithecoder/learnblockchainwithcuda works
This educational CUDA project demonstrates a blockchain workflow and a separate miner↔pool simulation. In the standalone demo, the user runs a benchmark and chain/tamper walkthrough using the hashing, blockchain, and GPU-mining components. In the pool workflow, a miner connects over TCP, authorizes, receives work, mines on the GPU, and submits shares; the pool verifies shares and may advance its chain when a share meets the harder block target. The README documents these capabilities; the sampled source does not include the application implementations, so links involving their internal calls rely on that documentation.
Main entry points: pool.cu Pool Server · main.cu Blockchain Demo · miner.cu Miner Client · sha256.cu SHA-256
Components 11
Blockchain Core
- SHA-256
src/sha256.cu - Block / Chain
src/blockchain.cu - CPU Mining
src/blockchain.cu
GPU Mining
- GPU Miner
src/gpu_miner.cu - CUDA Kernels
src/gpu_miner.cu
Pool Simulation
- Miner Client
src/miner.cu - Pool Server
src/pool.cu - TCP / Line Protocol
include/net.h - Pool Share / Block State
src/pool.cu
Standalone Demo
- Blockchain Demo
src/main.cu
Other components
- User
Connections 18
- User → Blockchain Demo: runs demo
- Blockchain Demo → SHA-256: checks hashing
- Blockchain Demo → Block / Chain: demonstrates chain
- Blockchain Demo → CPU Mining: benchmarks CPU
- Blockchain Demo → GPU Miner: benchmarks GPU
- CPU Mining → SHA-256: hashes candidates
- Block / Chain → SHA-256: hashes blocks
- User → Pool Server: starts pool
- User → Miner Client: starts miner
- Miner Client → TCP / Line Protocol: connects / exchanges
- Pool Server → TCP / Line Protocol: listens / exchanges
- Miner Client → Pool Server: submits shares
- Pool Server → Miner Client: sends jobs
- Miner Client → GPU Miner: mines job
- GPU Miner → CUDA Kernels: launches kernels
- Pool Server → Pool Share / Block State: verifies shares
- Pool Server → SHA-256: checks proof
- Pool Server → Block / Chain: advances on block