A basic Python implementation of a blockchain that includes block creation, hashing, proof-of-work, and chain validation.
- Add transactions and mine blocks
- SHA-256 hashing for security
- Detect tampering with chain validation
- Python 3.x
- Clone the repository:
git clone https://github.com/CodeTitan7/simple-blockchain.git cd simple-blockchain - Run the script:
python blockchain.py
- The genesis block is created automatically.
- Transactions are added and new blocks are mined.
- The blockchain is displayed and validated.
- The
is_valid_chainmethod ensures integrity. - If tampering occurs, validation flags inconsistencies.