Skip to main content

Paymaster Credential Matrix

Which credential applies to which paymaster call, how to obtain it, and how to rotate it. Read this before putting any key or URL into a browser, a Privy Dashboard field or a backend.

The ERC-7677 URL always embeds a token (https://paymaster.pepeunchained.com/v2/paymaster/<token>); there is no tokenless default. A project server key (ppk_) is a secret and stays server-side. A client token (ppt_) works only from the project's allowed origins and is refused with project_origin_not_allowed when none are set. The free tier needs a verified Privy access token from PEPU's own Privy app (context.privyAccessToken, REST Authorization: Bearer); a third-party app's own Privy token is ignored for billing. v1 credentials no longer apply because the v1 paymaster is retired.

Credential types​

CredentialFormatWho holds itBrowser-safe
Privy access tokenJWT from PrivyThe signed-in userYes
v1 app keyRaw key; the service stores only sha256(key) in config/apps.jsonThe operator and the appThe URL embedding it is a secret
Server keyppk_..., secretA project's backendNo
Client tokenppt_..., publishableA project's frontend or Privy DashboardYes, spends only from allowed origins
SIWE sessionOpaque bearer, 1 hourA project owner's browserYes
Admin tokenADMIN_TOKEN (v1), SPONSORSHIP_ADMIN_TOKEN (v2, 32 or more characters)PEPU operatorsNo
Privy app secretFrom the Privy dashboardThe developerNo, one call only

credentialKind(credential) from @pepu-chain/sdk/paymaster tells "client" from "server" by prefix and never inspects more.

Matrix by call path​

Callv1v2
GET /healthnonenone
GET /v2/config, /v2/contract, /v2/free-tiern/anone
POST /sponsorPrivy token (Authorization: Bearer) and app key (X-Api-Key)n/a
POST /v2/sponsorn/aX-Api-Key server key (any wallet) or client token (allowed Origin); Privy token required for the free tier
pm_getPaymasterStubDatanone: the URL credential is not resolved (spec-compliant)none: URL token only picks the sponsor id for the stub
pm_getPaymasterDataapp key in the URLppt_ or ppk_ in the URL; context.privyAccessToken for the free tier
/v2/auth/nonce, /v2/auth/loginn/anone (login is a SIWE signature)
/v2/me, /v2/auth/logoutn/aSIWE session
POST /v2/projects/verifyn/aSIWE session for ownerAddress plus the Privy app secret in the body
POST /v2/projects/preparen/aSIWE session
POST/GET /v2/projects..., rotation, settings, usage, events, allowlistn/aSIWE session whose address is the current on-chain owner
POST /admin/circuit-breaker/resetX-Admin-Tokenn/a
/v2/admin/*n/aX-Admin-Token; 404 if unset, and not exposed on the hosted host (404)

What each unlocks on the sponsorship path:

CredentialSponsorsFree tierOrigin checkOn a leak
Server key ppk_Any wallet, from the project's budgetNo (needs a Privy token)NoneRotate at once; bounded by the project's on-chain limits
Client token ppt_Any wallet, only from allowedOriginsWith a Privy tokenYes; none configured means it cannot spend the projectRotate; spend limited to the project's allowlist and daily limits
v1 app keyRegistered app's budgetn/aOptional PAYMASTER_RPC_ALLOWED_ORIGINS (speed bump)Operator rotates; anyone with the URL can request sponsorship under the app's caps

How to obtain each​

CredentialHow
Privy access tokenFrom the signed-in Privy session, for example getAccessToken() in the Privy client
v1 app keyAn operator generates a raw key, runs npm run hash-api-key -- <key> in the policy service and stores the hash in config/apps.json. There is no self-serve path in v1
SIWE sessionapi.v2.loginWithWallet(sign, { address, domain }), or nonce then login by hand
AttestationrequestClaimAttestation from @pepu-chain/sdk/paymaster/server (server or CLI only)
Server key and client tokenPOST /v2/projects on a claimed project (api.v2.projects.register), shown once
Admin tokenSet in the service environment by the operator

Rotation​

CredentialRotate withEffect
Client tokenPOST /v2/projects/{id}/token/rotate (rotateClientToken)Old token stops immediately. Update the URL in the Privy Dashboard and any frontend
Server keyPOST /v2/projects/{id}/server-key/rotate (rotateServerKey)Old key stops immediately
Both, on ownership changeAutomatic revocation when the on-chain owner changes (denial project_owner_changed)The new owner rotates to get fresh ones
Lost tokenPOST /v2/admin/projects/{key}/token/rotate (admin)Recovery
SuspendPOST /v2/admin/projects/{key}/statusKill switch; does not touch funds
v1 app keyOperator replaces the hash in apps.json and restartsOld URL dies
Privy app secretRotate in the Privy dashboard after verifyingThe service never stored it

Rules​

  • A ppk_ key never goes into a browser, a NEXT_PUBLIC_ variable or a Privy Dashboard field. buildErc7677Url throws CONFIG_SERVER_ONLY for a server key in a browser.
  • Origin binding is a browser guard: non-browser clients can forge Origin. The contract's limits are the real backstop.
  • Never log or commit any of these. Only sha256(rawKey) goes in apps.json.

Common failures​

SymptomCauseFix
unknown_or_invalid_app_credentialRotated, mistyped or wrong environmentRe-copy the credential, check which service it belongs to
project_origin_not_allowedClient token used from an unlisted originAdd the origin with PATCH /v2/projects/{id}/settings
free_tier_identity_requiredNo Privy token with a free-tier requestPass Authorization: Bearer or context.privyAccessToken
403 on an owner routeSession address is not the on-chain ownerSign in with the owner wallet
Pasted URL stopped workingThe token was rotated, or a tunnel URL changedRe-issue and update the Dashboard