A secure, full-stack crypto trading platform that demonstrates how blockchain technology and multi-factor authentication (MFA) can be combined to ensure transactional integrity and user protection. This project simulates ETH trading on the Ethereum blockchain using signed raw transactions while enforcing OTP-based login to guard against unauthorized access.
This system allows users to:
- Register with a unique Ethereum address and private key
- Log in using multi-factor authentication (OTP)
- Buy and sell ETH with USDT (virtual)
- Execute real ETH transfers on a local blockchain (Ganache)
- Sign transactions with private keys (no unlocked accounts)
- View and sync ETH balances directly from the blockchain
All actions are logged, validated, and securely managed via smart transaction flows and server-side protection.
| Feature | Description |
|---|---|
| 🔗 On-Chain ETH Transactions | Real ETH transfers using eth_sendRawTransaction, signed with user's private key |
| 🔑 Multi-Factor Authentication | Secure OTP-based login via email using PHPMailer |
| 🔐 Private Key Isolation | Each user has their own Ethereum keypair; no keys are exposed or reused |
| 🔄 Live Blockchain Balance Sync | ETH balance fetched from Ganache using eth_getBalance and stored in SQL |
| 🧠 Smart Validation | All balances, OTPs, and blockchain state transitions are validated in PHP |
-
Backend: PHP (with Composer), MySQL
-
Blockchain: Ganache CLI (Ethereum test network)
-
Libraries:
-
Frontend: HTML, CSS
-
Server: XAMPP / Apache (localhost)
project-root/
├── backend/
│ ├── buy_sell.php
│ ├── get_balance.php
│ ├── send_otp.php
│ ├── verify_otp.php
│ └── vendor/ (Composer libraries)
├── frontend/
│ ├── login.php
│ ├── register.php
│ ├── dashboard.php
│ └── index.css
├── database/
│ └── crypto_transaction.sql
├── .gitignore
├── README.md
-
Start Ganache CLI (with deterministic accounts):
ganache-cli -d
➤ Download: Ganache CLI
-
Install PHP Dependencies via Composer
composer install
➤ Download: Composer
-
Import SQL Schema Use
phpMyAdminor CLI to importdatabase/crypto_transaction.sqlinto MySQL. -
Configure Email OTP Set up email credentials in
send_otp.phpusing PHPMailer. ➤ Download: PHPMailer GitHub -
Run on Localhost Serve the project using XAMPP or any local Apache server:
http://localhost/crypto_transaction/ -
Register → OTP Login → Trade
- ✅ Blockchain signing: Private key used to sign ETH transactions with
ethereum-tx - ✅ No unlocked accounts: Ganache is accessed via raw RPC only
- ✅ MFA enforced: OTP sent via email is required to access user dashboard
- ✅ SQL Sanitization: All queries prepared with bound parameters
- ✅ Balance integrity: All ETH balances are fetched from Ganache, not faked
- Blockchain Developer portfolios
- Backend Engineer job applications
- Demonstrating system security knowledge (MFA, wallet isolation, key signing)
- Students applying for crypto/web3 internships or junior dev roles
This project is open-source under the MIT License. Feel free to fork, customize, and contribute.
You can also view the initial version of this platform (focused on basic web programming) here: