DEV Community

Cover image for FSOCIETY: Building a Terminal Chatroom to Fight Tech Oligarchs (and Maybe Become One)
Joseph Asiagi
Joseph Asiagi

Posted on • Originally published at Medium

FSOCIETY: Building a Terminal Chatroom to Fight Tech Oligarchs (and Maybe Become One)

"FSOCIETY: Building a Terminal Chatroom to Fight Tech Oligarchs (and Maybe Become One)"

In modern times, chatrooms have all been about beautiful GUIs and heavy mobile apps. Let's be real—they are mostly built by billion-dollar corporations stalking your metadata, harvesting your interactions, and selling them to the highest, oiliest snake oil salesman just to rip you off. It's a great business model, but Elliot Alderson definitely doesn't approve.

While re-watching Mr. Robot, I came across a scene featuring a raw chatroom running straight inside a Linux terminal. At that exact moment, I had a divine vision. For days, I couldn’t stop thinking about how I could become the next big tech olig—pardon me, a revolutionary member of fsociety. Yeah, fuck the tech oligarchs who spy on us to make billions (though I secretly wish it were me with those billions).

mr-robot-chatroom-terminal

Equipped with a single working braincell and a strong hatred for digital stalkers, I embarked on a journey to build the promised darknet chatroom in the terminal.

The Core Tech Stack

  • Golang: The heavy lifter for concurrent socket handling.

  • Bash & Markdown: For scripting shortcuts and text styling.

  • Divine Blessing : To give me the strength so I can keep building

    The System Architecture

The blueprint is simple, lightweight, and completely bypasses standard tracking infrastructure. Traffic flows sequentially down this pipeline:

[ TUI Front-End ] ──► [ Terminal Client Engine ] ──► [ Tor Proxy Network ] ──► [ Target Onion Server ]──► [ TUI Front-End ] ──► [ Terminal Client Engine ] ──► [ TUI Front-End]
Enter fullscreen mode Exit fullscreen mode

Step 1: The Cryptographic Handshake (Login & Registration)

I wanted a custom protocol for joining the chatroom that didn't rely on classic passwords or centralized OAuth trackers. Instead, the application runs an asymmetrical cryptographic authentication challenge.

  1. The Identity Exchange: The client transmits their Ed25519 public key to the server.

  2. Database Lookup: The server queries its tiny, local sqlite3 database to check if this public key is a recognized user.

  3. The Cryptographic Challenge: If recognized, the server dispatches a unique authentication challenge string back to the client. The client must sign this challenge using their private key.

  4. The Stealth Pivot: To keep the protocol fast, the client bundles their X25519 public key along with the signed response.

Once verified, the user is authorized to enter the room. This approach yields a completely unique, persistent, yet anonymous identifier.

Future Scope: We harvest the X25519 keys during the handshake so that we can implement full peer-to-peer End-to-End Encryption (E2EE) once I get motivated to burn my remaining braincell on it. I also threw in a basic Ping/Pong protocol to keep the server and client sockets in sync.

Step 2: Designing the Interface (Arch Chads vs. UwU Princesses)

This was perhaps the step where my enslaved braincell almost quit. I realized early on that terminal users are split into two completely hostile camps, so I had to design two distinct front-ends.

The No-TUI Mode (For the Arch Linux GigaChads)

First, I deployed a bare-bones, raw terminal mode. This is built specifically for the Arch Chads who know that graphical styling is for mortals. I made sure to make it as visually punishing as humanly possible, knowing that the Archies are essentially tech deities who aren't bothered by raw text streams.

  • They use their sheer telepathic powers to type /servers to list active connections and /use <server_name> to shuffle between active rooms.

  • To send a message, they simply command their PC through sheer force of will.

tsup-no-gui

The TUI Mode (For the Cutie Patootie UwU Princesses)

For the users who want rainbows, boxes, and roses in their terminal, I brought in the Bubbletea framework by Charm. Coding this part was completely soul-crushing, and I did my absolute best to make it beautiful and functional.

  • The result is a clean, almost responsive terminal layout.

  • Users can use standard arrow keys to seamlessly shuffle between rooms, type into an input bar, and press Enter to broadcast messages globally.

tsup-gui

Step 3: Debugging the Logic (Pointers and Contexts)

Because I was operating on a single braincell, I ran into a massive wall of logical bugs while configuring the concurrent network hub.

My biggest nightmare was unregistering users from the server's central connection hub once their terminal closed. Clients would disconnect, but the server would hang or keep ghost resources active. I almost lost my mind over it.

// The catastrophic bug: Passing by value instead of reference
func (h *Hub) Unregister(client Client) { ... } 

// The elegant fix:
func (h *Hub) Unregister(client *Client) { ... }
Enter fullscreen mode Exit fullscreen mode

Turns out, all I missed was a single asterisk (*). I was handing out completely disconnected copies of the client structures to my functions instead of pointing to the actual memory addresses where the live connections resided.

Additionally, managing the lifecycle of my background goroutines without leaking memory forced me to finally level up. As a former Go newbie, I had to master the native context package to safely propagate cancellation signals across sockets whenever a connection folded.

The Security Model

We don't build security gaps. The tool enforces four strict layers of protection:

  • Tor Core Routing: The entire application forces traffic directly through the Tor network. This masks the real IP addresses of our users and gives us completely free, metadata-stripped TCP transport across onion networks.

  • Volatile In-Memory Storage: The chat data is entirely volatile. Everything lives strictly in RAM. If the feds ever decide to raid your chatroom kitten server, turning off the machine instantly wipes the entire history into the void. No disk forensics can save them.

  • TLS Layering: We layer standard TLS over the connection for total confidentiality. Because we handle authentication natively via our public keys, we explicitly skip traditional CA certificate verification.

What I Learned

I spent three weeks bursting my brains out on this project. By the end, I didn’t just build a chatroom; I completely leveled up my systems engineering skills. I moved past basic tutorials and learned how the backbone of modern private communication—Public Key Infrastructure (PKI), Diffie-Hellman Key Exchanges, and Layer 4 networking—actually behaves under stress.

The terminal isn't finished yet, and I'm still hacking away at the UI layers. You can check out the source code here at [TSUP]. If you consider yourself a true member of fsociety, pull requests are open. Our supreme leader Elliot calls for us to unite and build something completely un-trackable.

I wonder if I can run ads in the terminal though... 🤔

Top comments (1)

Collapse
 
anonyrat profile image
Joseph Asiagi

Hello friend