Offnet: I built a darkweb inside Ethereum in 2018 (and the contract still works)

By William Entriken

6 minutes

You want to publish a web page.

No server. No domain. No hosting bill. No one can take it down.

I solved that in 2018 with Offnet. You store the entire HTML, CSS, and JS directly on Ethereum. Anyone with a browser and a Web3 connection can load it using a special URI. The browser does the rest.

Here is the exact contract I deployed:

pragma solidity 0.5.0;

contract Offnet {
    mapping (bytes32 => bytes) files;
    
    function getFile(bytes32 contentIdentifier) external view returns (bytes memory content) {
        return files[contentIdentifier];
    }

    function addFile(bytes calldata content) external returns (bytes32 contentIdentifier) {
        contentIdentifier = keccak256(bytes(content));
        files[contentIdentifier] = content;
    }
}

Address: 0x8370f43041c98ad30b99c192e8263bcd64529c38

How it works

  1. You publish by calling addFile with your full file. You pay only the transaction fee.
  2. The contract returns the keccak256 hash of your content. That hash is part of your permanent URI.
  3. You share the URI with anyone: ?offnet-35fbb6dc3891aacaf1ffa07abec2344fdbc454aab533a2a03bcf93577eb7837b
  4. They open that URL with Offnet, the browser intercepts the URI, calls the contract on-chain, and injects the raw content.

Here is the exact service worker that does the magic:

self.addEventListener("fetch", event => {
  const url = new URL(event.request.url);
  if (url.search.startsWith("?offnet-")) {
    const newUrl = "./" + url.search.substr(9);
    event.respondWith(fetch(newUrl, { mode: 'cors' }));
  }
});

The full index.html (the entry point users visit) is still live and works today. It gives you the “Load” and “Publish” forms, a list of cool pages, and the security warning.

What you get

Why nobody scaled it

Gas was expensive in 2018–2022. Storing even a medium-sized HTML file cost real money. Service workers have quirks (Firefox and Safari hide them in private browsing).

2026 update — it is viable now

Dencun blobs and cheap L2s (Base, Arbitrum, Optimism) changed everything. Storage is no longer insane. You can host entire real sites for pennies now. The service-worker pattern still works perfectly.

I still have the full original files: the two versions of index.html, the service worker, and the exact contract. The demo still loads today.

Try it yourself

  1. Visit the live index.html (or save it locally).
  2. Connect any Web3 wallet.
  3. Load one of the published pages using the ?offnet- URI format.
  4. Publish your own tiny page and share the hash.

This was never meant to replace the normal web. It was a proof that we could build a parallel, serverless, censorship-resistant web using only the tools we already had.

I built it because I wanted to see if it was possible. It was.

What are you going to host first?

Full index.html

<!doctype html>
<html>
  <head>
    <meta charset="utf-8">
    <title>Offnet</title>
    <script>
