A full-featured banking system demonstrating real banking operations
π Quick Start | π Documentation | π€ Contributing
LedgerCOBOL is a full-featured core banking system implemented in COBOL, demonstrating real banking operations including transfers, transaction history, and role-based access control.
π‘ 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
|
PIN-based login with session management and account lockout. Send money between accounts with full validation. Complete audit trail with date, time, and amount. |
Admin, Teller, Customer with different permissions. Create new bank accounts with auto-generated numbers. Customers can only access their own account. |
| 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 | β | β | β |
| 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 |
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# 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- Run the program
- Select "2. Init System" to create default admin and sample data
- Login with default admin credentials
| Username | PIN | Role |
|---|---|---|
| ADMIN | 123456 | Administrator |
β οΈ Important: Change the default admin PIN after first login!
================================================
=== 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 ===
================================================
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 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
========================================
---------------------------------------------------------------------------
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
| 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 |
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
| 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 |
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-featureLedgerCOBOL 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.
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.
This project is licensed under the MIT License - see the LICENSE file for details.
β Star this repo if you find it useful!
v4.0 - COBOL + AI + Solana Blockchain π
π Quick Start β’ π€ AI Agent β’ πͺ Blockchain β’ π Docs