# CertChain Nigeria
## Development of a Blockchain-Based Certificate Verification System for Nigerian Universities
CertChain is a defence-ready final-year Cybersecurity project that combines a conventional MySQL university database with an Ethereum-compatible Solidity smart contract. Student and certificate information remains off-chain in MySQL. Only a deterministic SHA-256 certificate fingerprint, Certificate ID, issuer wallet, timestamp and revocation state are stored on-chain.
The system supports administrator authentication, certificate registration, approved corrections, revocation, QR generation, public employer verification, graduate status checks, audit logging and tampering detection.
## Online-ready build
This package includes `ONLINE_DEPLOYMENT.md`, Railway configuration, Polygon Amoy deployment support, dynamic QR generation, cloud MySQL initialization, production environment validation, timezone-safe MySQL dates, and local HTTP CSP handling. For an always-online QR verification service, follow `ONLINE_DEPLOYMENT.md`.
## Core demonstration
1. An authorized administrator logs in.
2. The administrator registers an approved certificate record.
3. The backend normalizes protected fields and generates a SHA-256 fingerprint.
4. The fingerprint is registered in `CertificateRegistry.sol` on the local Hardhat blockchain.
5. The complete certificate record is saved in MySQL.
6. A QR code is generated for the public verification URL.
7. An employer verifies the Certificate ID.
8. The system recomputes the fingerprint from MySQL and compares it with both the stored MySQL fingerprint and blockchain fingerprint.
9. The result is displayed as Valid, Invalid/Tampered, Revoked or Not Found.
## Technology stack
- Frontend: HTML5, CSS3 and Vanilla JavaScript
- Backend: Node.js and Express.js
- Database: MySQL through XAMPP and `mysql2`
- Blockchain: Solidity, Hardhat, Ethers.js and MetaMask
- Hashing: SHA-256 using Node.js `crypto`
- QR: `qrcode`
- Authenticatio …