@arcanetech/stellar-privacy-pool-zk-sdk 0.9.1-rc.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.
Files changed (43) hide show
  1. package/dist/ciphertext-blob.d.ts +17 -0
  2. package/dist/circuit-artifacts.d.ts +9 -0
  3. package/dist/circuit-urls-2x2-COiK1uEc.mjs +6 -0
  4. package/dist/circuit-urls-2x2-COiK1uEc.mjs.map +1 -0
  5. package/dist/circuit-urls-2x2-DVpZIkgS.js +12 -0
  6. package/dist/circuit-urls-2x2-DVpZIkgS.js.map +1 -0
  7. package/dist/circuit-urls-2x2.d.ts +3 -0
  8. package/dist/circuit-urls-6x6-CqdzNC4I.js +12 -0
  9. package/dist/circuit-urls-6x6-CqdzNC4I.js.map +1 -0
  10. package/dist/circuit-urls-6x6-Dtp8u02o.mjs +6 -0
  11. package/dist/circuit-urls-6x6-Dtp8u02o.mjs.map +1 -0
  12. package/dist/circuit-urls-6x6.d.ts +3 -0
  13. package/dist/cli.d.ts +1 -0
  14. package/dist/cli.js +3114 -0
  15. package/dist/cli.js.map +1 -0
  16. package/dist/derived-escrow-key.d.ts +10 -0
  17. package/dist/domain-separators.d.ts +16 -0
  18. package/dist/ephemeral-key.d.ts +28 -0
  19. package/dist/index.d.ts +30 -0
  20. package/dist/index.mjs +3875 -0
  21. package/dist/index.mjs.map +1 -0
  22. package/dist/kyt-flow.d.ts +60 -0
  23. package/dist/kyt-onboarding.d.ts +36 -0
  24. package/dist/kyt-passage.d.ts +83 -0
  25. package/dist/output-note-encryption.d.ts +72 -0
  26. package/dist/prover.d.ts +5 -0
  27. package/dist/sdk.d.ts +130 -0
  28. package/dist/shared-secret.d.ts +24 -0
  29. package/dist/stealth-address.d.ts +23 -0
  30. package/dist/stealth-sign-message.d.ts +20 -0
  31. package/dist/stealth-signature.d.ts +29 -0
  32. package/dist/transaction-audit.d.ts +26 -0
  33. package/dist/types.d.ts +64 -0
  34. package/dist/wasm.d.ts +1 -0
  35. package/dist/withdrawal-transaction-input.d.ts +162 -0
  36. package/dist/witness.d.ts +3 -0
  37. package/dist/zk-artifact-url.d.ts +4 -0
  38. package/dist/zk-layout.d.ts +84 -0
  39. package/package.json +57 -0
  40. package/pkg/client_sdk_wasm.d.ts +120 -0
  41. package/pkg/client_sdk_wasm.js +765 -0
  42. package/pkg/client_sdk_wasm_bg.wasm +0 -0
  43. package/pkg/client_sdk_wasm_bg.wasm.d.ts +21 -0
