Inspiration

A chitfund is a rotating savings scheme prevalent in lower-income countries where getting a bank account is cumbersome. A chit fund is formed by a group of known people called subscribers who make small regular amounts for a given frequency in return for a lump sum payment during the tenure of the Fund. An organizer takes care of bringing together the people, collecting the monthly payments and disbursing the lumpsum payments. However, there have been instances, where organizers have disappeared with the subscriber's fund and to reduce the risk of organizers disappearing, we came up with the idea of a Decentralised Chit Fund.

What it does

The Decentralised Chit Fund dapp allows subscribers to start a chit fund without the need for an organizer. A User needs to enter a list of subscriber wallets, frequency of payments, and payment amount (in stable coin (ERC-20) preferably) and a chit fund is created immediately. Users can then make regular payments in native protocol and any of the cross-chain protocols supported by CCIP. The dapp automatically and randomly selects the subscribers to receive lumpsum payment. The dapp also provides a credit score as NFT for each user for every fund he participated in upon completion of the fund tenure. The app publishes the credit score immediately in case of user defaults.

How we built it

Core smart contract is deployed in the Polygon Mumbai network with an option to receive payments from Avalanche Fuji network and Sepolia via CCIP. Since stablecoins are used for payments, corresponding smart contracts in Fuji and Sepolia receive the payment and send only the confirmation message to the Core smart contract Mumbai . Bridging the stablecoins back to the polygon is not in the scope of the current project. A chainlink automation job CCMChecker checks for any CCIP message every 15 minutes to trigger the payment update in the Core smart contract for all the chit funds created. Also, there are fund-specific automation jobs such as FUNDID100001 which run as per the payment frequency of the Fund to check defaults and to select the winner of the lumpsum payments. Chainlink's VRF is used to ensure the winners are selected randomly without any bias. There is an option to generate credit scores as a dynamic NFT.

Challenges we ran into

  1. Initial expectation was to include Base as part of CCIP, then realized that it was not integrated with polygon where the core contracts reside. Hence need to drop base from our project.
  2. Avalanche Fuji was not supporting the latest EVM configurations such as PUSH0 opcode and hence Solidity contracts deployed in Fuji need to be changed to the old version.

Accomplishments that we're proud of

CCIP integration with Polygon Mumbai, Sepolia and Avalanche Fuji networks Generation of Dynamic NFTs. Meaningful and practical integration of three chainlink services. 1) Chainlink VRF 2)CCIP 3) Chainlink Automation

What we learned

We have learned how to use cross chain messaging (CCIP). We have a better appreciation for Oracles and how they facilitate functionality that are native to blockchain.

What's next for Decentralised ChitFund

We would certainly launch this project in the wild because of the potential it has especially since we are from developing countries where chit funds are run off chain.

Built With

  • chainlink
  • nextjs
  • rainbowkit
  • react
  • wagmi
Share this project:

Updates