A complete, production-ready peer-to-peer blockchain system with Proof of Vote consensus mechanism, built with Node.js and Electron.
- Overview
- Features
- Screenshots
- Architecture
- Prerequisites
- Installation
- Usage
- Technical Details
- File Structure
- Contributing
- License
V-Blockchain is a sophisticated, decentralized cryptocurrency network implementing a novel Proof of Vote (PoV) consensus mechanism. Unlike traditional Proof of Work, PoV allows network participants to democratically validate blocks through voting, achieving consensus with a 66.7% approval threshold.
The system features a beautiful dual-interface design:
- CLI Version: Command-line interface for advanced users and developers
- GUI Version: Professional Electron desktop application for end-users
- RSA-2048 Encryption for wallet key generation
- SHA-256 Hashing for transaction and block integrity
- Digital Signatures for transaction authentication
- Password-Protected Wallets with salted hashing
- Immutable Ledger with blockchain validation
- Transaction Management with pending pool and mining
- Block Mining with configurable difficulty levels
- Chain Persistence with automatic save/load from JSON
- Balance Tracking with accurate transaction history
- Proof of Vote (PoV) consensus algorithm
- 66.7% Approval Threshold for block validation
- Democratic Voting System where all nodes participate
- Vote Tracking with approval percentages
- TCP Socket Communication for peer-to-peer connections
- Automatic Peer Discovery via bootstrap server
- Message Broadcasting for transactions, blocks, and votes
- Network Synchronization with real-time updates
- Boot Node Registration for decentralized discovery
- Unique V-Addresses generated from public key hashes
- 50 V Welcome Bonus for new accounts (one-time only)
- Transaction History with sent/received tracking
- QR Code Generation for easy address sharing
- Persistent Storage with password protection
- Professional GUI built with Electron
- 6-Tab Dashboard: Wallet, Mining, Transactions, Blockchain, Network, Voting
- Real-time Updates with automatic balance refresh
- Mining Controls with start/stop functionality
- Blockchain Explorer for viewing chain history
- Network Statistics showing connected nodes and total circulation
- REST API Server for network discovery
- Comprehensive Logging for debugging
- Automatic Firewall Configuration on Windows
- Clean Architecture with modular design
- Jest Test Suite with 32 comprehensive tests
Main wallet interface showing balance, address, and quick actions
Mining control panel with real-time statistics and logs
Send transactions and view complete transaction history
View all blocks in the chain with detailed information
Monitor network nodes, total circulation, and node information
Cast votes on pending blocks and view approval percentages
┌─────────────────────────────────────────────────────────────┐
│ Desktop Application │
│ ┌──────────────────────────────────────────────────────┐ │
│ │ Electron Main Process │ │
│ │ (IPC Server, Wallet Management, Mining Control) │ │
│ └──────────────────────────────────────────────────────┘ │
│ ▼ │
│ ┌──────────────────────────────────────────────────────┐ │
│ │ GUI Renderer Process │ │
│ │ (6-Tab Dashboard, Real-time Updates, Forms) │ │
│ └──────────────────────────────────────────────────────┘ │
└──────────────────┬──────────────────────────────────────────┘
│
┌──────────┴──────────┐
▼ ▼
┌─────────────┐ ┌──────────────────┐
│ Blockchain │ │ P2P Network │
│ - Ledger │ │ - TCP Sockets │
│ - Mining │ │ - Broadcasting │
│ - Voting │ │ - Peer Discovery│
└─────────────┘ └──────────────────┘
│ │
└─────────────┬───────┘
▼
┌──────────────────────────┐
│ Bootstrap Server │
│ - Node Registration │
│ - Peer Discovery │
│ - Address Registry │
│ - Network Statistics │
└──────────────────────────┘
- Node.js: v14.0 or higher
- npm: v6.0 or higher
- Windows/Mac/Linux: Cross-platform compatible
- RAM: Minimum 512MB recommended
- Disk Space: ~100MB for installation
git clone https://github.com/PointerKnight/v-blockchain.git
cd v-blockchainnpm installnpm install electron@latest --save-devnpm startOpens the professional Electron desktop application.
node client.jsInteractive command-line interface for advanced users.
node server.jsStarts the IP registry and boot node on localhost:3000.
- Launch the application
- Enter username and password
- Click "Create New Wallet"
- Automatically receives 50 V welcome bonus
- Ready to send/receive transactions
- Go to Transactions tab
- Enter receiver's address
- Enter amount to send
- Click "Send Transaction"
- Transaction goes to pending pool
- Needs mining to be confirmed
- Go to Mining tab
- Click "▶ Start Mining"
- Miner automatically mines pending transactions
- Mining reward: 10 V per block
- Block is broadcast to network
- Receivers automatically sync balances
- Go to Voting tab
- View latest block and vote count
- Click "✓ Vote YES" or "✗ Vote NO"
- Block approved when 66.7%+ vote YES
- Approval percentage updates in real-time
- Go to Blockchain tab
- View all blocks in descending order
- Click block to see detailed information
- Monitor chain validity status
- Go to Network tab
- View active nodes count
- See total V in circulation
- Monitor registered addresses
- Check your node information
How it works:
- Miner creates block with pending transactions
- Block broadcasts to network
- All nodes validate block structure
- Nodes vote YES or NO on validity
- Approval Threshold: 66.7% YES votes required
- Block becomes immutable when approved
- Next block can be mined
Advantages over PoW:
- ✅ Energy efficient (no computational waste)
- ✅ Democratic (all nodes have voting power)
- ✅ Fast finality (instant validation)
- ✅ No mining centralization
- ✅ Scalable (no hashing arms race)
User Creates Transaction
│
▼
Sign with Private Key
│
▼
Add to Pending Pool
│
▼
Broadcast to Network (P2P)
│
▼
Included in Next Block
│
▼
Block Mined
│
▼
Votes Collected (66.7% needed)
│
▼
Block Approved & Finalized
│
▼
Balance Updated
| Component | Algorithm | Details |
|---|---|---|
| Key Pair | RSA-2048 | 2048-bit asymmetric encryption |
| Address | SHA-256 | 40-character V-format address |
| Signature | RSA-SHA256 | Digital transaction signing |
| Hash | SHA-256 | Block and transaction hashing |
| Password | SHA-256 | Salted password hashing |
v-blockchain/
├── blockchain.js # Core blockchain implementation
├── wallet.js # Wallet management & key generation
├── p2p.js # P2P networking layer
├── miner.js # Mining & voting logic
├── server.js # Bootstrap server & IP registry
├── client.js # CLI interface
├── electron-main.js # Electron main process
├── preload.js # Electron security bridge
│
├── gui/
│ ├── index.html # GUI layout (6-tab dashboard)
│ ├── renderer.js # GUI event handlers
│ └── styles.css # Professional styling
│
├── package.json # Dependencies & scripts
├── README.md # This file
└── test.js # Test suite (32 tests)
Run the comprehensive test suite:
npm testTest Coverage:
- ✅ Blockchain core functionality (8 tests)
- ✅ Transaction validation (6 tests)
- ✅ Mining and rewards (5 tests)
- ✅ Proof of Vote consensus (4 tests)
- ✅ Wallet management (4 tests)
- ✅ Balance calculations (3 tests)
- ✅ Chain integrity (2 tests)
Result: 32/32 tests passing ✅
- ✅ RSA-2048 asymmetric encryption
- ✅ SHA-256 cryptographic hashing
- ✅ Digital signature verification
- ✅ Password protection with hashing
- ✅ Chain validation on load
- ✅ Transaction signature validation
- ✅ Electron context isolation
- Store private keys locally (never on server)
- Use strong passwords (recommended 12+ characters)
- Regularly back up wallet files
- Keep Node.js updated
- Run on secure, trusted machines
- Use firewall protection
Edit electron-main.js to change:
const SERVER_ADDRESS = 'http://localhost:3000'; // Bootstrap server
const MINING_DIFFICULTY = 2; // Block difficulty
const VOTE_THRESHOLD = 66.7; // Approval %
const MINER_REWARD = 10; // V per blockEdit miner.js to adjust:
- Mining interval (default: 5 seconds)
- Mining reward amount
- Block difficulty
Edit p2p.js to change:
- Peer discovery interval (default: 10 seconds)
- TCP port range
- Socket timeout values
- Install Node.js
- Clone repository
- Run
npm install - Run
npm start
- Start bootstrap server:
node server.js - Start node 1:
npm start(first instance) - Start node 2:
npm start(second instance) - Nodes auto-discover via server
docker build -t v-blockchain .
docker run -p 3000:3000 v-blockchainContributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/YourFeature) - Commit changes (
git commit -m 'Add YourFeature') - Push to branch (
git push origin feature/YourFeature) - Open a Pull Request
- Use ES6+ syntax
- Add JSDoc comments for functions
- Follow existing naming conventions
- Test before submitting PR
- Use GitHub Issues tab
- Provide detailed description
- Include logs/error messages
- Specify Node.js version
This project is licensed under the MIT License - see LICENSE file for details.
- Developer: Ali Hamza
- Inspired by Bitcoin and Ethereum architectures
- Built with Node.js, Electron, and Express
- Smart contract support
- Cross-chain bridges
- Advanced DeFi features
- Mobile application
- Web dashboard
- Sharding implementation
- Zero-knowledge proofs
- Layer 2 scaling
⭐ If you found this useful, please consider giving it a star!