How iBird Stores Every Action on Hedera: The Single-Topic Architecture
Deep dive into iBird's unified HCS architecture — how posts, likes, replies, tips, and follows all flow through one immutable Hedera topic. Learn how we eliminated topic creation fees and made the entire platform rebuildable from a single message stream.
The Problem with Traditional Social Media
Every post you've ever shared on Facebook, X, or Instagram lives on servers owned by a corporation. If those servers crash, your data is gone. If the company decides to delete your account, years of content vanish overnight. You don't own your followers, your data, or your digital identity.
iBird solves this by storing every single action — not just posts, but likes, replies, tips, and follows — on the Hedera Consensus Service (HCS). Once data is written to HCS, it's permanent, immutable, and cryptographically verified. No one can delete it. No one can alter it. Not even us.
What Is the Hedera Consensus Service?
HCS is a decentralized messaging service built on the Hedera Hashgraph network. It provides:
- Absolute finality — once a message reached consensus (3 seconds), it's permanent
- Cryptographic ordering — every message gets a sequence number that can never change
- Fractional cost — $0.0008 per message
- Fair ordering — no miner can front-run or reorder your transactions
Think of an HCS topic as an append-only public ledger. You can write to it, but you can never edit or delete what's been written. Every message is timestamped, sequenced, and visible to anyone.
The Single-Topic Architecture
When we first built iBird, we used multiple HCS topics: one for posts, one for events, one for ads, and separate topics for each thread and poll. This created a clean separation of data — but it had a hidden cost.
Every topic creation on Hedera costs $0.01. Every topic has an auto-renewal fee of ~$0.00022 every 90 days, forever. At scale, this becomes unsustainable:
| Volume | Old Architecture Cost | New Architecture Cost |
|---|---|---|
| 1,000 threads/month | $10/month | $0 |
| 10,000 threads/month | $100/month | $0 |
| 100,000 threads/month | $1,000/month | $0 |
So we simplified. Everything now flows through one topic.
One Topic, 14 Message Types
The iBird Omni Topic (0.0.9920911 on testnet) handles every action on the platform. Each message has a type field that identifies what it represents:
| Type | What it represents | On chain? |
|---|---|---|
POST | A regular post | ✅ |
REPLY | A reply to a post | ✅ |
REACTION | A like, love, haha, wow, sad, or angry | ✅ |
TIP | An HBAR tip to a creator | ✅ |
FOLLOW | A follow or unfollow | ✅ |
THREAD | A multi-message thread (grouped by ID) | ✅ |
POLL | A poll with choices | ✅ |
AD | A burn-to-advertise ad | ✅ |
PROFILE | A profile update | ✅ |
DELETE | A post deletion (tombstone) | ✅ |
POLL_VOTE | A vote on a poll choice | ✅ |
What this means
Previously, social interactions like likes, replies, and tips were only stored in our PostgreSQL database. If the database was lost, those interactions were gone forever. Now, every like, every reply, every tip, and every follow is permanently recorded on Hedera. The entire platform can be rebuilt from a single topic's message history.
How Data Flows: From Click to Blockchain
When you click "Post" on iBird, here's what happens in ~3 seconds:
- You submit a post → The iBird API server receives it
- Server builds the message → Creates a JSON object with your content, account ID, and timestamp
- Writes to database → Your post appears instantly in the feed (no waiting for blockchain)
- Queues in HCS Outbox → The message is written to a database table in the same transaction as your post
- Outbox Worker publishes to HCS → Every 3 seconds, a background worker submits pending messages to the Omni topic
- Hedera consensus reached → In ~3 seconds, the message is permanently recorded with a sequence number
- Subscriber syncs → A separate process polls the Mirror Node every 5 seconds to catch any messages it might have missed
The Transactional Outbox Pattern
One of the biggest challenges with blockchain integration is ensuring data consistency. What happens if the server crashes between writing to the database and sending to HCS?
iBird solves this with the Transactional Outbox pattern:
- When you post, the database write and the outbox entry are committed in the same transaction
- A background worker picks up the outbox entry and submits it to HCS
- If the submission fails, the worker retries up to 10 times with exponential backoff
- If it still fails after 10 attempts, the entry goes to a "dead letter" state for manual investigation
- The entry is never silently dropped
This guarantees at-least-once delivery: every action that reaches the database also reaches the blockchain.
Rebuilding from Scratch
Because every action is on HCS, the entire iBird database is rebuildable. Here's how it works:
- Start with an empty PostgreSQL database
- The HCS subscriber polls the Omni topic from sequence number 1
- Each message is decoded and upserted to the correct table
- Posts go to the Post table, replies to the Reply table, reactions to the Reaction table, and so on
- Within minutes, the entire platform state is reconstructed
This is what "HCS is the source of truth" means. The database is a fast read cache — it makes the app snappy. But the blockchain holds the real data, and the cache can be rebuilt at any time.
Cost Breakdown
Here's what it actually costs to run iBird on Hedera:
| Action | HCS Fee | iBird Fee (with 50% margin) |
|---|---|---|
| Publish a post | $0.0008 | ~$0.001 |
| Reply to a post | $0.0008 | ~$0.001 |
| Like a post | $0.0008 | ~$0.001 |
| Follow a user | $0.0008 | ~$0.001 |
| Send a tip | $0.0008 + transfer fee | ~$0.001 + tip amount |
| Topic creation | $0 | $0 (single topic) |
Compare this to Ethereum-based social platforms where a single post can cost $5-50 in gas fees, or even Farcaster at $0.001-0.01 per interaction. iBird is 10-500× cheaper than competitors.
Why This Matters
Most "Web3" social platforms only put some data on chain — usually just posts. Likes, replies, and follows are often stored off-chain in centralized databases. This means:
- If the platform shuts down, your likes and follows are lost
- You can't prove someone liked your post at a specific time
- The platform can manipulate engagement metrics
iBird puts everything on chain. Every reaction, every reply, every tip, every follow — all timestamped, sequenced, and immutable. This creates a level of transparency and permanence that no centralized platform can match.
Try It Yourself
Want to see your actions recorded on the Hedera ledger? Open iBird, connect your HashPack wallet, and publish a post. Then check the Hedera Mirror Node — your message will appear with a consensus timestamp and sequence number. It's permanent, verifiable, and yours forever.
Frequently Asked Questions
What is the Hedera Consensus Service (HCS)?
HCS is a service on the Hedera network that allows applications to submit messages to topics. Messages are assigned a consensus timestamp and sequence number, and are immutable once submitted. Think of it as an append-only log with cryptographic proof of ordering.
How much does it cost to post on iBird?
Each message submitted to HCS costs approximately $0.0008. iBird posts, replies, likes, tips, and follows all cost this same amount. The platform charges a small service fee on top, which includes a 50% profit margin. Total cost per post: less than $0.001.
Why does iBird use only one HCS topic?
Creating HCS topics costs $0.01 each plus ongoing auto-renewal fees. At scale, creating topics for every thread and poll would cost hundreds of dollars per month. By using one topic, iBird pays $0 in topic creation fees while still maintaining a complete, immutable audit trail.
Can the iBird database be rebuilt from HCS?
Yes. Every user action — posts, replies, reactions, tips, follows, profile updates, and poll votes — is written to a single HCS topic. The entire PostgreSQL database can be reconstructed by replaying the message stream from sequence number 1.
What happens if the iBird server goes down?
All data is safely on Hedera. When the server comes back online, the HCS subscriber automatically syncs any messages it missed by polling the Mirror Node. No data is ever lost because the blockchain is the source of truth.