Skip to content

revengerrr/LedgerCOBOL

Repository files navigation

COBOL Logo

🏦 LedgerCOBOL

Classic Core Banking System Built with COBOL

A full-featured banking system demonstrating real banking operations

Quick Start Features License

COBOL AI Solana Version Platform


πŸš€ Quick Start | πŸ“– Documentation | 🀝 Contributing


🎯 What is LedgerCOBOL?

LedgerCOBOL is a full-featured core banking system implemented in COBOL, demonstrating real banking operations including transfers, transaction history, and role-based access control.

Why COBOL?

πŸ’‘ Fun Fact: Over 95% of ATM transactions and 80% of in-person transactions still use COBOL today!

  • βœ… Battle-Tested - Running banks since 1959
  • βœ… Reliable - Processes trillions of dollars daily
  • βœ… Educational - Learn how real banking systems work
  • βœ… Full-Featured - Transfer, history, access control

✨ Features

πŸ” Real Authentication

PIN-based login with session management and account lockout.

πŸ’± Transfer Between Accounts

Send money between accounts with full validation.

πŸ“ Transaction History

Complete audit trail with date, time, and amount.

πŸ‘₯ Role-Based Access

Admin, Teller, Customer with different permissions.

🏦 Account Management

Create new bank accounts with auto-generated numbers.

πŸ”’ Customer Access Control

Customers can only access their own account.


πŸ‘₯ Role-Based Access Control

Feature Admin Teller Customer
Create User βœ… βœ… ❌
View All Users βœ… ❌ ❌
Create Account βœ… βœ… ❌
Init Database βœ… ❌ ❌
Deposit/Withdraw βœ… (any) βœ… (any) βœ… (own)
Transfer βœ… (any) βœ… (any) βœ… (from own)
View History βœ… (all) βœ… (all) βœ… (own)
Account Report βœ… βœ… βœ… (own)
Change PIN βœ… βœ… βœ…

πŸ“ Components

File Description
BANK-MAIN.CBL Main program with role-based dashboards
LOGIN.CBL Real authentication with session management
CREATE-USER.CBL Admin/Teller create new users
LIST-USERS.CBL Admin view all users
CREATE-ACC.CBL Create new bank accounts
INIT-DB.CBL Initialize sample account data
INIT-USERS.CBL Initialize default admin user
TRANS-PROC.CBL Deposit/Withdraw with history logging
TRANSFER.CBL Transfer between accounts
HISTORY.CBL View transaction history
REPORT-GEN.CBL Account balance report
CHANGE-PIN.CBL Change user PIN
ACCOUNTS.CPY Account record copybook
USERS.CPY User record copybook
HISTORY.CPY Transaction history copybook

πŸš€ Quick Start

Prerequisites

You need GnuCOBOL installed on your system.

πŸ“¦ Windows (MSYS2)
pacman -Sy
pacman -S mingw-w64-x86_64-gnucobol
cobc --version
🐧 Linux (Debian/Ubuntu)
sudo apt-get update
sudo apt-get install gnucobol
🍎 macOS (Homebrew)
brew install gnucobol

Compilation & Execution

# Compile all modules
cobc -m INIT-DB.CBL
cobc -m INIT-USERS.CBL
cobc -m LOGIN.CBL
cobc -m CREATE-USER.CBL
cobc -m LIST-USERS.CBL
cobc -m CREATE-ACC.CBL
cobc -m TRANS-PROC.CBL
cobc -m TRANSFER.CBL
cobc -m HISTORY.CBL
cobc -m REPORT-GEN.CBL
cobc -m CHANGE-PIN.CBL

# Compile main program
cobc -x BANK-MAIN.CBL

# Run
./BANK-MAIN        # Linux/macOS
BANK-MAIN.exe      # Windows

πŸ–₯️ Usage

First Time Setup

  1. Run the program
  2. Select "2. Init System" to create default admin and sample data
  3. Login with default admin credentials

Default Admin Account

Username PIN Role
ADMIN 123456 Administrator

⚠️ Important: Change the default admin PIN after first login!


Admin Dashboard

================================================
            === ADMIN DASHBOARD ===             
================================================
User: ADMIN
Role: Administrator
------------------------------------------------

--- User Management ---
 1. Create New User
 2. View All Users

--- Account Management ---
 3. Create New Account
 4. Init Account Database

--- Transactions ---
 5. Deposit / Withdraw
 6. Transfer Between Accounts
 7. Transaction History

--- Reports ---
 8. Account Balance Report

--- Settings ---
 9. Change My PIN

99. Logout & Exit

Customer Dashboard

================================================
          === CUSTOMER DASHBOARD ===            
================================================
User   : JOHN DOE
Role   : Customer
Account: 1000000001
------------------------------------------------

--- Banking Services ---
 1. Deposit / Withdraw
 2. Transfer to Another Account
 3. View My Balance
 4. My Transaction History

--- Settings ---
 5. Change My PIN

99. Logout & Exit

πŸ’± Transfer Feature

========================================
        TRANSFER BETWEEN ACCOUNTS          
========================================

From Account: 1000000001 (Your Account)
To Account Number: 1000000002
Amount: 500000

Processing transfer...

========================================
       TRANSFER SUCCESSFUL!            
========================================

From    : 1000000001 (JOHN DOE)
To      : 1000000002 (JANE SMITH)
Amount  : $500,000.00

========================================

πŸ“ Transaction History

========================================
        TRANSACTION HISTORY            
========================================

