If you’ve hit a page with a jackal-eared anime girl asking you to wait a moment, you’ve met Anubis. It’s the open-source proof-of-work wall that went viral in early 2025 when Xe Iaso built it to stop Amazon’s crawler from DDoSing her Git server, and it now guards some of the busiest infrastructure on the internet: the Linux kernel mailing list archives and git server, GNOME’s GitLab, Wikimedia, FFmpeg, Wine, UNESCO, Duke University’s digital archives. Free software’s answer to AI crawlers isn’t a $2,000/month WAF — it’s a math puzzle served to anyone whose User-Agent contains the string “Mozilla”.

The pitch is elegant: make scraping cost computation instead of money. Whether that pitch survives contact with arithmetic is the actual story. In this article I’ll reverse-engineer the challenge protocol from the Go and Rust source, build a working solver in pure Python, run it against a live Anubis deployment and the project’s own website, benchmark what every difficulty tier costs, and then run the economics both ways — because the wall cuts both directions.

The challenge, byte for byte

Anubis sits as a reverse proxy in front of your origin. On the first request, it serves an HTML page with the puzzle embedded as JSON:

{"rules": {"algorithm": "sha256", "difficulty": 16},
 "challenge": {"id": "01a1d2f4-5922-...", "method": "sha256",
  "randomData": "84c5bae812483a0b...", "difficulty": 16, "spent": false}}

Your browser must find a number (the nonce) such that sha256(randomData + nonce) starts with a run of zeros. That’s Bitcoin mining with the serial numbers filed off — the project namechecks Hashcash as its ancestor. Two details matter enormously and are documented almost nowhere.

First: there are two different difficulty semantics. Anubis currently ships two challenge engines, and difficulty means different things in each:

  • fast/slow (the JavaScript-era engine in lib/challenge/proofofwork): the client computes sha256(randomData + str(nonce)) and the difficulty counts leading zero hex digits of the ASCII hash. Difficulty 4 = 16 zero bits = ~2¹⁶ hashes on average.
  • sha256 (the current default, a WebAssembly module in lib/challenge/wasm): the client hashes the raw challenge bytes with a u32 nonce in binary form, and difficulty counts leading zero bits. Difficulty 16 = ~2¹⁶ hashes. The nonce’s endianness flips based on the last challenge byte — a small anti-GPU tweak the source calls out explicitly.

Conflating the two is the classic failure mode: the numeric difficulty values are not comparable between engines. The Rust validator (wasm/pow/sha256/src/lib.rs) checks bits by masking; the Go fast validator checks strings.HasPrefix(response, strings.Repeat("0", difficulty)). I know this because my first solver worked against one engine and silently produced garbage proofs for the other.

Second: the challenge is bound to your session. The challenge page sets a verification cookie. Redeem the proof from a different HTTP context and the server just issues a fresh challenge, forever. This single gotcha kills most naive scripts before they solve a single hash.

The solver

Everything below is pure Python stdlib, tested end-to-end against Anubis v1.28.2 running locally in Docker and against the live site at anubis.techaro.lol. The full flow: fetch challenge on a cookie-carrying session, mine the nonce, redeem the proof, receive the auth cookie, read the content behind the wall.

import hashlib, http.cookiejar, json, re, struct, time, urllib.request

UA = "Mozilla/5.0 (X11; Linux x86_64) Firefox/130.0"  # Anubis challenges any "Mozilla" UA

def open_session():
    """A cookie-carrying opener: the whole flow must run on one session."""
    jar = http.cookiejar.CookieJar()
    return urllib.request.build_opener(urllib.request.HTTPCookieProcessor(jar))

def get_challenge(opener, base_url):
    """GET the protected page; the challenge lives in an inline JSON script tag."""
    req = urllib.request.Request(base_url, headers={"User-Agent": UA})
    html = opener.open(req, timeout=30).read().decode()
    m = re.search(r'<script id="anubis_challenge" type="application/json">(.*?)</script>', html, re.S)
    if not m:
        raise RuntimeError("no challenge found - page unprotected or auth cookie already valid")
    return json.loads(m.group(1))["rules"], json.loads(m.group(1))["challenge"]

