This project, Garden of Eden, is a blockchain simulation built in Java that showcases a secure transaction system using ECDSA for digital signatures and SHA-256 for hashing. The project integrates MongoDB for storing blockchain data and demonstrates the core functionalities of blockchain technology, such as transaction creation, validation, mining, and decentralized ledger maintenance.
- Overview
- Features
- Technology Stack
- Getting Started
- Usage
- Project Structure
- Contributing
- License
- Contact
The Garden of Eden project is a Java-based blockchain simulation that implements core blockchain functionalities, including secure transactions, wallet management, and block mining. This project aims to provide an educational tool for understanding how blockchain works, with a focus on cryptographic security, decentralized transaction management, and data integrity.
- Secure Transaction System: Utilizes ECDSA for digital signatures and SHA-256 for hashing, ensuring data integrity and authenticity in blockchain transactions.
- Wallet Functionality: Implements public/private key pairs for users to securely send and receive funds while maintaining a decentralized ledger of transactions.
- Decentralized Ledger: Manages a blockchain ledger that validates, mines, and stores blocks in a distributed fashion.
- Integration with MongoDB: Efficiently stores and manages transaction data, blocks, and other blockchain-related information using MongoDB.
- Block Mining and Validation: Implements Proof-of-Work (PoW) consensus mechanism for mining new blocks and validating transactions.
- Java: Core programming language for implementing blockchain logic and features.
- MongoDB: NoSQL database for storing blockchain data.
- BouncyCastle: Cryptographic library for ECDSA digital signatures.
- SHA-256: Secure Hash Algorithm for hashing data.
- Maven: Build automation tool for managing dependencies and project build lifecycle.
To run this project, you'll need to have the following installed:
- Java 21 or later
- Maven 3.6.0 or later
- MongoDB (local or cloud-based instance)
- Git for version control
-
Clone the Repository
git clone https://github.com/v5run/eden.git cd eden/ -
Set Up MongoDB Make sure you have a running instance of MongoDB. If using MongoDB Atlas, create a cluster and get the connection URI.
-
Configure MongoDB Connection
Update the MongoDB connection URI in GardenOfEden.java: (Feel Free to use your own User/Pass or eden:garden777)
public static String uri = "mongodb+srv://<username>:<password>@<cluster-url>/";- Build the Project with Maven
mvn clean package- Run the Application
java -jar target/eden-1.0.jarOnce the application is running, it will simulate the creation of wallets, transactions, and blocks within a blockchain network. The following functionalities are demonstrated:
- Creating Wallets: Two wallets (A and B) are created and initialized with a balance.
- Sending Funds: Wallets can send funds to each other securely, with transactions being added to new blocks.
- Mining Blocks: New blocks are mined using a Proof-of-Work algorithm and added to the blockchain.
- Viewing Blockchain Integrity: The system checks and displays the integrity and validity of the entire blockchain.
The project is structured as follows:
/src/main/java/garden/
|-- Block.java
|-- GardenOfEden.java
|-- Transaction.java
|-- Wallet.java
|-- TransactionInput.java
|-- TransactionOutput.java
|-- ...- Block.java: Represents a block in the blockchain.
- GardenOfEden.java: Main class to run the blockchain simulation.
- Transaction.java: Represents a transaction with inputs and outputs.
- Wallet.java: Handles wallet functionalities, such as sending and receiving funds.
- TransactionInput.java and TransactionOutput.java: Handle transaction details and outputs.
Contributions are welcome! Please follow these steps:
- Fork the repository.
- Create a feature branch: git checkout -b feature/new-feature.
- Commit your changes: git commit -m 'Add new feature'.
- Push to the branch: git push origin feature/new-feature.
- Open a Pull Request.
This project is licensed under the MIT License. See the LICENSE file for more details.
Varun Pathak - @LinkedIn - [email protected]