OxideChain is a lightweight, experimental blockchain implementation written in Rust. Designed for educational purposes, it explores the fundamental concepts of distributed ledger technology, including peer-to-peer networking, Proof-of-Work (PoW) consensus, and UTXO-based transaction models.
- Proof of Work Mining: Implements a naive PoW algorithm to secure the network.
- UTXO Transaction Model: Secure transaction handling with input/output validation.
- P2P Networking: Decentralized communication between nodes.
- Wallet Management: Create wallets, generate addresses, and manage keys.
- Persistent Storage: Uses
sled(and SQLite) for persistent block storage. - Merkle Tree: Efficient data verification using Merkle roots.
- CLI Interface: Easy-to-use command line tools for interaction.
The project is modularized for clarity:
block: Core block structure and validation.blockchain: Chain management and storage logic.transaction: Transaction creation and signing.wallet: Key pair generation and address management.p2p: Networking layer for node communication.
- Rust & Cargo installed.
Clone the repository:
git clone https://github.com/Alkamal01/oxide-chain.git
cd oxide-chainBuild the project:
cargo build --release1. Create a Wallet Generate a new wallet to receive rewards.
cargo run createwallet
# Output: address 3JGDNu6Pnuench1hoXyibBemfYjGT8RHRS2. Initialize the Blockchain Create the genesis block and award the initial supply to your address.
cargo run create <YOUR_ADDRESS>3. Run a Node / Mine Start the node and beginning mining blocks (check CLI for specific mining commands if separate).
cargo run startnode4. transact Send coins to another address.
cargo run send <FROM_ADDRESS> <TO_ADDRESS> <AMOUNT>5. Inspect Chain Print the current state of the blockchain.
cargo run printchainContributions are welcome! This is an educational project, so feel free to open issues or PRs to improve code quality or add new features (e.g., a better consensus algorithm, smarter mempool).
This project is open-source and available under the MIT License.