BlackEye is a basic blockchain implementation in Python, built from scratch for educational and experimental purposes. It includes essential blockchain components such as the genesis block, mining algorithm, proof-of-work, public/private key cryptography for client wallets, and basic transaction handling.
- Genesis block creation
- SHA-256-based Proof-of-Work mining
- Blockchain validation
- Simple wallet generation using public/private keys (ECDSA)
- Basic peer-to-peer transaction model
- Block addition through mining
Make sure you have Python 3.8+ installed. Follow these steps to set up the environment and run the project:
git clone https://github.com/yourusername/blackeye.git
cd blackeyepython -m venv venv# On Windows:
venv\Scripts\activate
# On macOS/Linux:
source venv/bin/activatepip install -r requirements.txtEach user/client has a public/private key pair generated using ECDSA. The public key acts as the wallet address, and the private key is used to sign transactions securely.
The blockchain starts with a genesis block, the first block in the chain. It is hardcoded and acts as the foundation for all subsequent blocks.
Each block requires a computational puzzle to be solved before it's added to the blockchain (Proof of Work). The difficulty level determines how complex this puzzle
- Wallets and blockchain data are saved in JSON format inside the data/ directory.
- You can inspect transaction history and balances manually if needed.
Blocks contain: -Index -Timestamp -List of transactions -Previous block hash -Nonce (for mining)
- Create .env file in the root (blackeye) folder and add
BLOCKCHAIN_PATH="Your Full Directory Path"
#example- "E:\\Black Eye (BEYE)\\Source Code\\blackeye"- Locate the blockchain.py and run it to start the application.
python blockchain.py
You'll see logs for:
- Wallet key generation
- Block creation and mining
- Blockchain status
- Current hash
blackeye/
├── Blockchain/
│ ├── Backend/
│ │ ├── core/
│ │ │ ├── database/
│ │ │ │ └── database.py # Block storage to disk
│ │ │ ├── EllepticCurve/ # ECC logic (key gen, signing)
│ │ │ ├── block.py # Block class
│ │ │ ├── blockchain.py # Main blockchain logic
│ │ │ ├── blockheader.py # Block header with mining logic
│ │ │ ├── Script.py # Transaction script evaluation
│ │ │ └── Tx.py # Transaction class and handling
│ │ └── util/ # Utility functions (hashing, merkle, etc.)
│ ├── client/
│ │ ├── account.py # Wallet/account creation
│ │ └── sendBEYE.py # Send BEYE tokens from wallet
│ └── Frontend/
│ ├── static/
│ │ └── css/
│ │ └── style.css # Basic styling
│ ├── templates/
│ │ └── wallet.html # HTML wallet interface
│ └── run.py # Launch Flask app
├── data/
│ ├── account/ # Wallet JSON files (public/private keys)
│ └── blockchain/ # Blockchain blocks stored as JSON
└── requirements.txt # Python dependencies- This project is not production-ready.
- Intended for learning, prototyping, and blockchain experimentation.
This project is open-source and available under the MIT License.