Getting started
There are two self-serve ways to see Privacy Pass in action:
- Get a real token with the demo tool: the fastest way to obtain a real, issuer-signed token, using a browser tool and a Cloudflare-provided demo issuer.
- See a local example: run the complete issuance and redemption flow on your own machine in a few minutes, using real Blind RSA cryptography.
To understand the protocol itself, refer to Privacy Pass Protocol. When you are ready to validate a real, Cloudflare-operated deployment, refer to Production Deployment Testing and contact us ↗ to begin setting up the necessary infrastructure.
The quickest way to see what an issuer-signed token looks like is with Cloudflare's Privacy Pass Demo Tool ↗. Pointed at an issuer, it runs the full issuance flow in your browser and returns a verified token.
- Our demo issuer directory URL, provided here: https://demo-pat.issuer.cloudflare.com/.well-known/private-token-issuer-directory ↗.
- Open the Privacy Pass demo tool ↗.
- In Fetch from issuer URL, paste the demo issuer directory URL and submit. The tool displays the issuer directory—a list of
token-keyswith token type2(Blind RSA)—and automatically fills in the fields for the following steps. - In Create challenge, submit the prefilled form. The tool builds a
WWW-Authenticatetoken challenge from the issuer's key. - In Send Token Request, submit the prefilled form. The tool blinds the request, sends it to the issuer, unblinds the response, and verifies the result.
A successful run shows:
Draft 16 Valid: truePrivateToken token=...Draft 16 Valid: true means the issuer returned a real token that verifies against its public key. The PrivateToken token=... value is the finalized token a client would send to an Origin in an Authorization header.
You can run the issuance and redemption flow on your machine in a few minutes, with no Cloudflare setup. It uses real Blind RSA cryptography, but everything happens in one process: the issuer key is generated locally and attestation is stubbed out. It is a quick way to see the protocol in action.
The @cloudflare/privacypass-ts ↗ library ships runnable examples. Clone the repository and install dependencies:
git clone https://github.com/cloudflare/privacypass-ts.gitcd privacypass-tsnpm ciThe publicly-verifiable example (pub_verif.example.ts ↗) only exports its functions, so add a small runner that calls just that one. Create examples/run-pub-verif.ts:
import { publicVerifiableTokensPSS } from "./pub_verif.example.js";
await publicVerifiableTokensPSS();import { publicVerifiableTokensPSS } from "./pub_verif.example.js";
await publicVerifiableTokensPSS();Compile the examples and run your runner:
npx tsc -b examplesnode ./lib/examples/run-pub-verif.jsIt prints:
Public-Verifiable tokens Suite: ... Valid token: trueValid token: true means a token was issued, unblinded, and verified successfully.
The example creates an Issuer, a Client, and an Origin in a single process (the Issuer key pair is generated up front in setup() with Issuer.generateKey), then runs them through the protocol. The code annotations in the diagram sit at the point in the flow where each step happens:
// +--------+ +--------+ +----------+ +--------+// | Origin | | Client | | Attester | | Issuer |// +---+----+ +---+----+ +----+-----+ +---+----+// | | | |// |<----- Request ------+ | |const redemptionContext = crypto.getRandomValues(new Uint8Array(32));const tokChl = origin.createTokenChallenge(issuer.name, redemptionContext); // Origin issues a token challenge// +-- TokenChallenge -->| | |// | |<== Attestation ==>| | // stubbed: no real Attester runs// | | | |const tokReq = await client.createTokenRequest(tokChl, pkIssuer); // Client blinds the request// | +--------- TokenRequest ------->|// | | | |const tokRes = await issuer.issue(tokReq); // Issuer signs the blinded request// | |<-------- TokenResponse -------+// | | | |const token = await client.finalize(tokRes); // Client unblinds to recover the token// |<-- Request+Token ---+ | |// | | | |const isValid = await origin.verify(token, issuer.publicKey); // Origin verifies against the issuer key- Production Deployment Testing — when you are ready to go beyond these self-serve demos, this is the in-depth guide to validating a real, Cloudflare-operated deployment, with your Attester, Issuer, and Origin working together.
- Privacy Pass Protocol — the four roles, the issuance and redemption flow, and the blinded signatures that produce tokens.
- Deployment Models — who operates each role and the deployment models.