Skip to content

LandCertificateΒΆ

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

"A blockchain network that lets land conservers certify land ownership on an immutable ledger; helping against land ownership fraud and disputes."


What Is ItΒΆ

LandCertificate is a Hyperledger Fabric blockchain application with a dual-role system; clients request land certificates from a land conserver (admin) who validates and certifies ownership on the blockchain. Each certified land gets a QR code for easy verification.

It's the evolution of bcertificate, same Hyperledger Fabric foundation, but with a real client/admin workflow, QR code generation, and MongoDB Atlas for persisting client requests.

Built on Hyperledger Fabric v2.x, tested on Linux/Debian 10 Buster, WSL/Debian 10 Buster, and WSL/Ubuntu.


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
Database MongoDB Atlas (client requests)
Infrastructure Docker
Extra QR Code generation

How It WorksΒΆ

The system has two distinct user roles:

Client:

  1. Visits the client portal and fills a land certificate request form
  2. Request is stored in MongoDB Atlas
  3. Admin receives the request in their panel

Admin (Land Conserver):

  1. Reviews incoming requests in the admin panel
  2. Validates and adds the land certificate to the blockchain
  3. Certificate is written to the Hyperledger Fabric ledger with a QR code generated for verification

Key chaincode operations:

  • initLedger: seeds the ledger with initial land certificates on deploy
  • addLandCertificate: writes a certified land to the blockchain
  • queryLandCertificate: retrieves a land certificate by ID
  • queryAllLandCertificates: returns all certified lands in the ledger

Project StructureΒΆ

landcertificate/
β”œβ”€β”€ landcertificate-network/
β”‚   β”œβ”€β”€ chaincode/landcertificate/  # Smart contract (JS and Java)
β”‚   └── landcertificate-starter/
β”‚       β”œβ”€β”€ startBcLand.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 landcertificate-network/landcertificate-starter/ and run the commands below.

Prerequisites:

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

Install Hyperledger Fabric:

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

Start the network:

# From landcertificate-network/landcertificate-starter/
./startBcLand.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/admin/index: admin panel with all certified lands
  • http://localhost:8080/api/admin/addland: add a new land certificate
  • http://localhost:8080/client/index: client request portal

ScreenshotsΒΆ

Admin panel: all certified lands:

Admin all certificates

Admin: adding a new land certificate:

Admin add land

Client: request form:

Client index

Client: form filled:

Client form filled

Client: form submitted:

Client request sent

Admin receives the request:

Admin add land filled

All certified lands after validation:

Admin all certificates updated

Certified land with QR Code:

Land detail with QR

Land detail QR close up


Key LearningsΒΆ

  • Client/Admin role separation: designing a real-world workflow where two different actors interact with the same blockchain network
  • MongoDB Atlas integration: combining a traditional database with blockchain; off-chain storage for requests, on-chain storage for certified data
  • QR Code generation: embedding verification codes directly into blockchain certificates
  • Hyperledger Fabric v2.x chaincode lifecycle: building on top of the bcertificate experience with a more complete application
  • Dual-interface web app: separate client and admin portals backed by the same Node.js API


LicenseΒΆ

Creative Commons Attribution 4.0 International (CC BY 4.0)

CategoriesΒΆ