Build privacy-first Solana apps in 5 minutes
Styx Stack is a comprehensive privacy SDK for Solana. Build private payments, encrypted messaging, and token airdrops in minutes.
Send crypto via text/email. No wallet needed to claim!
200+ operations for private token management.
Private airdrops to 1M+ recipients.
Install the unified Styx Stack SDK:
npm install @styx-stack/sdk @solana/web3.jsOr individual packages:
npm install @styx-stack/sps-sdk @styx-stack/whisperdrop-sdkStyx SDK works in two modes:
No custom programs needed! Works on any Solana cluster immediately.
Uses Styx mainnet programs for advanced features.
✨ No wallet needed! Recipient gets a link to claim funds.
import { Resolv, LAMPORTS_PER_SOL } from '@styx-stack/sdk';
import { Connection, Keypair } from '@solana/web3.js';
const connection = new Connection('https://api.mainnet-beta.solana.com');
const resolv = new Resolv(connection);
// Your wallet
const sender = Keypair.fromSecretKey(/* your secret key */);
// Create claimable payment (0.1 SOL)
const { payment, link } = await resolv.createPayment({
sender,
amount: BigInt(0.1 * LAMPORTS_PER_SOL),
});
// Generate SMS message
const sms = resolv.generateSmsMessage(link, 'Alice');
console.log('📱 Send this SMS:', sms.body);
// "Hey! Alice sent you 0.1 SOL! Click to claim: https://..."
// Recipient clicks link → stealth wallet created → funds received!Send E2E encrypted messages with the Styx Program:
import { StyxClient } from '@styx-stack/sdk';
import { Connection, Keypair, PublicKey } from '@solana/web3.js';
const connection = new Connection('https://api.mainnet-beta.solana.com');
const styx = new StyxClient({ connection });
const sender = Keypair.fromSecretKey(/* your secret key */);
const recipient = new PublicKey('RECIPIENT_ADDRESS');
// Derive shared secret (ECDH)
const sharedSecret = deriveSharedSecret(senderPrivKey, recipientPubKey);
// Send encrypted message
const signature = await styx.messaging.sendPrivateMessage(
sender,
recipient,
'Hello, this message is encrypted!',
sharedSecret
);
console.log('✅ Private message sent:', signature);Launch a WhisperDrop campaign - recipient list stays private!
import { WhisperDropClient, buildMerkleTree } from '@styx-stack/sdk';
const whisperdrop = new WhisperDropClient(connection);
// Define recipients (kept completely private!)
const allocations = [
{ recipient: wallet1, amount: 100_000_000n, nonce: randomBytes(32) },
{ recipient: wallet2, amount: 200_000_000n, nonce: randomBytes(32) },
// Supports 1M+ recipients!
];
// Build Merkle tree - only root goes on-chain
const campaignId = generateCampaignId();
const { root, proofs } = buildMerkleTree(campaignId, allocations);
// Create campaign
const { campaignPDA } = await whisperdrop.initCampaign({
authority,
tokenMint,
campaignId,
merkleRoot: root,
expiryUnix: Date.now() / 1000 + 30 * 86400, // 30 days
});
// Share individual proofs privately with recipients
console.log('🎉 Airdrop created:', campaignPDA.toBase58());