@opaquecash/psr-prover 0.1.0 → 0.2.1
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/defaultReputationArtifacts.d.ts +2 -2
- package/dist/defaultReputationArtifacts.js +4 -4
- package/dist/defaultReputationArtifacts.js.map +1 -1
- package/dist/index.d.ts +4 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/pipeline.d.ts +14 -12
- package/dist/pipeline.d.ts.map +1 -1
- package/dist/pipeline.js +15 -11
- package/dist/pipeline.js.map +1 -1
- package/dist/prove.d.ts +7 -3
- package/dist/prove.d.ts.map +1 -1
- package/dist/prove.js +13 -10
- package/dist/prove.js.map +1 -1
- package/dist/witness.d.ts +36 -22
- package/dist/witness.d.ts.map +1 -1
- package/dist/witness.js +32 -51
- package/dist/witness.js.map +1 -1
- package/package.json +14 -4
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { ArtifactPaths } from "./prove.js";
|
|
2
2
|
/**
|
|
3
|
-
* Host for reputation Groth16 assets (same `/circuits/...` paths as the Opaque frontend).
|
|
3
|
+
* Host for reputation Groth16 assets (same `/circuits/v2/...` paths as the Opaque frontend).
|
|
4
4
|
*/
|
|
5
5
|
export declare const DEFAULT_REPUTATION_ARTIFACTS_ORIGIN = "https://www.opaque.cash";
|
|
6
6
|
/**
|
|
7
|
-
* Default wasm + zkey URLs for `generateReputationProof` when `artifacts` is omitted.
|
|
7
|
+
* Default V2 wasm + zkey URLs for `generateReputationProof` when `artifacts` is omitted.
|
|
8
8
|
*/
|
|
9
9
|
export declare const DEFAULT_REPUTATION_ARTIFACT_PATHS: ArtifactPaths;
|
|
10
10
|
//# sourceMappingURL=defaultReputationArtifacts.d.ts.map
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Host for reputation Groth16 assets (same `/circuits/...` paths as the Opaque frontend).
|
|
2
|
+
* Host for reputation Groth16 assets (same `/circuits/v2/...` paths as the Opaque frontend).
|
|
3
3
|
*/
|
|
4
4
|
export const DEFAULT_REPUTATION_ARTIFACTS_ORIGIN = "https://www.opaque.cash";
|
|
5
5
|
/**
|
|
6
|
-
* Default wasm + zkey URLs for `generateReputationProof` when `artifacts` is omitted.
|
|
6
|
+
* Default V2 wasm + zkey URLs for `generateReputationProof` when `artifacts` is omitted.
|
|
7
7
|
*/
|
|
8
8
|
export const DEFAULT_REPUTATION_ARTIFACT_PATHS = {
|
|
9
|
-
wasmPath: `${DEFAULT_REPUTATION_ARTIFACTS_ORIGIN}/circuits/
|
|
10
|
-
zkeyPath: `${DEFAULT_REPUTATION_ARTIFACTS_ORIGIN}/circuits/
|
|
9
|
+
wasmPath: `${DEFAULT_REPUTATION_ARTIFACTS_ORIGIN}/circuits/v2/stealth_reputation.wasm`,
|
|
10
|
+
zkeyPath: `${DEFAULT_REPUTATION_ARTIFACTS_ORIGIN}/circuits/v2/stealth_reputation_final.zkey`,
|
|
11
11
|
};
|
|
12
12
|
//# sourceMappingURL=defaultReputationArtifacts.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaultReputationArtifacts.js","sourceRoot":"","sources":["../src/defaultReputationArtifacts.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,CAAC,MAAM,mCAAmC,GAAG,yBAAyB,CAAC;AAE7E;;GAEG;AACH,MAAM,CAAC,MAAM,iCAAiC,GAAkB;IAC9D,QAAQ,EAAE,GAAG,mCAAmC,
|
|
1
|
+
{"version":3,"file":"defaultReputationArtifacts.js","sourceRoot":"","sources":["../src/defaultReputationArtifacts.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,CAAC,MAAM,mCAAmC,GAAG,yBAAyB,CAAC;AAE7E;;GAEG;AACH,MAAM,CAAC,MAAM,iCAAiC,GAAkB;IAC9D,QAAQ,EAAE,GAAG,mCAAmC,sCAAsC;IACtF,QAAQ,EAAE,GAAG,mCAAmC,4CAA4C;CAC7F,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `@opaquecash/psr-prover` — witness construction and Groth16 proving for the
|
|
2
|
+
* `@opaquecash/psr-prover` — witness construction and Groth16 proving for the V2
|
|
3
|
+
* `stealth_reputation` circuit.
|
|
3
4
|
*
|
|
4
5
|
* Depends on `snarkjs` and `circomlibjs`; browser apps should polyfill `Buffer` (see {@link ensureBufferPolyfill}).
|
|
5
6
|
*
|
|
6
7
|
* @packageDocumentation
|
|
7
8
|
*/
|
|
8
|
-
export type { CircuitWitness } from "./witness.js";
|
|
9
|
-
export {
|
|
9
|
+
export type { CircuitWitness, BuildWitnessV2Params } from "./witness.js";
|
|
10
|
+
export { buildWitnessV2, ensureBufferPolyfill, } from "./witness.js";
|
|
10
11
|
export type { ArtifactPaths, ProofProgressCallback } from "./prove.js";
|
|
11
12
|
export { generateGroth16Proof, verifyProofLocally, } from "./prove.js";
|
|
12
13
|
export { DEFAULT_REPUTATION_ARTIFACT_PATHS, DEFAULT_REPUTATION_ARTIFACTS_ORIGIN, } from "./defaultReputationArtifacts.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,YAAY,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACzE,OAAO,EACL,cAAc,EACd,oBAAoB,GACrB,MAAM,cAAc,CAAC;AAEtB,YAAY,EAAE,aAAa,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AACvE,OAAO,EACL,oBAAoB,EACpB,kBAAkB,GACnB,MAAM,YAAY,CAAC;AAEpB,OAAO,EACL,iCAAiC,EACjC,mCAAmC,GACpC,MAAM,iCAAiC,CAAC;AAEzC,YAAY,EAAE,6BAA6B,EAAE,MAAM,eAAe,CAAC;AACnE,OAAO,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `@opaquecash/psr-prover` — witness construction and Groth16 proving for the
|
|
2
|
+
* `@opaquecash/psr-prover` — witness construction and Groth16 proving for the V2
|
|
3
|
+
* `stealth_reputation` circuit.
|
|
3
4
|
*
|
|
4
5
|
* Depends on `snarkjs` and `circomlibjs`; browser apps should polyfill `Buffer` (see {@link ensureBufferPolyfill}).
|
|
5
6
|
*
|
|
6
7
|
* @packageDocumentation
|
|
7
8
|
*/
|
|
8
|
-
export {
|
|
9
|
+
export { buildWitnessV2, ensureBufferPolyfill, } from "./witness.js";
|
|
9
10
|
export { generateGroth16Proof, verifyProofLocally, } from "./prove.js";
|
|
10
11
|
export { DEFAULT_REPUTATION_ARTIFACT_PATHS, DEFAULT_REPUTATION_ARTIFACTS_ORIGIN, } from "./defaultReputationArtifacts.js";
|
|
11
12
|
export { generateReputationProof } from "./pipeline.js";
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EACL,cAAc,EACd,oBAAoB,GACrB,MAAM,cAAc,CAAC;AAGtB,OAAO,EACL,oBAAoB,EACpB,kBAAkB,GACnB,MAAM,YAAY,CAAC;AAEpB,OAAO,EACL,iCAAiC,EACjC,mCAAmC,GACpC,MAAM,iCAAiC,CAAC;AAGzC,OAAO,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC"}
|
package/dist/pipeline.d.ts
CHANGED
|
@@ -1,32 +1,34 @@
|
|
|
1
1
|
import type { DiscoveredTrait, ProofData } from "@opaquecash/psr-core";
|
|
2
|
-
import type { StealthWasmModule } from "@opaquecash/stealth-wasm";
|
|
3
2
|
import type { ArtifactPaths, ProofProgressCallback } from "./prove.js";
|
|
4
3
|
/**
|
|
5
4
|
* High-level inputs for {@link generateReputationProof}.
|
|
6
5
|
*/
|
|
7
6
|
export interface GenerateReputationProofParams {
|
|
8
|
-
/** Initialized WASM module. */
|
|
9
|
-
wasm: StealthWasmModule;
|
|
10
7
|
/** Trait to prove (from scanner). */
|
|
11
8
|
trait: DiscoveredTrait;
|
|
12
|
-
/**
|
|
13
|
-
* When set, witness is built via Rust `generate_reputation_witness` using this JSON string.
|
|
14
|
-
* Otherwise {@link buildWitnessCircuitConsistent} is used (zero-hash tree dev mode).
|
|
15
|
-
*/
|
|
16
|
-
attestationsJson?: string;
|
|
17
9
|
/** 32-byte reconstructed one-time stealth private key for the trait output. */
|
|
18
10
|
stealthPrivKeyBytes: Uint8Array;
|
|
19
|
-
/** External nullifier as decimal string (see
|
|
11
|
+
/** External nullifier as decimal string (see `externalNullifierFromScope` in `@opaquecash/psr-core`). */
|
|
20
12
|
externalNullifier: string;
|
|
13
|
+
/** Issuer's BabyJubJub x-coordinate (field element). Omit for the deterministic dev-mode value. */
|
|
14
|
+
issuerPkX?: string | bigint;
|
|
15
|
+
/** Poseidon hash of the attestation data payload. Omit for the deterministic dev-mode value. */
|
|
16
|
+
traitDataHash?: string | bigint;
|
|
17
|
+
/** Leaf-blinding secret from issuance. Omit for the deterministic dev-mode value. */
|
|
18
|
+
nonce?: string | bigint;
|
|
21
19
|
/**
|
|
22
|
-
* Circom wasm + zkey paths/URLs.
|
|
23
|
-
* Defaults to {@link DEFAULT_REPUTATION_ARTIFACT_PATHS} (opaque.cash).
|
|
20
|
+
* Circom V2 wasm + zkey paths/URLs.
|
|
21
|
+
* Defaults to {@link DEFAULT_REPUTATION_ARTIFACT_PATHS} (opaque.cash, `/circuits/v2/...`).
|
|
24
22
|
*/
|
|
25
23
|
artifacts?: ArtifactPaths;
|
|
26
24
|
onProgress?: ProofProgressCallback;
|
|
27
25
|
}
|
|
28
26
|
/**
|
|
29
|
-
* End-to-end: build
|
|
27
|
+
* End-to-end V2 prove: build the dev-mode zero-hash-tree witness, then Groth16 prove.
|
|
28
|
+
*
|
|
29
|
+
* The returned proof's public signals are
|
|
30
|
+
* `[merkle_root, attestation_id, external_nullifier, nullifier_hash]`; submit
|
|
31
|
+
* `publicSignals[0]` as the Merkle root after registering it with the verifier admin.
|
|
30
32
|
*/
|
|
31
33
|
export declare function generateReputationProof(params: GenerateReputationProofParams): Promise<ProofData>;
|
|
32
34
|
//# sourceMappingURL=pipeline.d.ts.map
|
package/dist/pipeline.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline.d.ts","sourceRoot":"","sources":["../src/pipeline.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"pipeline.d.ts","sourceRoot":"","sources":["../src/pipeline.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEvE,OAAO,KAAK,EAAE,aAAa,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAIvE;;GAEG;AACH,MAAM,WAAW,6BAA6B;IAC5C,qCAAqC;IACrC,KAAK,EAAE,eAAe,CAAC;IACvB,+EAA+E;IAC/E,mBAAmB,EAAE,UAAU,CAAC;IAChC,yGAAyG;IACzG,iBAAiB,EAAE,MAAM,CAAC;IAC1B,mGAAmG;IACnG,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5B,gGAAgG;IAChG,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAChC,qFAAqF;IACrF,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB;;;OAGG;IACH,SAAS,CAAC,EAAE,aAAa,CAAC;IAC1B,UAAU,CAAC,EAAE,qBAAqB,CAAC;CACpC;AAED;;;;;;GAMG;AACH,wBAAsB,uBAAuB,CAC3C,MAAM,EAAE,6BAA6B,GACpC,OAAO,CAAC,SAAS,CAAC,CAgBpB"}
|
package/dist/pipeline.js
CHANGED
|
@@ -1,20 +1,24 @@
|
|
|
1
1
|
import { DEFAULT_REPUTATION_ARTIFACT_PATHS } from "./defaultReputationArtifacts.js";
|
|
2
2
|
import { generateGroth16Proof } from "./prove.js";
|
|
3
|
-
import {
|
|
3
|
+
import { buildWitnessV2 } from "./witness.js";
|
|
4
4
|
/**
|
|
5
|
-
* End-to-end: build
|
|
5
|
+
* End-to-end V2 prove: build the dev-mode zero-hash-tree witness, then Groth16 prove.
|
|
6
|
+
*
|
|
7
|
+
* The returned proof's public signals are
|
|
8
|
+
* `[merkle_root, attestation_id, external_nullifier, nullifier_hash]`; submit
|
|
9
|
+
* `publicSignals[0]` as the Merkle root after registering it with the verifier admin.
|
|
6
10
|
*/
|
|
7
11
|
export async function generateReputationProof(params) {
|
|
8
12
|
params.onProgress?.("preparing-witness", 5);
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
params.
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
const witness = await buildWitnessV2({
|
|
14
|
+
attestationId: params.trait.attestationId,
|
|
15
|
+
stealthPrivKeyBytes: params.stealthPrivKeyBytes,
|
|
16
|
+
externalNullifier: params.externalNullifier,
|
|
17
|
+
issuerPkX: params.issuerPkX,
|
|
18
|
+
traitDataHash: params.traitDataHash,
|
|
19
|
+
nonce: params.nonce,
|
|
20
|
+
});
|
|
21
|
+
params.onProgress?.("preparing-witness", 60);
|
|
18
22
|
return generateGroth16Proof(witness, params.artifacts ?? DEFAULT_REPUTATION_ARTIFACT_PATHS, params.onProgress);
|
|
19
23
|
}
|
|
20
24
|
//# sourceMappingURL=pipeline.js.map
|
package/dist/pipeline.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline.js","sourceRoot":"","sources":["../src/pipeline.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pipeline.js","sourceRoot":"","sources":["../src/pipeline.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iCAAiC,EAAE,MAAM,iCAAiC,CAAC;AAEpF,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AA0B9C;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAC3C,MAAqC;IAErC,MAAM,CAAC,UAAU,EAAE,CAAC,mBAAmB,EAAE,CAAC,CAAC,CAAC;IAC5C,MAAM,OAAO,GAAG,MAAM,cAAc,CAAC;QACnC,aAAa,EAAE,MAAM,CAAC,KAAK,CAAC,aAAa;QACzC,mBAAmB,EAAE,MAAM,CAAC,mBAAmB;QAC/C,iBAAiB,EAAE,MAAM,CAAC,iBAAiB;QAC3C,SAAS,EAAE,MAAM,CAAC,SAAS;QAC3B,aAAa,EAAE,MAAM,CAAC,aAAa;QACnC,KAAK,EAAE,MAAM,CAAC,KAAK;KACpB,CAAC,CAAC;IACH,MAAM,CAAC,UAAU,EAAE,CAAC,mBAAmB,EAAE,EAAE,CAAC,CAAC;IAC7C,OAAO,oBAAoB,CACzB,OAAO,EACP,MAAM,CAAC,SAAS,IAAI,iCAAiC,EACrD,MAAM,CAAC,UAAU,CAClB,CAAC;AACJ,CAAC"}
|
package/dist/prove.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import type { CircuitWitness } from "./witness.js";
|
|
|
4
4
|
* Paths or URLs to Circom wasm + final zkey (Groth16).
|
|
5
5
|
*/
|
|
6
6
|
export interface ArtifactPaths {
|
|
7
|
-
/** Path/URL to `
|
|
7
|
+
/** Path/URL to `stealth_reputation.wasm` (V2). */
|
|
8
8
|
wasmPath: string;
|
|
9
9
|
/** Path/URL to final `.zkey`. */
|
|
10
10
|
zkeyPath: string;
|
|
@@ -14,9 +14,13 @@ export interface ArtifactPaths {
|
|
|
14
14
|
*/
|
|
15
15
|
export type ProofProgressCallback = (stage: string, percent: number) => void;
|
|
16
16
|
/**
|
|
17
|
-
* Run `snarkjs.groth16.fullProve` on a prepared witness.
|
|
17
|
+
* Run `snarkjs.groth16.fullProve` on a prepared V2 witness.
|
|
18
18
|
*
|
|
19
|
-
*
|
|
19
|
+
* V2 public signals: `[merkle_root, attestation_id, external_nullifier, nullifier_hash]`.
|
|
20
|
+
* The returned {@link ProofData}'s `nullifier` field carries `nullifier_hash`
|
|
21
|
+
* (`publicSignals[3]`) — the value the on-chain verifiers consume.
|
|
22
|
+
*
|
|
23
|
+
* @param witness - JSON object accepted by the V2 Circom wasm.
|
|
20
24
|
* @param artifacts - Wasm + zkey locations (browser: serve static files; Node: file paths).
|
|
21
25
|
* @param onProgress - Optional UI hook.
|
|
22
26
|
*/
|
package/dist/prove.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prove.d.ts","sourceRoot":"","sources":["../src/prove.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAMnD;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,
|
|
1
|
+
{"version":3,"file":"prove.d.ts","sourceRoot":"","sources":["../src/prove.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAMnD;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,kDAAkD;IAClD,QAAQ,EAAE,MAAM,CAAC;IACjB,iCAAiC;IACjC,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;AAE7E;;;;;;;;;;GAUG;AACH,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,cAAc,EACvB,SAAS,EAAE,aAAa,EACxB,UAAU,CAAC,EAAE,qBAAqB,GACjC,OAAO,CAAC,SAAS,CAAC,CA+BpB;AAED;;;;;GAKG;AACH,wBAAsB,kBAAkB,CACtC,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,OAAO,CAAC,CAOlB"}
|
package/dist/prove.js
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { ProofError } from "@opaquecash/psr-core";
|
|
2
2
|
/**
|
|
3
|
-
* Run `snarkjs.groth16.fullProve` on a prepared witness.
|
|
3
|
+
* Run `snarkjs.groth16.fullProve` on a prepared V2 witness.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
5
|
+
* V2 public signals: `[merkle_root, attestation_id, external_nullifier, nullifier_hash]`.
|
|
6
|
+
* The returned {@link ProofData}'s `nullifier` field carries `nullifier_hash`
|
|
7
|
+
* (`publicSignals[3]`) — the value the on-chain verifiers consume.
|
|
8
|
+
*
|
|
9
|
+
* @param witness - JSON object accepted by the V2 Circom wasm.
|
|
6
10
|
* @param artifacts - Wasm + zkey locations (browser: serve static files; Node: file paths).
|
|
7
11
|
* @param onProgress - Optional UI hook.
|
|
8
12
|
*/
|
|
@@ -11,12 +15,11 @@ export async function generateGroth16Proof(witness, artifacts, onProgress) {
|
|
|
11
15
|
const snarkjs = (await import("snarkjs")).groth16;
|
|
12
16
|
const { proof, publicSignals } = await snarkjs.fullProve(witness, artifacts.wasmPath, artifacts.zkeyPath);
|
|
13
17
|
onProgress?.("generating-proof", 90);
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
const isValidSignal = String(publicSignals[1] ?? "0");
|
|
17
|
-
if (isValidSignal !== "1") {
|
|
18
|
-
throw new ProofError("Generated proof has is_valid≠1; witness does not satisfy the circuit.");
|
|
18
|
+
if (publicSignals.length !== 4) {
|
|
19
|
+
throw new ProofError(`Expected 4 V2 public signals, got ${publicSignals.length} — the configured artifacts appear to be the retired V1 circuit.`);
|
|
19
20
|
}
|
|
21
|
+
const nullifierHash = publicSignals[3];
|
|
22
|
+
const attestationIdFromProof = Number(publicSignals[1]);
|
|
20
23
|
return {
|
|
21
24
|
proof: {
|
|
22
25
|
pi_a: proof.pi_a.slice(0, 2),
|
|
@@ -24,10 +27,10 @@ export async function generateGroth16Proof(witness, artifacts, onProgress) {
|
|
|
24
27
|
pi_c: proof.pi_c.slice(0, 2),
|
|
25
28
|
},
|
|
26
29
|
publicSignals,
|
|
27
|
-
nullifier,
|
|
28
|
-
attestationId: Number.
|
|
30
|
+
nullifier: nullifierHash,
|
|
31
|
+
attestationId: Number.isSafeInteger(attestationIdFromProof)
|
|
29
32
|
? attestationIdFromProof
|
|
30
|
-
:
|
|
33
|
+
: publicSignals[1],
|
|
31
34
|
};
|
|
32
35
|
}
|
|
33
36
|
/**
|
package/dist/prove.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prove.js","sourceRoot":"","sources":["../src/prove.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAsBlD
|
|
1
|
+
{"version":3,"file":"prove.js","sourceRoot":"","sources":["../src/prove.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAsBlD;;;;;;;;;;GAUG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,OAAuB,EACvB,SAAwB,EACxB,UAAkC;IAElC,UAAU,EAAE,CAAC,kBAAkB,EAAE,EAAE,CAAC,CAAC;IACrC,MAAM,OAAO,GAAG,CAAC,MAAM,MAAM,CAAC,SAAS,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AK,CAAC,IAAI;QAC1B,IAAI,EAAE,SAAS,CAAC,KAAK,CAAC,IAAI;QAC1B,IAAI,EAAE,SAAS,CAAC,KAAK,CAAC,IAAI;KAC3B,CAAC,CAAC;AACL,CAAC"}
|
package/dist/witness.d.ts
CHANGED
|
@@ -1,39 +1,53 @@
|
|
|
1
|
-
import type { StealthWasmModule } from "@opaquecash/stealth-wasm";
|
|
2
1
|
/**
|
|
3
2
|
* Ensure `Buffer` exists for `circomlibjs` in browser bundles.
|
|
4
3
|
*/
|
|
5
4
|
export declare function ensureBufferPolyfill(): Promise<void>;
|
|
6
5
|
/**
|
|
7
|
-
* Circuit witness
|
|
6
|
+
* Circuit witness matching the **V2** `stealth_reputation` input names
|
|
7
|
+
* (decimal-string field elements; see `circuits/v2/stealth_reputation.circom`).
|
|
8
8
|
*/
|
|
9
9
|
export interface CircuitWitness {
|
|
10
|
+
stealth_pk: string;
|
|
11
|
+
schema_id: string;
|
|
12
|
+
issuer_pk_x: string;
|
|
13
|
+
trait_data_hash: string;
|
|
14
|
+
nonce: string;
|
|
15
|
+
merkle_path: string[];
|
|
16
|
+
merkle_path_indices: string[];
|
|
10
17
|
merkle_root: string;
|
|
11
18
|
attestation_id: string;
|
|
12
19
|
external_nullifier: string;
|
|
13
|
-
|
|
14
|
-
ephemeral_pubkey: [string, string];
|
|
15
|
-
announcement_attestation_id: string;
|
|
16
|
-
merkle_path_elements: string[];
|
|
17
|
-
merkle_path_indices: number[];
|
|
20
|
+
nullifier_hash: string;
|
|
18
21
|
}
|
|
19
22
|
/**
|
|
20
|
-
*
|
|
23
|
+
* Inputs for {@link buildWitnessV2}. The leaf commits to
|
|
24
|
+
* `Poseidon(stealth_pk, schema_id, issuer_pk_x, trait_data_hash, nonce)`.
|
|
21
25
|
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
* @param externalNullifier - Decimal string or hex-compatible numeric string for the circuit scalar.
|
|
26
|
+
* `issuerPkX`, `traitDataHash`, and `nonce` come from the attestation context.
|
|
27
|
+
* When omitted, deterministic dev-mode values are derived so the same
|
|
28
|
+
* (holder, schema) pair always rebuilds the same leaf — and therefore the same
|
|
29
|
+
* Merkle root, keeping a previously registered dev root valid across sessions.
|
|
27
30
|
*/
|
|
28
|
-
export
|
|
31
|
+
export interface BuildWitnessV2Params {
|
|
32
|
+
/** Numeric trait/schema id — becomes both `schema_id` and the public `attestation_id`. */
|
|
33
|
+
attestationId: number | bigint | string;
|
|
34
|
+
/** 32-byte reconstructed one-time stealth private key. */
|
|
35
|
+
stealthPrivKeyBytes: Uint8Array;
|
|
36
|
+
/** External nullifier as a decimal string (action scope). */
|
|
37
|
+
externalNullifier: string;
|
|
38
|
+
/** Issuer's BabyJubJub x-coordinate as a field element. Dev default derived from the schema id. */
|
|
39
|
+
issuerPkX?: string | bigint;
|
|
40
|
+
/** Poseidon hash of the attestation data payload. Dev default derived from the schema id. */
|
|
41
|
+
traitDataHash?: string | bigint;
|
|
42
|
+
/** Leaf-blinding secret. Dev default: `Poseidon(stealth_pk, schema_id)` (deterministic). */
|
|
43
|
+
nonce?: string | bigint;
|
|
44
|
+
}
|
|
29
45
|
/**
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
* @param stealthPrivkeyBytes - 32-byte one-time stealth private key.
|
|
36
|
-
* @param externalNullifier - Decimal string (must match {@link buildActionScope} encoding policy).
|
|
46
|
+
* Build a **dev-mode** V2 Merkle witness: the trait's leaf sits at index 0 of an
|
|
47
|
+
* otherwise-empty zero-hash tree, so the resulting `merkle_root` is exactly what
|
|
48
|
+
* the verifier admin registers for this leaf via `update_merkle_root` /
|
|
49
|
+
* `submitMerkleRoot`. Production indexers must build the real announcement tree
|
|
50
|
+
* with the identical leaf formula.
|
|
37
51
|
*/
|
|
38
|
-
export declare function
|
|
52
|
+
export declare function buildWitnessV2(params: BuildWitnessV2Params): Promise<CircuitWitness>;
|
|
39
53
|
//# sourceMappingURL=witness.d.ts.map
|
package/dist/witness.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"witness.d.ts","sourceRoot":"","sources":["../src/witness.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"witness.d.ts","sourceRoot":"","sources":["../src/witness.ts"],"names":[],"mappings":"AAUA;;GAEG;AACH,wBAAsB,oBAAoB,IAAI,OAAO,CAAC,IAAI,CAAC,CAK1D;AAED;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MAAM,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,mBAAmB,EAAE,MAAM,EAAE,CAAC;IAC9B,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;IACvB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,cAAc,EAAE,MAAM,CAAC;CACxB;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,oBAAoB;IACnC,0FAA0F;IAC1F,aAAa,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;IACxC,0DAA0D;IAC1D,mBAAmB,EAAE,UAAU,CAAC;IAChC,6DAA6D;IAC7D,iBAAiB,EAAE,MAAM,CAAC;IAC1B,mGAAmG;IACnG,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5B,6FAA6F;IAC7F,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAChC,4FAA4F;IAC5F,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACzB;AAED;;;;;;GAMG;AACH,wBAAsB,cAAc,CAClC,MAAM,EAAE,oBAAoB,GAC3B,OAAO,CAAC,cAAc,CAAC,CAmDzB"}
|
package/dist/witness.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Buffer } from "buffer";
|
|
2
|
-
import { generateReputationWitnessJson } from "@opaquecash/stealth-wasm";
|
|
3
2
|
const TREE_DEPTH = 20;
|
|
4
3
|
function bytesToBigInt(bytes) {
|
|
5
4
|
let result = 0n;
|
|
@@ -17,70 +16,52 @@ export async function ensureBufferPolyfill() {
|
|
|
17
16
|
}
|
|
18
17
|
}
|
|
19
18
|
/**
|
|
20
|
-
* Build a **
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* @param stealthPrivKeyBytes - 32-byte reconstructed one-time stealth private key.
|
|
26
|
-
* @param externalNullifier - Decimal string or hex-compatible numeric string for the circuit scalar.
|
|
19
|
+
* Build a **dev-mode** V2 Merkle witness: the trait's leaf sits at index 0 of an
|
|
20
|
+
* otherwise-empty zero-hash tree, so the resulting `merkle_root` is exactly what
|
|
21
|
+
* the verifier admin registers for this leaf via `update_merkle_root` /
|
|
22
|
+
* `submitMerkleRoot`. Production indexers must build the real announcement tree
|
|
23
|
+
* with the identical leaf formula.
|
|
27
24
|
*/
|
|
28
|
-
export async function
|
|
25
|
+
export async function buildWitnessV2(params) {
|
|
29
26
|
await ensureBufferPolyfill();
|
|
30
27
|
const circomlib = await import("circomlibjs");
|
|
31
28
|
const poseidon = await circomlib.buildPoseidon();
|
|
32
|
-
const babyjub = await circomlib.buildBabyjub();
|
|
33
29
|
const F = poseidon.F;
|
|
34
|
-
const
|
|
35
|
-
const
|
|
36
|
-
const
|
|
37
|
-
const
|
|
38
|
-
const
|
|
39
|
-
const
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
const
|
|
45
|
-
const sharedX = F.toObject(sharedSecret[0]);
|
|
46
|
-
const sharedY = F.toObject(sharedSecret[1]);
|
|
47
|
-
const addressCommitment = F.toObject(poseidon([sharedX, sharedY, stealthPubX, stealthPubY]));
|
|
48
|
-
const leaf = F.toObject(poseidon([addressCommitment, attestationId]));
|
|
49
|
-
const zeroHashes = [];
|
|
50
|
-
zeroHashes.push(F.toObject(poseidon([0n, 0n])));
|
|
30
|
+
const H = (inputs) => F.toObject(poseidon(inputs));
|
|
31
|
+
const schemaId = BigInt(params.attestationId);
|
|
32
|
+
const extNullifier = BigInt(params.externalNullifier);
|
|
33
|
+
const stealthPk = F.toObject(F.e(bytesToBigInt(params.stealthPrivKeyBytes)));
|
|
34
|
+
const issuerPkX = params.issuerPkX !== undefined ? BigInt(params.issuerPkX) : H([schemaId, 1n]);
|
|
35
|
+
const traitDataHash = params.traitDataHash !== undefined ? BigInt(params.traitDataHash) : H([schemaId, 2n]);
|
|
36
|
+
const nonce = params.nonce !== undefined ? BigInt(params.nonce) : H([stealthPk, schemaId]);
|
|
37
|
+
// leaf = Poseidon(stealth_pk, schema_id, issuer_pk_x, trait_data_hash, nonce)
|
|
38
|
+
const leaf = H([stealthPk, schemaId, issuerPkX, traitDataHash, nonce]);
|
|
39
|
+
// Zero-hash sibling chain: leaf at index 0 of an otherwise-empty tree.
|
|
40
|
+
const zeroHashes = [H([0n, 0n])];
|
|
51
41
|
for (let i = 1; i < TREE_DEPTH; i++) {
|
|
52
|
-
zeroHashes.push(
|
|
42
|
+
zeroHashes.push(H([zeroHashes[i - 1], zeroHashes[i - 1]]));
|
|
53
43
|
}
|
|
54
|
-
const
|
|
44
|
+
const merklePath = [];
|
|
55
45
|
const merklePathIndices = [];
|
|
56
46
|
let current = leaf;
|
|
57
47
|
for (let i = 0; i < TREE_DEPTH; i++) {
|
|
58
|
-
|
|
59
|
-
merklePathIndices.push(0);
|
|
60
|
-
current =
|
|
48
|
+
merklePath.push(zeroHashes[i].toString());
|
|
49
|
+
merklePathIndices.push("0");
|
|
50
|
+
current = H([current, zeroHashes[i]]);
|
|
61
51
|
}
|
|
52
|
+
const nullifierHash = H([stealthPk, extNullifier]);
|
|
62
53
|
return {
|
|
54
|
+
stealth_pk: stealthPk.toString(),
|
|
55
|
+
schema_id: schemaId.toString(),
|
|
56
|
+
issuer_pk_x: issuerPkX.toString(),
|
|
57
|
+
trait_data_hash: traitDataHash.toString(),
|
|
58
|
+
nonce: nonce.toString(),
|
|
59
|
+
merkle_path: merklePath,
|
|
60
|
+
merkle_path_indices: merklePathIndices,
|
|
63
61
|
merkle_root: current.toString(),
|
|
64
|
-
attestation_id:
|
|
62
|
+
attestation_id: schemaId.toString(),
|
|
65
63
|
external_nullifier: extNullifier.toString(),
|
|
66
|
-
|
|
67
|
-
ephemeral_pubkey: [ephemeralPubX.toString(), ephemeralPubY.toString()],
|
|
68
|
-
announcement_attestation_id: attestationId.toString(),
|
|
69
|
-
merkle_path_elements: merklePathElements,
|
|
70
|
-
merkle_path_indices: merklePathIndices,
|
|
64
|
+
nullifier_hash: nullifierHash.toString(),
|
|
71
65
|
};
|
|
72
66
|
}
|
|
73
|
-
/**
|
|
74
|
-
* Delegate witness construction to Rust WASM (`generate_reputation_witness`) for full Merkle paths.
|
|
75
|
-
*
|
|
76
|
-
* @param wasm - Initialized `@opaquecash/stealth-wasm` module.
|
|
77
|
-
* @param attestationsJson - JSON array string from the scanner.
|
|
78
|
-
* @param targetTraitId - Decimal string attestation id to prove.
|
|
79
|
-
* @param stealthPrivkeyBytes - 32-byte one-time stealth private key.
|
|
80
|
-
* @param externalNullifier - Decimal string (must match {@link buildActionScope} encoding policy).
|
|
81
|
-
*/
|
|
82
|
-
export function buildWitnessFromWasm(wasm, attestationsJson, targetTraitId, stealthPrivkeyBytes, externalNullifier) {
|
|
83
|
-
const json = generateReputationWitnessJson(wasm, attestationsJson, targetTraitId, stealthPrivkeyBytes, externalNullifier);
|
|
84
|
-
return JSON.parse(json);
|
|
85
|
-
}
|
|
86
67
|
//# sourceMappingURL=witness.js.map
|
package/dist/witness.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"witness.js","sourceRoot":"","sources":["../src/witness.ts"],"names":[],"mappings":"AAA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OAAO,GAAG,IAAI,CAAC;IACnB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,EAAE,CAAC,EAAE,EAAE,CAAC;QACpC,UAAU,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;QAC1C,iBAAiB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAC5B,OAAO,GAAG,CAAC,CAAC,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACxC,CAAC;IAED,MAAM,aAAa,GAAG,CAAC,CAAC,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC,CAAC;IAEnD,OAAO;QACL,UAAU,EAAE,SAAS,CAAC,QAAQ,EAAE;QAChC,SAAS,EAAE,QAAQ,CAAC,QAAQ,EAAE;QAC9B,WAAW,EAAE,SAAS,CAAC,QAAQ,EAAE;QACjC,eAAe,EAAE,aAAa,CAAC,QAAQ,EAAE;QACzC,KAAK,EAAE,KAAK,CAAC,QAAQ,EAAE;QACvB,WAAW,EAAE,UAAU;QACvB,mBAAmB,EAAE,iBAAiB;QACtC,WAAW,EAAE,OAAO,CAAC,QAAQ,EAAE;QAC/B,cAAc,EAAE,QAAQ,CAAC,QAAQ,EAAE;QACnC,kBAAkB,EAAE,YAAY,CAAC,QAAQ,EAAE;QAC3C,cAAc,EAAE,aAAa,CAAC,QAAQ,EAAE;KACzC,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opaquecash/psr-prover",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Circom witness helpers and Groth16 proving (snarkjs) for PSR",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -19,12 +19,22 @@
|
|
|
19
19
|
"clean": "rm -rf dist"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@opaquecash/psr-core": "0.1
|
|
23
|
-
"@opaquecash/stealth-wasm": "0.1
|
|
22
|
+
"@opaquecash/psr-core": "0.2.1",
|
|
23
|
+
"@opaquecash/stealth-wasm": "0.2.1",
|
|
24
24
|
"buffer": "^6.0.3",
|
|
25
25
|
"circomlibjs": "^0.1.7",
|
|
26
26
|
"snarkjs": "^0.7.5",
|
|
27
27
|
"viem": "^2.21.0"
|
|
28
28
|
},
|
|
29
|
-
"sideEffects": false
|
|
29
|
+
"sideEffects": false,
|
|
30
|
+
"license": "Apache-2.0",
|
|
31
|
+
"repository": {
|
|
32
|
+
"type": "git",
|
|
33
|
+
"url": "git+https://github.com/opaquecash/sdk.git",
|
|
34
|
+
"directory": "packages/psr-prover"
|
|
35
|
+
},
|
|
36
|
+
"homepage": "https://docs.opaque.cash",
|
|
37
|
+
"publishConfig": {
|
|
38
|
+
"access": "public"
|
|
39
|
+
}
|
|
30
40
|
}
|