@auditable/privacy-pool-zk-sdk 0.7.0 → 0.8.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.
@@ -0,0 +1,10 @@
1
+ export type DerivedEscrowKey = {
2
+ scalarHex: string;
3
+ pointXHex: string;
4
+ pointYHex: string;
5
+ };
6
+ export declare function derivedEscrowKey(nonce: bigint, recipientHi: bigint, recipientLo: bigint): Promise<DerivedEscrowKey>;
7
+ export declare function sampleDerivedEscrowKey(recipientHi: bigint, recipientLo: bigint, startNonce?: bigint, window?: bigint): Promise<{
8
+ nonce: bigint;
9
+ key: DerivedEscrowKey;
10
+ }>;
@@ -0,0 +1,10 @@
1
+ export declare const DOM_PADDING = 1347436868n;
2
+ export declare const DOM_NULLIFIER = 1346917708n;
3
+ export declare const DOM_ESCROW = 1346720579n;
4
+ export declare const DOM_ENC = 1346719299n;
5
+ export declare const BABYJUB_SUBGROUP_ORDER = 2736030358979909402780800718157159386076813972158567259200215660948447373041n;
6
+ /**
7
+ * Map any integer into `(0, l)` so it satisfies circom `LessThan(252)` vs
8
+ * `BABYJUB_SUBGROUP_ORDER` and `BabyPbk`. Values already in range are unchanged.
9
+ */
10
+ export declare function canonicalBabyJubScalarFromInteger(value: bigint): bigint;
package/dist/index.d.ts CHANGED
@@ -1,22 +1,25 @@
1
1
  export { PrivacyPoolSDK } from './sdk';
2
+ export { generateWitness } from './witness';
2
3
  export type { CoinData, GeneratedCoin, SDKOptions, StateFile, WithdrawMerkleWitness, WithdrawResult, } from './types';
3
4
  export { COIN_VALUE_STROOPS, POOL_MERKLE_TREE_DEPTH } from './types';
4
5
  export type { DepositObject, DepositSlot, TransactionWitnessInput, WasmEcdhPointFns, WithdrawalProofPublicParams, WithdrawObject, WithdrawSlot, } from './withdrawal-transaction-input';
5
- export { DEFAULT_APPLICATION_ID, DEMO_AUDIT_PUBLIC_KEY, TRANSACTION_N_AUDIT_SLOTS, buildUniformAuditParams, resolveSlotApplicationIds, resolveTransactionAuditParams, withApplicationIdOnDeposit, withApplicationIdOnWithdraw, } from './transaction-audit';
6
+ export { DEFAULT_APPLICATION_ID, DEMO_AUDIT_PUBLIC_KEY, TRANSACTION_N_AUDIT_SLOTS, buildUniformAuditParams, resolveAuditPublicKeyFromEnv, resolveSlotApplicationIds, resolveTransactionAuditParams, withApplicationIdOnDeposit, withApplicationIdOnWithdraw, } from './transaction-audit';
6
7
  export type { AuditPublicKey, TransactionAuditParams, TransactionSlotApplicationIds, } from './transaction-audit';
7
- export { addressToCanonicalXdr, buildKytPassageAuthorization, derivePassageFromTransactContext, derivePassageId, hashOnboarding, hashPublicLegContext, hashPublicSignalBytes, inspectKytPassage, NOTE_AUDIT_LEN as KYT_NOTE_AUDIT_LEN, TOTAL_PUBLIC_SIGNALS, zeroAddressSentinelBuffer, } from './kyt-passage';
8
+ export { addressToCanonicalXdr, buildKytPassageAuthorization, derivePassageFromTransactContext, derivePassageId, derivePassageIdV1, hashPublicLegContext, hashPublicSignalBytes, inspectKytPassage, NOTE_AUDIT_LEN as KYT_NOTE_AUDIT_LEN, NOTE_AUDIT_PLAINTEXT_LEN, TOTAL_PUBLIC_SIGNALS, zeroAddressSentinelBuffer, } from './kyt-passage';
8
9
  export type { InspectKytPassageRequest, InspectKytPassageApproved, KytPassageAuthorization, KytPassageDerivation, PublicLegContextInput, } from './kyt-passage';
