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.
{ "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:
$ OPRF_NODE_INDEX=2 OPRF_SHARE_PATH=keys/oprf-2.json CLUSTER=mainnet HELIUS_RPC_URL=<rpc url> npm run start:oprf| Variable | What it sets |
|---|---|
OPRF_NODE_INDEX | Your node's index, 1 to 3. Must match the share file. |
OPRF_SHARE_PATH | The share file. Defaults to keys/localnet/oprf-<index>.json. OPRF_SHARE_JSON can carry the file's contents instead. |
CLUSTER | localnet or mainnet. |
SOLANA_RPC_URL | The RPC on the localnet. |
HELIUS_RPC_URL | The RPC on mainnet. Required there. |
CLUSTER_RECORD_PATH | The cluster record. Defaults to localnet.json. CLUSTER_RECORD_JSON can carry its contents instead. |
HOST, PORT | Where it listens. The port defaults to 27311 plus the index. |
CORS_ORIGINS | The browser origins allowed to call it, comma-separated. |
What it serves
| Endpoint | Answer |
|---|---|
GET /health | status: ready |
GET /v1/info | The node's index, its public key share, the threshold and its status |
POST /v1/evaluate | The 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
Rate
Each client gets 12 evaluations a minute; past that the node answers
RATE_LIMITEDwith the seconds to wait.Request
The request names this node, its timestamp is within a minute of the node's clock (
STALE_TIMESTAMPotherwise), and the credential's valid-until time hasn't passed.Statement
The seven public signals of the
authorizeproof match the blinded query, the issuer key, the holder key and the valid-until time in the request (PROOF_INVALIDotherwise).Holder signature
The holder key signed this node's index, the blinded query and the timestamp (
SIGNATURE_INVALIDotherwise).Registry
The issuer key is active in the issuer registry (
ISSUER_UNKNOWNotherwise), the OPRF registry's point at this index equals the node's own share, and the registry's four points are consistent (PROGRAM_UNAVAILABLEotherwise).Proof
The
authorizeproof 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.