Skip to content

I have implemented core blockchain concepts like distributed ledger structure, cryptographic hashing, consensus mechanisms through proof-of-work, transaction processing, mining with rewards, and blockchain validation.

License

Notifications You must be signed in to change notification settings

dhruvv1402/Blockchain-JAVA

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Blockchain-Java

🚀 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!

🔥 Features

  • 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)

🛠️ Installation & Setup

Prerequisites

  • Java JDK 11+
  • Maven (Optional for dependency management)

Steps

  1. Clone the Repository

    git clone https://github.com/dhruvv1402/Blockchain-JAVA.git
    cd Blockchain-JAVA
  2. Compile & Run the Project

    javac src/*.java
    java src.Blockchain

📡 How It Works

🏗️ Creating the 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

⛏️ Proof of Work (PoW)

To add a new block, the miner must solve a cryptographic puzzle (finding a nonce that makes the hash meet a difficulty target).

🔄 Adding Transactions

Users can create transactions, which are stored in a pending transactions list until they are mined into a new block.

📂 Project Structure

Blockchain-JAVA/
│-- src/
│   │-- Blockchain.java   # Main blockchain logic
│   │-- Block.java        # Block structure
│   │-- Transaction.java  # Transaction handling
│-- README.md             # Documentation

🤝 Contributing

Want to improve this project? Follow these steps:

  1. Fork the repository
  2. Create a new branch (git checkout -b feature-branch)
  3. Commit your changes (git commit -m 'Add new feature')
  4. Push to your branch (git push origin feature-branch)
  5. Open a Pull Request 🚀

📜 License

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! 🔗🔥

About

I have implemented core blockchain concepts like distributed ledger structure, cryptographic hashing, consensus mechanisms through proof-of-work, transaction processing, mining with rewards, and blockchain validation.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages