Skip to content
OnlyProjects
BCA · BlockchainFor educational purposes only
Code included

Tamper-Evident Farm-Subsidy Disbursement Trail with Merkle-Batch Anchoring (Java, MySQL)

From field verification to bank credit, every instalment of a DBT-style farm subsidy leaves a hash-linked, independently checkable trail

Mapped to your syllabusUniversity of Madras CBCS 2023-24 · 320S61 Mini Project (Professional Competency Skill) · Semester 6

Overview

1 min read

UzhavanPay is an advanced BCA mini-project (University of Madras CBCS, slot 320S61, semester 6) that models the payment trail of a direct-benefit-transfer (DBT) farm-subsidy scheme — the pattern used by programmes such as PM-KISAN, where an instalment travels through field verification, sanction, a payment file and finally bank credit — and makes every step of that trail tamper-evident and independently verifiable.

The taluk office in the model has four roles: the field officer verifies a beneficiary and records the disbursement event; the taluk officer sanctions a batch; the disbursing officer generates the payment file and later imports the bank's credit acknowledgements; and the beneficiary checks status and can verify a receipt. Each disbursement event is hashed; each sanctioned batch is sealed into a Merkle tree whose root is written to an append-only anchor ledger — and, as an explicitly optional industry-standard extension, published to the Sepolia testnet through Web3j so the root exists outside the office's own database.

Given any receipt, the system can produce a Merkle inclusion proof: a handful of sibling hashes that lets a verifier confirm the payment belongs to the anchored batch without seeing anyone else's data.

The build uses the profile's own stack — Java (220C4A), MySQL (320C5B) and JSP/Servlets (320C5C) — with the Merkle tree and hash functions written in plain Java, plus JUnit tests for every proof. The design never stores Aadhaar or other government ID numbers: beneficiaries are internal codes with a masked bank reference.

Relevant for
Tamil Nadu
Level
Advanced · 6 weeks · solo
Common at
University of Madras, IGNOU, Bharathiar University
Updated
Nov 2026

Syllabus alignment

University of Madras · CBCS 2023-24

320S61 · Mini Project (Professional Competency Skill) · Semester 6 · 2 credits · 40 + 60

Subjects this project applies
  • Java (220C4A)
  • RDBMS (320C5B)
  • Web Technology (320C5C)
  • Data Structures (220C3A)
How it is evaluated

See your department's project guidelines.

Also fits: IGNOU BCA (revised) — BCSP-064 guidelines, Bharathiar University 2023-24.

What's in the box

11 parts · 5 free · 2 previewed · 4 unlock for ₹2,000

Problem & synopsis

5 min read

Problem statement

Farm-subsidy instalments disbursed through a taluk office travel through several hands — field verification, sanction, payment-file generation, bank credit — and every hand touches the same database. Because the database is the only record, a person with write access can alter an amount, substitute a bank reference, mark a paid instalment as failed, or insert a fake beneficiary after the fact, and no conventional application will ever notice. When beneficiaries or auditors question a payment, the office can only point at the same mutable table, so disputes end as arguments. A full blockchain network is the textbook answer but is impractical for a single office that needs no cryptocurrency.

What is needed is a disbursement trail that is append-only and self-proving: recording must be as easy as today, but any alteration must become detectable, each payment must be provable to belong to a sanctioned batch, and the proof must not depend on trusting the office's own database alone.

Synopsis

Abstract

UzhavanPay is a semester-6 mini project that implements a tamper-evident disbursement trail for a taluk-level farm-subsidy scheme on the DBT pattern. Disbursement events (verify, sanction, payment file, bank credit) are hash-linked; sanctioned batches are sealed into Merkle trees whose roots are anchored in an append-only anchor store and optionally on a public testnet. A Merkle-proof service lets a beneficiary verify a receipt against the anchored root. The build uses Java Servlets/JSP, MySQL and JUnit.

Introduction

India moves farm subsidies through DBT: the sanctioning office releases instalments, a bank credits them, and portals such as the PM-KISAN beneficiary-status page let farmers see where an instalment stands. The integrity of that trail depends on the office's own database. If a row is altered — an amount changed, a credit marked 'failed' after money actually moved, a beneficiary swapped — ordinary software notices nothing, and an audit must trust whatever the database currently says.

