🚀 A Java-based blockchain implementation that demonstrates the fundamentals of blockchain technology, including block creation, proof-of-work, and transaction handling. Ideal for learning how blockchain works under the hood!
- Custom Blockchain Implementation 🏗️
- Proof-of-Work (PoW) Algorithm ⛏️
- SHA-256 Cryptographic Hashing 🔑
- Transaction Handling & Validation 💰
- Block Mining & Chain Verification 🔍
- Decentralization Concepts 🌍 (Basic P2P networking support planned)
- Java JDK 11+
- Maven (Optional for dependency management)
-
Clone the Repository
git clone https://github.com/dhruvv1402/Blockchain-JAVA.git cd Blockchain-JAVA -
Compile & Run the Project
javac src/*.java java src.Blockchain
Each block contains:
- Index: Block position in the chain
- Timestamp: Time of creation
- Transaction Data: List of transactions
- Previous Hash: Hash of the previous block
- Nonce: Proof-of-work value
- Current Hash: Unique identifier for the block
To add a new block, the miner must solve a cryptographic puzzle (finding a nonce that makes the hash meet a difficulty target).
Users can create transactions, which are stored in a pending transactions list until they are mined into a new block.
Blockchain-JAVA/
│-- src/
│ │-- Blockchain.java # Main blockchain logic
│ │-- Block.java # Block structure
│ │-- Transaction.java # Transaction handling
│-- README.md # Documentation
Want to improve this project? Follow these steps:
- Fork the repository
- Create a new branch (
git checkout -b feature-branch) - Commit your changes (
git commit -m 'Add new feature') - Push to your branch (
git push origin feature-branch) - Open a Pull Request 🚀
This project is licensed under the MIT License.
💡 Fun Fact: Did you know the first blockchain, Bitcoin, was created in 2009 by an anonymous person (or group) named Satoshi Nakamoto? 🤯
🚀 Happy coding and blockchain building! 🔗🔥