If your wallet is a SHHH V8.4 wallet — the default since v14.5.0 — useDocumentation Index
Fetch the complete documentation index at: https://docs.chipipay.com/llms.txt
Use this file to discover all available pages before exploring further.
X402ShhhClient. The existing X402Client only works for CHIPI v29 and Argent X wallets; it signs payments with a raw {r, s} pair that V8.4 rejects on chain.
X402ShhhClient is in @chipi-stack/backend (and re-exported from @chipi-stack/x402 for convenience). Same fetch(url, init) surface as the regular client.
Which buyer client do I need?
| Your wallet | Use |
|---|---|
| SHHH V8.4 (default for new wallets in v14.5.0+) | X402ShhhClient (this page) |
| CHIPI v29 (legacy default) | X402Client |
| READY (Argent X v0.4.0) | X402Client |
wallet.walletType off any wallet returned from getWallet / createWallet / useChipiWallet.
Install
@chipi-stack/x402 re-exports X402ShhhClient so a single import covers facilitator + client surfaces.
Construct the client
wallet— the wallet’spublicKey(deployed account address) andencryptedPrivateKey(ciphertext). SameWalletData-derived shape every other SDK call uses.encryptKey— passkey-derived key or PIN that decrypts the wallet’s STARK key client-side at sign time.chipiClient— Chipi HTTP client (the same one your server uses elsewhere).bearerToken— your chipi-back auth token. Server-side only; never crosses the wire to the x402 seller.
config:
Pay for a 402-protected request
fetch is a drop-in replacement for the global fetch. If the seller returns 200, it passes through. If they return 402 Payment Required, the client signs the payment locally and retries:
X-PAYMENT header to the retry. No paymaster call from your side — the facilitator (the seller’s side) settles by forwarding the signed calldata to chipi-back’s /transactions/execute-sponsored-raw.
What gets signed
- Build a
USDC.transfer(payTo, amount)call. - Build a SHHH V8.4
execute_from_outside_v2outside-execution wrapping that call, withcaller = ANY_CALLER(paymaster sponsorship). - Compute the V8.4 SNIP-12 hash against the wallet’s address + chain id.
- Decrypt the STARK key client-side, sign the hash, wrap into a
V2_SNIP12envelope. - Serialize the full
execute_from_outside_v2calldata intopayload.shhh.oeCalldata. - Ship that as the
X-PAYMENTheader.
Signer kind support
signerKind | Status |
|---|---|
"STARK" | Shipped — used by 100% of SHHH wallets created today |
"ED25519" | Coming — Phantom (Solana) buyers paying x402 sellers |
WEBAUTHN_P256, EIP191_SECP256K1, etc. | Not in v14.5.0 — the SHHH client throws a clear error for non-STARK kinds so silent on-chain reverts are impossible |
WEBAUTHN_P256, EIP191_SECP256K1), the right pattern is to call your wallet adapter’s signMessage directly and build the envelope via buildWebAuthnEnvelopeFromAssertion / buildEip191EnvelopeFromSignature from @chipi-stack/backend, then submit through the paymaster yourself. The drop-in fetch(url) flow is STARK-only today.
Safety: caps + allowlists
Both the originalX402Client and X402ShhhClient enforce the same two safety nets at sign time:
maxPaymentAmount— hard cap per request in human USDC (“1.00” = 1 USDC). Throws before signing if a 402 asks for more.allowedRecipients— whitelist of seller addresses. Throws before signing if a 402’spayToisn’t on the list.
Facilitator side (sellers)
You don’t need a different facilitator for SHHH buyers —X402Facilitator from PR #298 onward auto-detects payload.shhh on the inbound payment and routes through the SHHH dispatch path. See x402 server — monetizing APIs for the seller-side setup; that page works as-is for SHHH buyers.
Related
- x402 introduction — protocol overview
- x402 client (CHIPI v29 / Argent X) — the matching page for legacy wallet types
- x402 server — accept x402 payments from any buyer type
- x402 + sessions — automated payments via session keys
- Spending policies — per-token caps on session keys