Existing System

  • Taluk-scale payment workflows are tracked in spreadsheets or plain CRUD systems with no cryptographic integrity.
  • Any officer with database access can silently modify amounts, swap accounts or retro-mark statuses.
  • Reconciliation between the office's records and bank acknowledgements is manual and produces disputes that neither side can prove.
  • Beneficiaries see a status screen but have no way to check that what it shows was ever truly sanctioned.
  • Blockchains solve this, but a full distributed ledger is neither deployable nor needed at taluk scale.

Proposed System

  • A Java web application that records each disbursement as an append-only event carrying its own SHA-256 hash and the previous event's hash.
  • A batch-sealing service that builds a binary Merkle tree over a sanctioned batch's events and stores the root in an append-only anchor table.
  • An optional anchoring extension (industry-standard extra) that posts each Merkle root to the Sepolia testnet via Web3j and stores the transaction hash, giving the trail an anchor that survives even a full local database rewrite.
  • A verification service that answers two questions on demand: is the whole trail internally consistent (full recompute), and does this receipt belong to the anchored batch (Merkle inclusion proof — logarithmic, no batch reveal).
  • Role-based workflow enforcement with a state machine (Verified → Sanctioned → PaymentFiled → Credited/Failed → Retry), duplicate-instalment checks per cycle, and a beneficiary status portal with printable, proof-bearing receipts.

Feasibility Study

  • Technical: Java's MessageDigest provides SHA-256; the Merkle builder is ~80 lines of plain Java; Web3j is one extra dependency used behind a feature flag. Tomcat, MySQL and JUnit run on any student laptop; the testnet option needs only an internet connection at anchoring time.
  • Economic: All components are open source; Sepolia test ether is free from public faucets.
  • Operational: Officers keep their existing flow — the app looks like a normal workflow tool — while the auditor gains a verify screen and the beneficiary gains a receipt QR that anyone can check.

Objectives

  1. 01Model the four-stage DBT disbursement workflow (verify, sanction, payment file, bank credit) as an enforced state machine over append-only events.
  2. 02Implement SHA-256 hash linking across all disbursement events so history cannot be rewritten without detection.
  3. 03Build a binary Merkle tree service that seals each sanctioned batch and stores the root in an append-only anchor table.
  4. 04Implement Merkle inclusion proofs so a receipt can be verified against the anchored root without revealing the rest of the batch.
  5. 05Integrate optional testnet anchoring of batch roots via Web3j as a clearly-labelled industry-standard extension, with a simulation fallback for offline demos.
  6. 06Enforce role-based access (field officer, taluk officer, disbursing officer, auditor) with duplicate-instalment and amount-tamper checks per cycle.
  7. 07Provide a beneficiary status portal with printable receipts carrying a proof QR code, plus JUnit tests for every proof and tamper case.

Scope

In scope

  • A single taluk office (simulated) with the four roles above and about 500 beneficiaries across 3 cycles of sample data.
  • Disbursement events, batches, Merkle sealing, anchor store, inclusion proofs, status portal, audit reports.
  • Optional Sepolia anchoring behind a configuration flag; simulation mode when offline.
  • No Aadhaar or government ID numbers anywhere — internal beneficiary codes and masked bank references only.

Out of scope (v1)

  • Real bank/NPCI integration: acknowledgements are imported from a CSV that stands in for the bank's file.
  • A private Hyperledger/Fabric network or any cryptocurrency payments.
  • Multi-taluk or state-level deployment, and GIS/land-record integration.
  • Grievance-workflow management beyond status display.

Methodology

The project uses an incremental model with weekly increments — the right fit for a 6-week mini project where each week must end in something demonstrable for the internal review.

WeekIncrementActivitiesReview deliverable
1Requirements & registryStudy the DBT disbursement flow (PM-KISAN, PFMS documentation), finalise scope, ER diagram, schema, beneficiary/land registry moduleRequirement list + ER
2Event trailAppend-only event recording with SHA-256 linking; state machine; role-based login; JUnit tests for linkingWorking trail demo
3Batches & MerkleBatch sanction service, binary Merkle builder (odd-leaf promotion), anchor table, duplicate-cycle checksSealed batch demo
4Proofs & portalInclusion-proof generator and verifier, receipt QR, beneficiary status screens, payment-file exportProof verification demo
5Anchoring & auditWeb3j testnet anchoring (flagged, with simulation fallback), full-trail audit report, tamper test suiteAnchor + audit demo
6Testing & reportIntegration tests, black-box test-case tables, report writing, PPT, dry-run vivaFinal submission

