Inspiration

We were inspired by the opportunities offered by decentralization. We wanted to create a platform where no one person or company has complete control over what posts are visible, a platform that was efficient and transparent, and where users were encouraged to provide quality questions, quality answers, or just quality posts. By using Solana's high speed and low cost transactions, we knew that we could achieve these goals.

What it does

Blockchannel is a decentralized text forum where you get paid for getting likes on your posts. After linking your wallet to our application, you are able to make a post for 0.01 SOL, comment on a post for 0.005 SOL, and like a post for 0.001 SOL. All SOL made from comments and likes on your post will be directly transferred to your wallet -- Solana's low-cost transactions mean this system can easily deliver viable results. Of course, these prices would be adjusted for full deployment -- all three costs would likely decrease to avoid de-incentivizing use of the service. In addition to posting themselves, users accessing the service can see a list of recent posts and associated comments, write their own comments, and "like" to support good posts and quality answers. One of Solana's stateless program accounts handles the transactions involved, including transferring SOL, handling the transaction fees, and writing the data to the blockchain.

How we built it

We built a frontend using Next.js and React, integrating with the user's wallet through the Solana browser integration package to allow the user to briefly and securely authenticate (making posts through their Solana wallet id). Data is retrieved directly from the blockchain, parsed, and displayed to the user on a clean interface built using DaisyUI and Tailwind. In the spirit of the hackathon, we utilized Solana's accounts for data storage as well as running smart contracts, hosting our entire process on the Solana blockchain rather than using a traditional backend database. We run a Rust program in a Solana account to handle posting and transactions, writing post data to Solana PDAs -- essentially data storage accounts linked to our program account -- to handle tracking and displaying posts. Our program makes use of Solana's unique features as a blockchain: its low write costs are practically required for a program like this (such a "donating" system would not be possible on a blockchain with higher transaction costs, since actions would quickly become more expensive than would be viable), and its high transaction speeds not only allow user actions to be reflected quickly, and facilitate a seamless experience, but help distributed chat systems like this scale better to higher user counts. We all developed on the same machine for speed, SSHing into one member's machine and collectively editing on the same filesystem so that we could see and apply changes faster. This was made quite easy by the use of VSCode remote plugins. In fact, not having a backend made this much easier since we wouldn't have to call a localhost backend when we exposed the frontend server port externally to our teammates.

Challenges we ran into

One of our major issues involved reading posts from our blockchain. Originally, although we could write our posts to the blockchain, we could not correctly read the data from the blockchain -- post content often ended up missing or truncated. To solve this, we worked with Rust and TS data structures to implement a deserialization process that successfully read each post's content by parsing the base64 data encoded on the chain. And, of course, learning to work with the Solana system was a challenge of itself. We spent the first section of the hackathon researching, building an understanding of our program structure, and refining our tech stack and structure to make effective use of the Solana infrastructure.

Accomplishments that we're proud of

We're proud that we were able to store the entirety of our "backend" on the Solana blockchain, rather than using something like a traditional SQL database. We're also proud that we were able to implement this in such a short timeframe as a 36-hour hackathon. Learning to work with the Solana devnet and interface was a big step for us -- we came in with no prior experience in this style of software development, and ended with a functioning project storing (and retrieving!) data on the blockchain. Learning a new skill is always exciting, and we're proud that we were able to reach this point!

What we learned

Perhaps the greatest thing we learned was how to use Solana (and blockchain infrastructure!) and integrate it with our frontend. When we first started, we had no real experience in Solana, or even with blockchain in general. Working on this project taught us a lot about how blockchain programs work, and how to practically use it in real-life situations. We also gained experience working with data transfer processes in general, and especially working in an unfamiliar development environment: developing a fully blockchain-hosted "backend" was a series of good lessons in how to quickly learn and effectively interface with a wholly unfamiliar system, extending what we knew to understand new structures of programs.

What's next for Blockchannel

Our first focus will be on improving our commenting, liking, and posting systems, and making sure they can deliver a clean experience for the user. A valuable extension for our project would be improved sorting and tagging systems: priorities for future work are the ability to sort by varying fields including not just time but popularity, for example, as well as adding a "tag" or "category" system to only display posts relevant to a certain topic, as seen in various ways in other chat software. Ideally, we'd also like to implement an effective search feature. We may also include more features, such as paginating data or only displaying posts from the current week (but having an archive of previous weeks' posts).

Built With

Share this project:

Updates