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

Tamper-Evident Digital Udhaar (Credit) Ledger for a Kirana Store (Python, MySQL)

The shopkeeper's credit book rebuilt as a hash-chained ledger, where a torn page or an altered amount can no longer be hidden

Mapped to your syllabusIGNOU BCA (revised) — BCSP-064 guidelines · BCSP-064 Project · Semester 6

Overview

1 min read

SahiKhata is a tamper-evident digital version of the udhaar bahi-khata — the ruled credit register that sits behind the counter of almost every Indian kirana store, where the shopkeeper writes down what each regular customer takes on credit and strikes it off when cash is paid. Pages tear, entries get overwritten, amounts are disputed at the end of the month, and the register is the only copy in existence.

This project rebuilds that register as a small web application with one property a paper book can never have: the entries cannot be quietly altered. Every credit sale and repayment is hashed with SHA-256 and linked to the hash of the previous entry. At closing time the day's entries are sealed into a block whose header carries the previous block's hash and a small simulated proof-of-work — the same pattern a real blockchain uses, implemented in plain Python on top of MySQL.

A Verify Chain screen recomputes the whole chain on demand and pinpoints the exact record where any tampering happened, which makes a memorable live demo for the viva.

The stack is deliberately beginner-friendly: Python and Flask for the application, MySQL for storage, with the hash functions coming from Python's built-in hashlib. This is a simulated blockchain — there is no public network or cryptocurrency — which is exactly the depth an individual BCSP-064 project should attempt and defend.

Relevant for
All India
Level
Beginner · 14 weeks · solo
Common at
IGNOU, University of Madras, University of Kerala
Updated
Nov 2026

Syllabus alignment

IGNOU · BCA (revised) — BCSP-064 guidelines

BCSP-064 · Project · Semester 6 · 8 credits · 200 = report 150 + viva 50 (≥40% each)

Subjects this project applies
  • Python programming
  • JavaScript
  • MySQL (Oracle / MySQL)
  • HTML/CSS
How it is evaluated

Team: individual only

synopsis with DFD (≥ level 2), ER/class diagrams; 50–80-page hardbound report (±10%); test cases; security section. Prohibited: C/C++ for DB projects, VB + MS-Access, dBase/FoxPro. Plagiarism → Exam Discipline Committee

Also fits: University of Madras CBCS 2023-24, Kerala University FYUGP 2024.

What's in the box

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

Problem & synopsis

5 min read

Problem statement

A neighbourhood kirana store extends credit to its regular customers through a paper udhaar register. The register is the single, unbacked copy of who owes what, and it offers no protection: a page can be torn out, an amount overwritten after the fact, a repayment strike-off disputed, or an employee quietly erase a debt. At month end the shopkeeper hand-tallies the book, and every mismatch becomes an argument that neither side can prove. Even when the store moves to Excel or a simple billing app, the same integrity problem remains, because any row of a spreadsheet or database table can be edited silently.

There is a need for a ledger that is append-only in practice — where recording a sale is easy but secretly altering or deleting a past record becomes impossible to hide — together with customer statements, dues reports and backups, at a cost and complexity a single-shopkeeper business can afford.

Synopsis

Abstract

SahiKhata is an individual BCA final-year project that digitises the credit (udhaar) register of a neighbourhood kirana store as a tamper-evident, hash-chained ledger. Each credit sale and repayment is recorded as an event that carries its own SHA-256 hash and the hash of the previous event. At day end the events are sealed into blocks linked by block hashes, with a simulated proof-of-work. A verification routine can prove the ledger has not been altered and locate any tampering precisely. The application is built with Python, Flask and MySQL.

Introduction

The udhaar register is one of the oldest databases in India. A typical store has 100–300 regular customers; the shopkeeper records a few dozen credit entries a day and settles accounts weekly or monthly. The register works, but it offers no integrity: a page can be torn out, an amount overwritten, a repayment strike-off disputed, or a dispute settled by whoever remembers best. The shopkeeper also has no backups — losing the book loses the entire receivables list.

Existing System

  • Credit entries live in a paper register; repayments are struck off with a pen.
  • Any party with physical access can alter or remove a record without a trace.
  • Month-end totals are calculated by hand, causing reconciliation disputes.
  • There is no customer-wise statement, no dues report and no backup.
  • Computerised alternatives (Excel sheets, basic billing apps) fix the arithmetic but not the integrity problem: a cell or row can still be edited silently.

