Skip to main content
For the complete documentation index, see llms.txt.
Built on the shoulders of giants - Special thanks to Umbra Cash for pioneering stealth payment infrastructure.

What You’ll Build

The @shakesco/private SDK lets you implement truly private crypto transactions. No one except the sender and receiver can link the payment to the recipient’s known address.

How It Works

Deep dive into stealth address cryptography

EIP-5564 Standard

Read the official Ethereum proposal

Installation

Import the SDK components:
Security Note: This implementation assumes a single private key secures your wallet and that you’re signing the same message hash. Multi-sig or threshold signatures require a different approach.

Complete Integration Workflow

Step 1: Check for Existing Stealth Keys

Before sending private transactions, verify if the recipient has registered stealth keys in the Umbra registry:
Spending Keys (spendingPublicKey)
  • Used to generate stealth addresses where funds are sent
  • Only the recipient can derive the private key to spend from these addresses
Viewing Keys (viewingPublicKey)
  • Allow scanning for incoming private transactions
  • Can detect payments without exposing spending ability
  • Safe to use for monitoring wallets
This separation means you can check for payments without risking your funds.

Step 2: Register Stealth Keys

If the user hasn’t registered, you’ll need to generate and register their key pairs.
For account abstraction wallets, register via a contract call:
Then execute the registration via your smart wallet:
Storing the viewingKeyPair.privateKeyHex for users is acceptable - it only enables transaction scanning, not spending. This lets you build features like automatic payment detection.

Step 3: Generate Stealth Address for Payment

Ready to send a private transaction? Generate a one-time stealth address:
1

Send funds to the stealth address

Transfer crypto to stealthKeyPair.address - this is a brand new address only the recipient can control
2

Publish announcement data

The recipient needs pubKeyXCoordinate and encrypted.ciphertext to prove ownership and spend the funds

Step 4: Announce the Payment

Critical: Without the announcement data, the recipient cannot access their funds!
Emit this event from your private transaction contract:
Recipients scan the blockchain for Announcement events. Use indexing services for efficient scanning:
  • The Graph - Decentralized indexing protocol
  • Moralis - Web3 data APIs
  • Custom indexer - Query RPC nodes directly (slower)
These services let recipients quickly find all announcements directed to their registered keys.

Step 5: Scan for Incoming Funds

Recipients check if an announcement belongs to them:

Step 6: Spend the Private Funds

Once you’ve confirmed funds belong to you, derive the private key to spend them:

What’s Next?

While stealth addresses provide strong privacy today, zero-knowledge proofs will eventually offer even better solutions. Until then, stealth payments are the best way to bring privacy to Ethereum transactions.

Additional Resources

Umbra Protocol Docs

Learn from the pioneers of stealth payments

EIP-5564 Discussion

Join the Ethereum community conversation

GitHub Repository

View source code and contribute