Testing approach: JUnit unit tests for hash vectors, tree building (including 3-leaf and 5-leaf odd cases) and proof generation/verification; tamper tests that mutate stored rows and assert detection; black-box test cases per screen; and a scripted end-to-end demo from field verification to a verified receipt.

Architecture & tech stack

6 diagrams · 7 technologies · 3 min read

  • Java
  • JSP/Servlets
  • MySQL
  • JavaScript
  • HTML/CSS
  • JUnit
  • Web3j (industry-standard extra)

UzhavanPay follows a classic three-tier Java web architecture with the cryptographic services isolated in a plain-Java core library so they can be tested without a servlet container.

  1. Presentation tier — JSP with JSTL, minimal JavaScript for the receipt-verification page; separate layouts per role.
  2. Application tier — Servlets and DAO classes implement the workflow; the crypto package holds HashUtil (SHA-256, canonical bytes), MerkleTree (build, root, proof) and AnchorPublisher (Web3j or simulation) — all pure Java, no container dependencies.
  3. Data tier — MySQL through JDBC with PreparedStatement everywhere; event, batch and anchor tables are append-only from the application.
flowchart LR
  B[Browser: officers / beneficiary] -->|HTTP| T[ Tomcat: Servlets + JSP ]
  T --> W[Workflow state machine]
  W --> DAO[JDBC DAOs - PreparedStatement]
  DAO --> DB[(MySQL)]
  W --> H[HashUtil - SHA-256 linking]
  W --> M[MerkleTree builder]
  M --> A[AnchorPublisher]
  A -->|flag on| S[Sepolia via Web3j]
  A -->|flag off| SIM[(Simulation anchor store)]
  T --> P[Proof service: inclusion proofs]
  P --> M

How a batch is sealed (Merkle tree)

flowchart TD
  R["Root: hash(h01 + h23)"] --> H01["h01 = hash(h0 + h1)"]
  R --> H23["h23 = hash(h2 + h3)"]
  H01 --> L0["h0: event 1 (verified payment)"]
  H01 --> L1["h1: event 2 (verified payment)"]
  H23 --> L2["h2: event 3 (verified payment)"]
  H23 --> L3["h3: event 4 (verified payment)"]

ER diagram

