Self-hosted CAPTCHA without traffic lights or tracking: comparing Proof-of-Work ALTCHA v3 and AI-detecting FCaptchaArticle · digest for November 24
Security engineer's desk with a studio still life of cryptographic security artifacts and a clean verification monitor free of third-party trackers
Article3 sections≈ 9 min

Self-hosted CAPTCHA without traffic lights or tracking: comparing Proof-of-Work ALTCHA v3 and AI-detecting FCaptcha

When you need to protect a /signup form from bots, you usually pick between two bad options. You can add Google reCAPTCHA, hCaptcha, or Cloudflare Turnstile. It's fast to set up, but it loads a third-party script with cookies and sends user data to an external provider (hello, GDPR and local data laws like Russia's 152-FZ). Or you can build honeypot fields and IP rate limits, which a script easily bypasses with a pool of proxies.

On top of that, a new problem has arrived. Traffic-light puzzles annoy real people, hurt accessibility, and no longer stop bots. AI agents can now click images from a screenshot or drive a real Chromium browser directly.

Two open-source, MIT-licensed self-hosted projects have stepped up to replace cloud widgets without using cookies. ALTCHA makes the browser solve a cryptographic puzzle, while FCaptcha analyzes client behavior and catches AI agents. Let's compare both on a /signup form.

ALTCHA v3: Proof-of-Work right in the browser

The idea behind ALTCHA (release v3.7.0) is simple: no telemetry, no fingerprinting, and no separate anti-bot server. Protection relies on Proof-of-Work (PoW), a cryptographic challenge that the browser solves in the background before submitting the form. Finding the hash takes a fraction of a second for one human user, while a spam bot sending thousands of requests has to burn CPU on every submission.

On the frontend, you use the <altcha-widget> tag built with Web Components, a native browser standard for custom HTML elements that doesn't depend on React or Vue. The widget meets WCAG 2.2 AA standards and computes hashes using the built-in Web Crypto API. If you are upgrading from v2, you'll need to update your markup using the v2 migration guide: challengeurl and challengejson were merged into challenge, and floating and overlay became display.

<!-- Load the ALTCHA v3 Web Component -->
<script async defer src="/altcha.js" type="module"></script>

<form method="post" action="/signup">
  <input type="email" name="email" required />
  <!-- In v3, the challenge attribute replaced challengeurl -->
  <altcha-widget
    challenge="/api/altcha/challenge"
    display="standard"
    language="en"
    workers="4"
  ></altcha-widget>
  <button type="submit">Sign up</button>
</form>

Once solved, the widget adds a hidden altcha field to the form. On the server side, altcha-lib supports TypeScript/JS, Go, Python, PHP, Rust, and five other languages. A second secret, hmacKeySignatureSecret, enables deterministic mode so the server can verify the signature almost instantly without recomputing the hash.

import {
  createChallenge,
  randomInt,
  verifySolution,
} from 'altcha-lib';
import { deriveKey } from 'altcha-lib/algorithms/pbkdf2';

const HMAC_SECRET = process.env.ALTCHA_HMAC_SECRET!;
const HMAC_KEY_SECRET = process.env.ALTCHA_HMAC_KEY_SECRET!;

// GET /api/altcha/challenge — issue a challenge to the browser
export async function getChallenge() {
  return createChallenge({
    algorithm: 'PBKDF2/SHA-256',
    cost: 5_000,
    counter: randomInt(5_000, 10_000),
    deriveKey,
    hmacSignatureSecret: HMAC_SECRET,
    hmacKeySignatureSecret: HMAC_KEY_SECRET,
  });
}

// POST /signup — verify the solution from the altcha field
export async function verifySignup(payload: {
  challenge: unknown;
  solution: unknown;
}) {
  const res = await verifySolution({
    challenge: payload.challenge,
    solution: payload.solution,
    deriveKey,
    hmacSignatureSecret: HMAC_SECRET,
    hmacKeySignatureSecret: HMAC_KEY_SECRET,
  });
  return res.verified;
}

You must store used salts in a cache to prevent replay attacks. PBKDF2/SHA-256 runs by default, but v3 also added Argon2id and Scrypt. These algorithms require a noticeable chunk of RAM, which makes brute-forcing harder on GPUs and ASICs. You load them in separate Web Workers via $altcha.algorithms.set(...), and there is an altcha/external build for strict CSP setups.

Official ALTCHA v3 banner — a self-hosted Proof-of-Work CAPTCHA alternative (Source: altcha.org)

The limit of pure PoW is clear right away: a bot in a real browser or an AI agent willing to wait a couple of seconds will pass the check. Also, heavy Argon2id settings can crash a browser tab with an OOM error on low-end phones (which is why the retryOnOutOfMemoryError flag exists). Fallback visual and audio challenges are only available in the commercial ALTCHA Sentinel product.

FCaptcha: catching AI agents and replacing siteverify

The WebDecoy team took a different approach with FCaptcha (v1.51.4). Their benchmarks on a low-end phone showed that Argon2id (64 MiB) slows down a human by 6.46 seconds, while SHA-256 finishes in 0.58 seconds. So they kept PoW as a light SHA-256 and turned it into a "timing gate": the server checks minAgeMs, which is 1.5 seconds for a normal client and up to 15 seconds for repeated suspicious requests from the same subnet (/24 IPv4, /56 IPv6). Hardware cannot speed up the server's clock, capping an attacker at roughly four tokens per minute.

