This Rust Blockchain Simulator serves as a platform to consolidate my Rust programming skills and to understand blockchain fundamentals. The project is structured in such a way that it can evolve; as I learn more advanced Rust features, I can integrate them to expand the blockchain's capabilities.
So far, the project simulates a simple blockchain that:
- Handles basic transactions between a sender and a receiver with a specified amount.
- Stores these transactions in blocks.
- Implements a basic proof-of-work (PoW) system to secure block creation using hashing.
- Allows dynamic addition of blocks to the blockchain during runtime through user input.
- Transaction: Represents a transfer of cryptocurrency from a sender to a receiver.
- Block: Contains a list of transactions, a reference to the previous block's hash, and its own hash calculated via SHA-256.
- Blockchain: Manages a sequence of blocks and ensures integrity through cryptographic hashes.
- Users can input transaction details including sender, receiver, and amount.
- Each transaction is placed into a new block.
- A proof-of-work algorithm secures each block before adding it to the blockchain.
- Users can interactively add more transactions and observe the blockchain's growth.
- Hashing and PoW Enhancement: Improve the hashing mechanism to include additional block attributes like timestamps and transaction counts.
- Security Features: Integrate digital signatures to authenticate transaction origins.
- Network Capabilities: Simulate a peer-to-peer network to manage the blockchain across multiple nodes.
- Persistence: Implement mechanisms to save and load the blockchain's state from disk.
- User Interface: Develop a more sophisticated interface for easier interaction with the blockchain.
Ensure you have Rust installed and configured. Clone the repository, navigate to the project directory, and run:
cargo run