This project simulates a simplified blockchain system using Python and Streamlit. It includes the main components of a blockchain: users with wallets, transactions, UTXO handling, mining with Proof of Work (PoW), block creation, and an interactive interface.
- Each user has a private/public key pair (ECDSA over
secp256k1). - The address is generated as the SHA-256 hash of the public key.
- UTXO-based model to track balances and transfers.
- Digital signatures to authorize transactions.
- Support for mining fees.
- Each block contains valid transactions, the previous hash, timestamp, and nonce.
- The genesis block delivers 1000 coins to the first user.
- Simplified proof of work: the hash must start with a certain number of zeros.
- Block rewards + fees are granted to the miner through a coinbase transaction.
- Create a new system or load an existing one
- View system summary
- Create new wallets
- Send transactions
- Mine blocks
- Visualize the blockchain
- View user balances
- Save the system
README.md
βββ src
βββ Block.py # Block definition and hashing
βββ BlockchainSimulation.py # Streamlit interface logic
βββ System.py # System controller (users, transactions, mining)
βββ Transaction.py # Transaction logic, signatures, and validation
βββ UTXO.py # Unspent Transaction Output (UTXO) model
βββ User.py # Wallet and key management
- Python 3.11
- Streamlit
- ECDSA (Elliptic Curve Cryptography)
- SHA-256 hashing
- Pandas (for data visualization)