Skip to content

BCertificateΒΆ

By:  Al-Fahami Toihir   🏷️ Blockchain β€’  ⏱️ ~6 min read

"A blockchain network that lets schools and universities add credentials to an immutable ledger; making diploma fraud a thing of the past."


What Is ItΒΆ

BCertificate is a full blockchain application built on Hyperledger Fabric v2.x that automates the issuance, dispatch, and management of university digital credentials; diplomas, skills assessments, transcripts, and degree certifications.

The core idea: universities write credentials to a distributed ledger. Employers and institutions can verify them without contacting the university directly. No more fake diplomas, no more verification delays.

This was my first Hyperledger Fabric project, built at the Faculty of Science in Kenitra as part of my Mathematics and Computer Science studies. The main focus was getting familiar with how Hyperledger Fabric builds and handles blockchain rather than polishing the user experience.


Tech StackΒΆ

Layer Technology
Blockchain Hyperledger Fabric v2.x
Smart Contract JavaScript / Java (Chaincode)
Backend Node.js, Express.js, REST API
Frontend Pug template engine, CSS
Infrastructure Docker
SDK Fabric SDK Node, Fabric Java SDK

Tested on Linux/Debian 10 Buster, WSL/Debian 10 Buster, and WSL/Ubuntu.


How It WorksΒΆ

The network consists of organizations (universities) that each run their own peers. A shared channel connects them, and the chaincode (smart contract) runs across all peers.

Flow:

  1. Admin enrolls and registers a user against the Certificate Authority
  2. University submits a credential transaction; the chaincode validates and writes it to the ledger
  3. Anyone with network access can query a certificate by ID
  4. Bulk import via Excel sheet (.xls) is supported for adding multiple credentials at once

Key chaincode operations:

  • initLedger: seeds the ledger with initial certificates on deploy
  • addCertificate: writes a new credential to the blockchain
  • queryCertificate : retrieves a credential by ID
  • queryAllCertificates: returns all credentials in the ledger

Project StructureΒΆ

bcertificate/
β”œβ”€β”€ certificate-network/
β”‚   β”œβ”€β”€ chaincode/certificate/      # Smart contract (JS and Java)
β”‚   └── certificate-starter/
β”‚       β”œβ”€β”€ startBCertificate.sh    # Starts the full network
β”‚       β”œβ”€β”€ networkDown.sh          # Tears down the network
β”‚       β”œβ”€β”€ javascript/             # Admin enroll, user register, query scripts
β”‚       β”œβ”€β”€ java/                   # Java admin scripts (partial)
β”‚       └── apiserver/              # Node.js REST API + web app
└── screenshots/

Running ItΒΆ

TL;DR

If you're already familiar with Hyperledger Fabric and have everything set up, go directly to certificate-network/certificate-starter/ and run the commands below.

Prerequisites:

  • Docker installed and configured
  • Hyperledger Fabric binaries set up (official docs)
  • curl installed

Install Hyperledger Fabric:

curl -sSL https://bit.ly/2ysbOFE | bash -s

If the above link doesn't work, download fabric-samples v2.0.0 directly.

Start the network:

# From certificate-network/certificate-starter/
./startBCertificate.sh

# Enroll admin, register user, query initial data
cd apiserver/
node enrollAdmin.js && node registerUser.js && node query.js

# Start the API server
node apiserver.js

Then visit:

  • http://localhost:8080/api/allcertificates: all credentials in the ledger
  • http://localhost:8080/api/addcertificate: add a new credential
  • http://localhost:8080/api/query/CERT11: query a specific certificate

ScreenshotsΒΆ

All certificates in the ledger:

All certificates

Adding a certificate (with Excel bulk import support):

Add certificate

Querying a specific certificate:

Certificate details


Key LearningsΒΆ

  • Hyperledger Fabric architecture: understanding organizations, peers, orderers, channels, and the Certificate Authority
  • Chaincode lifecycle: packaging, installing, approving, and committing chaincode across organizations
  • Fabric SDK: enrolling admins, registering users, and submitting transactions from a Node.js client
  • Docker networking: how Fabric spins up containers for each peer and orderer
  • Permissioned vs public blockchain: why enterprise use cases need identity and access control that public chains like Ethereum don't provide


LicenseΒΆ

MIT - open source and free to use.

CategoriesΒΆ