@alleyboss/ashborn-sdk
v2.3.5
Published
The Shadow Monarch SDK - Universal Privacy Layer for Solana with ZK proofs, stealth addresses, and selective disclosure
Maintainers
Readme
🌑 THE SHADOW ARSENAL
Ashborn is not just a relay. It is a complete privacy operating system for Solana.
1. ⚡ THE SHADOW RELAY (Network Privacy)
"The Monarch stands in front. The world sees only Him." Ashborn acts as a sovereign entity, wrapping your interactions with other protocols.
- PrivacyCash sees "Ashborn Relay".
- ShadowWire sees "Ashborn Relay".
- You remain a ghost.
2. 🤖 SHADOW AGENTS (Private AI Commerce)
"My soldiers trade in silence." Compute-to-Compute payments where neither AI reveals its strategy or wallet.
- AI Buyers pay for inference/data without exposing their treasury.
- AI Sellers receive funds without revealing their earnings.
3. 👻 SHADOW WIRE (Stealth Addresses)
"I am everywhere, yet nowhere."
Deterministic stealth addresses based on secp256k1 (Vitalik's formula).
- Generate infinite one-time deposit addresses from a single root key.
- mathematically unlinkable on-chain.
4. 🎭 SHADOW SEAL (ZK Compliance)
"Prove your power without revealing your face." Zero-Knowledge Range Proofs (Groth16) to satisfy requirements without doxxing.
- Prove "I have > 10 SOL" without revealing exact balance.
- Compatible with regulatory gateways (e.g. "User is not sanctioned").
💻 THE SHADOW Monarch (Usage)
"One interface to rule them all."
1. Initialize The Monarch
import { PrivacyRelay } from '@alleyboss/ashborn-sdk';
const monarch = new PrivacyRelay({
relayKeypair: process.env.RELAY_KEYPAIR, // Server-side sovereign identity
rpcUrl: 'https://api.mainnet-beta.solana.com'
});2. 🤖 SHADOW AGENT (Private Commerce)
AI Buyer pays an AI Seller anonymously.
// 1. Buyer shields funds (Network sees "Ashborn Relay")
const { note } = await monarch.shield({
amount: 10_000_000_000n, // 10 SOL
mint: SOL_MINT
});
// 2. Buyer pays Seller (Unlinkable transfer)
await monarch.transfer({
recipient: sellerStealthAddress,
amount: 5 // 5 SOL
});3. 👻 SHADOW WIRE (Stealth Addresses)
Generate infinite unlinkable deposit addresses.
import { ShadowWire } from '@alleyboss/ashborn-sdk/stealth';
// Sender generates a unique address for Recipient
// Only Recipient can derive the private key
const stealthAddress = await ShadowWire.deriveStealthAddress({
rootKey: recipientPublicKey,
ephemeralSecret: oneTimeSecret
});4. 🎭 SHADOW SEAL (ZK Compliance)
Prove solvency without doxxing. Real Groth16 proofs via snarkjs — not simulated.
// Generate real ZK range proof
// Returns { isReal: true, proofTime: 1234, proof: "..." }
const proofResult = await monarch.prove({
balance: 0.5, // Your actual balance (SOL)
min: 0.1, // Prove balance >= 0.1 SOL
max: 1.0 // Prove balance <= 1.0 SOL
});
// proofResult.isReal === true → Real Groth16 via snarkjs
// proofResult.proofTime → Generation time in ms5. 🌐 API USAGE (Server-Side)
Call SDK from your API routes — all ZK logic stays in SDK.
// In your Next.js API route (app/api/prove/route.ts)
import { PrivacyRelay } from '@alleyboss/ashborn-sdk';
export async function POST(req: Request) {
const { balance, min, max } = await req.json();
const relay = new PrivacyRelay({
relayKeypair: process.env.RELAY_KEYPAIR,
rpcUrl: 'https://api.devnet.solana.com'
});
// SDK handles everything — real snarkjs proof generation
const proofResult = await relay.prove({ balance, min, max });
return Response.json(proofResult);
}5. ☀️ UNSHIELD (Exit Shadows)
Withdraw to a clean public wallet.
// Relay handles the withdrawal. PrivacyCash sees "Ashborn Relay".
// Your destination wallet remains unconnected to the source.
await monarch.unshield({
amount: 2.5, // 2.5 SOL
recipient: "PublicWalletAddress123..."
});🔥 What Protocols See
| Protocol | Without Ashborn | With Shadow Relay |
|----------|-----------------|-------------------|
| PrivacyCash | Your wallet address | Ashborn Relay |
| ShadowWire | Your stealth meta | Ashborn Relay |
| Light Protocol | Your ZK identity | Ashborn Relay |
| x402 Micropay | Your agent wallet | Ashborn Relay |
| ZK Groth16 | N/A | Real snarkjs proof |
🛡️ Features
| Feature | Description |
|---------|-------------|
| Shadow Relay | Protocols see Ashborn, not you |
| K-Anonymity² | Hide in Ashborn pool + protocol pool |
| ECDH Stealth | Vitalik's formula: P = H(r*A)*G + B |
| ZK Compliance | Prove statements without revealing data |
| Ring Signatures | 4+ decoys per transfer |
📦 Modules
// Core
import { Ashborn, PrivacyRelay } from '@alleyboss/ashborn-sdk';
// Stealth (ECDH)
import { ShadowWire, generateDecoys } from '@alleyboss/ashborn-sdk/stealth';
// ZK Proofs
import { RangeCompliance } from '@alleyboss/ashborn-sdk/zk';
// Integrations
import { PrivacyCashOfficial, HeliusEnhanced } from '@alleyboss/ashborn-sdk/integrations';🔒 Security
- Non-Custodial: Ashborn is a RELAY. Funds transit through, never stored.
- Real ECDH: Uses @noble/curves for proper elliptic curve operations.
- Groth16 Proofs: Real ZK via snarkjs (not simulated).
- Metadata Stripped: IP, User-Agent removed at relay layer.
