# Charter: user-chosen trust for Windows software *Working title. Status: outline, November 2026.* ## Goal Make it possible to install software on Windows because **people you chose to trust reproduced it from source**, rather than because a publisher rented a code-signing certificate or built up SmartScreen reputation. In short: Nix's trust model, available to Windows users. A file should be trusted when: 1. **It's reproducible.** Its hash follows from its source and build recipe, and anyone can rebuild it and get the same bytes. 2. **Independent rebuilders agree.** At least *k* of the *n* rebuilders the user picked (the developer, a distro, a company, people they know) signed that hash. 3. **The user holds the trust roots.** The user chooses whose signatures count, like Nix's `trusted-public-keys`. Microsoft's root program is one option among many, not the gatekeeper. 4. **It's current.** A genuinely signed but old, vulnerable release can't be passed off as the latest (rollback and freeze attacks). 5. **It's public.** Every attestation is in an append-only log, so nobody can quietly sign two different hashes for two audiences. ## Why Windows trust today is one root program (Microsoft's), reputation you pay for (Authenticode certificates and SmartScreen), opaque builds, and antivirus heuristics in place of proof. A concrete case: quine-global/hyper#176, where Bkav's machine-learning heuristic (`W32.AIDetectMalware`) flags Hyper's unsigned Windows installers on VirusTotal. Nothing a user can do on their own machine changes that verdict: no local trust store and no package manager's hash pinning reaches the antivirus engines or SmartScreen. ## Non-goals - Replacing Authenticode or SmartScreen, or changing how Windows itself decides trust. The client works alongside them. - Renting trust: no paid or CA-issued code-signing certificate, free or not (SignPath Foundation included). Hyper's answer to #176 is this charter's, not a certificate. - Writing a new Nix. Native Nix on Windows is upstream Nix's job (see [Prior art](#prior-art)); we contribute there rather than fork it. - Changing GnuPG. It answers "did this key sign these bytes?" and does that well. Freshness and transparency belong one layer up. ## Prior art | What | Status | What we take from it | |---|---|---| | [Bitcoin Core's Guix builds](https://github.com/bitcoin/bitcoin/blob/master/contrib/guix/README.md) and [guix.sigs](https://github.com/bitcoin-core/guix.sigs) | In production | Reproducible Windows releases cross-built from Linux; many independent builders sign their hashes (`guix-attest`, `guix-verify`); Authenticode signatures attached reproducibly | | nixpkgs `pkgsCross.mingwW64` | In production | Cross-compiling Windows binaries reproducibly from Linux | | [libnix](https://nlnet.nl/project/libnix/) (NLnet, NGI Zero Core) and upstream Nix's Windows port | In progress | Native Nix on Windows; [Nix 2.34.0](https://discourse.nixos.org/t/nix-2-34-0-released/75818.md) notes continued work | | [nova-nix](https://hackage.haskell.org/package/nova-nix) | Experimental | A separate Windows-native Nix; `C:\nix\store`, needs Developer Mode for symlinks | | [TUF](https://theupdateframework.io/) | Mature (python-tuf, go-tuf, AWS `tough`) | Freshness, rollback and freeze protection, k-of-n role keys, key rotation | | [in-toto](https://in-toto.io/) | Mature | Layouts (who may perform which build step, with thresholds) and attestations; Debian's `apt-transport-in-toto` experiment with rebuilders | | [Sigstore](https://www.sigstore.dev/) (cosign, Rekor) and [Sigsum](https://www.sigsum.org/) | Mature / young | Transparency logs; Sigsum has independent witnesses that cosign its log | | Debian's reproducible builds and rebuilderd | In production | Independent rebuilders as infrastructure | The gap: nobody has a **Windows client** that checks k-of-n rebuilder attestations against roots the user chose, with freshness and a transparency log, for any project. ## Architecture Three pieces, which can progress independently: 1. **Reproducible Windows builds:** Nix or Guix cross-compiling from Linux. The build machine needn't run Windows. 2. **Attestations and distribution:** rebuilders publish in-toto attestations ("from commit C I built H"). TUF metadata distributes the project's layout, the rebuilder keys and the latest release, and makes them fresh. Every attestation also goes into a transparency log. 3. **The Windows client:** given a file, it checks the attestations against the user's trust store and threshold, the TUF freshness metadata and log inclusion, then reports or installs. It's a single .exe with no GnuPG or Python. ## Milestones ### M0: Prototype client against Bitcoin Core (done) `bitcoin-verify`, in [quine-global/bitcoin, branch `windows-trust-verifier`](https://github.com/quine-global/bitcoin/tree/windows-trust-verifier/contrib/verify-binaries-rs). Rust, one 3 MB .exe. It pins builder fingerprints in its own trust store and checks a release file against each builder's signed `all.SHA256SUMS` in guix.sigs with a threshold. It was tested on a real Windows machine against the 32.1 installer (genuine: pass; one byte changed: fail) and has 9 offline tests on real attestations. What we learned: on its own, this does nothing GnuPG plus Bitcoin Core's `verify.py` can't. Its value is packaging (no Python, GnuPG or wget on Windows). It counts toward the goal only once it gains what GnuPG lacks: M2 and M3. ### M1: Make the client project-agnostic (done) [quine-global/quorum](https://github.com/quine-global/quorum). It has a trust store per project (feed, source, threshold, pinned rebuilders) and two feeds: `guix-sigs` (OpenPGP, with a `bitcoin-core` preset) and `in-toto` (DSSE envelopes holding in-toto Statements, with Ed25519 or ECDSA P-256 keys). `quorum keygen` and `quorum attest` cover the rebuilder's side. On Windows (runner-windows), the same `quorum.exe` checked the real Bitcoin Core 32.1 installer against live guix.sigs, and a release of a second project through an in-toto feed. The second project was a stand-in made for the test; a real one is M4. There are 17 tests, and ECDSA P-256 signatures made independently with LibreSSL verify. Interop with attestations made by cosign itself is still untested. ### M2: Freshness and rollback protection (done) In quorum. A project's TUF repository signs one target, `release.json`, which says which release is the latest. Users pin its first root by SHA-256. `quorum check` follows the specification's client workflow (section 5): it walks the root chain (rotation), checks role thresholds, lengths and hashes, and fails with `OUTDATED` (unless `--allow-old`), `FROZEN` (expired metadata) or `ROLLBACK`. `quorum tuf init | release | refresh | rotate-root` publish it. It's a minimal client of our own. awslabs' `tough` is async and needs aws-lc-sys, a C library that breaks the Windows cross-build. Tested in 7 end-to-end cases, among them a correctly signed old release (`OUTDATED`) and the whole repository replayed as it was (`ROLLBACK`). Not yet tested against repositories made by python-tuf or tuf-on-ci, nor run on Windows. ### M3: Transparency (done) Off the shelf, with quorum as the client. The log is a self-hostable, static C2SP tlog-tiles log of attestations, not a public service: [Tessera](https://github.com/transparency-dev/tessera)'s `posix-oneshot` writes it, and [litewitness](https://github.com/FiloSottile/torchwood) witnesses cosign it over C2SP tlog-witness before a checkpoint is published. This is Sigsum's witness model with its ecosystem's own tools, without publishing anything to a public log. quorum reads it with Cloudflare's `signed_note` and `tlog_tiles` crates: it counts an attestation only if it's logged, requires k of the pinned witnesses, and refuses a log whose history changed since it last looked (`FORK`, by a consistency proof). `quorum log monitor` reports a rebuilder signing two hashes for one file (`EQUIVOCATION`) and rebuilders disagreeing (`DISAGREEMENT`). Tested in 7 end-to-end cases against the real Tessera and two real litewitnesses (pinned in quorum's flake), among them equivocation found by the monitor and a rewritten history: refused by the witnesses, and caught by the client even when colluding witnesses cosigned it. Waiting (not asking) for Cloudflare's next release of its crates: their main branch has `tlog_cosignature`, which would replace quorum's last log code, and no longer pulls in `url`, which costs quorum 30 crates (Unicode data) in 0.2.0. quorum moves to it once it's on crates.io. Open: inclusion proofs instead of reading every leaf hash; submitting to public Sigsum or Rekor logs, which would publish data and so needs a decision. ### M4: A second reproducible project for Windows (done for x64) - **Done: quorum itself.** `nix build github:quine-global/quorum/#windows`. It uses the official Rust toolchain and the Windows target's std (fenix), linked by zig, rather than `pkgsCross.mingwW64`, which would build a mingw GCC and a Windows rustc from source. At commit `21161095`, pulp (twice, `nix build --rebuild`) and runner-x86-linux got the same derivation and the same `quorum.exe`: `ed426feea1487d925651a120b28cbc1e7ad51cd74661f29bdc3813c88c3a3574`. That file passes a Bitcoin Core check on runner-windows. This also settles the client's own bootstrapping: the verifier can be rebuilt and compared. Lessons: zig ships no `synchronization` import library (we generate one for `api-ms-win-core-synch-l1-2-0.dll`), and nixpkgs' cargo-zigbuild needs a `dlltool` wrapper. Rebuilders should build from the published commit, not from copied files: macOS metadata files once changed the source hash (not the output). - **Hyper: done for x64, app and installer.** On branch `reproducible-windows` of quine-global/hyper, `nix build .#win-unpacked` (x64) gave the same derivation and the same 319 files on runner-x86-linux and pulp, and a `--rebuild` found no difference. That Hyper.exe ran on runner-windows and opened a shell through ConPTY. The native modules (node-pty's ConPTY parts, native-process-working-directory, native-reg) are compiled with zig, not MSVC: N-API is a C interface, linked against an import library naming Hyper.exe. Electron, its headers and electron- builder's NSIS plugins are pinned inputs, not rebuilt. ConPTY only and no custom V8 snapshot, by decision. `nix build .#installer` makes the NSIS installer offline (NSIS from source, no Wine): runner-x86-linux and pulp built the same `Hyper-4.0.0-q-canary.25.exe` (`dcd686f6…`), and a `--rebuild` matched. It installs, runs and uninstalls cleanly on runner-windows. What it took in electron-builder (patched in the flake, to propose upstream): read the uninstaller out instead of running Wine; build the NSIS header in a fixed order; a fixed temporary folder name. And NSIS's SetDateSave off. - Since then: one installer for x64 and arm64, as releases are (`nix build .#windows`; arm64 untested on an arm64 machine), built in Hyper's CI on every push ("Windows (reproducible)", which logs its hashes; its first runs matched pulp and the runner over SSH). From the next tag, releases carry it as `Hyper--reproducible.exe` with its `.SHA256SUMS`, beside the Windows runner's installer, which stays the download and the update (the update site skips `*-reproducible*`). - Open: winpty and the V8 snapshot, if wanted; independent rebuilders (M5). - Done when: two independent machines produce the same Windows hash. Done for quorum and for Hyper (x64). ### M5: Independent rebuilders - At least two parties not under one control rebuild each release and publish attestations (in-toto, logged per M3). - Document how to run a rebuilder: hardware, keys, the expected work. - Done when: a release passes a 2-of-2 threshold with no shared keys or machines. - **Done: the kit.** One command, `nix run github:quine-global/quorum#rebuild`, builds a release with Nix, builds it again (`--rebuild`: bit for bit the same, and the machine's own, not a binary cache's), signs the files' hashes with cosign (no public log) and, for the log's operator, logs it with Tessera. Guide: quorum's `docs/REBUILDER.md`. Tested end to end on a Linux runner with quorum.exe: rebuilt, signed, logged, and `quorum check` passed against that feed. - **Done: the feed**, [quine-global/attestations](https://github.com/quine-global/attestations), one folder per project (`hyper/`, `quorum/`), each with `builder-keys/`, attestations and `log/`. - Waiting: a release built by the flake (Hyper's next tag; none before `v4.0.0-q-canary.25` has it), and a second rebuilder not under our control. ### M6: Windows experience - Explorer integration ("Verify with trusted rebuilders" on right-click). - A winget- or Scoop-style front end that installs only verified files. - Setting up the trust store without a terminal. ### M7: Native Nix on Windows (contribute upstream) - Track libnix and upstream Nix's Windows port. Contribute where our work needs it (likely store layout and DLL lookup), instead of starting our own. - **Tried, 2026-11-29:** stock NixOS/nix master (`db565067`, cross-built for MinGW, straight from cache.nixos.org) on real Windows 11 (our runner, not a VM image). It builds a derivation natively: `nix build --expr` with `cmd.exe` as the builder made `C:\ProgramData\nix\store\z2cz5hvk…-hello`, the same store path as [nix-windows-demo](https://github.com/nix-windows/nix-windows-demo)'s patched fork. Unit tests: libstore 820 passed; libutil 917 passed, 1 failed (`canonPath.resolvesSymlinks`, a drive path read as `\C:`). What stock Nix can't do yet is read a `.nix` file (`BadFilename: cannot have a parent path: "C:\…\hello.nix"`), which the demo fork's unmerged path commits address. This answers the question John Ericson left on NixOS/nix#10822 (whether the demo works with stock Nix); the reply to post there is drafted, not posted. ## Open questions and risks - **The client's own trust.** quorum checks OpenPGP with GnuPG (on Windows, Gpg4win's or Git for Windows', found by itself), which took it from 218 crates to 127; the rest of its producer side is off the shelf too (cosign, Tessera, litewitness, tuftool). What's left is the checking itself: about 3,400 lines. - **Bootstrapping.** The client must itself be built reproducibly (M4) and verified once by other means; after that it verifies its own updates. - **Who rebuilds.** Rebuilders cost time and hardware. What makes M5 sustainable? - **Key management for rebuilders:** expiry, rotation, compromise. TUF covers part of it. - **Upstream appetite.** Bitcoin Core is dependency-averse and builds releases without Rust today. Showing the client is useful comes before asking them to ship it. ## Related work in flight - **quine-global/hyper#176** (Bkav flags the unsigned installers). No certificate (see [Non-goals](#non-goals)): the answer is reproducible installers with `SHA256SUMS` (M4, done), rebuilders' attestations (M5) and a public log of them (M3), which anyone, antivirus vendors included, can check. - **`verify.py` on Windows:** [quine-global/bitcoin, branch `verify-py-windows`](https://github.com/quine-global/bitcoin/tree/verify-py-windows). It drops the `wget` dependency and fixes the GnuPG status file on Windows. Not yet run to a full pass: the upstream `test.py` needs builder keys in the GnuPG keyring, and fails the same way on unpatched master. Not yet run on Windows. A small, standalone upstream contribution; no PR opened.