When the Protocol Is Newer Than the Docs
A follow-up to "Building Communication From Scratch." That post ended with "we'll write up the live side once a real member has received a real message." Nobody did. This is why.
The plan was clean. Members sign in with a cryptographic identity, so the site can message them at that same identity, over a protocol built for exactly this: wallet-to-wallet messaging with no email in the middle. We built it, tested it end to end, and the test passed.
Then we pointed a real, current client at it, and nothing arrived.
What "tested" meant
Our test sent a message from our sender to a throwaway identity on the protocol's test network, and read it back. It arrived intact. Green.
What we had actually tested was our code talking to a copy of itself: two clients on the same version of the same library. They agreed with each other, which proves very little. We had never tried the one thing that matters, which is a message crossing from our software into somebody else's.
When we finally did, using the protocol's own browser chat app with a wallet that had a registered inbox, the picture was strange:
- Our sender said the message was sent. The protocol's network said it was published. Reading our own side back showed it sitting in a conversation with exactly the right recipient.
- The recipient's chat app showed nothing. Not in a requests folder, not after a reload, not after a sync.
- The app happily accepted our test addresses as reachable. So the two sides agreed on who exists, and disagreed about everything after that.
- The reverse direction failed too. A message typed in the chat app never reached a client of ours that was sitting waiting for it.
No error anywhere. Success on every line of our logs, and no message.
Ruling things out
It's tempting to blame your own code, and we did, first. So we made it hard for our code to be the cause:
- A brand-new throwaway identity with no history, not the site's own.
- Three different senders, so it couldn't be one account's state.
- Two builds of the library: the current stable release, and a pre-release with newer native code underneath.
- Both directions.
Same result every time. That is a useful kind of result. It means the problem isn't in the part you wrote.
Along the way we also learned how much of our "debugging" was reading the other side's code. The chat app is a public web page, so its JavaScript is public too. Reading it showed it's built on newer networking code than the stable library we were using, with network modes ours had never heard of. That fit the symptoms, though we can't prove it caused them. We were wrong about at least one thing on the way: we found a hosted address in the app's code, read it as the messaging server, and it turned out to be something else. We retracted it, which is the right thing to do and also a good illustration of how easy it is to build a confident story out of a string you found.
The newest version had no map
The obvious next move was the newest release, the one the docs now describe. It isn't a bigger version of the same thing. It changes the model: you run or point at your own backend, there is no built-in "test network" or "live network" name, and the documentation says older libraries can't use it. We couldn't find a hosted address for it in the docs. Its own type definitions didn't match what the package actually exported at runtime. We stopped there. When the map doesn't match the territory, you can keep going on instinct, but you are no longer engineering.
Then the bigger news
Looking for answers, we found reports, from news sites rather than from the project itself, so treat them as unconfirmed, that the hosted network is being shut down in early 2027 as the project moves to software that everyone runs themselves. We couldn't reach a primary announcement. But it explained the shape of everything: a stable library for a network on its way out, a new library for a network that doesn't exist in public yet, and a gap between them where messages fall and nobody gets an error.
We don't know that this protocol is dead. The code is actively released. We know it's moving, and that the thing we were building on was in the middle of the move.
What we did instead
We threw out the transport and kept everything else.
Messages now go to an inbox on the site itself. Staff write a message; it lands in the inbox of every member who opted in, and members read it when they sign in, with a count in the navigation. On its own that path has no external service, no key to protect, no retry queue and no background worker, which means there is much less that can fail silently. The consent rules, the staff page, and the audit record all carried over. As a side effect it now reaches people who sign in with a Solana identity or an email, which the protocol never could.
It's less romantic than wallet-to-wallet messaging. It also works, today, and we can test the whole path ourselves. It is also, honestly, just a database table, and Transparent Cities exists to show off what crypto can do. So that was the floor, not the plan.
Then we looked for a network that was alive
We went through the obvious alternatives, checking each one's pulse before writing any code this time:
- Mailchain, the one people mention first, turned out to have been shut down for good: its own site says the service was discontinued in May 2026 and all data deleted. Its code hadn't been touched since late 2023.
- Ledgermail is a closed web-mail product. No public API, and the recipient has to use it too.
- Chainmail, the open-source protocol that came up, is a one-person project with a handful of commits: a design worth reading, not a network anyone is on.
- Push Protocol and Dialect looked stale or gone: no recent releases, a missing repository, a site returning errors.
- Waku is alive and actively developed, but its JavaScript library is still pre-1.0. It's on the list to evaluate properly, not a decision we made on a skim.
The pattern is the same as the first failure: every option was a dependency on someone else's network, and networks stop. So we stopped looking for one and wrote our own, small enough to read in a minute.
A message board contract, and a better idea than copies
The contract emits events and stores nothing, so there is nothing to corrupt or migrate. The part that changes the cost is how a message reaches many people. The traditional way is to clone the message into every recipient's mailbox. Here the body is encrypted once with a random key and written once; that key is then sealed separately for each recipient, a 104-byte grant each. Only the tiny grants grow with the audience. That design is Transparent Cities' idea: a shared message database with per-person access should cost less gas than copies. It does.
Measured for a 1 KB message: about 5.6 times less gas than copies for 10 recipients, about 10 times less for 100, and about 11 times less for 500. On the real test network, a broadcast to ten members cost about 1.7 times what a message to one did. (Test-network fees are nearly free, so those aren't a price forecast. The ratios are the point.)
We tested it the way the first attempt should have been: a sender written in one place and a separate reader page written in another, sharing nothing but the on-chain format. A message sent on a public test network appeared and decrypted in a real browser; a message sealed for someone else did not appear; reloading the page recovered old messages with nothing kept on a server. A person watched it arrive.
What it is not: anonymous. The sender's address, the timing and the size of each message are public, and the encrypted copy is permanent, so it cannot be deleted later and removing your key only stops new ones. It is pseudonymous and private in content, and we say so in the consent text.
What we'd tell ourselves earlier
- Test across the boundary, not inside it. A test where both ends are yours proves your two halves agree. The first test should be your code against software you don't control, the same software your users will have.
- "Sent" is not "delivered." Every layer reported success. The only honest signal was a human looking at the other screen. Build that check into the plan before you build anything else.
- Check whether the network is alive before you build on it. Read the project's own announcements, its release notes, its issue tracker, not just its quickstart. A quiet forum and a new major version with a different architecture are both worth five minutes. We did it properly the second time and found the best-known alternative had already shut down.
- Keep the transport swappable. The reason this was a one-day change and not a rewrite is that the protocol sat behind one small service and one status field. Everything above it didn't know or care.
- Stable isn't current. The "latest" release on the package index was the old generation, and the docs describe the next one. Neither told us which one the rest of the ecosystem was running. Ask.
- Stop when the map is wrong. We spent the last hours of this guessing at an API that didn't match its own types. It was the right call to stop and pick a different path.
- Don't copy data you can share. Cloning a message into every recipient's box is the habit email gave us. Writing it once and handing out small keys cut the cost by an order of magnitude.
- Own the part that has to keep working. A contract we wrote depends on a chain we can check is alive, not on a company's roadmap. It costs more design effort, and it is the only kind of dependency we can read end to end.
Where it stands
Working and live: sign-in with an Ethereum-style or Solana identity, the consent controls, the staff compose page, and the in-app inbox. Tested: delivery to the inbox for opted-in members only, nothing for anyone else, and members can only ever see their own messages.
Built and tested, not yet switched on for members: the encrypted on-chain copy. The contract is deployed on a public test network, a real browser has decrypted real messages from it, and the server side publishes through a small script, off by default. Turning it on needs a funded throwaway key on the server, which is a deliberate manual step. We'll say so here when it has happened and a member has seen their own message arrive.
Retired: sending over the wallet-messaging protocol. The code is still in the repository, marked as not deployed, in case the network and the tooling settle into something we can trust.
The email-and-password login is still there, for now. An identity is still meant to be the only way in.
0 replies
log in to reply.