Skip to main content

Demo Project

A complete example project demonstrating how to use PrivacyCash SDK: https://github.com/Privacy-Cash/solana-sdk-demo-interface

Installation

Requires Node.js 24+. The SDK is written in TypeScript and includes type definitions.

Deriving Encryption Key

Client need to ask user to sign an offchain message, before the user can interact with Privacy Cash.
Once the user signed the message, pass the resulting signature to EncryptionService of the SDK:

Get hasher

Common Issues

Next.js project needs to update the postinstall build scripts:

Warnings

Privacy Cash SDK requires consistent signature generation, otherwise the deposited tokens might be lost forever since the encrypted UTXO can’t be decrypted. For frontend, please make sure deriveEncryptionKeyFromSignature() generates the same result for the same params passed in, and for backend, please make sure deriveEncryptionKeyFromWallet() generates the same result. Most wallets returns the same result, but some non major wallets might generate different result.