@@ -0,0 +1,162 @@
1
+ import type { TransactionAuditParams } from './transaction-audit';
2
+ import type { WithdrawMerkleWitness } from './types';
3
+ /** Matches `Transaction(20, 2, 2, publicNInputs, publicNOutputs, 4, 12, 6)` in `circuits/main.circom`. */
4
+ export declare const TRANSACTION_TREE_DEPTH = 20;
5
+ export declare const TRANSACTION_N_INS = 2;
6
+ export declare const TRANSACTION_N_OUTS = 2;
7
+ export declare const TRANSACTION_N_AUDIT_SLOTS = 4;
8
+ export declare const NOTE_AUDIT_LEN = 12;
9
+ export declare const NOTE_OUTPUT_LEN = 6;
10
+ /** Must match `Transaction(..., publicNInputs, publicNOutputs)` and contract `get_public_slot_config`. */
11
+ export declare const TRANSACTION_PUBLIC_N_INPUTS = 1;
12
+ export declare const TRANSACTION_PUBLIC_N_OUTPUTS = 1;
13
+ /** BN254 scalar field modulus (ark `Fr`, circom signals). */
14
+ export declare const BN254_SCALAR_MOD = 21888242871839275222246405745257275088548364400416034343698204186575808495617n;
15
+ /**
16
+ * BabyJub ECDH in `circuits/encryption.circom` uses `Num2Bits(253)`; scalars must be < 2^253
17
+ * (matches `libs/cryptography` `scalar_mul_253`).
18
+ */
19
+ export declare const BN254_BABYJUB_SCALAR_MAX_EXCLUSIVE: bigint;
20
+ export interface WithdrawalProofPublicParams {
21
+ /** Decimal string, circom `stateRoot`. */
22
+ stateRoot: string;
23
+ /** Decimal string, circom `withdrawAddressHi` (Ed25519 key bytes [0..16] as big-endian u128). */
24
+ withdrawAddressHi: string;
25
+ /** Decimal string, circom `withdrawAddressLo` (Ed25519 key bytes [16..32] as big-endian u128). */
26
+ withdrawAddressLo: string;
27
+ /** Decimal string, circom `escrowRecipientHi`. */
28
+ escrowRecipientHi?: string;
29
+ /** Decimal string, circom `escrowRecipientLo`. */
30
+ escrowRecipientLo?: string;
31
+ /** Decimal string, circom `sweepOutputOwnerPubX`. Zero off-sweep. */
32
+ sweepOutputOwnerPubX?: string;
33
+ /** Decimal string, circom `sweepOutputOwnerPubY`. Zero off-sweep. */
34
+ sweepOutputOwnerPubY?: string;
35
+ /** Decimal string, default owner scalar copied onto dummy withdraw slots. */
36
+ privKeyScalar: string;
37
+ }
38
+ /** Public accounting legs (`publicWithdrawnAssets`, `publicDepositedAssets`, `publicDeposits`, `publicWithdrawals`). */
39
+ export interface TransactionPublicLegParams {
40
+ publicWithdrawnAssets: Array<[string, string]>;
41
+ publicDepositedAssets: Array<[string, string]>;
42
+ publicDeposits: string[];
43
+ publicWithdrawals: string[];
44
+ }
45
+ /** All-zero public legs (private-only pool moves). */
46
+ export declare function zeroPublicLegs(publicNInputs?: number, publicNOutputs?: number): TransactionPublicLegParams;
47
+ export declare function padPublicLegs(legs: TransactionPublicLegParams, publicNInputs: number, publicNOutputs: number): TransactionPublicLegParams;
48
+ /** Real withdraw leg; coordinates are decimal field strings (same as `CoinData`). */
49
+ export interface WithdrawObject {
50
+ value: string;
51
+ nullifier: string;
52
+ secret: string;
53
+ /** Asset contract id as two decimal Fr strings (`asset[0]`, `asset[1]`). */
54
+ asset: [string, string];
55
+ /** BN254 Fr decimal; `0` for dummy slots. */
56
+ applicationId: string;
57
+ /** Owner BabyJubJub public key `[x, y]` as decimal strings. */
58
+ ownerPub: [string, string];
59
+ /** Per-input owner scalar. */
60
+ privKeyScalar: string;
61
+ paddingRandom: string;
62
+ escrowNonce: string;
63
+ recipientStellar: [string, string];
64
+ stateSiblings: string[];
65
+ stateIndex: string;
66
+ }
67
+ export interface DepositObject {
68
+ value: string;
69
+ nullifier: string;
70
+ ephemeralKeyScalar: string;
71
+ /** Asset contract id as two decimal Fr strings. */
72
+ asset: [string, string];
73
+ /** BN254 Fr decimal; `0` for dummy slots. */
74
+ applicationId: string;
75
+ /** Recipient public key `[x, y]` as decimal strings. */
76
+ recipientPublicKeys: [string, string];
77
+ escrowNonce?: string;
78
+ recipientStellar?: [string, string];
79
+ }
80
+ export type WithdrawSlot = WithdrawObject | 'dummy';
81
+ export type DepositSlot = DepositObject | 'dummy';
82
+ /** Witness calculator input for a `Transaction(20, nIns, nOuts, …)` instantiation. */
83
+ export interface TransactionWitnessInput {
84
+ stateRoot: string;
85
+ withdrawAddressHi: string;
86
+ withdrawAddressLo: string;
87
+ escrowRecipientHi: string;
88
+ escrowRecipientLo: string;
89
+ sweepOutputOwnerPubX: string;
90
+ sweepOutputOwnerPubY: string;
91
+ privKeyScalars: string[];
92
+ ownerPubs: Array<[string, string]>;
93
+ paddingRandoms: string[];
94
+ withdrawnValues: string[];
95
+ withdrawnNullifiers: string[];
96
+ withdrawnSecrets: string[];
97
+ withdrawnAssets: Array<[string, string]>;
98
+ withdrawnEscrowNonces: string[];
99
+ inputRecipientStellar: Array<[string, string]>;
100
+ stateSiblings: string[][];
101
+ stateIndex: string[];
102
+ depositedValues: string[];
103
+ depositedNullifiers: string[];
104
+ depositedAssets: Array<[string, string]>;
105
+ depositedEphemeralKeyScalars: string[];
106
+ depositedRecipientPublicKeys: Array<[string, string]>;
107
+ depositedEscrowNonces: string[];
108
+ outputRecipientStellar: Array<[string, string]>;
109
+ publicWithdrawnAssets: Array<[string, string]>;
110
+ publicDepositedAssets: Array<[string, string]>;
111
+ publicDeposits: string[];
112
+ publicWithdrawals: string[];
113
+ inputApplicationIds: string[];
114
+ outputApplicationIds: string[];
115
+ auditEphemeralScalar: string;
116
+ noteAuditPublicKey: [string, string];
117
+ }
118
+ export interface WasmEcdhPointFns {
119
+ ecdhEphemeralPublicKeyFromScalarHex(scalarHex: string): {
120
+ x: string;
121
+ y: string;
122
+ };
123
+ }
124
+ /** 32-byte field coordinate (hex, no 0x) → decimal string mod BN254 scalar field. */
125
+ export declare function coordHexToDecimal(hex: string): string;
126
+ /**
127
+ * 32-byte big-endian scalar hex → decimal for circom `ephemeralKeyScalar` / ECDH `priv`.
128
+ * Integer must be < 2^253 (not reduced mod r — values ≥ 2^253 are rejected).
129
+ */
130
+ export declare function scalarHexToFrDecimal(hex: string): string;
131
+ /**
132
+ * Stellar G-address Ed25519 payload (32 bytes as 64 hex, optional 0x) → two circom public decimals
133
+ * (`withdrawAddressHi` / `withdrawAddressLo`). No mod-r; each half fits in 128 bits.
134
+ */
135
+ export declare function ed25519PubkeyPayloadHexToWithdrawFrDecimals(hex: string): {
136
+ hi: string;
137
+ lo: string;
138
+ };
139
+ /**
140
+ * Stellar contract id (`C…`) → two circom field decimals for `asset[0]`, `asset[1]` (same 32-byte split as accounts).
141
+ */
142
+ export declare function stellarContractAddressToAssetFrDecimals(address: string): [string, string];
143
+ /** Uniform random `Fr` as decimal (32 random bytes, mod r). For Poseidon-only inputs (e.g. nullifiers). */
144
+ export declare function randomFrDecimal(): string;
145
+ /** Random scalar < 2^253 for BabyJub ECDH / `Num2Bits(253)` (uses {@link generateRandomScalarHex32}). */
146
+ export declare function randomFrDecimal253(): string;
147
+ export declare function resolveDepositsForWitness(depositSlots: [DepositSlot, DepositSlot], wasm: WasmEcdhPointFns): [DepositObject, DepositObject];
148
+ export declare function padWithdrawSlots(slots: WithdrawSlot[], nIns: number): WithdrawSlot[];
149
+ export declare function padDepositSlots(slots: DepositSlot[], nOuts: number): DepositSlot[];
150
+ export declare function buildTransactionWitnessInput(publicParams: WithdrawalProofPublicParams, publicLegs: TransactionPublicLegParams, withdrawSlots: WithdrawSlot[], depositSlots: DepositSlot[], audit: TransactionAuditParams, wasm: WasmEcdhPointFns, dims?: {
151
+ nIns?: number;
152
+ nOuts?: number;
153
+ publicNInputs?: number;
154
+ publicNOutputs?: number;
155
+ }): TransactionWitnessInput;
156
+ /** `stpl1…` stealth address → `[x, y]` as decimal field strings for `depositedRecipientPublicKeys`. */
157
+ export declare function recipientPublicKeysDecimalFromStealthAddress(stealthAddress: string): [string, string];
158
+ /** First withdraw leg: Merkle witness + owner public key (hex) and matching scalar. */
159
+ export declare function withdrawObjectFromMerkleWitness(witness: WithdrawMerkleWitness, ownerPubHex: {
160
+ x: string;
161
+ y: string;
162
+ }, applicationId: string, privKeyScalar: string): WithdrawObject;
@@ -0,0 +1,3 @@
1
+ import type { TransactionWitnessInput } from './withdrawal-transaction-input';
2
+ /** @deprecated Witness generation is in the main SDK WASM (`proveGroth16`). */
3
+ export declare function generateWitness(_input: TransactionWitnessInput, _circuitWasm?: BufferSource, _wasmFileName?: string): Promise<Uint8Array>;
@@ -0,0 +1,4 @@
1
+ export declare const ZK_ARTIFACT_GITHUB_REPO = "Polynom-Labs/stellar-privacy-layer-contracts";
2
+ export declare const ZK_SDK_PACKAGE_VERSION = "__ZK_SDK_PACKAGE_VERSION__";
3
+ export declare function defaultZkArtifactBaseUrl(version?: string): string;
4
+ export declare function trimArtifactBaseUrl(value: string): string;
@@ -0,0 +1,84 @@
1
+ /** Off-chain ZK layout table. Must stay byte-identical to `libs/zk::ZkLayoutParams`. */
2
+ export declare const LEGACY_ZK_NONCE = 0n;
3
+ export declare const COMMITMENT_V2_ZK_NONCE = 2n;
4
+ export declare const BINDING_ZK_NONCE = 3n;
5
+ export declare const SIX_BY_SIX_ZK_NONCE = 6n;
6
+ export declare const SIX_BY_SIX_BINDING_ZK_NONCE = 7n;
7
+ export declare const LEGACY_PUBLIC_INPUT_PREFIX_LEN = 5;
8
+ export declare const V2_PUBLIC_INPUT_PREFIX_LEN = 7;
9
+ export declare const NOTE_AUDIT_LEN = 12;
10
+ export declare const NOTE_OUTPUT_LEN = 6;
11
+ export type CircuitProfileName = '2x2' | '6x6';
12
+ export declare enum BundledZkCircuit {
13
+ TwoByTwo = "2x2",
14
+ SixBySix = "6x6"
15
+ }
16
+ export interface ZkCircuitLayoutFields {
17
+ nIns: number;
18
+ nOuts: number;
19
+ publicNInputs: number;
20
+ publicNOutputs: number;
21
+ }
22
+ export type BundledZkCircuitConfig = ZkCircuitLayoutFields & {
23
+ circuit: BundledZkCircuit;
24
+ };
25
+ export type DevZkCircuitConfig = ZkCircuitLayoutFields & {
26
+ circuitGraph: BufferSource;
27
+ r1cs: BufferSource;
28
+ provingKey: BufferSource;
29
+ zkey?: BufferSource;
30
+ };
31
+ export type ZkCircuitConfig = BundledZkCircuitConfig | DevZkCircuitConfig;
32
+ export declare function isDevZkCircuitConfig(config: ZkCircuitConfig): config is DevZkCircuitConfig;
33
+ export declare const DEFAULT_ZK_CONFIG_NONCE = 3n;
34
+ export declare const DEFAULT_ZK_CIRCUITS: Record<string, BundledZkCircuitConfig>;
35
+ export declare function layoutFromCircuitConfig(config: ZkCircuitConfig): ZkLayoutParams;
36
+ export declare function resolveZkCircuitConfig(zkCircuits: Record<string, ZkCircuitConfig> | undefined, zkConfigNonce: bigint | undefined): {
37
+ nonce: bigint;
38
+ config: ZkCircuitConfig;
39
+ };
40
+ export declare function bundledCircuitFileNames(circuit: BundledZkCircuit): {
41
+ graphFileName: string;
42
+ r1csFileName: string;
43
+ provingKeyFileName: string;
44
+ verificationKeyFileName: string;
45
+ zkeyFileName: string;
46
+ };
47
+ export interface ZkLayoutParams {
48
+ nIns: number;
49
+ nOuts: number;
50
+ publicNInputs: number;
51
+ publicNOutputs: number;
52
+ nAuditSlots: number;
53
+ noteAuditLen: number;
54
+ noteOutputLen: number;
55
+ publicInputPrefixLen: number;
56
+ auditOffset: number;
57
+ outputNoteOffset: number;
58
+ }
59
+ export interface CircuitProfile {
60
+ name: CircuitProfileName;
61
+ nonce: bigint;
62
+ layout: ZkLayoutParams;
63
+ wasmFileName: string;
64
+ zkeyFileName: string;
65
+ }
66
+ export declare function zkLayoutFromShape(nIns: number, nOuts: number, publicNInputs: number, publicNOutputs: number, nAuditSlots: number, noteAuditLen: number, noteOutputLen: number, publicInputPrefixLen?: number): ZkLayoutParams;
67
+ export declare function zkLayoutFromShapeBinding(nIns: number, nOuts: number, publicNInputs: number, publicNOutputs: number, nAuditSlots: number, noteAuditLen: number, noteOutputLen: number): ZkLayoutParams;
68
+ export declare function ciphertextsInPublicSignals(layout: ZkLayoutParams): boolean;
69
+ export declare function ciphertextFieldCount(layout: ZkLayoutParams): number;
70
+ export declare function auditEphemeralPublicKeyCount(layout: ZkLayoutParams): number;
71
+ export declare function indexAuditEphemeralPublicKeys(layout: ZkLayoutParams): number;
72
+ export declare function indexAuditTags(layout: ZkLayoutParams): number;
73
+ export declare function indexOutputNoteTags(layout: ZkLayoutParams): number;
74
+ export declare function publicOutputsLen(layout: ZkLayoutParams): number;
75
+ export declare function totalPublicSignals(layout: ZkLayoutParams): number;
76
+ export declare function stateRootIndex(layout: ZkLayoutParams): number;
77
+ export declare function legacyOwnerBoundLayout(): ZkLayoutParams;
78
+ export declare function standardLayout(): ZkLayoutParams;
79
+ export declare function sixBySixLayout(): ZkLayoutParams;
80
+ export declare function standardBindingLayout(): ZkLayoutParams;
81
+ export declare function sixBySixBindingLayout(): ZkLayoutParams;
82
+ export declare function layoutForKnownNonce(nonce: bigint): ZkLayoutParams;
83
+ export declare function circuitProfileFromName(name: string): CircuitProfile;
84
+ export declare function circuitProfileFromNonce(nonce: bigint): CircuitProfile;
package/package.json ADDED
@@ -0,0 +1,57 @@
1
+ {
2
+ "version": "0.9.1-rc.0",
3
+ "name": "@arcanetech/stellar-privacy-pool-zk-sdk",
4
+ "description": "Client SDK for Soroban Privacy Pools - coin generation, withdrawal proofs, and proof serialization",
5
+ "main": "dist/index.mjs",
6
+ "module": "dist/index.mjs",
7
+ "types": "dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "import": "./dist/index.mjs",
11
+ "types": "./dist/index.d.ts"
12
+ },
13
+ "./sdk.wasm": "./pkg/client_sdk_wasm_bg.wasm",
14
+ "./pkg/client_sdk_wasm.js": "./pkg/client_sdk_wasm.js"
15
+ },
16
+ "bin": {
17
+ "client-sdk-cli": "./dist/cli.js"
18
+ },
19
+ "engines": {
20
+ "node": ">=19.0.0"
21
+ },
22
+ "repository": {
23
+ "type": "git",
24
+ "url": "https://github.com/Polynom-Labs/stellar-privacy-layer-contracts"
25
+ },
26
+ "files": [
27
+ "dist/",
28
+ "pkg/"
29
+ ],
30
+ "scripts": {
31
+ "build:wasm": "cd crate && wasm-pack build --target web --out-dir ../pkg",
32
+ "build:ts": "rollup -c",
33
+ "build": "rollup -c",
34
+ "cli": "node dist/cli.js",
35
+ "test:kyt": "node test/kyt-flow-atomic.mjs && node test/kyt-public-leg-context.mjs && node test/kyt-passage-id-auth.mjs && node test/derived-escrow-key.mjs && node test/spend-scalar-domain.mjs && node test/eighteen-decimal-value.mjs && node test/zk-artifact-url.mjs && node test/no-onboarding-exports.mjs && node test/owner-bound-witness-check.mjs && node test/six-by-six-layout.mjs && node test/six-by-six-witness-proof.mjs",
36
+ "test:output-note": "node test/output-note-encryption.mjs"
37
+ },
38
+ "dependencies": {
39
+ "@noble/hashes": "^2.2.0",
40
+ "@stellar/stellar-sdk": "^16.0.1",
41
+ "bech32": "^2.0.0",
42
+ "circomlibjs": "^0.1.7",
43
+ "ffjavascript": "^0.3.0"
44
+ },
45
+ "devDependencies": {
46
+ "@rollup/plugin-alias": "^5.0.0",
47
+ "@rollup/plugin-commonjs": "^25.0.0",
48
+ "@rollup/plugin-json": "^6.0.0",
49
+ "@rollup/plugin-node-resolve": "^15.0.0",
50
+ "@rollup/plugin-typescript": "^11.0.0",
51
+ "@types/node": "^20.0.0",
52
+ "rollup": "^4.0.0",
53
+ "rollup-plugin-copy": "^3.5.0",
54
+ "tslib": "^2.6.0",
55
+ "typescript": "^5.0.0"
56
+ }
57
+ }
@@ -0,0 +1,120 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+
4
+ /**
5
+ * Merkle root, path, and coin field strings for the first withdraw leg (JSON → JSON).
6
+ */
7
+ export function buildWithdrawMerkleWitness(coin_json: string, state_json: string): string;
8
+
9
+ /**
10
+ * Calculate owner-bound nullifier hash from nullifier and spend-scalar decimal strings.
11
+ * Returns hex string (0x...)
12
+ */
13
+ export function calculateNullifierHash(nullifier_decimal: string, priv_key_scalar_decimal: string): string;
14
+
15
+ /**
16
+ * `R = Poseidon255(2)(hi, lo)`; `scalar` is the raw Poseidon hash when it is
17
+ * already in `(0, BabyJub subgroup order)`. Out-of-range hashes fail so the
18
+ * caller can rejection-sample a new nonce.
19
+ */
20
+ export function derivedEscrowKey(nonce_decimal: string, recipient_hi_decimal: string, recipient_lo_decimal: string): any;
21
+
22
+ /**
23
+ * UTF-8 seed → `SHA256` → scalar → BabyJubJub `BASE8 * r` (circom `ECDHEphemeralKey`).
24
+ * `x` and `y` are lowercase hex (no `0x`). Bech32 / stealth string: TypeScript `encodeStealthAddress`.
25
+ */
26
+ export function ecdhEphemeralPublicKey(seed: string): any;
27
+
28
+ /**
29
+ * 32-byte scalar as 64 hex chars (optional `0x`) → `ecdh_ephemeral_public_key` (no UTF-8 seed hash).
30
+ */
31
+ export function ecdhEphemeralPublicKeyFromScalarHex(scalar_hex: string): any;
32
+
33
+ /**
34
+ * Circuit `ECDH`: `priv * (pub_x, pub_y)` → shared key (`key[0], key[1]` hex).
35
+ */
36
+ export function ecdhSharedKey(priv_hex: string, pub_x_hex: string, pub_y_hex: string): any;
37
+
38
+ /**
39
+ * Generate a new coin with random nullifier, secret, and owner public-key field elements.
40
+ * `amount_decimal` is an arbitrary-precision decimal field element (never JS `number`).
41
+ * `asset_hi_decimal` / `asset_lo_decimal` are decimal Fr strings for the Stellar asset contract id (two limbs).
42
+ * Returns JSON: { coin: { value, nullifier, secret, commitment, asset_hi, asset_lo }, commitment_hex, precommitement_hex }
43
+ */
44
+ export function generateCoin(amount_decimal: string, asset_hi_decimal: string, asset_lo_decimal: string, application_id_decimal: string): any;
45
+
46
+ /**
47
+ * `Poseidon₁(scalar)` secret + recipient owner public key (hex), matching an aligned deposit witness.
48
+ */
49
+ export function generateCoinForDepositWithOwnerPubHex(scalar_hex: string, owner_x_hex: string, owner_y_hex: string, amount_decimal: string, asset_hi_decimal: string, asset_lo_decimal: string, application_id_decimal: string): any;
50
+
51
+ /**
52
+ * `secret` in coin = `Poseidon255(1)(scalar)` per `deposit.circom`; scalar is 32-byte hex (64 chars, optional `0x`).
53
+ */
54
+ export function generateCoinFromDepositEphemeralScalarHex(scalar_hex: string, amount_decimal: string, asset_hi_decimal: string, asset_lo_decimal: string, application_id_decimal: string): any;
55
+
56
+ /**
57
+ * Same as `generateCoin`, but commitment uses the given owner public key (64-char hex coords).
58
+ */
59
+ export function generateCoinWithOwnerPubHex(owner_x_hex: string, owner_y_hex: string, amount_decimal: string, asset_hi_decimal: string, asset_lo_decimal: string, application_id_decimal: string): any;
60
+
61
+ /**
62
+ * Convert snarkjs proof JSON to hex bytes for Soroban contract.
63
+ */
64
+ export function proofToHex(proof_json: string): string;
65
+
66
+ /**
67
+ * Graph witness + arkworks Groth16 prove. Returns `{ proof_hex, public_hex }`.
68
+ */
69
+ export function proveGroth16(graph: Uint8Array, proving_key: Uint8Array, r1cs: Uint8Array, inputs_json: string): any;
70
+
71
+ /**
72
+ * Convert snarkjs public signals JSON to hex bytes for Soroban contract.
73
+ */
74
+ export function publicToHex(public_json: string): string;
75
+
76
+ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
77
+
78
+ export interface InitOutput {
79
+ readonly memory: WebAssembly.Memory;
80
+ readonly buildWithdrawMerkleWitness: (a: number, b: number, c: number, d: number, e: number) => void;
81
+ readonly calculateNullifierHash: (a: number, b: number, c: number, d: number, e: number) => void;
82
+ readonly derivedEscrowKey: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
83
+ readonly ecdhEphemeralPublicKey: (a: number, b: number, c: number) => void;
84
+ readonly ecdhEphemeralPublicKeyFromScalarHex: (a: number, b: number, c: number) => void;
85
+ readonly ecdhSharedKey: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
86
+ readonly generateCoin: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => void;
87
+ readonly generateCoinForDepositWithOwnerPubHex: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number, o: number) => void;
88
+ readonly generateCoinFromDepositEphemeralScalarHex: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number) => void;
89
+ readonly generateCoinWithOwnerPubHex: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number) => void;
90
+ readonly proofToHex: (a: number, b: number, c: number) => void;
91
+ readonly proveGroth16: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => void;
92
+ readonly publicToHex: (a: number, b: number, c: number) => void;
93
+ readonly __wbindgen_export: (a: number, b: number) => number;
94
+ readonly __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
95
+ readonly __wbindgen_export3: (a: number) => void;
96
+ readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
97
+ readonly __wbindgen_export4: (a: number, b: number, c: number) => void;
98
+ }
99
+
100
+ export type SyncInitInput = BufferSource | WebAssembly.Module;
101
+
102
+ /**
103
+ * Instantiates the given `module`, which can either be bytes or
104
+ * a precompiled `WebAssembly.Module`.
105
+ *
106
+ * @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
107
+ *
108
+ * @returns {InitOutput}
109
+ */
110
+ export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
111
+
112
+ /**
113
+ * If `module_or_path` is {RequestInfo} or {URL}, makes a request and
114
+ * for everything else, calls `WebAssembly.instantiate` directly.
115
+ *
116
+ * @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
117
+ *
118
+ * @returns {Promise<InitOutput>}
119
+ */
120
+ export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;