Getting Started/Introduction

Introduction

Onyx SDK provides privacy-preserving stealth addresses for Solana. Send and receive SOL without revealing your identity on the blockchain.

What are Stealth Addresses?

A cryptographic technique that allows a sender to create a unique one-time address for each payment, making it impossible for outside observers to link payments to a recipient's public identity.

How It Works

1

Receiver generates a meta-address

A pair of public keys (spending + viewing) that can be shared publicly.

2

Sender creates a stealth payment

Uses the meta-address to derive a unique stealth address and ephemeral key.

3

Payment is sent

SOL is transferred to the stealth address. The ephemeral key is published.

4

Receiver scans and claims

Using their viewing key, the receiver detects payments and derives the spending key.

Quick Example

main.rs
rust
use onyx_sdk::prelude::*;

// Receiver: Generate and share meta-address
let meta = StealthMetaAddress::generate()?;
let public_meta = meta.to_public();
println!("Share this: {}", public_meta.encode());

// Sender: Create stealth payment
let payment = StealthPayment::create(&public_meta)?;
// Transfer SOL to payment.stealth_address
// Publish payment.ephemeral_pubkey

// Receiver: Scan and claim
let keypair = StealthKeypair::derive(&meta, &ephemeral_pubkey)?;
// Use keypair to spend from stealth_address

Features

  • One-time addresses - Each payment uses a unique address
  • Unlinkable - Observers cannot connect payments to your identity
  • Efficient scanning - On-chain registry for payment detection
  • Ed25519 compatible - Works with Solana's native key format