← Back to Blog Home

    TOMI vs IPFS Gateways: Building Censorship‑Resistant Web Frontends

    November 28, 2025
    TOMI vs IPFS Gateways: Building Censorship‑Resistant Web Frontends

    Title: TOMI vs IPFS Gateways: Building Censorship-Resistant Web Frontends

    Introduction

    What happens to a dapp when its frontend disappears? Smart contracts can stay live, but if users can’t reach the UI the product effectively dies. Builders seeking practical censorship resistance need a predictable stack: content-addressed hosting (IPFS + pinned persistence), verifiable storage (Filecoin Onchain Cloud), decentralized naming (ENS / Handshake), and operational tooling (service workers, cache headers, monitors). This post compares TOMI’s public positioning against IPFS gateway strategies and hybrid failover recipes that keep interfaces usable when URLs are blocked. We emphasize engineering trade-offs and operational playbooks for Web3 teams and investors assessing frontend resilience.

    TOMI, IPFS, and the decentralized web: a quick reality check

    TOMI (marketed as "tomiNet") pitches an integrated browser + tDNS stack with domain auctions and a mesh/cloud hybrid for resilient delivery. That integrated story is useful to examine because it promises an all-in-one delivery and naming solution. However, treat product claims as marketing until validated against documentation, code, and uptime data.

    By contrast, IPFS and its ecosystem take a composable approach: immutable content addressing (CIDs), public and private gateways that bridge HTTP↔IPFS, and economic persistence layers (pinning services, Filecoin). Recent engineering work (delegated routing + caching) has materially improved browser retrieval, and Filecoin Onchain Cloud provides verifiable, pay-for-availability persistence suitable for production dapps. Key takeaway: TOMI offers an integrated marketing story; IPFS + Filecoin + gateway/pinning services offer modular, proven primitives you can adopt today — but you must design for fallback and verifiability.

    Why routing and naming matter

    How a browser resolves UI assets defines your attack surface. Centralized gateways (single hostnames) are convenient but create choke points and legal/technical single points of failure. Many public gateways lack origin isolation or other hardening, which can leak credentials or introduce other risks. Use gateway catalogs and risk-checkers to assess providers.

    Practical hybrid naming and failover patterns

    Framing: The goal is to keep a human-readable pointer (ENS/Handshake) and multiple resolvers/gateways that serve the same immutable CID.

    Primary strategy (canonical): Publish your static UI as an IPFS CID and point your canonical website to a gateway you control or trust.

    Failover patterns (ordered):

    • Failover #1 — ENS: Publish the CID in an ENS contenthash for your .eth name. dapp-aware resolvers and wallets can fetch via known gateways or delegated routing. Keep ENS as the human-readable on-chain pointer; use subdomains/wildcards to mirror mirror endpoints.
    • Failover #2 — Handshake TLDs: Register a Handshake TLD to decouple from DNS providers; use it as an additional out-of-chain namespace for recovery or branding.
    • Additional: Publish multiple HTTP gateway URLs (e.g., ipfs.io, dweb.link, provider delegated gateways) and include client logic to try alternates automatically.

    Tip: Expose the same CID from multiple gateways and configure clients to attempt them in priority order. For browsers and mobile, leverage delegated routing so clients can locate peers even without running a long-lived IPFS node.

    Handling dynamic data and authenticated sessions without leaking private data

    Static frontends on IPFS are straightforward; dynamic state requires a thin backend or encrypted client-only storage. Two practical models:

    1. Thin serverless API + wallet auth (SIWE): Authenticate users off-chain with Sign-In with Ethereum (EIP-4361). Issue short-lived HttpOnly session tokens tied to domain/nonces. This keeps sensitive signing keys off servers and allows server APIs to use standard cookie/session semantics.

    2. Client-only encrypted state: Encrypt private data in the browser with ephemeral session keys derived from wallet signatures. Sync ciphertext blobs to IPFS/Filecoin; clients fetch and decrypt locally. Never embed long-lived secrets in public CIDs or metadata.

    Operational note: For each model, design for gateway failures — e.g., cache enough UI and last-known encrypted blobs locally to allow a usable offline/restore UX while you attempt alternate gateways or delegated lookups.

    Security and best practices

    • Use SIWE (EIP-4361) for authentication. Verify nonces, chainId, and origin server-side and set short expirations.
    • Use HttpOnly, Secure, and SameSite cookies for session continuity when server APIs are required.
    • Avoid storing PII or credentials in public IPFS objects. If you must persist user data, encrypt it client-side and pin only ciphertext.

    Service workers, cache headers, and a deployment recipe (React example)

    Goal: make the client resilient at runtime by combining service-worker caching with gateway fallback logic.

    High-level recipe:

    1. Build and export a static React bundle (npm run build → dist/).
    2. Add to IPFS & get the CID (use web3.storage, nft.storage, or a pinning provider).
    3. Pin to durable storage (Filecoin Onchain Cloud or commercial pinning). Use verifiable persistence where available.
    4. Publish ENS contenthash (set ipfs://<CID> on your resolver).
    5. Client fallback logic: In app startup or index.html, detect failed requests (timeouts/5xx) and re-request via alternate gateway URLs or delegated resolvers (eth.limo, delegated routing). Implement exponential backoff and a "Try alternate gateway" UX.
    6. Service worker + caching: precache the app shell on install (cache-first for hashed assets; network-first or stale-while-revalidate for API responses). Set Cache-Control: public, max-age=31536000, immutable for hashed assets and shorter TTLs for index.html so ENS updates propagate.

    Example rollback flow: Service worker tries gateway A → timeout → try gateway B → check ENS contenthash via eth.limo/delegated routing → fall back to cached offline/restore page. Keep this lifecycle in a single place in your service-worker code.

    Monitoring, automation, and operational playbook

    • Monitor gateway availability with synthetic checks (request your CID via multiple gateways). Use Upptime or Uptime Kuma and alert on failures.
    • Automate pinning health: periodic retrieval + hash verification and auto-repin to alternate providers on reachability drops.
    • Canary checks: verify ENS contenthash on-chain regularly and alert on mismatches or suspicious updates.
    • Run cost/SLA reviews: track provider charges and retrieval latency to make informed choices about which providers to rely on.

    Moderation, legal exposure, and safe harbor considerations

    Decentralized delivery changes but does not eliminate legal risk. Intermediary protections (DMCA safe harbor, Section 230-like regimes) depend on jurisdiction and identifiable intermediaries; decentralization complicates takedown mechanics. Retain legal counsel and follow community guidance on platform liability and takedown workflows.

    Practical mitigations:

    • Keep an owned control plane (multisig/Safe) that can update pointers (ENS contenthash) to implement governance delists when legally required.
    • Design takedown escalation: flag → review → delist/replace pointer. For immutable content, provide an off-chain governance pointer and a human-readable explanation rather than attempting to remove historical CIDs.

    Conclusion — short operational playbook for frontend resilience

    1. Publish static UI bundles as IPFS CIDs.
    2. Pin to multiple providers and add verifiable persistence (e.g., Filecoin Onchain Cloud).
    3. Publish an ENS contenthash and register backup Handshake names or TLDs.
    4. Implement a service-worker precache strategy and appropriate cache headers (immutable for hashed assets; short TTL for index.html).
    5. Authenticate with SIWE (EIP-4361) and never leak secrets to public objects.
    6. Monitor gateway & CID reachability with synthetic checks and automate repinning and pointer failover.

    If you want, TokenVitals can run a risk scan of a target dapp (single gateway, single pin provider, single DNS) and produce a prioritized remediation plan with estimated costs and SLA trade-offs. We can also provide templates: a GitHub Actions workflow that monitors three gateways + ENS contenthash, a React service-worker fallback template, and a Terraform snippet to pin a CID to a persistence provider.

    References

    • Filecoin — "Introducing Filecoin Onchain Cloud" (Nov 18, 2025).
    • IPFS Blog — "Faster Peer-to-Peer Retrieval in Browsers With Caching in the Delegated Routing HTTP Server" (Sep 5, 2025).
    • Public Gateway Checker — IPFS (gateway risk & origin isolation warning).
    • EIP-4361 — Sign-In with Ethereum (SIWE) spec.
    • ENS DAO Newsletter — Sep 9, 2025 (naming practices & updates).
    • MDN — Service Worker caching guidance.
    • Upptime — GitHub Actions uptime tooling.
    • EFF — platform liability and policy resources.
    • TOMI coverage (marketing/roadmap example) — U.Today (July 2025).

    Mentioned in this article