@auditable/privacy-pool-zk-sdk 0.0.2-rc.9 → 0.4.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/assets/main.wasm +0 -0
- package/assets/main_final.zkey +0 -0
- package/assets/witness_calculator.js +2 -0
- package/dist/cli.js +30618 -460
- package/dist/cli.js.map +1 -1
- package/dist/ephemeral-key.d.ts +28 -0
- package/dist/index.d.ts +12 -1
- package/dist/index.mjs +30794 -595
- package/dist/index.mjs.map +1 -1
- package/dist/sdk.d.ts +78 -8
- package/dist/shared-secret.d.ts +24 -0
- package/dist/stealth-address.d.ts +23 -0
- package/dist/stealth-sign-message.d.ts +7 -0
- package/dist/stealth-signature.d.ts +21 -0
- package/dist/types.d.ts +19 -1
- package/dist/withdrawal-transaction-input.d.ts +117 -0
- package/dist/witness.d.ts +2 -2
- package/package.json +11 -6
- package/pkg/client_sdk_wasm.d.ts +77 -33
- package/pkg/client_sdk_wasm.js +514 -413
- package/pkg/client_sdk_wasm_bg.wasm +0 -0
- package/pkg/client_sdk_wasm_bg.wasm.d.ts +12 -6
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { DecodedStealthAddress, Hex } from './stealth-address';
|
|
2
|
+
/** BabyJubJub affine point for ECDH (depositors’ published keys, etc.). */
|
|
3
|
+
export interface DecodedEphemeralKey {
|
|
4
|
+
x: Hex;
|
|
5
|
+
y: Hex;
|
|
6
|
+
}
|
|
7
|
+
/** Depositor preimage: nonce scalar ‖ recipient stealth point (circuit-aligned). */
|
|
8
|
+
export interface DecodedDepositorSharedSecretPreimage {
|
|
9
|
+
randomNonceScalar: Hex;
|
|
10
|
+
recipientStealthAddress: DecodedStealthAddress;
|
|
11
|
+
}
|
|
12
|
+
export type EncodedEphemeralKey = string;
|
|
13
|
+
export type EncodedDepositorSharedSecretPreimage = string;
|
|
14
|
+
/** Bech32 HRP for {@link DecodedEphemeralKey} only (`x ‖ y`, 64 bytes). */
|
|
15
|
+
export declare const DECODED_EPHEMERAL_HRP: "epk1";
|
|
16
|
+
/** Bech32 HRP for {@link DecodedDepositorSharedSecretPreimage} (96 bytes). */
|
|
17
|
+
export declare const DEPOSITOR_SHARED_SECRET_PREIMAGE_HRP: "epk_dep_pre1";
|
|
18
|
+
/**
|
|
19
|
+
* 32-byte big-endian integer as hex (64 chars), **< 2^253**, so BabyJub ECDH matches
|
|
20
|
+
* `circuits/encryption.circom` `Num2Bits(253)` and `libs/cryptography` `scalar_mul_253`.
|
|
21
|
+
*/
|
|
22
|
+
export declare function generateRandomScalarHex32(): Hex;
|
|
23
|
+
/** Bech32 `epk1`: encodes `x ‖ y` (64 bytes). */
|
|
24
|
+
export declare function encodeDecodedEphemeralKey(decoded: DecodedEphemeralKey): EncodedEphemeralKey;
|
|
25
|
+
export declare function decodeDecodedEphemeralKey(encoded: EncodedEphemeralKey): DecodedEphemeralKey;
|
|
26
|
+
/** Bech32 `epk_dep_pre1`: `randomNonceScalar ‖ recipient.x ‖ recipient.y`. */
|
|
27
|
+
export declare function encodeDepositorSharedSecretPreimage(decoded: DecodedDepositorSharedSecretPreimage): EncodedDepositorSharedSecretPreimage;
|
|
28
|
+
export declare function decodeDepositorSharedSecretPreimage(encoded: EncodedDepositorSharedSecretPreimage): DecodedDepositorSharedSecretPreimage;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,13 @@
|
|
|
1
1
|
export { PrivacyPoolSDK } from './sdk';
|
|
2
|
-
export type { CoinData, GeneratedCoin, SDKOptions,
|
|
2
|
+
export type { CoinData, GeneratedCoin, SDKOptions, StateFile, WithdrawMerkleWitness, WithdrawResult, } from './types';
|
|
3
|
+
export { COIN_VALUE_STROOPS, POOL_MERKLE_TREE_DEPTH } from './types';
|
|
4
|
+
export type { DepositObject, DepositSlot, TransactionWitnessInput, WasmEcdhPointFns, WithdrawalProofPublicParams, WithdrawObject, WithdrawSlot, } from './withdrawal-transaction-input';
|
|
5
|
+
export { BN254_BABYJUB_SCALAR_MAX_EXCLUSIVE, BN254_SCALAR_MOD, TRANSACTION_N_INS, TRANSACTION_N_OUTS, TRANSACTION_TREE_DEPTH, buildTransactionWitnessInput, coordHexToDecimal, ed25519PubkeyPayloadHexToWithdrawFrDecimals, randomFrDecimal, randomFrDecimal253, recipientPublicKeysDecimalFromStealthAddress, scalarHexToFrDecimal, stellarContractAddressToAssetFrDecimals, withdrawObjectFromMerkleWitness, } from './withdrawal-transaction-input';
|
|
6
|
+
export { STEALTH_ADDRESS_HRP, decodeStealthAddress, encodeStealthAddress, } from './stealth-address';
|
|
7
|
+
export type { DecodedRecipientSharedSecretPreimage, DecodedStealthAddress, Hex, StealthAddress, } from './stealth-address';
|
|
8
|
+
export { buildStealthAddressSignMessage, DEFAULT_STEALTH_SIGN_NONCE, } from './stealth-sign-message';
|
|
9
|
+
export { privKeyScalarDecimalFromStellarSignature } from './stealth-signature';
|
|
10
|
+
export { DECODED_EPHEMERAL_HRP, DEPOSITOR_SHARED_SECRET_PREIMAGE_HRP, decodeDecodedEphemeralKey, decodeDepositorSharedSecretPreimage, encodeDecodedEphemeralKey, encodeDepositorSharedSecretPreimage, generateRandomScalarHex32, } from './ephemeral-key';
|
|
11
|
+
export type { DecodedDepositorSharedSecretPreimage, DecodedEphemeralKey, EncodedDepositorSharedSecretPreimage, EncodedEphemeralKey, } from './ephemeral-key';
|
|
12
|
+
export { sharedSecretFromDepositorPreimage, sharedSecretFromRecipientPreimage, } from './shared-secret';
|
|
13
|
+
export type { DecodedWithdrawerSharedSecret, EcdhSharedKeyFn, SharedSecret, } from './shared-secret';
|