Back to docs

SDK Documentation

TypeScript & Kotlin SDKs for Styx Protocol

Installation

npm / pnpm / yarn

npm install @styx-stack/pmp-sdk @styx-stack/whisperdrop-sdk

PMP - Private Memo Program

View on Solscan

Program ID: GhSTPRZFBnWXMjt6xFnpY2ZHFwijFoC44KkxXSEC94X9

Fee: 0.001 SOL per instruction

19 Instruction Types

3Private Message

End-to-end encrypted message

4Routed Message

Multi-hop onion routing

5Private Transfer

SOL with hidden amount

7Ratchet Message

Forward-secret (Double Ratchet)

8Compliance Reveal

Auditor disclosure

9Proposal

DAO proposal inscription

10Private Vote

Anonymous voting

11VTA Transfer

Virtual token balance

12Referral Register

Register referral

13Referral Claim

Claim rewards

14Hashlock Commit

Atomic swap

15Hashlock Reveal

Execute swap

16Conditional Commit

Smart contract lite

17Batch Settle

Rollup settlement

18State Channel Open

Open channel

19State Channel Close

Close channel

20Time Capsule

Time-locked message

21Ghost PDA

ZK proof via PDA

22CPI Inscribe

Cross-program inscription

Quick Start - Private Message

import { Connection, Keypair, PublicKey } from '@solana/web3.js';
import { StyxPMP, encryptMessage, generateKeyPair } from '@styx-stack/pmp-sdk';

const connection = new Connection('https://api.mainnet-beta.solana.com');
const pmp = new StyxPMP(connection);

// Generate encryption keys (X25519)
const senderKeys = generateKeyPair();
const recipientPubKey = new PublicKey('...');

// Encrypt and send message
const encrypted = encryptMessage(
  'Hello, this is private!',
  senderKeys.secretKey,
  recipientPubKey
);

const sig = await pmp.sendPrivateMessage(
  senderWallet,
  recipientPubKey,
  encrypted,
  { stealth: true }
);

console.log('Message sent:', sig);

WhisperDrop - Private Airdrops

View on Solscan

Program ID: GhstFNnEbixAGQgLnWg1nWetJQgGfSUMhnxdBA6hWu5e

Init Fee: 0.01 SOL |Claim Fee: 0.0005 SOL

9 Token Gate Types

0None

Open claiming

1SplTokenHolder

Hold any SPL amount

2SplMinBalance

Hold minimum SPL

3Token22Holder

Hold Token-2022

4Token22MinBalance

Min Token-2022 balance

5NftHolder

Hold specific NFT

6NftCollection

Hold collection NFT

7CnftHolder

Hold cNFT

8CnftCollection

Hold cNFT collection

Quick Start - Create Airdrop

import { 
  WhisperDrop, 
  buildMerkleTree, 
  generateCampaignId,
  GateType 
} from '@styx-stack/whisperdrop-sdk';

const connection = new Connection('https://api.mainnet-beta.solana.com');
const whisperdrop = new WhisperDrop(connection);

// Prepare recipients
const allocations = [
  { recipient: new PublicKey('...'), amount: 100_000_000n, nonce: generateNonce() },
  { recipient: new PublicKey('...'), amount: 200_000_000n, nonce: generateNonce() },
];

// Build Merkle tree
const campaignId = generateCampaignId();
const { root, proofs } = buildMerkleTree(campaignId, allocations);

// Create campaign (0.01 SOL fee)
const { campaignPDA, escrowPDA } = await whisperdrop.initCampaign(
  authority,
  tokenMint,
  {
    campaignId,
    merkleRoot: root,
    expiryUnix: BigInt(Date.now() / 1000 + 86400 * 30), // 30 days
    gateType: GateType.NftCollection,  // Optional: require NFT
    gateMint: collectionMint,
  }
);

console.log('Campaign created:', campaignPDA.toBase58());

Protocol Fees

OperationFee (SOL)Fee (Lamports)
PMP Instructions (all 19 types)0.0011,000,000
WhisperDrop Init Campaign0.0110,000,000
WhisperDrop Claim0.0005500,000
WhisperDrop ReclaimFREE0

Treasury: 13xnC9kDksJMBE9FYVW1S7dukLjRDgrh4Dzm6eq5moon

Resources