Back to docs

Styx Stack Solana SDK

Private tokens, Signal-style messaging, and zero-rent compression for Solana

Installation

# Full privacy SDK
npm install @styxstack/sdk

# Individual packages
npm install @styxstack/sps-sdk      # Privacy-native tokens & DeFi
npm install @styxstack/sts-sdk      # Event-sourced token standard
npm install @styxstack/app-kit      # React/React Native components
npm install @styxstack/whisperdrop-sdk  # Private airdrops

Quick Start

import { SpsClient, DOMAIN_STS, sts } from '@styxstack/sps-sdk';
import { Connection, Keypair } from '@solana/web3.js';

const connection = new Connection('https://mainnet.helius-rpc.com/?api-key=YOUR_KEY');
const wallet = Keypair.fromSecretKey(/* your key */);

const client = new SpsClient(connection, wallet, { network: 'mainnet' });

// Transfer private tokens
const { signature } = await client.transfer({
  mintId: 'TOKEN_MINT_ID',
  amount: 1000000n,
  recipient: recipientPubkey,
});

SDK Packages

@styxstack/sdk

Complete privacy SDK

@styxstack/sps-sdk

Privacy Standard SDK

@styxstack/sts-sdk

Token Standard SDK

@styxstack/app-kit

React/React Native components

@styxstack/whisperdrop-sdk

Private Airdrops

🔐 Private Tokens (STS Domain 0x01)

Zero-rent inscription tokens with native privacy. Create fungible tokens, NFTs, or semi-fungibles.

// Create token (fungible, NFT, or semi-fungible)
await client.createMint({
  name: 'My Token',
  symbol: 'MTK',
  decimals: 9,
  mintType: 0,    // 0=Fungible, 1=NFT, 2=SemiFungible
  backingType: 0, // 0=Native, 1=SplBacked, 2=Hybrid
  privacyMode: 0, // 0=Private, 1=Transparent, 2=Optional
});

// Shielded transfer (hidden amounts)
await client.shieldedTransfer({
  mintId,
  amount: 1000000n,
  recipient,
  memo: 'Private payment',
});

// Shield SPL tokens → private SPS notes
await client.shield({
  splMint: tokenMintPubkey,
  amount: 1000000n,
  commitment: generateCommitment(viewingKey),
});

// Unshield → back to SPL tokens
await client.unshield({
  nullifier,
  amount: 1000000n,
  recipient: walletPubkey,
});

Three Token Models

Native STS

Domain 0x01 - Pure inscription, zero accounts

IC Compression

Domain 0x0F - Light Protocol-style Merkle trees

DAM Materialize

Domain 0x0E - Virtual ↔ Real bidirectional

Domains Reference

IDDomainDescription
0x01STSToken Standard (fungible, NFT, semi-fungible)
0x02MESSAGINGSignal-style encrypted messaging
0x03ACCOUNTVirtual Token Accounts, delegation
0x04VSLVirtual Shielded Ledger
0x05NOTESUTXO notes and Merkle trees
0x07PRIVACYDecoys, ephemeral, shadow
0x08DEFISwaps, pools, staking
0x09NFTMarketplace (list, bid, buy)
0x0DGOVERNANCEPrivate voting
0x0EDAMDeferred Account Materialization
0x0FICInscription Compression

Kotlin (Android)

import com.styx.appkit.StyxAppKit
import com.styx.appkit.messaging.PrivateMessaging

class ChatViewModel : ViewModel() {
    private val styx = StyxAppKit.create(Network.MAINNET, rpcUrl)
    
    suspend fun sendMessage(to: String, content: String) {
        styx.messaging.send(to, content.toByteArray())
    }
    
    fun onMessageReceived(handler: (PrivateMessage) -> Unit) {
        styx.messaging.subscribe(handler)
    }
}

Program IDs

MainnetView
GhSTPRZFBnWXMjt6xFnpY2ZHFwijFoC44KkxXSEC94X9
DevnetFehhtvqDUQrhDnnVVw4mvkwpgXa1CaQf6QytkysuGQeW

🔐 Security

  • E2E Encryption: X25519 + XChaCha20-Poly1305
  • Forward Secrecy: Double Ratchet protocol
  • Zero-Knowledge: Nullifier-based double-spend protection
  • No Trusted Setup: Unlike zk-SNARKs, no ceremony required

Ready to Build?

Get your API keys and start building private Solana apps today.