Proposed System

  • A web application where the shopkeeper (and a limited assistant role) record credit sales and repayments.
  • Every ledger event stores a canonical representation, its SHA-256 hash, and the hash of the previous event, forming a hash chain.
  • A nightly/optional close the day action seals the day's events into a block whose header contains the previous block's hash, a Merkle-style summary root and a nonce found by a small proof-of-work simulation (hash must start with two zeros).
  • A Verify Chain page recomputes all hashes and reports the first inconsistent event or block, proving tampering.
  • Customer statements, outstanding-dues reports, daily closing summaries and CSV export.
  • Secure login with hashed passwords, session timeout and an audit log of privileged actions.

Feasibility Study

  • Technical: Python's standard library provides hashlib and hmac; Flask and MySQL are installed with a few commands and run comfortably on an i3 laptop. All logic is local — no blockchain node, cloud account or internet dependency is needed for the demo.
  • Economic: Zero licence cost; everything is open source.
  • Operational: The interface mirrors the mental model of the register (customer page, add entry, settle up). A shopkeeper needs one short walkthrough; the assistant role is read-and-add only.

Objectives

  1. 01Design a normalised (3NF) MySQL schema for users, customers, ledger events and sealed blocks.
  2. 02Implement SHA-256 hash chaining so every ledger event stores its own hash and the previous event's hash.
  3. 03Implement daily block sealing, where each block header carries the previous block's hash, an event-count summary root and a nonce from a simulated proof-of-work.
  4. 04Build a chain-verification audit that recomputes every hash and reports the first tampered event or block.
  5. 05Provide secure role-based login (shopkeeper, assistant) with salted password hashing, session timeout and an audit log.
  6. 06Generate customer statements, outstanding-dues reports and daily closing summaries with CSV export.
  7. 07Validate all input on the server and use parameterised queries for every database access.

Scope

In scope

  • A single store with two roles: Shopkeeper (full control) and Assistant (add entries only).
  • Customers managed by name and phone number — no government ID numbers are stored.
  • Credit-sale events and repayment events, both hash-chained in one ledger.
  • Close-the-day sealing into blocks with the simulated proof-of-work.
  • Verify Chain audit page, customer statements, dues report, daily summary, CSV export.
  • Designed for a few thousand events per year — the scale of one shop.

Out of scope (v1)

  • A public blockchain, cryptocurrency, wallets or any real distributed network.
  • WhatsApp/SMS payment reminders and online payment collection.
  • Multi-store or franchise deployment.
  • Barcode scanning and inventory management.
  • Handwritten-register import (future scope).

Methodology

The project follows the Waterfall model with a verification checkpoint at the end of each phase. This suits an individual, part-time IGNOU project because the requirements are small and stable (one shop, two roles, one ledger), the developer works alone, and each phase produces a reviewable document for the guide.

PhaseWeeksActivitiesDeliverable
Requirement analysis1–2Observe the register workflow at a local store, list functional and non-functional requirements, decide what is out of scopeSRS with use cases
System design3–4ER diagram, DFD level 0/1/2, schema design, wireframes, define the canonical event format and hash inputsDesign document
Implementation5–9Schema + auth → ledger events with hash chaining → block sealing → verification audit → statements/reportsWorking modules
Testing10–11Unit tests for hashing, chaining and sealing; deliberate tamper tests; black-box test-case tables; UAT with a month of sample dataTest report
Documentation & viva prep12–14Report chapters, security section, diagrams, demo script, PPT, dry-run vivaFinal submission

Testing approach: unit tests cover the pure hash/chain functions (known-vector tests for SHA-256, chain-tail update, block-header recomputation); tamper tests deliberately UPDATE a stored amount, re-run verification and assert that the exact event is reported; black-box test cases cover every screen with documented input/expected/actual columns.

Architecture & tech stack

6 diagrams · 5 technologies · 2 min read

  • Python
  • Flask
  • MySQL
  • JavaScript
  • HTML/CSS

SahiKhata is a three-tier web application:

  1. Presentation tier — server-rendered Jinja templates styled with plain CSS, plus a little JavaScript for the statement print view. Works on the shop laptop and a phone browser.
  2. Application tier — Flask blueprints (auth, customers, ledger, blocks, reports). All business rules — validation, canonical formatting, hashing, chain linking, block sealing, verification — live here, never in the browser.
  3. Data tier — MySQL, accessed exclusively through parameterised queries. Ledger and block tables are effectively append-only: the application never issues UPDATE or DELETE on them.
