SPECTER logo
SPECTER SDK
POST-QUANTUM STEALTH ADDRESSES
☆ STAR @specterpq/sdk
WASM · IN-BROWSER

Interactive
Playground

Generate ML-KEM-768 stealth addresses, create payments, and scan announcements — all cryptography runs locally in WebAssembly. No keys leave your browser.

SDK INIT
→
KEY GEN
→
META ADDR
→
PAYMENT
→
SCAN
◈ Initializing WASM module...
LOADING
01
Generate recipient keys
RECIPIENT ▼

Generate an ML-KEM-768 keypair for spending and viewing. Secret keys stay in memory and are redacted from serialization. Click generate to create fresh keys.

const keys = generateSpecterKeys(); // → { spending: { publicKey, secretKey }, viewing: { publicKey, secretKey } }
spending.publicKey
—
viewing.publicKey
—
spending.secretKey
—
02
Build meta-address
RECIPIENT ▼

Combine spending + viewing public keys into a canonical meta-address hex. Recipients publish this (e.g. on-chain or via ENS) so senders can derive unique stealth addresses.

const meta = metaAddressFromPublicKeys( keys.spending.publicKey, keys.viewing.publicKey, { description: 'Alice' } ); // meta.hex — 1218 bytes, publishable
meta.hex (publishable)
—
meta.bytes.length
—
03
Create stealth payment
SENDER ▼

The sender takes a recipient's meta-address and calls createStealthPayment. This performs ML-KEM-768 encapsulation, derives unique stealth addresses for ETH and Sui, and produces a compact announcement.

const payment = createStealthPayment(meta.hex); // → { ephemeralCiphertext, viewTag, ethAddress, suiAddress }

Or paste a meta-address hex from elsewhere:

ephemeralCiphertext (announce this)
—
viewTag
—
ethAddress
—
suiAddress
—
04
Scan announcement
RECIPIENT ▼

Recipient decapsulates the ephemeral ciphertext using their viewing secret key, checks the view-tag (1-byte filter), and if matched, derives the spendable stealth keys.

const result = scanAnnouncement( { ephemeralCiphertext, viewTag }, recipient.viewing, recipient.spending.publicKey, recipient.spending.secretKey, // spend key → derives stealthKeys ); if (result.isMatch) { // result.stealthKeys.ethPrivateKey → import into viem / ethers }

Paste announcement fields below (auto-filled from step 3 if you ran it above):

TAMPER TEST

Modify the announcement only for this scan to verify that SPECTER rejects tampered data.

stealthKeys.ethAddress
—
stealthKeys.suiAddress
—
stealthKeys.ethPrivateKey
—
BATCH SCAN TEST

Generate decoy announcements and scan them with scanAnnouncements().

Ctrl+Enter or ⌘+Enter to run
CONSOLE OUTPUT
Output will appear here after running your code…
AVAILABLE GLOBALS
initSpecterSdk generateSpecterKeys generateKeysLocal metaAddressFromPublicKeys parseMetaAddress encapsulate decapsulate computeViewTag verifyViewTag deriveStealthAddress deriveStealthSuiAddress deriveStealthPublic deriveStealthKeys createStealthPayment scanAnnouncement scanAnnouncements sealAnnouncementMetadata openAnnouncementMetadata encodeAnnouncementMetadata decodeAnnouncementMetadata encryptAnnouncementMetadata decryptAnnouncementMetadata KYBER_PUBLIC_KEY_SIZE KYBER_CIPHERTEXT_SIZE PROTOCOL_VERSION PLAINTEXT_METADATA_SIZE ENCRYPTED_METADATA_SIZE METADATA_TX_HASH_SIZE METADATA_AMOUNT_SIZE METADATA_SOURCE_CHAIN_ID_SIZE