Skip to content
These pages target solana-private-channels commit c9e2240, the source of the escrow program deployed to devnet at 9tgHa1DcnaSSUtmMsst8ovKTe1Gfxzezn27KnH9xXYeU. Upstream main has moved on: it replaces the Sparse Merkle Tree with an onchain withdrawal bitmap, makes Token-2022 the channel’s only token program, and changes the operator scripts and required secrets. Clients generated from main don’t match the code on these pages, so check out c9e2240 as shown below.

​Prerequisites

These are the versions commit c9e2240 pins:
  • Rust 1.91.0 (rust-toolchain.toml)
  • Solana CLI 3.1.13 (Agave, versions.env): sh -c "$(curl -sSfL https://release.anza.xyz/v3.1.13/install)"
  • Node.js 24 (the version the repository’s Dockerfile installs)
  • pnpm 10.15.1 (the repository’s packageManager field pins it): npm install -g pnpm@10.15.1

​Clone the Repository

​Generate TypeScript Clients

The TypeScript clients are not published to npm. They must be generated from the IDL using Codama.
Generated clients land in:
  • private-channel-escrow-program/clients/typescript/src/generated/
  • private-channel-withdraw-program/clients/typescript/src/generated/
Import from these local paths in your application; there is no @private-channels/client package on npm.

​Set Up Your Project

The code samples import @solana/kit and @solana-program/token from your own project, and the generated clients through a relative path (../private-channel-escrow-program/...). Create the project in a folder at the root of the cloned repository so those paths resolve:
Save a sample as a .ts file in app and run it with npx tsx <file>.ts. The generated clients are TypeScript with extensionless imports, so plain node can’t load them. type=module lets the samples use top-level await. The generated clients sit in a CommonJS package, so Node.js can’t see the names that generated/index.ts re-exports: the samples import each instruction from its own file, such as generated/instructions/deposit. A bundler such as Vite also accepts the shorter generated path.

​Connect to Devnet

Fund that address with devnet SOL from the Solana Faucet (solana airdrop no longer works on devnet), then check the balance:
  • Escrow Program ID: 9tgHa1DcnaSSUtmMsst8ovKTe1Gfxzezn27KnH9xXYeU
  • Withdraw Program ID: J231K9UEpS4y4KAPwGc4gsMNCjKFRMYcQBcjVW7vBhVi

​Next Steps

Deposit Tokens - make your first deposit