---------------------------------------------------------------------------
DATE       | TIME     | TYPE     | AMOUNT          | FROM/TO
---------------------------------------------------------------------------
2026-03-03 | 14:30:25 | TRANSFER | $500,000.00
           FROM: 1000000001 -> TO: 1000000002
2026-03-03 | 14:25:10 | DEPOSIT  | $100,000.00     | 1000000001
2026-03-03 | 14:20:05 | WITHDRAW | $50,000.00      | 1000000002
---------------------------------------------------------------------------

Total Transactions: 3

πŸ”’ Security Features

Feature Description
Real Authentication Validates against USERS.DAT database
Session Management Login state saved to SESSION.DAT
Account Lockout Locked after 3 failed attempts
Customer Isolation Customers only access own account
Transfer Validation Check balance before transfer
Audit Trail All transactions logged to HISTORY.DAT
Session Cleanup Session file deleted on logout

πŸ—‚οΈ Project Structure

ledgercobol/
β”œβ”€β”€ πŸ“„ BANK-MAIN.CBL      # Main program
β”œβ”€β”€ πŸ“„ LOGIN.CBL          # Authentication
β”œβ”€β”€ πŸ“„ CREATE-USER.CBL    # User creation
β”œβ”€β”€ πŸ“„ LIST-USERS.CBL     # List users
β”œβ”€β”€ πŸ“„ CREATE-ACC.CBL     # Account creation
β”œβ”€β”€ πŸ“„ INIT-DB.CBL        # Init accounts
β”œβ”€β”€ πŸ“„ INIT-USERS.CBL     # Init users
β”œβ”€β”€ πŸ“„ TRANS-PROC.CBL     # Deposit/Withdraw
β”œβ”€β”€ πŸ“„ TRANSFER.CBL       # Transfer
β”œβ”€β”€ πŸ“„ HISTORY.CBL        # Transaction history
β”œβ”€β”€ πŸ“„ REPORT-GEN.CBL     # Reports
β”œβ”€β”€ πŸ“„ CHANGE-PIN.CBL     # Change PIN
β”œβ”€β”€ πŸ“„ ACCOUNTS.CPY       # Account copybook
β”œβ”€β”€ πŸ“„ USERS.CPY          # User copybook
β”œβ”€β”€ πŸ“„ HISTORY.CPY        # History copybook
β”œβ”€β”€ πŸ“ ai-agent/          # πŸ€– AI Integration
β”‚   β”œβ”€β”€ 🐍 ai_agent.py
β”‚   β”œβ”€β”€ πŸ“‹ requirements.txt
β”‚   β”œβ”€β”€ πŸ”§ setup.sh
β”‚   └── πŸ“– README.md
β”œβ”€β”€ πŸ“ blockchain/        # πŸͺ™ Solana Integration
β”‚   β”œβ”€β”€ 🐍 solana_bridge.py
β”‚   β”œβ”€β”€ πŸ“‹ requirements.txt
β”‚   β”œβ”€β”€ πŸ”§ setup.sh
β”‚   └── πŸ“– README.md
β”œβ”€β”€ πŸ“ assets/
β”‚   └── πŸ–ΌοΈ cobol-logo.jpeg
β”œβ”€β”€ πŸ“ .gitignore
β”œβ”€β”€ πŸ“– README.md
β”œβ”€β”€ πŸ“– CONTRIBUTING.md
└── πŸ“œ LICENSE

πŸ”§ Data Files

File Description Auto-generated
USERS.DAT User credentials & roles By INIT-USERS
ACCOUNTS.DAT Bank accounts & balances By INIT-DB
SESSION.DAT Current login session By LOGIN
HISTORY.DAT Transaction audit trail By transactions

🀝 Contributing

Contributions are welcome! See CONTRIBUTING.md for guidelines.

git checkout -b feature/amazing-feature
git commit -m "feat: add amazing feature"
git push origin feature/amazing-feature

πŸ€– AI Agent

LedgerCOBOL supports natural language commands via AI!

πŸ‘€ You: "Transfer 500000 to account 1000000002"

πŸ€– AI: I'll transfer $500,000 to account 1000000002.
       ⏳ Processing transfer...
       βœ… Transfer successful!
cd ai-agent
./setup.sh          # Install dependencies
ollama serve        # Start AI (in separate terminal)
python ai_agent.py  # Run the agent

πŸ“– See ai-agent/README.md for full documentation.


πŸͺ™ Solana Blockchain Integration

Every transaction gets recorded on Solana blockchain (Devnet) - creating an immutable audit trail!

COBOL Transaction β†’ SHA256 Hash β†’ Solana Devnet β†’ Immutable Proof βœ…

Features:

  • πŸ”— Real blockchain - Verifiable on Solana Explorer
  • πŸ†“ 100% FREE - Uses Devnet (test network)
  • πŸ”’ Immutable - Cannot be altered once recorded
  • πŸ“Š Auto-sync - Syncs from COBOL HISTORY.DAT
cd blockchain
pip install -r requirements.txt
python solana_bridge.py

πŸ“– See blockchain/README.md for full documentation.


πŸ“œ License

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


Made with πŸ’™ for COBOL enthusiasts

⭐ Star this repo if you find it useful!


v4.0 - COBOL + AI + Solana Blockchain πŸš€

πŸš€ Quick Start β€’ πŸ€– AI Agent β€’ πŸͺ™ Blockchain β€’ πŸ“– Docs

About

A COBOL banking system with AI integration. Built to learn how legacy code still powers modern banking.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors