Qaku: Decentralised Q&A with Persistence Enabled by Codex

While decentralised storage has a range of use cases across established industries, it is also immediately beneficial to decentralised apps (dapps) that aim to function without centralised data storage providers.
As a Decentralised Durability Engine (DDE) designed to offer a robust and censorship-resistant alternative to centralised storage platforms, Codex provides a platform for reliably and trustlessly storing data without reliance on third parties.
Qaku, a Q&A app developed by Logos Core Contributor and Solution Engineer Vaclav Pavlin, is an excellent example of how dapps can leverage the Codex protocol to persist data without assuming the risks accompanying centralised storage providers and while adhering to the underlying principles of Web3.
Qaku (Questions & Answers over Waku) is a decentralised application that enables users to create and manage Q&A boards in a fully Web3-native manner. Users can generate a Q&A session, share a link, and allow participants to submit and upvote questions.
Q&A owners have control over their board, allowing them to enable or disable it and respond to questions as needed. Popular questions naturally rise to the top based on community engagement.
Two fundamental protocols, Waku and Codex, are at the core of Qaku’s decentralised design. Waku facilitates the real-time, peer-to-peer communication that powers Qaku’s interactions, while Codex provides decentralised and persistent storage, ensuring that Q&A data remains accessible over time.
For a full demonstration of Qaku using Codex for persistence, check out Vaclav’s presentation at the Decentralised Data Summit 2024:
A Q&A App Built on Web3 Principles
Traditional Web3 projects often rely on centralised infrastructure, even if their core technology is built on blockchain. In contrast, Qaku operates without a dedicated backend infrastructure—aside from its front end being hosted on Vercel—yet still provides users with access to the network to ask and answer questions.
Qaku handles data communication using js-Waku, the JavaScript implementation of Waku. It follows the event sourcing model, a widely used approach in distributed systems.
Instead of storing the entire application's state in a database, Qaku records a sequence of events that define changes in the state. Users who interact with Qaku retrieve and process these events to reconstruct the current state.
Waku operates as a permissionless network, allowing anyone to join without requiring approval from a central authority. To prevent spam and network abuse, Waku integrates Rate-Limiting Nullifiers (RLN), a zero-knowledge proof-based mechanism that restricts message rates without compromising user privacy.
Waku is also optimised for edge nodes such as mobile devices and browsers. Unlike traditional peer-to-peer networks that rely on continuous message relaying (which can drain battery and consume bandwidth), Waku employs light protocols for efficient data transmission on lightweight devices.
Qaku began as a proof-of-concept and has been successfully demonstrated at various events and alongside various online events, proving the viability of a decentralised Q&A platform.
The next stage in Qaku’s development is the hardening and refining of the application to make it production-ready and reliable for widespread deployment.
Be among the first to explore Qaku! Try it out at qaku.app.
How Qaku Uses Codex for Persistence
One challenge with Qaku is that Waku’s store protocol retains historical messages for only a limited time—typically a few hours to a few days. Since Waku is inherently ephemeral, any questions and answers exchanged on the network disappear once they age out of Waku’s message store.
To address this, Qaku integrates Codex as a decentralised persistence layer. Codex enables Qaku to store Q&A data in a distributed network, ensuring that past discussions remain accessible even after disappearing from Waku’s ephemeral network.
Codex provides the persistence layer for Qaku, allowing Q&As to be stored on a distributed network and accessed after the ephemeral data transmitted over Waku has been dropped from the p2p comms network.
The initial implementation of Qaku’s persistent storage uses Codex nodes operating in altruistic mode for storing Q&A data. Altruistic mode allows for the free storage of small amounts of data, thanks to nodes on the network offering storage space altruistically, which is viable for the small data requirements of a Q&A platform.
To bridge the gap between the Waku and Codex protocols, Vaclav built a backend service called Qaku Cache, which runs a JavaScript implementation of both a Waku and Codex node. The Waku node listens for new Q&A and data and then records it to Codex using its API.
It also includes a pull proxy that serves requested data to users from Codex instead of Waku.
Although Vaclav’s initial presentation of Qaku’s integration with Codex was technically centralised as he was hosting the only Qaku Cache service, this operation could have been run by anyone, making it possible to decentralise the process entirely.
In summary, the initial implementation of Codex for storage persistence in Qaku works as follows:
- Real-time Q&A interactions are transmitted over Waku’s peer-to-peer network.
- Periodic snapshots of the Q&A board are stored in Codex as structured JSON data.
- Codex generates a unique identifier (CID) for each snapshot.
- Qaku Cache retrieves data from Codex, making it available to users.
- Users can fetch historical data via an API or run their own Codex node for complete decentralisation.
By integrating Codex, Qaku effectively overcomes Waku’s ephemeral nature, ensuring that Q&A sessions remain persistent and accessible long after their initial creation.
Join the Codex Testnet
Qaku’s usage of Codex demonstrates just one of the many robust use cases for a decentralised storage protocol capable of persisting data on a distributed network.
From artificial intelligence to tamper-proof storage of legal records, Codex offers a reliable, robust way to persist data while remaining censorship-resistant and durable across a host of potential use cases.
The Codex public testnet is now live, allowing anyone to help build the decentralised, durable data archive for the future Internet. By running Codex, you are playing a role in enabling and building a decentralised archive of durable knowledge.
To get started, read our step-by-step guide on how to install and run Codex.
Follow us on social media, join our Discord, and subscribe to our newsletter to get the latest updates from Codex.