Shielded Vote

PIR Server Setup

nf-server

Fresh PIR Setup

Use Automatic for the supported one-command install. Switch to Manual when you need to download, verify, configure, and start nf-server yourself without running start_pir.sh.

  1. Provision A Dedicated PIR Host

    Minimum production requirement: run PIR on its own machine with at least this capacity.

    Platform
    Linux amd64
    CPU
    4 vCPU + AVX-512
    Memory
    32 GB RAM
    Storage
    65 GB free SSD

    More CPU and storage are recommended when available to keep query serving and future snapshot growth comfortable.

    The production linux-amd64 binary requires AVX-512. If the host does not expose AVX-512, the service will crash before binding port 3000, usually with status=4/ILL in systemd logs.

  2. Run The PIR Installer

    Run this on the PIR host. It installs the verified nf-server release, writes the systemd service, starts nullifier-query-server, and bootstraps the active PIR snapshot from Valar-hosted object storage.

    curl -fsSL https://vote.fra1.digitaloceanspaces.com/start_pir.sh | sudo bash

    The installer targets Linux hosts with systemd and must run as root because it writes under /opt and /etc.

  3. Expose HTTPS To The Local Service

    nf-server serves plaintext HTTP on local port 3000. Set up your own Caddy, nginx, or load balancer so the public URL uses HTTPS and proxies to 127.0.0.1:3000. Do not expose the raw port directly to clients.

    pir.example.org {
        reverse_proxy 127.0.0.1:3000
    
        @debug path /tier1/row/* /tier2/row/*
        handle @debug {
            respond 403
        }
    }

    Replace pir.example.org with your hostname. The public endpoint should look like https://pir.example.org.

  4. Publish The PIR Endpoint

    Add the public HTTPS URL to pir_endpoints[] in dynamic-voting-config.json. Add one JSON object with url and label, then open a PR from GitHub's edit flow. Edit voting config.

    {
      "url": "https://pir.example.org",
      "label": "Example PIR"
    }

Rebootstrap PIR Data

Bootstrapped PIR tier data is disposable. If the local PIR data is corrupt or stuck on the wrong height, clear it and restart the service so it downloads the current snapshot again.

sudo systemctl stop nullifier-query-server
sudo rm -rf /opt/nf-ingest/pir-data/*
sudo systemctl start nullifier-query-server

This is for bootstrapped serve-only hosts. If you intentionally run synced mode, back up nullifier artifacts before wiping the data directory.

Node Operations

Follow service logs

sudo journalctl -u nullifier-query-server -f

View local readiness

curl -fsS http://127.0.0.1:3000/ready
curl -fsS http://127.0.0.1:3000/health | jq -r '.status'
curl -fsS http://127.0.0.1:3000/root | jq '{height, pir_depth, num_ranges}'

Restart service

sudo systemctl restart nullifier-query-server

Run host check

nf-server doctor --pir-data-dir /opt/nf-ingest/pir-data
Destructive PIR Teardown Permanently removes local PIR data, configuration, and services.

Destructive PIR Teardown

This permanently removes the local PIR service, configuration, and PIR data under /opt/nf-ingest. Bootstrapped serve-only hosts can rebuild from published snapshots, but synced-mode or local-only nullifier artifacts should be backed up first.

Use this when a test host should stop serving PIR. Remove the public endpoint from pir_endpoints[] before clients continue routing requests to a deleted server.

  1. Run The Teardown Script

    Run this on the PIR host. The script requires typing REMOVE PIR before it deletes local state.

    curl -fsSL https://vote.fra1.digitaloceanspaces.com/remove-pir.sh | sudo bash
    • Stops and removes nullifier-query-server.
    • Deletes /opt/nf-ingest, /etc/default/nf-server, and the nf-server symlink when owned by this setup.
    • Backs up and removes generated Caddy config only when it clearly belongs to this PIR server.
  2. Remove Published References

    Remove this host's public HTTPS URL from pir_endpoints[]. Otherwise clients may keep routing PIR requests to a server that no longer exists. Edit voting config.

References