Skip to content

melvinthoompunkal/Blockchain_Credit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 

Repository files navigation

Decentralized Credit Scoring with Alternative Data

This project explores a decentralized approach to credit scoring by leveraging non-traditional data sources such as phone bills, utility payments, and other financial records. Built using Python, Solidity, and the Brownie framework, the system calculates credit scores off-chain and stores summarized results on-chain using a local blockchain network powered by Ganache.

Purpose

To prototype a transparent credit scoring mechanism that:

  • Uses alternative financial data to determine creditworthiness
  • Stores credit score summaries on-chain for traceability
  • Enables queries of credit score metadata per blockchain update

This system is aimed at individuals looking to build decentralized credit profiles using responsible financial behavior outside of traditional banking systems.


Learning & Development Highlights

This project was a personal deep dive into decentralized development and scripting. Key learning milestones include:

  • Git and Version Control: Applied Git in a structured project setting for the first time.
  • Smart Contracts with Brownie: Learned how to write, deploy, and interact with Solidity contracts through Brownie and Web3.py.
  • Data Processing in Python: Built a system that recursively searches for CSV files, cleans the data, and merges them into a unified format for score processing.
  • Manual Blockchain Interaction: Gained hands-on experience deploying and updating contracts via the Brownie CLI with Ganache.
  • Problem Solving:
    • Faced early issues with overly strict data validation filters resulting in empty merged datasets.
    • Adapted by loosening the cleaner logic to convert malformed data into usable formats instead of discarding it outright.

Tech Stack

  • Python – Data parsing, CSV compilation, blockchain interaction scripts
  • Brownie – Smart contract development and deployment
  • Solidity – Credit score contract logic
  • Ganache – Local Ethereum network for development
  • Web3.py – Python interface to interact with Ethereum blockchain

Core Functionality

1. CSV Compilation

  • Scans the entire project directory for CSV files
  • Cleans and merges valid entries into one master CSV
  • Ensures data consistency before blockchain submission

2. Smart Contract Storage

  • Stores a mapping of {userID: creditScore} on-chain
  • Designed for easy updates when new credit score data is available

3. Blockchain Updates

  • Manual update pipeline via the Brownie console
  • update_credit_scores pushes latest scores from the combined CSV

4. Querying Data

  • Smart contract exposes a function to retrieve metadata about on-chain entries and version history

Project Layout

.
├── smart_contracts/
│   ├── contracts/
│   │   └── CreditScoreContract.sol
│   ├── scripts/
│   │   ├── deploy_credit_contract.py
│   │   ├── update_credit_scores.py
│   │   ├── query_credit_scores.py
│   │   └── show_block.py
├── CreditScoreCreation.py
├── CsvCompiler.py
├── DataSetCleaning.py
├── *.csv
├── DirectoryPathways.env
└── brownie-config.yaml

Getting Started

  1. Start Ganache

  2. Open Brownie Console

brownie console
  1. Deploy the Smart Contract
run('scripts/deploy_credit_contract')
  1. Compile and Merge CSVs
python CsvCompiler.py
  1. Update Credit Scores On-Chain
run('scripts/update_credit_scores')
  1. Query Metadata or Scores
run('scripts/query_credit_scores')

Note: You’ll need Python, Brownie, and Ganache properly installed. See the Brownie Installation Guide for setup details.

Final Notes

  • All code is thoroughly commented for ease of understanding.
  • This project has no frontend interface; it operates entirely through the CLI.
  • The focus is on demonstrating end-to-end credit score calculation and blockchain integration using open-source tools.

AUTHOR: Melvin Thoompunkal

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors