TronVoice - Decentralized Microblogging
Inspiration
I've always wanted to build some kind of decentralized social network that lives inside the blockchain. I believe the TRON blockchain is the perfect blockchain for this kind of use case. Here it is: The first microblogging platfrom that lives inside the blockchain. It is live and running at TronVoice.com.

What it does
The platform allows people to post messages (up to 280 bytes) which are posted into the TRON blockchain. The data is not stored off-chain like most other implementations do it, but actually on-chain. That means the application does not have a traditional server. Everything you see and all data that is loaded is loaded from the blockchain (except for the profile images). The big advantage of this is that everything is decentralized, even if the website goes offline the data continues to live inside the blockchain. The downside is that every interaction (posting or liking) requires the user to sign a transaction. As these transaction require gas, that also means that posting and liking comes with a cost. For example, the gas cost for posting a message is between 25 and 80 TRX (1-5 $) depending on the size of your message (longer posts require more gas).
To compensate an author for the gas cost, other users can like posts which will earn the original creator some TRX. Currently, I've set the fees for the different actions on TronVoice to the following values:
| Action | Fee | Gas Cost (estimate) | Fee Earner |
|---|---|---|---|
| Account Creation | 1 TRX | 10-30 TRX | TronVoice |
| Account Update | - | 10 TRX | - |
| Create Post | 1 TRX | 25-80 TRX | TronVoice |
| Like Post | 10 TRX | 8 TRX | Post author |
That means, there is a small fee for account and post creation. But authors are able to earn the TRX back by creating interesting posts that are liked by other people. To keep this flexible I've added the functionality to update the prices of the different actions in the smart contract allowing to react on future price and fee changes. Due to the complex nature of this smart contract and its functionality, the gas costs are rather high, but by liking other posts I hope people have an incentive to post quality content.
The following GIF shows how to like a post: The creator of the post receives 10 TRX in the process.

In addition, it is also possible to reply to other posts like on Twitter. That way you can even create a thread of messages. The following GIF shows two people communicating via TronVoice:

Every user can create an own account where he is able to add a profile image and add his own website. After connecting your wallet, TronVoice will automatically check if you already added your account (by checking the corresponding smart contract function). If that is not the case you will be asked to enter the information.
Afterwards, you receive your own profile. Note how your wallet address is your primary identifier of your profile mearning that others can be sure that all information that is posted by the profile is posted by the person that has access to the corresponding wallet. For example, posts by the user at https://tronvoice.com/profile/TX2kDevwMKSLKj1rFMWoZq44vJ8hbjaNzd have been made by the user with the corresponding TRON address TX2kDevwMKSLKj1rFMWoZq44vJ8hbjaNzd.
The following image shows an example of a user profile. The user has entered a name, a profile image and a website which are displayed:

How I built it
The frontend I've build is based on TypeScript, Next.js/React and some other libraries (see the repository on github). The smart contract was written in Solidity. The interaction with the TRON blockchain is done via TronLink (the browser extension). All code has been published on Github.
Initially, I also incorporated a backend server, but in the end I found it much more appealing to turn this into a project without a traditional backend and store all data in the TRON blockchain to see if it was possible to implement it in this way.
I've also focussed on the user experience. As you might note, all interactive parts and transactions with the blockchain feature loading animations and transitions to display the current state of an action.
After development, I choose CloudFlare to host the website (via CloudFlare Pages) and use their domain registrar to register TronVoice.com for the project.
The smart contract has been published on github and is available on the TRON mainnet at address TC2RzBkXf5wNNmzrf5GmqrjnPQ6VjGzUQS (link to tronscan).
Challenges I ran into
The initial plan for this project included more features. The first version I've implemented featured followers and following of addresses. While this was a nice feature, it drastically increased the gas costs for account creation (setting of user name, URL, etc.) as dynamic arrays had to be initialized. In the end I removed the featured but I hope that I'm able to implement this off-chain in the future.
Another challenge was to batch the interaction with the blockchain. For example, a user who has created 100 posts should not trigger 100 transactions to the blockchain when you open his profile page. I've solved this by creating a function in the smart contract which allows to download 5 posts at once instead of downloading them individually. In addition, it has an offset parameter that allows paging so that you do not need to download all 100 posts at once.
The last challenge was the user interface. As I'm not a designer, I've tried to keep it as simple as possible. I hope people like it :)
Accomplishments that I'm proud of
I'm very proud of the overall result. I did some research regarding social networks on blockchains but non actually satisfied by needs, so I implemented everything from scratch. I believe this is the first functional microblogging platform that runs completely inside a blockchain. So the concept is very unique and I'm curious to see if people like and use it.
I'm also happy with the tradeoffs I made (like excluding some of the features to allow for lower gas costs) that I've mentioned in the challenges.
Finally, I'm very happy to submit an actual running hackathon entry. I've deployed everything in production. TronVoice is fully functional running at TronVoice.com.
What I've learned
This was the first time I've used the TRON blockchain and it was very interesting to learn about the usage of the different resources (bandwidth and energy). The usage of TronLink as the "gate to the blockchain" (instead of using a traditional server) was also very interesting and included a lot of learnings.
I've also learned a lot about the impementation of this kind of decentralized approach. A lot of the work was around tweaking the smart contract to optimize the needed resources when interacting with it.
What's next for TronVoice
Currently, the project is a ready-to-use prototype of how to run a decentralized microblogging platform in the TRON blockchain. I would be very happy if people start using the platform, even only for annoucements or to ensure belonging of a message to a specific address.
I have plans for the future which feature off-chain improvements. I've removed them from this hackathon entry to submit this as a "pure blockchain" implementation without a traditional backend. The backend will allow users to follow each others and to receive notifications when another user they follow has posted something.
Longterm, if the adoption of TronVoice increases I also want to implement Twitter-like features like searching for hashtag and similar features. But these also have to be implemented off-chain.
If you like the idea, please check out the project website and create an account for yourself:
📣 TronVoice.com 📣
Built With
- next.js
- tronweb
- typescript

Log in or sign up for Devpost to join the conversation.