@zkp2p/zkp2p-attestation 1.6.3 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -1
- package/README.md +29 -19
- package/dist/cli/verify.js +2 -1
- package/dist/cli/verify.js.map +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +72 -51
- package/dist/index.d.ts +72 -51
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 3.0.0
|
|
4
|
+
|
|
5
|
+
- BREAKING: `/identity` and its package helpers now require normalized `callerAddress` inside session-material JWEs and require the encrypted address to match the outer request. Unbound identity envelopes are rejected; buyer TEE envelopes are unchanged.
|
|
6
|
+
- Add typed Alipay buyer TEE and identity requests using `transfer_alipay`/`register_alipay` with encrypted `Cookie` session material.
|
|
7
|
+
- Add typed Monobank buyer TEE payloads using `transfer_monobank`, encrypted `X-Token` session material, and `ACCOUNT_ID`/`TRANSACTION_ID` params.
|
|
8
|
+
- Type seller-produced Monobank identity attestations as `register_monobank` while keeping Monobank excluded from the standalone identity request API.
|
|
9
|
+
|
|
10
|
+
## 2.0.0
|
|
11
|
+
|
|
12
|
+
- Hard-cut the preprod hostname to the isolated preprod enclave PCR8. Production remains pinned only at `attestation-service.zkp2p.xyz`.
|
|
13
|
+
- BREAKING: Buyer TEE Zelle verification now accepts only `platform: "zelle"` with `transfer_zelle_bofa`, `transfer_zelle_chase`, or `transfer_zelle_citi`. All three actions attest the generic Zelle payment-method hash.
|
|
14
|
+
|
|
3
15
|
## 1.6.3
|
|
4
16
|
|
|
5
17
|
- Bind the default global `fetch` fallback to `globalThis` so browser and extension callers that rely on SDK defaults do not hit receiver-sensitive `Illegal invocation` failures. Caller-provided `fetch` overrides are still used unchanged.
|
|
@@ -15,7 +27,7 @@
|
|
|
15
27
|
|
|
16
28
|
## 1.6.0
|
|
17
29
|
|
|
18
|
-
- Add generic buyer TEE Zelle typing for `platform: "zelle"` and bank-specific action types `transfer_zelle_bofa`, `transfer_zelle_chase`, and `transfer_zelle_citi
|
|
30
|
+
- Add generic buyer TEE Zelle typing for `platform: "zelle"` and bank-specific action types `transfer_zelle_bofa`, `transfer_zelle_chase`, and `transfer_zelle_citi`.
|
|
19
31
|
|
|
20
32
|
## 1.5.1
|
|
21
33
|
|
package/README.md
CHANGED
|
@@ -10,7 +10,9 @@ The package runs in Chrome MV3 service workers, browser DOM contexts, React Nati
|
|
|
10
10
|
yarn add @zkp2p/zkp2p-attestation
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
In the protocol coordination workspace, `bin/workspace refresh-packages`
|
|
14
|
+
creates an ignored local package link for declared consumers. Standalone builds
|
|
15
|
+
and deployments must install a published package version.
|
|
14
16
|
|
|
15
17
|
## Environment Init
|
|
16
18
|
|
|
@@ -31,7 +33,7 @@ Environment defaults:
|
|
|
31
33
|
| `staging` | `https://attestation-service-staging.zkp2p.xyz` | bundled staging pin |
|
|
32
34
|
| `production` | `https://attestation-service.zkp2p.xyz` | bundled production pin |
|
|
33
35
|
|
|
34
|
-
Callers can still pass `attestationServiceUrl` and `trust.expectedPcr8Hex` directly. Explicit trust pins always win. The
|
|
36
|
+
Callers can still pass `attestationServiceUrl` and `trust.expectedPcr8Hex` directly. Explicit trust pins always win. The preprod hostname is pinned to the isolated preprod enclave; it is not a production alias.
|
|
35
37
|
|
|
36
38
|
## Fast Path
|
|
37
39
|
|
|
@@ -75,7 +77,7 @@ const verifiedCredentialBundle = verifySellerCredentialBundle(credentialBundle,
|
|
|
75
77
|
});
|
|
76
78
|
```
|
|
77
79
|
|
|
78
|
-
Venmo, Cash App,
|
|
80
|
+
Venmo, Cash App, and PayPal still require a top-level `payeeId`; existing callers can keep using the same call shape:
|
|
79
81
|
|
|
80
82
|
```ts
|
|
81
83
|
const encryptedUpload = await nitro.createEncryptedSellerCredentialUpload({
|
|
@@ -84,12 +86,8 @@ const encryptedUpload = await nitro.createEncryptedSellerCredentialUpload({
|
|
|
84
86
|
});
|
|
85
87
|
```
|
|
86
88
|
|
|
87
|
-
Venmo seller uploads can use either the existing session material or Google OAuth. For Google OAuth, pass the numeric Venmo account id as `payeeId` and use `sessionMaterial: { credentialSource: "google_oauth", authorizationCode, redirectUri }`; the service validates Gmail access against venmo.com DKIM-signed incoming payment receipts. To onboard through a partner-owned Google OAuth app instead of Peer's default app, include `oauthClient: { clientId, clientSecret }` inside that encrypted `sessionMaterial`. The client secret is seller credential material: the package only places it in the compact JWE upload plaintext, it reaches the service enclave through that JWE, and the service persists it only inside the KMS-envelope-sealed seller credential bundle that the curator holds as ciphertext. It rides the same encrypted credential envelope as the Gmail refresh token and is reused only for later Gmail token refresh.
|
|
88
|
-
|
|
89
89
|
PayPal Gmail OAuth seller uploads use the same app-selection model. Pass the seller PayPal email as `payeeId` and use `sessionMaterial: { credentialSource: "google_oauth", authorizationCode, redirectUri }`; the service validates Gmail access against paypal.com DKIM-signed payment receipts. To onboard through a partner-owned Google OAuth app, include `oauthClient: { clientId, clientSecret }` inside the encrypted `sessionMaterial`. The PayPal partner client secret is handled as seller credential material: it rides only in the compact JWE upload plaintext, is sealed with the Gmail refresh token in the KMS-envelope seller credential bundle, and is reused only to refresh that seller's Gmail access token.
|
|
90
90
|
|
|
91
|
-
Zelle seller uploads use the same Gmail OAuth shape with `platform: "zelle"` and a top-level `payeeId` for the seller's Zelle recipient identifier. The service validates the OAuth mailbox by finding at least one DKIM-verified incoming Zelle receipt from a supported bank/Zelle sender, then later resolves `/seller/verify/zelle` by matching `txId` against the received receipt's transaction, confirmation, reference, or payment id. Seller Zelle attestations use the generic on-chain payment method `keccak256("zelle")`; receipt providers such as Chase, Citi, and Bank of America are metadata only.
|
|
92
|
-
|
|
93
91
|
Buyer TEE requests use the same attested upload key and compact JWE envelope. The typed helper encrypts the captured
|
|
94
92
|
session material, posts `{ encryptedSessionMaterial, params, chainId, intent }` to
|
|
95
93
|
`POST /buyer/verify/:platform/:actionType`, unwraps the service envelope, and returns a typed `AttestationOutput`.
|
|
@@ -150,25 +148,22 @@ Buyer TEE platform matrix:
|
|
|
150
148
|
| `monzo` | `transfer_monzo` | `Authorization` | `TX_ID` |
|
|
151
149
|
| `wise` | `transfer_wise` | `Cookie` or `X-Access-Token` | `PROFILE_ID`, `TRANSACTION_ID` |
|
|
152
150
|
| `revolut` | `transfer_revolut` | `Cookie`, `x-device-id` | `index` |
|
|
153
|
-
| `citi` | `transfer_zelle` | `Cookie` | `index` |
|
|
154
151
|
| `chime` | `transfer_chime` | `Cookie`, `body` | `{}` |
|
|
155
|
-
| `chase` | `transfer_zelle` | `Cookie`, `x-jpmc-channel`, `x-jpmc-csrf-token`, `Referer`, `Origin` | `index` |
|
|
156
|
-
| `bankofamerica` | `transfer_zelle` | `Cookie` | `index` |
|
|
157
152
|
| `zelle` | `transfer_zelle_bofa` | `Cookie` | `index` |
|
|
158
153
|
| `zelle` | `transfer_zelle_chase` | `Cookie`, `x-jpmc-channel`, `x-jpmc-csrf-token`, `Referer`, `Origin` | `index` |
|
|
159
154
|
| `zelle` | `transfer_zelle_citi` | `Cookie` | `index` |
|
|
160
155
|
| `paypal` | `transfer_paypal` | `Cookie` | `PAYMENT_ID` |
|
|
156
|
+
| `alipay` | `transfer_alipay` | `Cookie` | `TRADE_NO` |
|
|
161
157
|
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
legacy drain support with `hashUtf8("zelle-citi")`, `hashUtf8("zelle-chase")`, or `hashUtf8("zelle-bofa")`.
|
|
158
|
+
Zelle buyer verification uses only `platform: "zelle"` with bank-specific action types. Every Zelle action attests
|
|
159
|
+
`intent.paymentMethod = hashUtf8("zelle")`; direct bank-specific platforms are unsupported.
|
|
165
160
|
|
|
166
161
|
Per-platform session-material types require these headers using the canonical names shown above while still allowing
|
|
167
162
|
additional captured headers. Captured request bodies are session material because they can contain sensitive data and
|
|
168
163
|
are encrypted before being sent to the service.
|
|
169
164
|
|
|
170
|
-
Identity requests use the same attested upload key
|
|
171
|
-
|
|
165
|
+
Identity requests use the same attested upload key as buyer TEE, but use a caller-bound plaintext envelope. The typed
|
|
166
|
+
helper normalizes `callerAddress`, encrypts it together with captured session material, posts
|
|
172
167
|
`{ platform, actionType, callerAddress, encryptedSessionMaterial, params }` to `POST /identity`, unwraps the service response, and
|
|
173
168
|
returns an `IdentityAttestationOutput`. `verifyIdentityAttestation` checks the EIP-712 signature, trusted signer,
|
|
174
169
|
platform/action binding, expected caller address, expected payee hash, canonical identity `dataHash`, and `validUntil`,
|
|
@@ -204,6 +199,11 @@ Identity platform matrix:
|
|
|
204
199
|
| `paypal` | `register_paypal` | `Cookie` | `{}` |
|
|
205
200
|
| `wise` | `register_wise` | `Cookie`, `X-Access-Token` | `PROFILE_ID` |
|
|
206
201
|
| `cashapp` | `register_cashapp` | `sessionCookie`, `requestPayload`, optional `requestHeaders` | `{}` |
|
|
202
|
+
| `alipay` | `register_alipay` | `Cookie` | `{}` |
|
|
203
|
+
|
|
204
|
+
This matrix is intentionally limited to the caller-bound `POST /identity` request flow. A Monobank seller credential
|
|
205
|
+
upload can additionally return a typed `IdentityAttestationOutputFor<"monobank">` with `register_monobank`; consumers
|
|
206
|
+
can pass that response directly to `verifyIdentityAttestation`, but cannot request it through `POST /identity`.
|
|
207
207
|
|
|
208
208
|
For Venmo identity, pass `SENDER_ID` in public params and include a replayable `Cookie` header in encrypted session
|
|
209
209
|
material. The service verifies the authenticated account id, derives the stories URL from `SENDER_ID`, and requires
|
|
@@ -213,12 +213,16 @@ For Cash App identity, pass the replayable Cash App session cookie as `sessionMa
|
|
|
213
213
|
`MY_ACTIVITY_WEB_V2` activity request body as `sessionMaterial.requestPayload`. Include captured replayable headers in
|
|
214
214
|
`sessionMaterial.requestHeaders` when needed; the service ignores public params for this flow.
|
|
215
215
|
|
|
216
|
+
For Alipay identity, pass a replayable `Cookie` header. The service fetches the authenticated account page and signs
|
|
217
|
+
the historical transfer-recipient preimage: normalized recipient name concatenated directly with the redacted,
|
|
218
|
+
lowercased email. The full normalized email is returned as `identity.username` for Curator binding.
|
|
219
|
+
|
|
216
220
|
Buyer TEE and identity expose discriminated unions keyed by `platform` and `actionType`, including per-platform
|
|
217
221
|
`params`, so invalid pairings fail during TypeScript compilation. Seller credential upload keeps its existing
|
|
218
|
-
platform narrowing (
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
+
platform narrowing (Wise and Monobank derive payee id from the credential; Venmo, Cash App, and PayPal require
|
|
223
|
+
`payeeId`) but
|
|
224
|
+
does not add exhaustive `sessionMaterial` typing because the service owns connector-specific validation and the SDK
|
|
225
|
+
would otherwise duplicate the wire contract.
|
|
222
226
|
|
|
223
227
|
## Cache-Friendly Path
|
|
224
228
|
|
|
@@ -254,12 +258,18 @@ const encryptedSessionMaterial = await nitro.encryptIdentitySessionMaterial({
|
|
|
254
258
|
key: verified.attestedSellerUploadKey,
|
|
255
259
|
platform: "paypal",
|
|
256
260
|
actionType: "register_paypal",
|
|
261
|
+
callerAddress: "0x0000000000000000000000000000000000000002",
|
|
257
262
|
sessionMaterial: {
|
|
258
263
|
Cookie: "<captured-cookie-header>",
|
|
259
264
|
},
|
|
260
265
|
});
|
|
261
266
|
```
|
|
262
267
|
|
|
268
|
+
Identity helpers emit `{ platform, actionType, sessionMaterial: { callerAddress, sessionMaterial },
|
|
269
|
+
boundPubKeySha256 }` inside the compact JWE. The service requires the encrypted, normalized address to exactly match
|
|
270
|
+
the outer request address before any provider request or signature. Identity JWEs created without this binding are
|
|
271
|
+
rejected and must be regenerated. Buyer TEE envelopes retain their existing wire shape.
|
|
272
|
+
|
|
263
273
|
The attested SPKI is stable within one enclave process. If the enclave restarts, cached keys become stale and upload decrypt will fail; fetch a fresh attestation for a new session.
|
|
264
274
|
|
|
265
275
|
## React Native Wiring
|
package/dist/cli/verify.js
CHANGED
|
@@ -4510,9 +4510,10 @@ var DEFAULT_TIMEOUT_MS = 1e4;
|
|
|
4510
4510
|
// src/trust/pins.ts
|
|
4511
4511
|
var STAGING_PCR8 = "5636e3bd96f847cf12cfd9de7faa8cad0e6fa00962ce16ba185f8e5ea57105abb3cc9cc34f1e1e4de3444ceabcca7485";
|
|
4512
4512
|
var PRODUCTION_PCR8 = "41a4ae0b9b96752cab5addb7d22689b3070e564e29f90a54316fa33fa38ea51387a6e887ea4f5a4b0cc34f69cea3f40e";
|
|
4513
|
+
var PREPROD_PCR8 = "5453c5bfb7d040285be5ba9af142f4fbdd9685d082f244b66c62bf7b22d8d02a638fa2e02b9a6fe8877953a9429209e0";
|
|
4513
4514
|
var DEFAULT_EXPECTED_PCR8_BY_HOST = {
|
|
4514
4515
|
"attestation-service-staging.zkp2p.xyz": normalizePcr8Pin(STAGING_PCR8, "bundled staging PCR8"),
|
|
4515
|
-
"attestation-service-preprod.zkp2p.xyz": normalizePcr8Pin(
|
|
4516
|
+
"attestation-service-preprod.zkp2p.xyz": normalizePcr8Pin(PREPROD_PCR8, "bundled preprod PCR8"),
|
|
4516
4517
|
"attestation-service.zkp2p.xyz": normalizePcr8Pin(PRODUCTION_PCR8, "bundled production PCR8")
|
|
4517
4518
|
};
|
|
4518
4519
|
|