Skip to content

About

Blockchain-based certificate verification system using Django, Truffle, Ganache, and MetaMask

Resources

Code of conduct

Contributing

Security policy

Stars

2 stars

Watchers

0 watching

Forks

Repository files navigation

ethereum-certificate-verifier

Introduction

The ethereum-certificate-verifier project provides a decentralized, immutable, and secure system for verifying academic and professional certificates using blockchain technology. This eliminates the risks of forgery and streamlines the certificate validation process for institutions and employers.

License

This project is open-source under the MIT License.

Research Paper

This project is based on the research paper Blockchain-Based Certificate Verification System: A Decentralized Approach, which explores how blockchain can be utilized for secure and transparent certificate verification.

Features

  • Decentralized Verification: Uses blockchain to store and verify certificates.
  • Immutable Records: Certificates are tamper-proof once added to the blockchain.
  • QR Code Authentication: Each certificate has a QR code linked to its blockchain record.
  • User Roles:
    • Admin: Issues and revokes certificates.
    • Student: Requests and views their certificates.
    • Verifier: Validates certificate authenticity.
  • CSV Export: Admins can export student records and certificates to CSV.
  • Email Notifications: Sends automated emails when a certificate is issued.
  • Django Admin Panel: Manage students, courses, and certificates via an intuitive interface.

Technologies Used

  • Backend: Django, Django REST Framework
  • Frontend: Django templates (or React.js if applicable)
  • Blockchain: Ethereum/Solidity (or Hyperledger, depending on implementation)
  • Database: PostgreSQL / SQLite
  • Authentication: JWT / OAuth2
  • QR Code Generation: qrcode Python library
  • Email Service: Mailjet / SMTP

Installation & Setup

Prerequisites

Ensure you have the following installed:

  • Python (>=3.8)
  • Node.js (if frontend uses React)
  • PostgreSQL / SQLite
  • Metamask / Ganache (for blockchain testing)

Backend Setup

# Clone the repository
git clone https://github.com/your-repo/ethereum-certificate-verifier.git
cd ethereum-certificate-verifier

# Create a virtual environment
python -m venv venv
source venv/bin/activate  # On Windows, use `venv\Scripts\activate`

# Install dependencies
pip install -r requirements.txt

# Apply migrations
python manage.py migrate

# Create a superuser
python manage.py createsuperuser

# Run the development server
python manage.py runserver 0.0.0.0:8000

Frontend Setup (If applicable)

cd frontend  # Navigate to the frontend directory
npm install  # Install dependencies
npm start    # Start the frontend development server

Usage

  • Admin logs into the Django admin panel to issue or revoke certificates.
  • Students can log in to request and view their certificates.
  • Verifiers can scan the QR code or enter the certificate ID to validate authenticity.

API Endpoints (Example)

Endpoint Method Description
/api/certificates/ GET Get all certificates
/api/certificates/<id>/ GET Get certificate details
/api/certificates/issue/ POST Issue a new certificate
/api/certificates/verify/ POST Verify a certificate

Contribution Guidelines

We welcome contributions! Follow these steps:

  1. Fork the repository.
  2. Create a new branch (feature/new-feature or bugfix/fix-issue).
  3. Commit your changes with meaningful messages.
  4. Push to your fork and submit a pull request.

Contributors

License

This project is licensed under the MIT License.

πŸ“ Truffle-Setup

πŸŽ“ ethereum-certificate-verifier an Blockchain Certificate Verification System

This project is a Django + Ethereum-based system to store and verify student certificates on the blockchain using smart contracts, Truffle, Ganache, MetaMask, and Web3.js.


πŸ“¦ Requirements


βœ… Step 1: Install Node.js

Download and install Node.js from the official website:

πŸ”— https://nodejs.org/

Then verify installation:

node -v
npm -v

βœ… Step 2: Install Truffle Globally

Install Truffle CLI using npm:

