Inspiration
I've tried to develop some real time social application with other blockchains (Filecoin, Ethereum, etc.) before. With these blockchains, I feel it's really hard for me to implement a simple prototype in which I can notify new content to users easily. Most of these blockchains will do that with an offline method. Blockchain in the application can only be used as incentive method. In my mind, a web3 social application should be capable of keep everything decentralized. That's what I think of Linera can give me some new way to implement that. So we create ResPeer on Linera for a real web3 decentralized content delivery application.
What it does
ResPeer aims to build a community in which authors can publish content to earn credits and native tokens easily, and the credits can be used to buy assets.
In ResPeer, people can submit their posts to the network. After they are reviewed by the Reviewer DAO, the posts will be published to all subscribers, allowing the author to receive remuneration in native tokens and ResPeer credits. Each reviewer who evaluates the article will also receive a fee (in native tokens and ResPeer credits) for their work. After the post is published, users can read, comment, like, or dislike the articles. They will also be rewarded with ResPeer credits.
ResPeer also provides a marketplace for artists to sell their artwork. Users can buy these artworks to design their personal avatars, which will be displayed in their articles, comments, and personal centers. Of course, they can sell their artwork at different prices again. The artworks will be priced in native tokens. However, for users who have ResPeer credits, their credits can deduct a portion of the artwork price.
Besides artists and authors, normal users can also earn native tokens and ResPeer credits through activities. Anyone can host an activity. If the activity is approved by the Reviewer DAO, it will lock some budget from the foundation for the activity. After the activity starts, users can vote for the participants. The activity host can set the ratio of rewards that will be distributed to voters. When the activity is finalized, those rewards will be distributed to the voting users.
How we built it
- 1 We built the ResPeer application based on the Linera client and Linera SDK.
- 2 We built a Microchain as a Service through a ResPeer fork of the linera-protocol.
- 3 We built a website application and browser extension wallet called CheCko.
- 4 We implemented a fully web3-compatible provider in CheCko.
- 5 We access Linera through CheCko with window.linera as a web3 provider which has the same interfaces as window.ethereum.
- 6 We built an editor copilot for content authors which could help them improve their paragraphs using Linera's Edge AI.
- 7 We integrated the CoEDiT T5 model into Linera's Edge AI, which will be able to complete different tasks to help authors improve their selected text.
- 8 We integrated a tiny stable-diffusion model into Linera's Edge AI, which can help users generate illustrations or covers for their articles.
- 9 We implemented a computing registry application to let computing providers register their computing resources for authors to rent.
- 10 We implemented a demo workflow in the frontend for task resource selection, payment, execution, and finalization.
Challenges we ran into
- 1 The service.rs of the Linera application is read-only for the application state. We cannot charge rental fees according to generated tokens (e.g., 0.001 Linera per 1000 tokens), so we have to use a per-task payment model.
- 2 We successfully found a CoEDiT T5 model that could be run in WASM using the candle examples, but there are no examples about running the latest tiny stable diffusion model in WASM memory. So, we need to implement this part ourselves.
- 3 We didn't have enough time to find a suitable abbreviation model. We will continue integrating that after this hackathon.
- 4 We tried to store contents and images in blob storage. But currently, the node service doesn't support the GET method, which would allow the frontend to load images directly using the
<img>tag. Maybe we need to deploy a fetch gateway before the Linera Node Service in the future.
Accomplishments that we're proud of
- 1 We successfully integrated CoEDiT T5 as our copilot model to help authors improve their content.
- 2 We successfully added an example workflow for resource holders to register their computing resources for rental. We also built a workflow for authors in which they can pay TLINERA tokens to rent computing resources for their tasks.
- 3 We successfully integrated a tiny stable diffusion model as our copilot model to help authors generate illustrations and covers.
- 4 We successfully implemented a frontend application in which authors can create, improve, and post their content to the Linera network easily.
What we learned
- 1 We learned how to integrate new AI models into Linera applications.
- 2 We learned how AI can help users improve their efficiency.
What's next for ResPeer: P2P Content Publishing Application on Linera
- 1 MaaS We will continue developing our Microchain as a Service to support our CheCko wallet.
- 2 CheCko We will continue building the production version of CheCko for the Linera testnet.
- 3 ResPeer We will continue building the production version of ResPeer for the Linera testnet.
Log in or sign up for Devpost to join the conversation.