def meets_nibbles(difficulty, digest):
    """"fast"/"slow" rule: difficulty leading zero hex digits (2 bits per nibble)."""
    zero_bytes, odd_nibble = divmod(difficulty, 2)
    if digest[:zero_bytes] != b"\x00" * zero_bytes:
        return False
    return not (odd_nibble and digest[zero_bytes] >> 4)

def meets_bits(difficulty, digest):
    """"sha256" rule: difficulty leading zero bits of the raw digest."""
    full, rem = divmod(difficulty, 8)
    if digest[:full] != b"\x00" * full:
        return False
    return rem == 0 or digest[full] >> (8 - rem) == 0

def solve_fast(random_data, difficulty):
    """Iterate decimal-string nonces for the 'fast'/'slow' rule."""
    data = random_data.encode()
    t0, nonce = time.perf_counter(), 0
    while True:
        digest = hashlib.sha256(data + str(nonce).encode()).digest()
        if meets_nibbles(difficulty, digest):
            dt = time.perf_counter() - t0
            return digest.hex(), nonce, (nonce + 1) / 1e3 / dt, dt
        nonce += 1

def solve_sha256(random_data, difficulty):
    """Iterate u32 nonces for the WASM rule: raw challenge bytes + binary nonce.
    Endianness flips on the last challenge byte (anti-GPU trick)."""
    data = bytearray(bytes.fromhex(random_data))
    use_le = (data[-1] if data else 0) >= 128
    data = bytes(data)
    t0, nonce = time.perf_counter(), 0
    pack = struct.pack
    while True:
        digest = hashlib.sha256(data + pack("<I" if use_le else ">I", nonce & 0xFFFFFFFF)).digest()
        if meets_bits(difficulty, digest):
            dt = time.perf_counter() - t0
            return digest.hex(), nonce, (nonce + 1) / 1e3 / dt, dt
        nonce += 1

def redeem(opener, base_url, ch, response_hash, nonce):
    """Exchange the proof for the EdDSA-signed auth cookie (7-day validity)."""
    url = (f"{base_url}/.within.website/x/cmd/anubis/api/pass-challenge"
           f"?id={ch['id']}&response={response_hash}&nonce={nonce}&redir=/&elapsedTime=5000")
    req = urllib.request.Request(url, headers={"User-Agent": UA})
    return opener.open(req, timeout=30).read().decode()

op = open_session()
rules, ch = get_challenge(op, "https://anubis.techaro.lol")
h, n, khs, secs = solve_sha256(ch["randomData"], ch["difficulty"])   # live site: sha256, difficulty 16
body = redeem(op, "https://anubis.techaro.lol", ch, h, n)
assert "anubis_challenge" not in body, "session mismatch - challenge re-issued"
print(f"accepted: nonce={n} at {khs:.0f} kH/s")

Against my local v1.28.2 instance (fast, difficulty 2), the complete run — challenge, mine, redeem, cookie, content behind the wall — exits clean:

challenge id=01a1d2f5-199d-... algo=fast difficulty=2
mined (2 zero hex digits = ~256 hashes): nonce=403 hash=00d1fb06... rate=647 kH/s wall=1ms
redeem: challenge accepted, auth cookie issued
upstream content behind the wall: True

And against the live production deployment:

challenge id=01a1d2f5-1c62-... algo=sha256 difficulty=16
mined (16 zero bits = ~65,536 hashes): nonce=63991 hash=0000f076... rate=679 kH/s wall=94ms
redeem: challenge accepted, auth cookie issued

The server accepted the proof in 94 milliseconds. The auth cookie is an EdDSA-signed JWT valid for 7 days by default — one solved puzzle buys a week of access.

What each difficulty tier actually costs

Benchmarks on a 2-core Intel Xeon E5-26xx v4 (a burstable cheap-VPS-class core), pure Python, single thread — measured on a fixed challenge, so the numbers are deterministic to re-run:

Difficulty (fast)WorkHashes neededWall time (measured)
4 (the --difficulty flag default)16 bits = 2¹⁶123,5740.18 s
520 bits = 2²⁰2,156,2963.34 s
624 bits = 2²⁴4,655,4457.08 s

