Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

Simple Blockchain

A minimal but complete blockchain implementation in Python with CLI and optional REST API.

Features

  • SHA-256 hashing
  • Proof-of-Work mining
  • Transaction pool
  • Chain validation
  • Optional Flask REST API

Usage

CLI Mode (no dependencies)

python blockchain.py cli

Available commands: add <sender> <recipient> <amount>, mine, chain, validate, quit

Server Mode

pip install -r requirements.txt
python blockchain.py server

Endpoints: GET /chain, POST /transactions/new, GET /mine, GET /validate

How It Works

  1. Transactions are submitted to a pending pool
  2. Mining bundles pending transactions into a new block
  3. Proof-of-Work requires the block hash to start with 0000
  4. Each block references the previous block's hash, forming an immutable chain

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages