Playground
This playground runs @specterpq/sdk in WebAssembly in your browser. Secret keys stay in your local session.
SDK Playground
Use the standalone playground route when you want the cleanest testing loop, and use the embedded version below when you want to stay inside the docs.
- Generate recipient spending and viewing keys
- Build a publishable meta-address
- Create a stealth payment announcement
- Scan announcements and verify matches
- Run editable SDK snippets in the code editor
The embedded playground below is an iframe pointed at the standalone Docusaurus-hosted app route, so it is easier to debug and deploy than an inline-script embed.
If the embedded playground feels cramped on a small screen, open /playground-app/ directly for the full experience.
Interactive API playground
Base URL: https://backend.specterpq.com
No setup required. Hit the live API and see stealth addresses in action.
Run these in order. Each step feeds into the next.
- Step 1: Generate keys
- Step 2: Create stealth payment
- Step 3: Publish announcement
- Step 4: Scan and discover
Generate a fresh hybrid identity — a secp256k1 spending keypair plus an ML-KEM-768 viewing keypair. This gives you everything needed to receive private payments.
curl -s -X POST https://backend.specterpq.com/api/v1/keys/generate \
| tee /tmp/specter-keys.json | jq '{meta_address: .meta_address[0:40], spending_pub: .spending_pub[0:40], viewing_pk: .viewing_pk[0:40]}' && echo "... (truncated, full keys saved to /tmp/specter-keys.json)"
Save the variables for the next steps:
META_ADDRESS=$(jq -r '.meta_address' /tmp/specter-keys.json)
VIEWING_SK=$(jq -r '.viewing_sk' /tmp/specter-keys.json)
SPENDING_PUB=$(jq -r '.spending_pub' /tmp/specter-keys.json)
Derive a one-time stealth address from the meta-address. This is what the sender does.
curl -s -X POST https://backend.specterpq.com/api/v1/stealth/create \
-H "Content-Type: application/json" \
-d "{\"meta_address\":\"$META_ADDRESS\"}" \
| tee /tmp/specter-create.json | jq .
Note the stealth_address in the response. That's where you'd send funds.
PAYMENT_ID=$(jq -r '.payment_id' /tmp/specter-create.json)
STEALTH_ADDRESS=$(jq -r '.stealth_address' /tmp/specter-create.json)
echo "Payment destination: $STEALTH_ADDRESS"
Post the announcement so the recipient can find the payment later.
curl -s -X POST https://backend.specterpq.com/api/v1/registry/announcements \
-H "Content-Type: application/json" \
-d "{
\"payment_id\":\"$PAYMENT_ID\",
\"tx_hash\":\"0x1111111111111111111111111111111111111111111111111111111111111111\",
\"amount\":\"0.01\",
\"chain\":\"ethereum\"
}" | jq .
Now scan with the recipient's keys to find the payment.
curl -s -X POST https://backend.specterpq.com/api/v1/stealth/scan \
-H "Content-Type: application/json" \
-d "{
\"viewing_sk\":\"$VIEWING_SK\",
\"spending_pub\":\"$SPENDING_PUB\"
}" | jq .
You should see one discovery with the same stealth_address from step 2, plus a shared_secret you combine with your spending secret key locally to derive the spendable key.
The scan is spend-key-free — it takes only viewing_sk + spending_pub and never returns private keys. Still treat viewing_sk and each shared_secret as secret material.
Multi-language examples
Here's how the core flow looks in different languages:
- cURL
- JavaScript
- Python
# Generate keys
curl -s -X POST https://backend.specterpq.com/api/v1/keys/generate | jq .
# Create stealth payment
curl -s -X POST https://backend.specterpq.com/api/v1/stealth/create \
-H "Content-Type: application/json" \
-d '{"meta_address":"<META_ADDRESS_HEX>"}' | jq .
// Generate keys
const keys = await fetch("https://backend.specterpq.com/api/v1/keys/generate", {
method: "POST"
}).then(r => r.json());
// Create stealth payment
const payment = await fetch("https://backend.specterpq.com/api/v1/stealth/create", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ meta_address: keys.meta_address })
}).then(r => r.json());
console.log("Stealth address:", payment.stealth_address);
import requests
# Generate keys
keys = requests.post("https://backend.specterpq.com/api/v1/keys/generate").json()
# Create stealth payment
payment = requests.post(
"https://backend.specterpq.com/api/v1/stealth/create",
json={"meta_address": keys["meta_address"]}
).json()
print(f"Stealth address: {payment['stealth_address']}")
Quick health check
Make sure the backend is alive:
curl -s https://backend.specterpq.com/health | jq .
Questions? Email pranshurastogi3196@gmail.com or reach out on X @specter_PQ.