For the live sha256 engine: difficulty 16 solved in 34,453 hashes (0.04 s on the same box), difficulty 20 in 609,477 (0.80 s). Each +1 hex digit (fast) or +4 bits (sha256) multiplies the work by 16; Python here does about 640-790 kH/s single-threaded, and the hashing itself could go much faster in C or with multiprocessing. The Anubis docs’ claim that difficulty 5 “can take several minutes” is a statement about phones, not about anyone who knows what a for-loop is.

The Tavis math: ~6 minutes a week

Tavis Ormandy (Google’s Project Zero) did the arithmetic everyone should have done before deploying: he pulled openssl speed on a Google Compute Engine e2-micro — Google’s smallest general-purpose VM — the same one-core, 1 GB class as AWS Lightsail’s $5/month entry instance — and measured roughly 2²¹ SHA-256 operations per second. Then he looked at Anubis’s cookie lifetime (7 days) and its ~11,500 GitHub stars and asked: what would it cost a crawler vendor to mine a valid token for every Anubis deployment on the internet, for a whole week?

(11,508 sites × 2^16 hashes) ÷ 2^21 hashes/sec ≈ 6 minutes

Six minutes of one micro-VM, once a week, for unrestricted access to every Anubis-protected site in the world. His conclusion: “I don’t think we reach a single cent per month in compute costs until several million sites have deployed Anubis… this is literally nothing for a soulless AI vendor with a monthly cloud services budget in the 8 figures.”

And the field data agrees. In August 2025, Codeberg — whose forge hosts tens of thousands of open-source projects behind Anubis — reported that AI crawler operators had started solving the challenges at scale. The wall works exactly as designed against casual scrapers and costs exactly nothing to a serious one. Note the asymmetry though: Tavis’s math assumes one cached token covers everything. In practice, tokens are per-site (cookie domain), per-IP in stricter configs, and sites tune difficulty up during abuse spikes — so a real crawler fleet needs distributed mining, not one e2-micro. That’s still a rounding error on an AI vendor’s compute budget; it’s just not literally one machine anymore.

Meanwhile the cost side of the ledger is real. LWN decided not to deploy Anubis partly because it blocks users with JavaScript disabled, and the Anubis forums fill up with owners of old laptops reporting fans spinning at full speed to read documentation. Every visitor pays the PoW tax; only the visitors with datacenters get a refund.

The verdict: what Anubis is actually for

Reading the economics honestly, Anubis is not a paywall against compute — a determined adversary clears it for pocket change. What it actually does, and does well, is three things:

  1. It kills the free lunch. Casual scraper scripts, naive wget mirrors, and lowest-bidder AI crawlers that were coasting on “robots.txt is a suggestion” now need an engineer, a solver, and someone on call when the difficulty ramps. Most don’t bother. For the median deployment, that’s the whole threat model gone.
  2. It converts scraping from a background process into a line item. Even at fractions of a cent, mining tokens per-domain at scale requires infrastructure — and infrastructure requires a budget owner, which means the scraping now competes with other uses of the vendor’s compute. Friction at that layer deters more than the raw math suggests.
  3. It buys the origin 7-day cache windows and breathing room during traffic spikes — the ScummVM admins credit it with absorbing what was effectively a DDoS.

If you’re an operator: Anubis is a excellent speed bump, a terrible wall. Deploy it for the median bot, assume it falls to the determined one, and layer rate limits, tarpits, and log analysis behind it. If you’re on the scraping side: now you know the wall is 65k hashes and a cookie jar. Whether you should climb it is a question of terms of service, copyright, and whether the data is worth an engineering line item — not a question of capability. The capability question was settled in 94 milliseconds.

The deeper lesson for anyone building web-scale systems: the interesting anti-bot layers are never the ones with the marketing. They’re the ones with the semver, the config flag, and the byte-level semantic drift between engines. Read the source, test against a live deployment, and price the economics on both sides of the wall before you trust anyone’s threat model — including mine.

Need a custom version of this — a distributed PoW solver fleet, a tarpit layer for your own origin, or an anti-bot audit of what your stack actually costs attackers? Email [email protected].