@rkmonarch/slogan
v0.1.2
Published
Dual-Key Stealth Address Protocol (DKSAP) for Solana — Ed25519 / X25519
Maintainers
Readme
@rkmonarch/slogan
Privacy primitives for Solana built around dual-key stealth addresses and a same-denomination CoinJoin-style mixer.
This SDK provides:
- stealth meta-address generation
- one-time stealth address derivation for senders
- memo-based stealth payment discovery for recipients
- claim key derivation and SOL/token sweep helpers
- a same-denomination mixer model for coordinated output shuffling
Install
npm install @rkmonarch/sloganWhat Problem It Solves
On Solana, a normal wallet address is a permanent surveillance anchor. Once a user shares it, every inbound payment is easy to cluster, monitor, and analyze. SLOGAN replaces that with a dual-key stealth model:
- the recipient publishes one
metaAddress - every sender derives a different one-time Solana destination
- the sender announces an ephemeral public key in the memo
- the recipient scans memo announcements to detect matching payments
- the recipient later derives the claim signer and sweeps funds out
This separates:
- discovery authority:
viewingPrivateKey - spending authority:
spendingPrivateKey
Core Concepts
Stealth Meta-Address
The recipient generates two keypairs:
- viewing keypair
- spending keypair
The public halves are encoded into a shareable st1:... meta-address.
Sender Flow
Given a recipient meta-address:
- derive a fresh one-time stealth address
- send SOL/tokens to that address
- attach the ephemeral public key to the same transaction memo
Receiver Scan Flow
Given:
- ephemeral public key from memo
- viewing private key
- spending public key
the receiver can recompute the expected stealth address and check whether a payment belongs to them.
Receiver Claim Flow
Given:
- ephemeral public key
- viewing private key
- spending private key
the receiver can derive the full stealth signer and sweep funds out of the stealth address.
Main Exports
Stealth address APIs
generateStealthMetaAddressencodeMetaAddressdecodeMetaAddressderiveStealthAddresscheckStealthAddressclaimStealthAddressbuildEphemeralAnnounceMemoparseEphemeralFromMemocreateStealthTransferTransactionscanForPaymentstransferSOLFromStealthtransferTokenFromStealth
Mixer APIs
MixPoolcoordinateMixverifyMixTransactiongenerateFreshOutputKeypairDENOMINATIONS_LAMPORTSMIN_PARTICIPANTS
Basic Usage
1. Generate a recipient meta-address
import { generateStealthMetaAddress } from '@rkmonarch/slogan';
const keys = generateStealthMetaAddress();
console.log(keys.metaAddress);
console.log(Buffer.from(keys.viewingPrivateKey).toString('hex'));
console.log(Buffer.from(keys.spendingPrivateKey).toString('hex'));2. Derive a one-time destination as a sender
import { deriveStealthAddress } from '@rkmonarch/slogan';
const { stealthAddress, ephemeralPublicKey } = deriveStealthAddress(recipientMetaAddress);Send funds to:
stealthAddress
Attach in memo:
ephemeralPublicKey
3. Scan for a payment as a receiver
import { checkStealthAddress } from '@rkmonarch/slogan';
const result = checkStealthAddress(
ephemeralPublicKey,
viewingPrivateKey,
spendingPublicKey,
);
console.log(result.stealthAddress);Important:
- scan uses the
spending public key - scan does not use the
spending private key
4. Claim and sweep a funded stealth address
import {
claimStealthAddress,
transferSOLFromStealth,
} from '@rkmonarch/slogan';
const claimKeys = claimStealthAddress(
ephemeralPublicKey,
viewingPrivateKey,
spendingPrivateKey,
);
const txSig = await transferSOLFromStealth({
connection,
claimKeys,
destination: destinationWallet,
lamports: 'max',
});Important:
- claim uses the
spending private key - claim is the spend-capable path
Examples
The SDK ships with examples in examples/:
derive-address.tsSender-side example that derives a one-time stealth address and optional memo announcement.send.tsBuilds and sends a stealth payment transaction.receive.tsGenerates keys, derives a receive address, scans memo announcements, and claims payments.claim.tsDerives the stealth signer from the memo key and sweeps SOL out.mix.tsDemonstrates a full stealth-address + CoinJoin-style privacy pipeline.
Run examples with:
npx ts-node examples/derive-address.ts
npx ts-node examples/send.ts
npx ts-node examples/receive.ts
npx ts-node examples/claim.ts
npx ts-node examples/mix.tsEnvironment
Examples expect:
SOLANA_RPC_URL=https://your-solana-rpcSome examples also optionally use:
FUNDER_PRIVATE_KEY=...
STEALTH_VIEWING_KEY=...
STEALTH_SPENDING_KEY=...Notes On Privacy
This SDK improves privacy, but it does not create absolute anonymity.
Stealth addresses help protect:
- recipient reuse
- balance visibility tied to one public address
- straightforward inbound payment clustering
The mixer model helps reduce:
- amount-based heuristics
- naive input-output tracing
- output-order matching
But privacy still depends on user behavior, timing, counterparty patterns, and the strength of the surrounding operational setup.
Security Notes
- never share
spendingPrivateKey - never log private keys in production
- treat
viewingPrivateKeyas sensitive even though it is view-only - use a trusted Solana RPC provider
- do not market the mixer example as production-grade anonymity infrastructure
License
MIT