Most of the detection comes from open-source scoring across 40+ behavioral signals in 12 categories. Early versions had a funny bug when averaging scores: a browser with navigator.webdriver = true got 0.95 and was banned, while the same browser plus five weak signals "diluted" the average down to 0.686 and slipped through. Switching to a noisy-OR formula and a 0.9 threshold for decisive signals (like webdriver or a missing PoW) closed that loophole.

The engine catches three classes of bots. Vision agents (screenshot, model API, click) get caught by straight mouse lines, "teleport clicks", and network pauses. Computer-use and CDP agents driving Chromium via Chrome DevTools Protocol (like Playwright and Puppeteer) send isTrusted: true clicks, but give themselves away through clustered pointer events, "thinking" pauses, programmatic typing without key presses, and mistakes like Ctrl+V from a spoofed macOS user agent. Honest AI crawlers (ClaudeBot, GPTBot) are verified cryptographically by the Go and Node servers using Web Bot Auth (RFC 9421), and the Go server also captures JA4 fingerprints from the TLS handshake.

The team ran the engine through a CI benchmark of 14 accessibility profiles (screen readers, keyboard-only navigation, tremors, DevTools) and fixed seven false-positive bugs. Aggressive experimental rules are turned off by default.

Official FCaptcha banner — an open-source CAPTCHA with bot and AI-agent detection (Source: github.com/WebDecoy/FCaptcha)

To migrate from the cloud, FCaptcha provides drop-in siteverify endpoints compatible with Turnstile, reCAPTCHA, and hCaptcha. Everything runs in a Go Docker container (Python/FastAPI and Node.js builds are also available):

# Run the Go FCaptcha server with a trusted proxy subnet
export FCAPTCHA_SECRET="$(openssl rand -hex 32)"
docker run -d --name fcaptcha \
  -p 127.0.0.1:3000:3000 \
  -e FCAPTCHA_SECRET \
  -e TRUSTED_PROXIES="10.0.0.0/8" \
  ghcr.io/webdecoy/fcaptcha:1.51.4

A common mistake at startup is forgetting TRUSTED_PROXIES. By default, the container only trusts localhost, so behind nginx it will silently ignore X-Forwarded-For and log every user under the load balancer's IP. For multi-replica setups, you'll need REDIS_URL (fail-closed mode) and a separate FCAPTCHA_VERIFY_SECRET key.

You drop a lightweight widget script into your /signup form:

<!-- FCaptcha widget in the same /signup form -->
<form method="post" action="/signup">
  <input type="email" name="email" required />
  <div
    data-fcaptcha="signup-form"
    data-endpoint="https://captcha.example.com"
  ></div>
  <button type="submit">Sign up</button>
</form>
<script src="https://captcha.example.com/fcaptcha.js"></script>

On the backend, if you're moving off Turnstile, you just swap the domain in the verification URL while keeping the request format identical:

# Backend sends the standard Turnstile request to your own domain
curl -X POST https://captcha.example.com/turnstile/v0/siteverify \
  -d "secret=$FCAPTCHA_VERIFY_SECRET" \
  -d "response=$TOKEN" \
  -d "remoteip=203.0.113.5"

In the response, check success, hostname, and action so a token from one page can't be reused on another. On the downside, the project is young (about a year old), the authors openly note that much of the code was written with generative AI, and the Python server doesn't do cryptographic RFC 9421 verification yet.

Which one should you pick: comparison and decision guide

Comparing bundle weight, infrastructure, and protection level against cloud widgets makes the trade-offs clear:

ParameterALTCHA v3FCaptchaTurnstile / reCAPTCHA
MechanismPoW (PBKDF2, Argon2id, Scrypt)40+ signals + SHA-256 timing gateCloud scoring + puzzles
Bundle size34 kB GZIP (52 kB with locales)~19 kB Brotli (~74 kB min)85+ kB / 300+ kB
InfrastructureBackend librarySeparate service + RedisExternal cloud
Cookies & privacyNo cookies, self-hostedNo cookies, self-hostedExternal telemetry
AI-agent detectionNoYes + Web Bot Auth (RFC 9421)Closed heuristics
Migrating from TurnstileCustom API & Web ComponentSwap siteverify URL—

Your choice comes down to your threat model and whether you want to maintain a separate service. ALTCHA v3 plugs straight into your existing backend with no containers, Redis, or proxy headaches. FCaptcha requires operational care, but it stops Playwright and AI-agent attacks and lets you leave cloud siteverify by changing a single URL.

Quick rule of thumb for choosing
  • Pick ALTCHA v3 for contact forms, newsletters, and comments when you want a simple spam filter without a separate container or Redis.
  • Pick FCaptcha for login, signup, and checkout flows targeted by Playwright/CDP or AI agents, or when you want a fast migration off Turnstile or reCAPTCHA.
  • Test the form from a mobile browser and behind your reverse proxy before rolling out: don't over-tune Argon2id in ALTCHA, and make sure you set TRUSTED_PROXIES in FCaptcha.
Want a deep diveVotes help us choose what to break down in detail. This material has 0 votes.
Sources · 7