Storage of Content
to be continued.
Storage of Text, Image and Video
Storing different types of data—such as text, images, and videos—on the blockchain poses unique challenges. Text data is relatively lightweight compared to images and videos, making it well-suited for on-chain storage. While it is possible to store an image on the blockchain, doing so is expensive and quickly approaches the blockchain's storage limits. Videos, which are significantly larger in size, are currently impractical for on-chain storage.
Hybrid Data Storage
Our solution for text data is to store it directly on the state machine, which is fundamental for a decentralized social media platform to achieve freedom of speech. For image storage, we adopt a hybrid approach that leverages centralized storage for the vast majority of images while reserving on-chain storage for select cases. Images such as profile pictures, critical photos from major events, and paid images can be stored on-chain under specific conditions. While videos are popular and necessary, they are not critical to the platform’s core functionalities, making storage on third-party centralized servers the most practical choice.
State Pruning
When a new post is generated, the post ID is added to a watch list with the current timestamp. After 3 years, when another new post is published, the handler checks the first item (the oldest post) in the watch list using a prefix iterator to determine if the post should be deleted based on defined criteria, such as its post score or popularity. If it meets the criteria, it will delete the watch list entry and remove the post from state machine accordingly. If it does not meet the deletion criteria, only the watch list entry will be removed, and the post will remain in the primary store. Users are able to adjust parameters of above pruning criteria through on-chain parameter change proposals.
Please be aware that deleting the post from state machine doesn’t mean deleting the post from chain. You can find your post content from transactions in blocks.
Handling Server Failures
What happens if a third-party centralized server for images and videos collapses? Rest assured, this would not impact the chain itself. Users would still be able to post content as usual, with text posts and critical images remaining accessible. This ensures that the platform’s core value of free speech is maintained. Additionally, our decentralized moderation team will implement strategies to incentivize third-party centralized servers for images and videos, ensuring their sustainability and preventing server failures.
Last updated