@zkproofport-app/sdk 0.2.1 → 0.2.3

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/dist/types.d.ts CHANGED
@@ -10,7 +10,7 @@
10
10
  * const circuit: CircuitType = 'coinbase_attestation';
11
11
  * ```
12
12
  */
13
- export type CircuitType = 'coinbase_attestation' | 'coinbase_country_attestation';
13
+ export type CircuitType = 'coinbase_attestation' | 'coinbase_country_attestation' | 'oidc_domain_attestation';
14
14
  /**
15
15
  * Proof request lifecycle status.
16
16
  *
@@ -72,6 +72,20 @@ export interface CoinbaseCountryInputs {
72
72
  isIncluded: boolean;
73
73
  scope: string;
74
74
  }
75
+ /**
76
+ * Input parameters for OIDC Domain attestation circuit.
77
+ *
78
+ * This circuit proves a user's email domain affiliation via Google Sign-In
79
+ * without revealing the full email address. The mobile app handles
80
+ * authentication and proof generation entirely on-device.
81
+ *
82
+ * @property domain - Email domain to prove (e.g., "google.com", "company.com")
83
+ * @property scope - Application-specific identifier for proof uniqueness (e.g., dapp domain)
84
+ */
85
+ export interface OidcDomainInputs {
86
+ domain: string;
87
+ scope: string;
88
+ }
75
89
  /**
76
90
  * Empty input type for circuits that retrieve all data from the mobile app.
77
91
  * Used when SDK doesn't need to provide any circuit-specific parameters.
@@ -82,7 +96,7 @@ export interface EmptyInputs {
82
96
  * Union type of all circuit-specific input types.
83
97
  * Each circuit type has a corresponding input interface.
84
98
  */
85
- export type CircuitInputs = CoinbaseKycInputs | CoinbaseCountryInputs | EmptyInputs;
99
+ export type CircuitInputs = CoinbaseKycInputs | CoinbaseCountryInputs | OidcDomainInputs | EmptyInputs;
86
100
  /**
87
101
  * Zero-knowledge proof request sent to mobile app via deep link.
88
102
  *
@@ -293,6 +307,8 @@ export interface DeepLinkComponents {
293
307
  * ```
294
308
  */
295
309
  export interface ChallengeResponse {
310
+ /** Session identifier (used as requestId) */
311
+ requestId: string;
296
312
  /** Hex-encoded 32-byte random challenge */
297
313
  challenge: string;
298
314
  /** Unix timestamp (ms) when challenge expires */
@@ -145,3 +145,22 @@ export declare function getVerifierChainId(circuit: CircuitType, customVerifier?
145
145
  * ```
146
146
  */
147
147
  export declare function extractScopeFromPublicInputs(publicInputsHex: string[], circuit?: string): string | null;
148
+ /**
149
+ * Extracts the nullifier (bytes32) from public inputs based on circuit type.
150
+ *
151
+ * The nullifier is a unique, deterministic hash derived from the user's attestation
152
+ * and scope. It serves as a privacy-preserving user identifier — the same user
153
+ * with the same scope always produces the same nullifier, enabling duplicate
154
+ * detection without revealing the wallet address.
155
+ *
156
+ * @param publicInputsHex - Array of hex-encoded field elements
157
+ * @param circuit - Circuit type (defaults to coinbase_attestation)
158
+ * @returns Nullifier as hex string (bytes32), or null if publicInputs too short
159
+ *
160
+ * @example
161
+ * ```typescript
162
+ * const nullifier = extractNullifierFromPublicInputs(publicInputs, 'coinbase_attestation');
163
+ * console.log(nullifier); // '0xabc123...'
164
+ * ```
165
+ */
166
+ export declare function extractNullifierFromPublicInputs(publicInputsHex: string[], circuit?: string): string | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zkproofport-app/sdk",
3
- "version": "0.2.1",
3
+ "version": "0.2.3",
4
4
  "description": "ZKProofport SDK for requesting zero-knowledge proofs from the ZKProofport mobile app and verifying them on-chain",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.esm.js",