Preload list scalability, size, considerations and alternate proposal

Open
#54 1 comment 1 reaction 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale

Research direction

The issue names no files, tests, or entry points. Begin by locating the existing preload-list implementation and measuring its startup, storage, and update behavior before evaluating the proposed alternatives. Done would require a scoped, agreed design with clear validation criteria.

Written by the indexing model from the issue text.

Description

I've been thinking since the beginning of the project that the concept of a preload list is the main bottleneck, both in terms of startup time, storage requirements, and overall scalability. For example, it becomes quite impractical around 500k domains, where the list grows to roughly 30MB (assuming each entry is 64 bytes). While we're far from reaching that scale—and considering that only a limited set of web applications would benefit from this mechanism—it may ultimately prove unrealistic.

Still, there’s value in exploring alternatives, both to reduce update size and speed up startup, and also just as a fun exercise.

I’d split the problem into two sub-problems:

  1. Knowing that a domain is enrolled
  2. Retrieving the enrollment data

The current list handles both through the same mechanism (a local list lookup), but there's no fundamental reason the two phases must be coupled.

Drawing inspiration from the great CRLite paper, it should be possible to build a cascading Bloom filter (with a final inverse filter to remove false positives) that simply tells us whether a domain is enrolled, without providing any additional data. This would depend on TLS, since Certificate Transparency (CT) gives us a view of all valid TLS certificates at a given time. That lets us compute the first Bloom filter layer and, because we can enumerate all false positives, also build the inverse filter. There should be a threshold where this approach becomes more space-efficient than a plain list, and figuring that out could be valuable.

At browser startup, the extension downloads the updated filter. Every X minutes, it also fetches an updated signed tree head (STH). At runtime, the extension uses the filter to check whether a domain is enrolled. If not, everything proceeds normally, and no further data is needed. If the domain is enrolled, it becomes the responsibility of the web server to provide signer information along with a CONIKS-like verification path. The result should match the out-of-band STH fetched earlier.

This is, of course, a high-level concept—I’m skipping over many implementation details that I haven’t explored yet or don’t know—but it seems feasible in principle.

Dominant language
TypeScript
Stars
116
Forks
12
Avg merge
1d 5h
Merged PRs (30d)
10

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from freedomofpress/webcat

All issues in freedomofpress/webcat

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.