npm install -g truffle

Verify installation:

truffle version

Expected output:

Truffle v5.9.x
Solidity v0.8.x
Node v...

βœ… Step 3: Initialize Truffle Project

cd C:\Users\Dell\Desktop\Blockchain
mkdir blockchain_cert && cd blockchain_cert
truffle init

βœ… Step 4: Add the Smart Contract

Place your smart contract (e.g., CertificateStorage.sol) into the contracts/ folder.

Example: contracts/CertificateStorage.sol


βœ… Step 5: Create Deployment Script

Create or modify migrations/2_deploy_contracts.js:

const CertificateStorage = artifacts.require("CertificateStorage");

module.exports = function (deployer) {
  deployer.deploy(CertificateStorage);
};

βœ… Step 6: Configure Truffle to Use Ganache

Edit truffle-config.js:

module.exports = {
  networks: {
    development: {
      host: "127.0.0.1",
      port: 7545,
      network_id: "*" // Match Ganache
    }
  },
  compilers: {
    solc: {
      version: "0.8.20" // Match your contract version
    }
  }
};

βœ… Step 7: Compile & Deploy the Contract

Start Ganache and then:

truffle compile
truffle migrate --network development

Copy the deployed contract address and ABI from:

πŸ“‚ build/contracts/CertificateStorage.json


🧠 Step 8: Connect Frontend to Contract

In your Django HTML/JS frontend:

  1. Paste the contract address:
const contractAddress = "0xYourContractAddressFromGanache";
  1. Paste the ABI as JSON array:
const contractABI = [ /* ABI from CertificateStorage.json */ ];

βœ… Final Step: Test Functionality

  1. Connect MetaMask to your local Ganache RPC (usually http://127.0.0.1:7545).
  2. Use the β€œWrite” button to store a certificate on-chain.
  3. Click β€œVerify” to fetch and display the on-chain certificate data.

πŸ›  Project Structure (example)

blockchain_cert/
β”‚
β”œβ”€β”€ contracts/
β”‚   └── CertificateStorage.sol
β”œβ”€β”€ migrations/
β”‚   └── 2_deploy_contracts.js
β”œβ”€β”€ build/
β”‚   └── contracts/
β”‚       └── CertificateStorage.json
β”œβ”€β”€ truffle-config.js
β”œβ”€β”€ django_project/
β”‚   └── templates/
β”‚       └── admin.html  ← JS for interaction
β”œβ”€β”€ static/
β”‚   └── js/
β”‚       └── web3-integration.js # optional (internal JS used)

πŸ§ͺ Technologies Used

  • 🧱 Solidity
  • 🧒 Truffle
  • 🌐 Web3.js
  • πŸ₯Š MetaMask
  • πŸ’  Ganache
  • 🐍 Django

πŸ“Έ Screenshots

Add screenshots in screenshots/ directory and reference them here:

![Certificate List](screenshots/cert-list.png)
![Write to Blockchain](screenshots/write.png)
![Verify Result](screenshots/verify.png)

πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.


🀝 Contributing

Contributions, issues and feature requests are welcome!

  1. Fork the repository
  2. Create your branch: git checkout -b feature/your-feature
  3. Commit your changes: git commit -m 'Add feature'
  4. Push to the branch: git push origin feature/your-feature
  5. Submit a pull request

❓ FAQ

Q: Why use Ganache instead of a testnet?

Ganache is faster and allows for local development without gas fees.

Q: Can this be deployed to a public Ethereum network?

Yes, with slight modifications in truffle-config.js and using MetaMask’s testnet wallets.

Q: What happens if MetaMask is not connected?

The frontend will prompt users to connect MetaMask to proceed.


Built with ❀️ using open-source tools for learning and exploration of blockchain integration with web apps.

About

Blockchain-based certificate verification system using Django, Truffle, Ganache, and MetaMask

Resources

Code of conduct

Contributing

Security policy

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages