DEV Community

Cover image for I built a "Paranoid" Data Protocol that runs away from server seizure or censorship (Python + Rust)
Dodod Bobovo
Dodod Bobovo

Posted on

I built a "Paranoid" Data Protocol that runs away from server seizure or censorship (Python + Rust)

The "Knock on the Door" Problem

We tend to think of decentralized storage (like IPFS) as permanent. But physically, data always sits on someone's hard drive.
If a node operator gets raided, or a data center gets seized, that data is gone (or worse, compromised). Encryption at rest helps, but it doesn't solve the physical availability problem.

I asked myself a question:

Can we make data behave like a living organism that runs away from danger?

This weekend, I built a Proof-of-Concept to answer that. Meet WDP (Wanderer Data Preservation).

🧬 Biological Survival Strategies in Code

Instead of static replication, WDP uses a "Moving Target Defense" strategy.
Data in this network is ephemeral and acts based on survival instincts. It migrates based on two triggers:

  1. Time (TTL): Data moves to a new peer automatically every "Epoch" (e.g., 10 minutes) to prevent static analysis.
  2. Threat Detection: If a node detects network anomalies, packet loss, or "seizure" patterns in the swarm, it triggers an immediate emergency migration to a safe node and wipes itself.

It’s like a digital game of "Hot Potato," but cryptographically signed.

Under the Hood (Python PoC)

The current implementation uses Python for logic and Ed25519 for signing every state transition.

Here is how the migration logic looks (simplified):

def attempt_migration(self, trigger="TTL"):
    # 1. Find a candidate node (or Emergency Peer)
    # If under attack, find the furthest node by latency
    target = self.swarm.find_peer(strategy=trigger)

    # 2. Sign the payload
    signature = self.signer.sign(self.data)

    # 3. Transmit & Escape
    if target.receive(self.data, signature):
        self.secure_wipe() # <--- The critical part
        print(f"Migration success ({trigger}). I am now empty.")
Enter fullscreen mode Exit fullscreen mode

I also built a "Swarm Simulation" to stress-test this. Even with 30% of nodes randomly dying (simulating active attacks/seizures), the data survived by constantly hopping to safe nodes.

🦀 Moving to Rust

Python is great for prototyping, but for a p2p node, we need raw performance and memory safety.
I've started porting the core protocol to Rust (using libp2p and tokio).

The goal is to compile this to WASM so WDP nodes can run directly in browsers, creating an unkillable, serverless storage layer.

🤝 I Need Your Roast

This is an experimental concept. I know there are challenges (bandwidth usage, latency, malicious nodes).
I released the code open-source under MIT, and I'm looking for feedback from the community.

  • Is "Migration" a viable alternative to "Replication"?
  • How would you handle the "Sybil Attack" in this dynamic topology?

Check out the repo here:
👉 GitHub: WDP Protocol

If you think this concept is cool (or crazy), drop a star ⭐. It keeps me motivated to finish the Rust port!

Top comments (0)