Skip to content

dudedani/gochain-lite

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gochain-lite

A minimal Bitcoin-style blockchain implemented in Go. Built to understand distributed consensus from the ground up — not as a tutorial walkthrough, but as a working implementation with real architectural decisions.

What it implements

  • Proof-of-Work mining with configurable difficulty
  • UTXO transaction model — unspent output tracking, not account balances
  • Mempool — pending transaction pool before block inclusion
  • Wallet — key generation, signing, address derivation
  • Simple P2P sync — basic peer discovery and chain propagation
  • JSON-RPC / CLI — interact with the node programmatically

Architecture

Clean Architecture with domain-driven design: domain logic is isolated from infrastructure concerns. Each layer (domain, application, infrastructure, interface) has a clear boundary so the core blockchain rules don't leak into HTTP handlers or storage code.

/domain         — Block, Transaction, Chain, UTXO core logic
/application    — Mining, wallet, mempool use cases  
/infrastructure — Storage, P2P networking
/interface      — JSON-RPC server, CLI

Why UTXO

Most tutorial blockchains use account balances (like Ethereum). UTXO is harder — you track individual unspent outputs, not totals — but it's how Bitcoin actually works. Double-spend prevention, transaction validity, and chain validation all work differently under UTXO.

Running it

git clone https://github.com/dudedani/gochain-lite
cd gochain-lite
go build ./...
./gochain-lite node start
./gochain-lite wallet new
./gochain-lite tx send --from <addr> --to <addr> --amount 10

Stack

Go · Clean Architecture · UTXO model · SHA-256 PoW · JSON-RPC

About

A minimal Bitcoin-style blockchain + wallet in Go with PoW, UTXO transactions, a mempool, simple P2P sync, and a tiny JSON-RPC/CLI.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors