https://github.com/v0id-user/coin
A minimal blockchain implementation exploring how Bitcoin and proof-of-work systems function.
https://github.com/v0id-user/coin
bitcoin block blockchain coin crypto network
Last synced: about 1 month ago
JSON representation
A minimal blockchain implementation exploring how Bitcoin and proof-of-work systems function.
- Host: GitHub
- URL: https://github.com/v0id-user/coin
- Owner: v0id-user
- License: isc
- Created: 2025-10-20T08:13:10.000Z (8 months ago)
- Default Branch: master
- Last Pushed: 2025-10-20T10:09:32.000Z (8 months ago)
- Last Synced: 2025-10-20T10:27:30.661Z (8 months ago)
- Topics: bitcoin, block, blockchain, coin, crypto, network
- Language: Python
- Homepage:
- Size: 15.6 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: License
Awesome Lists containing this project
README
# Coin
A minimal blockchain implementation exploring how Bitcoin and proof-of-work systems function.
**Demo video:**

## Overview
This project demonstrates the core concepts of blockchain technology:
- Proof of Work (PoW) mining
- Block validation
- Chain consensus
- Client-server architecture
## Requirements
Pure Python 3 - no external dependencies required. Uses only the standard library.
We use `uv` for package management, but you can run it directly with `python3` if preferred.
## Usage
**Start the server:**
```bash
python main.py server
```
**Mine and submit a block (in another terminal):**
```bash
python main.py client "Your transaction data here"
```
## How it Works
1. Server maintains a blockchain stored as a JSON list
2. Clients fetch the last block hash
3. Clients mine new blocks using SHA256 with configurable difficulty
4. Server validates:
- Hash correctness (SHA256 of prev_hash + timestamp + data + nonce)
- Difficulty requirement (leading zeros)
- Chain continuity (prev_hash matches last block)
5. Valid blocks are appended to the chain
## Files
- `main.py` - Entry point (server/client modes)
- `server.py` - HTTP server with validation endpoints
- `client.py` - Mining client
- `pow.py` - Proof of Work algorithm + validation
- `schema.py` - Block data structure
- `db.py` - Simple key-value storage
## License
ISC