# Running a rebuilderA rebuilder builds a project's release from its source, on their ownmachine, and signs the hashes of what came out. When enough rebuilders thata user trusts got the same hashes, quorum lets the user run the file. Yoursignature says one thing: *I built this release from its published source,and these are the bytes I got.* It doesn't vouch for the code being good.What makes it worth something is that you're independent: your own machine,your own key, nobody else's build. Two rebuilders run by one person or onecompany count as one.## What you need- A Linux machine (x86_64) with [Nix](https://nixos.org/download/) andflakes. Builds run in Nix's sandbox; a release of Hyper takes some 10 GBof disk and 4 GB of memory, twice its build time (below), and network tofetch sources.- A key, made once and kept to yourself:```nix run github:quine-global/quorum#cosign -- generate-key-pair --output-key-prefix ~/rebuilder/<you>````<you>.key` is the secret (encrypted with the password you give it);`<you>.pub` is what you publish. Pick a name (`<you>`) that people willknow you by: lower case, no spaces.- A clone of the feed, [quine-global/attestations](https://github.com/quine-global/attestations).## For each release```nix run github:quine-global/quorum#rebuild -- \--project hyper --release 4.0.1 \--flake github:quine-global/hyper/v4.0.1#windows \--name <you> --key ~/rebuilder/<you>.key --feed ~/attestations```It:1. builds the release from that tag with Nix;2. builds it **again** (`nix build --rebuild`) and stops unless both arebit for bit the same. This also makes sure the result is your machine'sown and not something Nix fetched from a binary cache;3. prints the files' SHA-256 and writes what you're vouching for (`quorumstatement`: the files, their hashes, the release);4. signs it with your key (cosign), into`hyper/4.0.1/<you>/attestation.sigstore.json` in the feed. cosign runswith an empty signing config, so nothing goes to Sigstore's public log.Compare the printed hashes with the project's `SHA256SUMS` before youpublish: if they differ, that's worth an issue, not an attestation.Then open a pull request to the feed with that file. The first time, addyour public key as `hyper/builder-keys/<you>.pem` (it's `<you>.pub`) and saywhere people can check its fingerprint independently (your website, asigned message, in person): users pin rebuilders by that fingerprint.```quorum trust -p hyper add <you> # what users run; it shows your fingerprint```Only `--flake` references to a tag or commit of the published repositorymake sense: a local checkout may hold changes nobody else can rebuild.## The logThe feed's maintainers log every attestation in the project's transparencylog (`hyper/log`, Tessera's format, cosigned by witnesses), so a rebuildercan't sign one hash for most people and another for a target. You don't needto do anything for that. (The maintainers run the same command with`--log-key`, and `--witness-policy` for the witnesses.)## Keys- Lost or leaked key: say so in an issue on the feed and add a new keyunder a new name (`<you>-2`). Users have to pin the new one by hand; thatis the point.- The key is encrypted with your password, and cosign asks for it when itsigns (or reads `COSIGN_PASSWORD`). The build machine holds the key whileit signs; signing on another machine isn't supported yet.