People qualify for credit based on their fiat history, why not based on their crypto history? To solve this problem we built a credit score dapp on NEAR and Polygon. In addition to obtaining their score, users may encrypt and store their score on-chain and issue viewing (decryption) keys to 3rd parties from whom they would like to apply for credit.
*We tried our best to baseline the credit score to current day fiat scoring logic. i.e. 300 - 900 point score range. However we had to invent the metrics ourselves as no literature exists for crypto credit scoring.
It’s best to answer this question piece-wise accordingly to the contracts of the project:
Frontend - we used NextJS + Typescript for the core web app alongside the tailwindCSS + Ant Design for all styling. We integrated with both MetaMask (ethers library) & NEAR wallets for address fetching. We spun up a PostgreSQL database in Heroku for local data storage. Heroku made this super easy.
Notifications - we used the Push SDK for opting in/out and sending notifications based on in-app triggers. Notifications include getting your score leaderboard rank after storing your score as well as score update eligibility.
Getting transactional data - for this we used Covalent - super cool! We used a number of their endpoints to get a user’s historical transactions across Polygon and Eth chains as well as NFT ownership information.
Smart contracts | Polygon - we used open zeppelin for Solidity boilerplate and Infura + brownie (python) for contract interaction. We also used Hardhat for testing which was useful as well as Mumbai test net.
Smart contracts | NEAR - we used the NEAR CLI, native wallet, NEAR Rust SDK and NEAR-api-js. We also forked NEAR’s contract template which was great in getting started. The rust-toolchain was also pretty helpful.
APIs - we’re impressed that we built one unified APIs using FastAPI. We also built integrations (all python) to Coinmarketcap for fetching coin price, as well as Opensea for getting NFT market values. We used the Python ‘cryptography’ library for encrypting string blurbs and this is also wrapped into our own FastAPI. We used symmetric encryption to obtain the decryption key.