9
10
  export { localSignKytPassageAuthorization, planKytSubmit, registerKytPassage, submitApprovedKytPassage, submitPoolTransact, submitWithKytPassage, } from './kyt-flow';
10
11
  export type { RegisterPassageParams, SubmitApprovedKytPassageParams, SubmitKytTransactParams, SubmitWithKytPassageParams, AtomicKytSubmitPlan, } from './kyt-flow';
11
- export { hashOnboardingCanonical, onboardingOptionToScVal, onboardingToScVal, } from './kyt-onboarding';
12
- export type { OnboardingPayloadInput, PlaintextNotePayload, OptionalPrivateAddressRegistrationPayload, } from './kyt-onboarding';
12
+ export { DOM_ESCROW, DOM_NULLIFIER, DOM_PADDING, DOM_ENC, BABYJUB_SUBGROUP_ORDER, canonicalBabyJubScalarFromInteger, } from './domain-separators';
13
+ export { derivedEscrowKey, sampleDerivedEscrowKey } from './derived-escrow-key';
14
+ export type { DerivedEscrowKey } from './derived-escrow-key';
13
15
  export { BN254_BABYJUB_SCALAR_MAX_EXCLUSIVE, BN254_SCALAR_MOD, TRANSACTION_N_INS, TRANSACTION_N_OUTS, TRANSACTION_TREE_DEPTH, NOTE_AUDIT_LEN, NOTE_OUTPUT_LEN, buildTransactionWitnessInput, coordHexToDecimal, ed25519PubkeyPayloadHexToWithdrawFrDecimals, randomFrDecimal, randomFrDecimal253, recipientPublicKeysDecimalFromStealthAddress, scalarHexToFrDecimal, stellarContractAddressToAssetFrDecimals, resolveDepositsForWitness, withdrawObjectFromMerkleWitness, } from './withdrawal-transaction-input';
14
- export { decryptOutputNoteEvent, encryptOutputNoteForDeposit, NOTE_OUTPUT_LEN as OUTPUT_NOTE_LEN, } from './output-note-encryption';
16
+ export { decryptOutputNoteEvent, encryptOutputNoteForDeposit, secretFromDepositEphemeralScalarDecimal, NOTE_OUTPUT_LEN as OUTPUT_NOTE_LEN, } from './output-note-encryption';
15
17
  export type { DecryptedOutputNote, OutputNoteEncryption, OutputNoteEventInput, OutputNotePlaintext, } from './output-note-encryption';
16
18
  export { STEALTH_ADDRESS_HRP, decodeStealthAddress, encodeStealthAddress, } from './stealth-address';
17
19
  export type { DecodedRecipientSharedSecretPreimage, DecodedStealthAddress, Hex, StealthAddress, } from './stealth-address';
18
- export { buildStealthAddressSignMessage, DEFAULT_STEALTH_SIGN_NONCE, } from './stealth-sign-message';
19
- export { privKeyScalarDecimalFromStellarSignature } from './stealth-signature';
20
+ export { buildStealthAddressSignMessage, DEFAULT_STEALTH_SIGN_NONCE, OWNER_BOUND_NOTE_SCHEMA_VERSION, SPEND_SCALAR_DOMAIN_TAG, resolveSpendScalarSchemaVersion, } from './stealth-sign-message';
21
+ export type { SpendScalarDomain } from './stealth-sign-message';
22
+ export { privKeyScalarDecimalFromStellarSignature, spendScalarHexFromStellarSignature, } from './stealth-signature';
20
23
  export { DECODED_EPHEMERAL_HRP, DEPOSITOR_SHARED_SECRET_PREIMAGE_HRP, decodeDecodedEphemeralKey, decodeDepositorSharedSecretPreimage, encodeDecodedEphemeralKey, encodeDepositorSharedSecretPreimage, generateRandomScalarHex32, } from './ephemeral-key';
21
24
  export type { DecodedDepositorSharedSecretPreimage, DecodedEphemeralKey, EncodedDepositorSharedSecretPreimage, EncodedEphemeralKey, } from './ephemeral-key';
22
25
  export { sharedSecretFromDepositorPreimage, sharedSecretFromRecipientPreimage, } from './shared-secret';