flowchart LR
  U[Browser: Shopkeeper / Assistant] -->|HTTPS| F[Flask app]
  F --> A[Auth and session check]
  A --> C[Customers blueprint]
  A --> L[Ledger blueprint]
  A --> B[Blocks blueprint]
  L --> H[Hash-chain engine: SHA-256]
  B --> P[Proof-of-work simulation]
  H --> Q[Parameterised queries]
  Q --> DB[(MySQL)]
  B --> V[Verify-chain audit]

ER diagram

erDiagram
  USER ||--o{ LEDGER_EVENT : records
  CUSTOMER ||--o{ LEDGER_EVENT : "is involved in"
  BLOCK ||--o{ LEDGER_EVENT : seals

  USER {
    string id PK
    string username UK
    string passwordHash
    string role
  }
  CUSTOMER {
    string id PK
    string name
    string phone
    decimal outstanding
  }
  LEDGER_EVENT {
    string id PK
    string customerId FK
    string type
    string itemsSummary
    decimal amount
    datetime createdAt
    string entryHash
    string prevEntryHash
    string blockId FK
  }
  BLOCK {
    string id PK
    date blockDate
    string prevBlockHash
    string summaryRoot
    int nonce
    string blockHash
    int eventCount
  }

DFD — Level 0 (context diagram)

flowchart LR
  S([Shopkeeper]) --"credit sales, repayments, close day"--> SYS(("SahiKhata Ledger"))
  SYS --"statements, dues, verification result"--> S
  A2([Assistant]) --"credit sales only"--> SYS
  C([Customer]) --"cash repayment"--> S
  SYS --"printed statement"--> C

DFD — Level 1

flowchart TD
  S([Shopkeeper]) --> P6[6.0 Authenticate]
  P6 <--> D1[(D1 Users)]
  S --> P1[1.0 Record ledger event]
  A2([Assistant]) --> P1
  P1 <--> D2[(D2 Customers)]
  P1 <--> D3[(D3 Ledger Events)]
  S --> P2[2.0 Seal daily block]
  P2 <--> D3
  P2 <--> D4[(D4 Blocks)]
  S --> P3[3.0 Verify chain]
  D3 --> P3
  D4 --> P3
  P3 --"verification result"--> S
  S --> P4[4.0 Manage customers]
  P4 <--> D2
  S --> P5[5.0 Statements and reports]
  D2 --> P5
  D3 --> P5
  P5 --"statement / CSV"--> S

DFD — Level 2 (process 1.0 exploded)

flowchart TD
  S(["Shopkeeper / Assistant"]) --> P11["1.1 Validate entry form"]
  P11 --"rejected"--> S
  P11 --"validated event"--> P12["1.2 Build canonical string and compute SHA-256"]
  D3[(D3 Ledger Events)] --"current chain tip hash"--> P13["1.3 Link to previous hash"]
  P12 --> P13
  P13 --"event with hash and prevHash"--> P14["1.4 Append inside one transaction"]
  P14 --> D3
  P14 --"new outstanding"--> D2[(D2 Customers)]

Use-case diagram

flowchart LR
  S([Shopkeeper])
  A([Assistant])
  subgraph SK[SahiKhata]
    UC1(Login)
    UC2(Add customer)
    UC3(Record credit sale)
    UC4(Record repayment)
    UC5(Close day / seal block)
    UC6(Verify chain)
    UC7(Print statement)
    UC8(View dues and export CSV)
  end
  S --- UC1 & UC2 & UC3 & UC4 & UC5 & UC6 & UC7 & UC8
  A --- UC1 & UC3 & UC7

Modules

6 modules

  1. Module 01

    Authentication, Roles and Audit Log

    Username/password login for the shopkeeper and assistant roles. Passwords are salted and hashed with PBKDF2 from Python's standard library; sessions expire after 30 idle minutes; the assistant role can only add entries and view statements. Every privileged action (sealing a block, running verification, editing a customer) is written to an audit log table with user and timestamp.

  2. Module 02

    Customer Management

    Add, search, view and (soft) deactivate customers, each with name, phone and running outstanding balance. The customer page is the digital equivalent of one khata page: the full event history for that person, current balance, and a printable statement for settling monthly accounts.

  3. Module 03

    Ledger Event Recording with Hash Chaining

    Records credit sales and repayments as typed events. Each event is serialised into a canonical string (type, customer id, amount in paise, items summary, timestamp), hashed with SHA-256, and stored together with the previous event's hash. Writes happen inside one transaction that re-reads the chain tip, so the chain stays linear even if two entries are saved at once.

  4. Module 04

    Daily Block Sealing (Simulated Blockchain)

    At closing time the day's unsealed events are grouped into a block. The header stores the previous block's hash, the date, the event count, a summary root computed by hashing the concatenated event hashes, and a nonce found by incrementing until the block hash starts with two zeros — a small, honest demonstration of proof-of-work cost without wasting real electricity.

  5. Module 05

    Verify Chain and Tamper Audit

    A one-click audit recomputes every event hash, every event-to-event link and every block header from stored data. It reports 'chain intact' or the exact first record where the recomputed hash diverges, which is the project's signature demo: the examiner alters a value directly in MySQL, the audit flags that precise row, and the shopkeeper finally has evidence a dispute cannot overwrite.

  6. Module 06

    Statements, Dues and Reports

    Customer statement with a print-friendly layout for monthly settlement; an outstanding-dues report sorted by amount and age; a daily closing summary of events and blocks; CSV export of all three for the shopkeeper's records or a tax consultant.

Slides

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

  1. Slide 1

    Tamper-Evident Digital Udhaar Ledger for a Kirana Store

  2. Slide 2

    Introduction: The Udhaar Register Problem

  3. Slide 3

    Problem Statement

  4. Slide 4

    Proposed System

  5. Slide 5

    Objectives

  6. Slide 6

    Technology Stack

  7. Slide 7

    How the Hash Chain Works

  8. Slide 8

    System Architecture and Database

  9. Slide 9

    Screenshots / Live Demo

  10. Slide 10

    Testing

  11. Slide 11

    Security Considerations

  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 cryptographic hash function, and which properties of SHA-256 make it suitable for your ledger?

    A hash function converts any input into a fixed-size digest. SHA-256 is deterministic (same input, same digest), has an avalanche effect where one changed bit changes about half the output bits, and is infeasible to invert or to fake with a collision. That means any alteration of a stored entry produces a completely different hash, which is what my verification audit detects.

  2. 02Concept

    You call this a simulated blockchain. What exactly is simulated, and why did you not use a real one?

    The chain structure, hash linking, block headers and proof-of-work are all implemented faithfully — but the chain lives in one MySQL database controlled by one store, and the proof-of-work difficulty is two zeros instead of a network-grade target. A public blockchain needs a distributed network of nodes and cryptocurrency economics, which is neither needed nor feasible for one shop; the tamper-evidence the shopkeeper needs comes entirely from hash linking plus an external check.

  3. 03Concept

    How is your system different from an ordinary accounting or billing application?

    A normal app stores current values and can edit or delete them; integrity depends entirely on access control. My system is append-only in practice: each record commits to the previous record's hash, so history is locked. An accounting app answers 'what does he owe?', mine additionally proves 'this is what was written at the time, unaltered' — and the Verify Chain audit is the proof mechanism.

+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

292 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

292 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

367 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

367 words · ~2 min read

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

Unlock for ₹2,000

References

7 sources

  1. Python 3 Documentation — hashlib (Secure hashes and message digests)
  2. Flask Documentation (Pallets)
  3. MySQL 8.0 Reference Manual
  4. NIST FIPS 180-4 — Secure Hash Standard (SHA-256)
  5. Satoshi Nakamoto, Bitcoin: A Peer-to-Peer Electronic Cash System (2008) — the original hash-chain and proof-of-work description
  6. OWASP Top 10 — Web Application Security Risks
  7. Abraham Silberschatz, Henry F. Korth & S. Sudarshan, Database System Concepts, 7th ed., McGraw-Hill

Cite this bundle

OnlyProjects. (2026). Tamper-Evident Digital Udhaar (Credit) Ledger for a Kirana Store (Python, MySQL): BCA Blockchain project bundle [Educational resource]. https://onlyprojects.online/projects/bca-blockchain-kirana-udhaar-hash-chain-ledger

Future scope

1 min read

  • External anchoring: publish each sealed block's hash as a QR code on the shop noticeboard, or optionally write it to a public blockchain testnet, so even a full local database rewrite can be detected against an external copy.
  • Reminder integration: WhatsApp/SMS nudges for customers whose dues cross an age threshold.
  • Register migration: photograph each page of the old paper register and semi-automatically seed the opening balances.
  • Offline-first PWA so the app keeps working when the shop's broadband drops, syncing later.
  • Migration path to a permissioned blockchain such as Hyperledger Fabric for a federation of stores — a natural upgrade story for the same project.

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