A blockchain-based document verification system that allows institutions to issue documents and third parties to verify them without relying on centralized servers.
- Institution Registration: Register on the blockchain as a verified issuer
- Document Issuance: Issue documents with comprehensive metadata
- QR Code Generation: Generate QR codes for easy verification
- Blockchain Storage: Store document hashes and metadata on-chain
- Digital Signatures: Cryptographically sign documents for authenticity
- Decentralized Verification: Verify documents directly from blockchain
- File Upload Verification: Upload document files for hash-based verification
- Hash-based Verification: Verify using document hash directly
- QR Code Scanning: Scan QR codes for instant verification
- Complete Document Information: Access all document metadata and issuer details
- โ No Centralized Dependencies: Verification works without issuer's servers
- โ Tamper-Proof: Documents stored on immutable blockchain
- โ Global Accessibility: Verify from anywhere in the world
- โ Real-time Verification: Instant verification results
- โ Complete Transparency: All verification data publicly accessible
- DocumentVerification.sol: Main contract for document management
- Institution Management: Register and verify institutions
- Document Lifecycle: Issue, verify, and revoke documents
- Access Control: Role-based permissions for different operations
- React + Vite: Modern web application framework
- Web3 Integration: MetaMask wallet connection
- Responsive Design: Works on desktop and mobile devices
- Real-time Updates: Live blockchain interaction
- Institution Registration: Institutions register on blockchain
- Document Issuance: Documents issued with metadata and QR codes
- Third-party Verification: Anyone can verify documents independently
- Blockchain Confirmation: All data verified directly from blockchain
- Node.js (v16 or higher)
- MetaMask browser extension
- Git
- Clone the repository
git clone <repository-url>
cd blockchain-document-verification- Install dependencies
npm run install:all- Set up environment variables
# Create .env file in root directory
cp .env.example .env
# Add your configuration
REACT_APP_CONTRACT_ADDRESS=your_deployed_contract_address
SEPOLIA_RPC_URL=your_sepolia_rpc_url
PRIVATE_KEY=your_private_key_for_deployment
ETHERSCAN_API_KEY=your_etherscan_api_key- Compile contracts
npm run compile- Deploy to local network
# Start local Hardhat node
npm run node
# Deploy to local network (in another terminal)
npm run deploy:local- Deploy to testnet (Sepolia)
npm run deploy:sepolia- Verify on Etherscan
npm run verify:sepolia <contract_address>- Start the development server
npm run dev- Access the application
- Frontend: http://localhost:5173
- Backend API: http://localhost:5000
- Connect your MetaMask wallet
- Navigate to "Issue Documents"
- Fill in institution details:
- Institution name
- Registration number
- Contact information
- Address
- Submit registration transaction
- Wait for blockchain confirmation
- Upload document file (PDF, DOC, DOCX, Images)
- Fill in document metadata:
- Document type (degree, certificate, etc.)
- Recipient information
- Issuance and expiration dates
- Academic details (for degrees)
- Submit issuance transaction
- Generate and save QR code
- Embed QR code in the document
- Navigate to "Verify Documents"
- Select "Upload Document" method
- Upload the document file
- Click "Verify Document"
- View verification results
- Navigate to "Verify Documents"
- Select "Enter Hash" method
- Enter the document hash
- Click "Verify Document"
- View verification results
- Navigate to "QR Scanner"
- Allow camera permissions
- Point camera at QR code
- View automatic verification results
# Blockchain Configuration
REACT_APP_CONTRACT_ADDRESS=0x... # Deployed contract address
SEPOLIA_RPC_URL=https://sepolia.infura.io/v3/... # RPC endpoint
PRIVATE_KEY=0x... # Private key for deployment
# API Keys
ETHERSCAN_API_KEY=... # For contract verification
POLYGONSCAN_API_KEY=... # For Polygon verification
# Database (Optional - for caching)
MONGODB_URI=mongodb://localhost:27017/docverify- Local Development: Hardhat Network (Chain ID: 31337)
- Ethereum Sepolia: Testnet (Chain ID: 11155111)
- Polygon Mumbai: Testnet (Chain ID: 80001)
- Ethereum Mainnet: Production (Chain ID: 1)
- Polygon Mainnet: Production (Chain ID: 137)
- Access Control: Role-based permissions
- Input Validation: Comprehensive parameter validation
- Reentrancy Protection: Safe external calls
- Overflow Protection: SafeMath operations
- Wallet Integration: Secure MetaMask connection
- Input Sanitization: XSS protection
- HTTPS Enforcement: Secure communication
- Error Handling: Graceful error management
# Run contract tests
npm test
# Run with coverage
npm run coverage# Run frontend tests
cd frontend && npm testfunction registerInstitution(string name, string regNumber, string contact)
function verifyInstitution(address institutionAddress)
function isInstitutionVerified(address institutionAddress) returns (bool)function issueDocument(bytes32 hash, string docType, string recipient, ...)
function verifyDocument(bytes32 hash) returns (...)
function revokeDocument(bytes32 hash)# Health check
GET /api/health
# Document operations
POST /api/documents
GET /api/documents/user/:walletAddress
GET /api/documents/status/:hash/:address
PUT /api/documents/:hash/verify- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
For support and questions:
- Create an issue on GitHub
- Check the documentation
- Review existing issues and discussions
- IPFS Integration: Decentralized document storage
- Multi-signature Support: Enhanced security for institutions
- Mobile App: Native mobile applications
- Batch Operations: Bulk document issuance
- Advanced Analytics: Verification statistics and insights
- Integration APIs: Third-party system integration