A complete prototype system for issuing, managing, and verifying academic certificates using blockchain technology and IPFS.
- Issue certificates with PDF upload
- Store certificate files on IPFS
- Store certificate hash on Ethereum blockchain
- Revoke certificates
- View certificate metadata
- Access IPFS certificate files
- Generate QR codes for verification
- Share verification links
- Upload certificate file or enter hash
- Verify certificate validity via blockchain
- View certificate status (valid/revoked)
- Frontend + Backend: Next.js 14 (App Router), TypeScript
- Web3: wagmi, viem
- Smart Contracts: Solidity 0.8.20
- Contract Tooling: Foundry (forge + cast)
- Blockchain: Ethereum Sepolia Testnet
- File Storage: IPFS via Pinata API
- Wallet: MetaMask
- Hashing: SHA256 via viem
certificate-verification-system/
βββ contracts/ # Foundry smart contract project
β βββ src/
β β βββ CertificateRegistry.sol
β βββ script/
β β βββ Deploy.s.sol
β βββ test/
β β βββ CertificateRegistry.t.sol
β βββ foundry.toml
βββ frontend/ # Next.js application
βββ app/
β βββ admin/
β β βββ issue/
β β βββ revoke/
β βββ student/
β βββ verify/
β βββ api/upload/
βββ components/
βββ lib/
- Node.js 18+
- Foundry (https://book.getfoundry.sh/getting-started/installation)
- MetaMask wallet
- Sepolia testnet ETH (from faucet)
- Pinata account (https://pinata.cloud)
cd certificate-verification-system/contractsforge installforge testcp .env.example .envEdit .env and add:
PRIVATE_KEY=your_metamask_private_key
BASE_SEPOLIA_RPC_URL=https://base-sepolia.infura.io/v3/YOUR_INFURA_KEY
ETHERSCAN_API_KEY=your_etherscan_api_key
source .env
forge script script/Deploy.s.sol --rpc-url $BASE_SEPOLIA_RPC_URL --broadcast --verifySave the deployed contract address!
cd ../frontendnpm installcp .env.example .env.localEdit .env.local and add:
NEXT_PUBLIC_CONTRACT_ADDRESS=0x... # From deployment
NEXT_PUBLIC_BASE_SEPOLIA_RPC_URL=https://base-sepolia.infura.io/v3/YOUR_INFURA_KEY
PINATA_JWT=your_pinata_jwt_token
npm run dev- Navigate to "Issue Certificate" page
- Connect MetaMask wallet (must be admin address)
- Enter student ID
- Upload certificate PDF
- Click "Issue Certificate"
- Approve transaction in MetaMask
- Wait for confirmation
- Save the certificate hash for future reference
- Navigate to "Revoke Certificate" page
- Connect MetaMask wallet (must be admin address)
- Enter certificate hash
- Click "Revoke Certificate"
- Approve transaction in MetaMask
- Navigate to "Student View" page
- Enter certificate hash
- View certificate details
- Generate QR code for sharing
- Copy verification link
- Navigate to "Verify Certificate" page
- Either:
- Upload the certificate PDF file, OR
- Enter the certificate hash
- Click "Verify Certificate"
- View verification result:
- β VALID - Certificate is authentic
- β REVOKED - Certificate was revoked
- β NOT FOUND - Certificate doesn't exist
- Only the admin (contract deployer) can issue and revoke certificates
- Certificate hashes are computed using keccak256
- All transactions are recorded on the blockchain
- IPFS ensures decentralized file storage
cd contracts
forge test -vvvforge coveragefunction issueCertificate(
bytes32 certHash,
string memory studentId,
string memory ipfsHash
) external onlyAdminfunction revokeCertificate(bytes32 certHash) external onlyAdminfunction verifyCertificate(bytes32 certHash)
external view
returns (
bool exists,
bool revoked,
string memory ipfsHash,
string memory studentId,
uint256 issuedAt
)-
Issuance:
- Admin uploads PDF β IPFS
- System computes file hash
- Smart contract stores: hash + studentId + IPFS CID
- Event emitted on blockchain
-
Verification:
- Verifier uploads file OR enters hash
- System queries blockchain
- Returns: exists, revoked status, metadata
- Display result to verifier
- Sepolia Faucet: https://sepoliafaucet.com
- Sepolia Explorer: https://sepolia.etherscan.io
- Pinata: https://pinata.cloud
- Foundry Book: https://book.getfoundry.sh
MIT License - This is a prototype for educational purposes.
This system demonstrates:
- Blockchain immutability for certificate records
- Decentralized storage with IPFS
- Smart contract access control
- Web3 integration with modern frontend
- Cryptographic verification
- Event-driven architecture
- Ensure you're on Sepolia network
- Check that you have test ETH
- Verify you're using the admin wallet
- Check gas settings
- Ensure contract address is correct
- Verify Pinata JWT token
- Check file size limits
- Ensure API endpoint is accessible
Built with β€οΈ for university thesis project.