erDiagram
  USER ||--o{ DISBURSEMENT_EVENT : acts
  BENEFICIARY ||--o{ DISBURSEMENT_EVENT : "receives"
  CYCLE ||--o{ DISBURSEMENT_EVENT : "covers"
  BATCH ||--o{ DISBURSEMENT_EVENT : "seals as leaves"
  BATCH ||--o| ANCHOR_RECORD : "is anchored by"

  USER {
    string id PK
    string username UK
    string passwordHash
    string role
  }
  BENEFICIARY {
    string code PK
    string name
    string village
    string landAlias
    string bankRefMasked
    string status
  }
  CYCLE {
    string id PK
    string label
    decimal amount
  }
  DISBURSEMENT_EVENT {
    string id PK
    string beneficiaryCode FK
    string cycleId FK
    string stage
    decimal amount
    string officerId FK
    datetime at
    string eventHash
    string prevEventHash
    string batchId FK
  }
  BATCH {
    string id PK
    string cycleId FK
    string merkleRoot
    int leafCount
    datetime sanctionedAt
  }
  ANCHOR_RECORD {
    string id PK
    string batchId FK
    string merkleRoot
    string anchorType
    string txRef
    datetime anchoredAt
  }

DFD — Level 0 (context diagram)

flowchart LR
  FO([Field Officer]) --"verification events"--> SYS((UzhavanPay<br/>Disbursement Trail))
  TO([Taluk Officer]) --"sanction"--> SYS
  DO([Disbursing Officer]) --"payment file, bank acks"--> SYS
  BEN([Beneficiary]) --"status query, receipt proof"--> SYS
  SYS --"sanctioned batches, audit reports"--> TO
  SYS --"anchored roots"--> AN([Anchor: store / testnet])

DFD — Level 1

flowchart TD
  FO([Field Officer]) --> P2["2.0 Record verification event"]
  P2 <--> D3[(D3 Beneficiaries)]
  P2 <--> D4[(D4 Disbursement Events)]
  TO([Taluk Officer]) --> P3["3.0 Sanction batch + build Merkle tree"]
  D4 --> P3
  P3 --> D5[(D5 Batches)]
  P3 --> P4["4.0 Publish anchor"]
  P4 --> D6[(D6 Anchor Records)]
  DO([Disbursing Officer]) --> P5["5.0 Payment file + bank acknowledgements"]
  P5 <--> D4
  BEN([Beneficiary]) --> P6["6.0 Status + receipt proof"]
  D5 --> P6
  D6 --> P6
  D4 --> P6
  U([Any officer]) --> P1["1.0 Authenticate + role check"]
  P1 <--> D2[(D2 Users)]

Use-case diagram

flowchart LR
  FO([Field Officer])
  TO([Taluk Officer])
  DO([Disbursing Officer])
  BEN([Beneficiary])
  subgraph UP[UzhavanPay]
    UC1(Login)
    UC2(Verify beneficiary + record event)
    UC3(Sanction batch and seal Merkle root)
    UC4(Generate payment file)
    UC5(Import bank credit acknowledgements)
    UC6(View status and verify receipt proof)
    UC7(Run full-trail audit)
    UC8(Anchor root to testnet)
  end
  FO --- UC1 & UC2
  TO --- UC1 & UC3 & UC7 & UC8
  DO --- UC1 & UC4 & UC5
  BEN --- UC6

Modules

6 modules

  1. Module 01

    Beneficiary and Land Registry

    CRUD for beneficiaries keyed by an internal code, with village, a land-parcel alias, masked bank reference and status; cycle definitions with per-instalment amounts; duplicate and eligibility checks (one instalment per beneficiary per cycle) enforced at insert time. No Aadhaar, account number or other government ID is ever stored, only the masked reference.

  2. Module 02

    Disbursement Event Trail (State Machine + Hash Linking)

    Every workflow action writes an append-only event — VERIFIED, SANCTIONED, PAYMENT_FILED, CREDITED or FAILED — stamped with the acting officer, hashed with SHA-256 over a canonical byte format and linked to the previous event's hash. Illegal transitions (for example crediting an un-sanctioned event) are rejected by the state machine, and JDBC transactions keep the chain linear under concurrent officers.

  3. Module 03

    Batch Sanction and Merkle Tree Builder

    The taluk officer sanctions a batch of verified events; the builder hashes each event as a leaf, promotes the last hash when a level has an odd number of leaves, and stores the root with the batch. The anchor table is INSERT-only from the application — even the code that seals a batch cannot update a previously anchored root, which is the property the audit relies on.

  4. Module 04

    Anchor Publisher (Web3j Extension) and Inclusion-Proof Service

    AnchorPublisher has two modes behind one flag: simulation mode writes the root to the local anchor store, and testnet mode posts it to Sepolia through Web3j and stores the transaction hash. The proof service answers a receipt query with the leaf hash and sibling hashes up the tree; the JSP verification page recomputes the root locally and shows PASS or FAIL against the anchored root.

  5. Module 05

    Payment File, Bank Acknowledgements and Reports

    Generates a CSV payment file (masked references only) that stands in for the bank's interface, imports the returned acknowledgement CSV to mark events CREDITED or FAILED, and produces audit reports: batch summaries, events altered-after-the-fact (always zero unless a tamper test ran), and a full-trail recompute that pins the first broken hash.

  6. Module 06

    Authentication, Roles and Security

    Login with salted PBKDF2 password hashing, session timeout, and role checks in a servlet filter (field/taluk/disbursing/auditor). All SQL uses PreparedStatement, the JSPs escape output to prevent XSS, receipt verification is rate-limited, and the whole security design is documented as a dedicated report section for the viva.

Slides

12 slides · titles free · bullets, notes and the .pptx unlock

  1. Slide 1

    Tamper-Evident Farm-Subsidy Disbursement Trail

  2. Slide 2

    Context: How a Farm Subsidy Travels

  3. Slide 3

    Problem Statement

  4. Slide 4

    Proposed System

  5. Slide 5

    Objectives

  6. Slide 6

    Technology Stack

  7. Slide 7

    Merkle Trees: Batch Sealing and Proofs

  8. Slide 8

    System Architecture and Database

  9. Slide 9

    Screenshots / Live Demo

  10. Slide 10

    Testing

  11. Slide 11

    Security and Limitations

  12. Slide 12

    Conclusion and Future Scope

Bullets, speaker notes and the .pptx · ₹2,000

The titles above are the real outline. The rest is what you present from.

Unlock for ₹2,000

Viva questions & answers

3 of 15 answered free · 12 unlock

Read each answer, close it, and say it in your own words. Your viva will ask. Now you'll know.

  1. 01Concept

    What is a Merkle tree and why does your design prefer it over the simple hash chain you could have used?

    A Merkle tree is a binary tree of hashes where leaves are event hashes and each parent is the hash of its children, ending in one root. A chain proves the whole history but any verification means recomputing everything, while a tree lets me prove one payment's inclusion with only log2(n) sibling hashes and without revealing the rest of the batch — which is exactly what a beneficiary receipt needs.

  2. 02Concept

    You did not build a blockchain network. Defend that decision for an examiner who expected one.

    A blockchain is a distributed consensus system for mutually distrusting parties; a taluk office is a single authority whose real problem is insider tampering and external verifiability. Hash-linked events plus an anchored Merkle root deliver tamper-evidence and third-party verification, and the Web3j extension gives the root a home outside the office's database — the properties that matter — without running nodes or needing cryptocurrency, which no taluk office would operate.

  3. 03Concept

    What exactly does the Web3j extension do, and why is it labelled an industry-standard extra?

    Web3j is a Java library for talking to Ethereum clients. In testnet mode my AnchorPublisher builds a transaction whose data field carries the batch's Merkle root, signs it with a test-only wallet and submits it to Sepolia, storing the returned transaction hash in the anchor record. It is an extra because the University of Madras syllabus does not cover Ethereum — the core project runs entirely on the profile's Java/MySQL stack, and the flag can be off with simulation mode instead.

+12 more questions, with answers

Try the free ones out loud first. Your examiner will not accept “it's in the PPT”.

Source code & how to run

7 steps · complete source code · unlocks with the project

Unlocks with the project · ₹2,000

7 steps · source code zip

Prerequisites, install, seed data and tests, written for demo day. Plus the complete source.

Unlock for ₹2,000

READMEFIRST

279 words · unlocks with the project

What to change before it goes anywhere near a submission. Skipping it is how the demo fails live.

Unlocks with the project · ₹2,000

279 words · ~1 min read

The checklist of things to rename, re-seed and re-think so the project reads as yours.

Unlock for ₹2,000

Instructions

351 words · unlocks with the project

How to study it, adapt it and walk your examiner through it, step by step.

Unlocks with the project · ₹2,000

351 words · ~2 min read

Report structure, formatting rules and the submission checklist your department will grade.

Unlock for ₹2,000

References

8 sources

  1. Jakarta EE — Servlet specifications (Eclipse Foundation)
  2. Oracle — Java SE 17 API documentation (java.security.MessageDigest)
  3. MySQL 8.0 Reference Manual
  4. R. C. Merkle, A Digital Signature Based on a Conventional Encryption Function, CRYPTO '87 — the original Merkle tree paper
  5. Web3j — Java and Android integration library for Ethereum
  6. PM-KISAN — Pradhan Mantri Kisan Samman Nidhi, Government of India (beneficiary status and instalment pattern)
  7. PFMS — Public Financial Management System, Controller General of Accounts, Government of India (DBT payment tracking)
  8. Cay S. Horstmann, Core Java Volume I — Fundamentals, 12th ed., Pearson

Cite this bundle

OnlyProjects. (2026). Tamper-Evident Farm-Subsidy Disbursement Trail with Merkle-Batch Anchoring (Java, MySQL): BCA Blockchain project bundle [Educational resource]. https://onlyprojects.online/projects/bca-blockchain-farm-subsidy-disbursement-trail

Future scope

1 min read

  • Federation: several taluk offices anchoring roots to a shared permissioned ledger (Hyperledger Fabric), turning one trail into a district-wide one.
  • Signed payment files: cryptographically sign the bank CSV so the bank can verify it came from the office unaltered.
  • Grievance workflow: beneficiary-raised disputes that auto-attach the Merkle proof and audit extract.
  • Land-record verification hooks: plugging the registry into state land-record portals for automated eligibility re-checks.
  • Analytics: cycle-level dashboards (sanction-to-credit time, failure rates by bank branch) for the collector's review.

Keep browsing

Same degree, same syllabus slot, different idea. Pick the one your guide will actually approve.

BCACode included

Web Development

Smart Hostel Management System

Room allocation, complaints and mess billing without the register

  • Next.js
  • TypeScript
  • Node.js
  • +3

intermediate8 wk2 students