const offnetUri = new URLSearchParams(window.location.search).get('offnet');
if (offnetUri) {
  const request = new XMLHttpRequest();
  request.open("GET", "jsonrpc/" + offnetUri, true);
  request.onreadystatechange = function () {
    if (request.readyState != 4 || request.status != 200) return;

// APPROACH 1 -- keeps existing HEAD
//    document.body.innerHTML = request.responseText;

// APPROACH 2 -- replace whole document
document.open("text/html", "replace");
document.write(request.responseText);  // htmlCode is the variable you called newDocument
document.close();
  };
  request.send();
}
    </script>
  </head>
  <body>
    <nav class="navbar navbar-light bg-light d-flex align-items-center">
      <h1 style="background-image:linear-gradient(to right, orange, pink, purple);background-clip:text; -webkit-background-clip:text;color:transparent">Offnet&trade;</h1>
      <form class="ml-auto form-inline my-0">
        <label class="mr-3" for="network">Network:</label>
        <select class="form-control" id="network">
          <option>Ethereum Mainnet (Infura)</option>
          <option>Local node, port 8456</option>
        </select>
      </form>
    </nav>
    <div class="container mt-5 lead">
      <img id="animage" src="">
      <p><em>Offnet URIs</em> are qualified to a specific network (set at top) and look like:</em></p>
      <p><code>?offnet=35fbb6dc3891aacaf1ffa07abec2344fdbc454aab533a2a03bcf93577eb7837b</code></p>
  
      <div class="row mt-5">
        <div class="col">
          <h2>Visit any page</h2>
          <form>
            <input class="form-control mb-2" name="offnet" placeholder="Offnet URI">
            <button id="visit" class="btn btn-primary mb-2">Visit</button>    
          </form>
        </div>
        <div class="col">
          <h2>Publish a page <span class="badge badge-info">only pay TX fee</span></h2>
          <form>
            <input type="file" class="mb-2 form-control-file" id="exampleFormControlFile1">
            <button type="submit" class="btn btn-primary mb-2">Publish</button>
          </form>
        </div>
      </div>
  
      <h2 class="mt-5">Some cool pages</h2>
  
      <ul>
        <li><strong>Style.css</strong> &mdash; the stylesheet for this page<br><a href="">?offnet=35fbb6dc3891aacaf1ffa07abec2344fdbc454aab533a2a03bcf93577eb7837b on Ethereum Mainnet</a></li>
        <li><strong>dogs</strong> &mdash; the stylesheet for this page<br><a href="?offnet=123456">?offnet=123456 on Ethereum Mainnet</a></li>
        <li>Share other cool pages <a href="mailto:">with us</a></li>
      </ul>
  
      <h2>Street smarts 💡</h2>
      <p>If you're reading this page, you might be a crypto billionaire. Before you visit anywhere with Offnet, use a private browsing mode and be extra skeptical of anything you click, lest you be tricked by someone that wants your billions.</p>
      <p class="text-danger"><strong>WARNING:</strong> If you are reading this page at XXX.NET or your own downloaded copy, then that's cool. Anything else claiming to be Offnet is unofficial and is a scam.</p>


      <h2 class="mt-5">How does this work?</h2>
      <p>Offnet works by intercepting Offnet URIs on web pages you visit, silently fetching and injecting the referenced content.</p>
      <p>
        Offnet does not store any documents or link to any documents. An Offnet URI is an <em>identifer</em> which uses the contents of a file to succinctly describe that file. In order to retrieve a web page or other file using Offnet you must be connected to a blockchain, such as Ethereum Mainnet. Offnet will retrieve and display requested files from the connected network.
      </p>
  
      <h2 class="mt-5">Maximum security</h2>
      <p>
        STEP 1: LOCAL NODE &mdash; Run your own local synchronized blockchain node and choose NETWORK at the top of this page to connect to it.
      </p>
      <p>
        STEP 2: OFFLINE &mdash; Disconnect from the Internet and all communications services on your device. You can still access all content on Offnet. Yes really.
      </p>
      <p>
        DONE &mdash; If you destroy your computer now, there will literally be no record on Earth of what you have done with Offnet. No "anonymized" records. No "we promise we don't keep logs." Welcome to privacy.
      </p>
    </div>
    <footer class="bg-dark py-5 mt-5">
      <div class="container text-light text-center">
        <div class="row">
          <div class="col">
            <strong>Offnet&trade;</strong>
            version 1.0-a1
          </div>
          <div class="col">
            Created by <a class="text-light" href="https://phor.net">William Entriken</a>
          </div>
          <div class="col">
            <a class="text-light" href="mailto:infura?Requesting to delete content from your local copy of the Ethereum blockchain/standard DMCA form fields">DMCA requests</a>
          </div>
        </div>
      </div>
    </footer>
  </body>
</html>

Comments

There are no comments yet.

Please discuss this topic anywhere and let me know any great comments or media coverage I should link here.