Inspiration
We found the idea of aiding artists and artisans quite interesting. One of our group members, who is from a Middle Eastern nation, told us about some of the issues facing artisans in the region, and so we decided to focus on them.
What it does
There are many issues facing rug weavers in the Middle East: the majority of rugs sold in popular tourist areas are now machine made, driving those who make them by hand out of the market, and it can take well over 6 months to make just one rug. The result of all this is that once the product is finished, many weavers are forced to sell it to middlemen at a much lower price than it’s actually worth, because they need the money now to survive and don’t have the time to find better customers.
RugDealer solves this problem by connecting such weavers with potential investors for short-term loans. The way it works is the following:
- A trusted warehouse partner verifies and holds the weaver’s rug, then registers a digital receipt on Stellar.
- An investor funds a short-term loan against that rug.
- When the weaver finds a buyer, the buyer pays through the Soroban contract.
- The contract repays the lender and sends the surplus to the weaver.
- After settlement, the warehouse releases the rug to the buyer.
Crucially, the partner will set some “minimum value” for the least amount the rug could be sold for (essentially what the weaver would have sold it for to the middlemen). If the weaver can’t find a buyer or defaults, this will be the valuation of the rug.
The weaver benefits because they get some money upfront, buying them time to search for a customer willing to buy the rug at its actual value, and overall make more money than they would have otherwise. The investor benefits because they will earn some interest on their investment, as their micro-loan will be smaller than the minimum value. The partner/warehouse benefits because they will earn money from a fixed custody fee.
How we built it
The application was built using Next.js, React, and TypeScript for the frontend, and we incorporated a Rust-based smart contract using Stellar’s Soroban platform for the blockchain. The frontend provides five interfaces for different user roles: rug stores, weavers, investors, platform administrators, and an activity dashboard.
All users (investors, stores, and weavers) need to connect their Stellar wallets through Varial (which can be run using a Chrome extension), allowing them to sign transactions. The frontend communicates directly with the Stellar Testnet RPC; as such, there is no traditional backend server or SQL database. It also simulates transactions before submitting them to ensure they can execute successfully.
The core business logic is implemented in the Soroban smart contract, which manages rug certificates, loan creation, repayments, interest calculations, fees, and collateral ownership. When a store issues a certificate, a weaver can use it to request a loan, which an investor funds using test USDC. The contract automatically distributes the funds and enforces the repayment and default rules, including transferring the rug to the store or investor under specified conditions. The frontend retrieves contract data and blockchain events to display transactions and update each user's dashboard. The general project is deployed on Stellar Testnet, with the frontend hosted on Vercel.
Challenges we ran into
The biggest challenge we ran into by far was figuring out a way to achieve real-world asset tokenization of the rugs. The project relies on having the trusted warehouse partner to tokenize the rug and bridge the gap between weaver and investor, and finding one such partner was no easy feat.
Accomplishments that we're proud of
Our biggest accomplishment is definitely finding potential partners. As described above, we needed to find a partner, and although it took a lot of effort, outreach, and dead ends, in the end we managed to find several promising leads.
What we learned
This challenge has been an amazing learning experience. We have learned a lot about the technical details of blockchain and building on it, such as smart contracts and Soroban, smart wallets, and how to tokenize real-world assets. We also learned much about the financial situation of underserved communities: our final solution is targeted towards Middle Easterns such as Turkish weavers, but our research and planning also took us to places such as Nigeria.
What's next for RugDealer
If RugDealer were to continue beyond this challenge, the next steps would likely be to expand our reach to other countries and groups. After all, all the foundational infrastructure is in place: all that would be required for this would be finding more partners in regions with weavers facing similar circumstances. We could also expand our target market from just weavers to other types of artisans, such as goldsmiths.
Built With
- nextjs
- react
- rust
- soroban
- typescript