Guides

Run an OPRF node

Hold one share of the OPRF key and answer enrollments with a DLEQ proof.

An OPRF node holds one of the 3 shares of the OPRF key and answers enrollment requests with its partial evaluation and a DLEQ proof. A person needs answers from 2 of 3 nodes to enroll; claims never reach the nodes. The threshold OPRF explains what the node computes.

What you need

  • Your share: a JSON file holding your node's index and its secret scalar, as a decimal string.
json
{ "index": 2, "scalar": "<your share, decimal>" }
  • The registry admin to have written your share's public point into the OPRF registry with set_oprf, at your index. The node refuses to answer while the registry holds a different point for its index.
  • An RPC endpoint for the cluster, so the node can read the issuer registry and the OPRF registry.
  • The cluster record, a JSON file naming the program ID and the cluster's genesis hash. The node checks the genesis hash against the RPC before it starts.

Run it

The node ships with Once's backend as the oprf role:

bash
$ OPRF_NODE_INDEX=2 OPRF_SHARE_PATH=keys/oprf-2.json CLUSTER=mainnet HELIUS_RPC_URL=<rpc url> npm run start:oprf
VariableWhat it sets
OPRF_NODE_INDEXYour node's index, 1 to 3. Must match the share file.
OPRF_SHARE_PATHThe share file. Defaults to keys/localnet/oprf-<index>.json. OPRF_SHARE_JSON can carry the file's contents instead.
CLUSTERlocalnet or mainnet.
SOLANA_RPC_URLThe RPC on the localnet.
HELIUS_RPC_URLThe RPC on mainnet. Required there.
CLUSTER_RECORD_PATHThe cluster record. Defaults to localnet.json. CLUSTER_RECORD_JSON can carry its contents instead.
HOST, PORTWhere it listens. The port defaults to 27311 plus the index.
CORS_ORIGINSThe browser origins allowed to call it, comma-separated.

What it serves

EndpointAnswer
GET /healthstatus: ready
GET /v1/infoThe node's index, its public key share, the threshold and its status
POST /v1/evaluateThe partial evaluation of one blinded query, with its DLEQ proof

The API lists each node's evaluation URL in GET /v1/config, and on mainnet forwards POST /v1/oprf/{nodeId}/evaluate to the node, so browsers reach every node through one origin.

What it checks before answering

  1. Rate

    Each client gets 12 evaluations a minute; past that the node answers RATE_LIMITED with the seconds to wait.

  2. Request

    The request names this node, its timestamp is within a minute of the node's clock (STALE_TIMESTAMP otherwise), and the credential's valid-until time hasn't passed.

  3. Statement

    The seven public signals of the authorize proof match the blinded query, the issuer key, the holder key and the valid-until time in the request (PROOF_INVALID otherwise).

  4. Holder signature

    The holder key signed this node's index, the blinded query and the timestamp (SIGNATURE_INVALID otherwise).

  5. Registry

    The issuer key is active in the issuer registry (ISSUER_UNKNOWN otherwise), the OPRF registry's point at this index equals the node's own share, and the registry's four points are consistent (PROGRAM_UNAVAILABLE otherwise).

  6. Proof

    The authorize proof verifies against its verification key.

Only then does the node multiply the blinded point by its share and return it with the proof. It keeps no record of what it answered. It sees the blinded point, the public keys, the valid-until time and the request time, never HashID or s.

Keeping the share

Two shares together can evaluate the OPRF without blinding, so no machine and no person should hold two of them. The admin can refresh the shares under the same combined key with set_oprf, which raises the registry version; enrollments made against the old version are refused with StaleOprfKey, and each node loads its new share.