This repository contains a simple yet illustrative implementation of a blockchain, designed for educational purposes. The project demonstrates core blockchain concepts such as proof-of-work, block structure, and chain validation, providing a foundation for understanding how decentralized ledgers operate.
The blockchain is composed of a sequence of blocks, each containing data or transactions. These blocks are cryptographically linked, with each block referencing the hash of the previous one. The proof-of-work algorithm requires miners to solve computational puzzles to add new blocks, thereby securing the chain against tampering. Chain validation mechanisms ensure the integrity and consistency of the entire blockchain.
- Proof-of-Work: Implements a mining process that requires computational effort to add new blocks, simulating real-world blockchain mining.
- Chain Validation: Verifies the integrity of the blockchain by checking the hashes and structure of each block.
- Local-Only Blockchain: Note: This implementation runs entirely on a single local instance. As such, it is insecure and can be easily manipulated by anyone with access to the program. There is no mechanism to prevent tampering or to reach consensus across multiple participants.
- Security Consideration: To build a truly secure and tamper-resistant blockchain, you must implement a peer-to-peer (P2P) network. This allows nodes to share chain data and broadcast new blocks, enabling consensus and resistance to manipulation. This project does not include P2P networking.
# Clone the repository from GitHub
git clone https://github.com/RedMads/Blockchain.git
# Navigate into the project directory
cd Blockchain/
# Build the main executable using the provided Makefile
make main
# Run the blockchain program
make runmFor questions or contributions, please open an issue or submit a pull request.
