Inspiration
We are involved in financial markets/products from much time. We encountered cumbersome route of trade financing, and wished for an efficient alternative to the trade financing. Currently, letter of credit (LC) and documentary collections (DC) are popular routes of trade financing. Conventionally they are done through banking networks. The conventional LC/DC generation takes several days, needs impressive banking history of the party, takes much time for settlement, and are expensive. Still, scams & defaults happen with the convention documentation of this type of credits.
Hence we decided to develop a blockchain based system that would eliminate need of the banks for trade financing, accessible for all, and ensure secure transactions & settlements.
Additionally, we found that this can be integrated with any other project that needs Boolean output based on any off-chain inputs.
What it does
It is basically a cryptocurrency on Tron that has several intrinsic/inbuilt functionalities. Apart from the transfer & allowance, any user can generate a credit for other users. Each credit has certain properties those are configured while credit generation. These properties are: amount, validity & terms of the credit. If the terms are fulfilled within the validity, then the amount is transferred to the designated person (say, debitor). If the terms don't meet or validity passes, then the amount is transferred back to the user who generated the credit (say, creditor). The terms can be the trading terms among the creditor & debitor. This credit can be generated & settled effortlessly similar to typical transactions.
The terms need not to be constrained for financial or trading related. They can be anything that leads to Boolean output in general (by logical reasoning). For instance, it can be a bet on some event or instance, or demand validation of a random claim or check whether certain NFT exists in reality. This boolean output can be used by the web2 or web3 programs for straightforward integration.
Hence, Croin offers a generic tool for boolean output.
How we built it
Croin is basically a TRC-20 token having additional functionalities. Any user can generate the credit with desired terms against another user.
There are some special user roles: trustee & ticker. Trustees constitute different ballotins. Each credit generation needs to be assigned to a specific ballotin. Then the trustees of that ballotin vote on the credit. If the terms fulfilled, then a trustee should vote as yes. Else, it should vote as no. Tickers have access to a special function that triggers settlement of the credit. This function makes all checks, conclude the decision and triggers respective amount transfers.
Each credit consumes some fee and this fee is distributed among the trustees & ticker involved in the credit settlement. Trustees giving incorrect vote get nothing, only those vote correct get the share in fee. Hence trustees are discouraged from incorrect voting.
Any user can become trustee or ticker.
We also have built a dApp facilitating user friendly execution on the smart contract. There the users can generate and execute the credit via tronlink.
Challenges we ran into
We have to optimize the fees. We ensure that the trustees & tickers get much more reward (i.e. share in fee) than the TRX the burn. We have developed through 20 versions of the smart contract and 8 versions of dApp. Initial smart contract had ~13 $ transaction fee while credit generation, ~2.5 $ while voting and ~10 $ while credit settlement. But we now are successful to lower them below $ 6, 1.7 & 5 respectively.
Currently, we are facing challenge in deployment of the dApp. It is built with react and firebase. We are facing errors for the deployment on vercel & netlify.
Accomplishments that we're proud of
User friendly dApp where common person can interact with the smart contract & whole system.
Achievement of reasonable transaction costs.
Evident application in global trade finance, and feasibility of adoption there.
What we learned
We learnt about whole Tron ecosystem and now have a good understanding to deploy relevant projects on Tron.
We also learnt about the optimum data structures and relevant smart contract designing w.r.t. optimum transaction costs.
What's next for Croin
We aim to deploy it on mainnet by December 2024. We hope to engage with potential clients/customers before the deployment on the mainnet.
Rigerous & wider testing will be done in 2 months.
Apart from trade financing, we shall also develop a NFT verification dApp on Croin.
Built With
- firebase
- jsx
- react
- solidity
- tronlink
- tronweb
- typescript
Log in or sign up for Devpost to join the conversation.