Skip to content

About

StealthPay is a Solana-based privacy payment protocol that uses stealth addresses and relayer-sponsored transactions to enable private, gasless transfers. Recipients publish a meta-address, senders generate one-time destination addresses, and relayers handle transaction fees and broadcasting behind the scenes.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

StealthPay

Rust Tokio Axum Solana Next.js TypeScript

A privacy-focused payment protocol for Solana that combines stealth addresses, transaction relaying, and gas abstraction to enable private transfers without exposing a recipient's primary wallet address on-chain.

StealthPay allows recipients to publish a reusable meta-address while senders generate unique one-time destination addresses for every payment. A relayer infrastructure handles transaction broadcasting and fee sponsorship, creating a smoother and more private payment experience.


Generate Privacy Handle

Example:

Deposit

What It Does

Traditional Solana payments expose a recipient's public wallet address.

StealthPay introduces a privacy layer where:

  • Recipients generate a Meta Address
  • Senders derive a unique one-time Stealth Address
  • Every payment goes to a different destination address
  • Recipients can recover ownership of the funds
  • Relayers can sponsor transaction fees
Recipient  ->  Meta Address  ->  Sender   ->  Stealth Address Generation   ->  Relayer   ->  Solana Network

Motivation

Most blockchain transactions are fully transparent.

Anyone can:

  • Track wallet balances
  • Link multiple transactions together
  • Monitor payment activity
  • Build transaction histories

StealthPay reduces wallet traceability by generating a unique destination address for every payment while preserving the recipient's ability to recover and spend the funds.


Features

Stealth Address Generation

Recipients create a Meta Address consisting of:

Public View Key
Public Spend Key

Senders use the Meta Address and an ephemeral keypair to derive a unique destination address.

Meta Address
      +
Ephemeral Key
      ↓
Stealth Address

Every transfer results in a different address.


ECDH-Based Shared Secret Derivation

The protocol uses Elliptic Curve Diffie-Hellman (ECDH) over Curve25519.

Sender:
r × A

Recipient:
a × R

Both parties derive the same shared secret independently.


One-Time Payment Addresses

Each payment generates:

R = Ephemeral Public Key
P = Stealth Public Key

Result:

Payment 1 → Address A
Payment 2 → Address B
Payment 3 → Address C

Even when sent to the same recipient.


Memo-Based Key Discovery

The sender publishes the ephemeral public key inside a Solana Memo instruction.

Recipients scan transaction memos to discover stealth payments intended for them.

Transaction
    ├── Transfer
    └── Memo (Ephemeral Public Key)

Relayer Infrastructure

A relayer service validates transactions before broadcasting them.

Responsibilities include:

  • Transaction validation
  • Fee payment verification
  • Fee sponsorship
  • Transaction broadcasting
User
  │
  ▼
Relayer
  │
  ▼
Solana

Payment Detection

Recipients can scan transactions and determine whether a payment belongs to them.

The detection flow:

Read Memo   ->  Recover Ephemeral Key   ->  Derive Shared Secret   ->   Reconstruct Expected Address   ->  Match Found

Architecture

Frontend (Next.js)   ->  Axum API   ->  Stealth Engine   ->  Relayer    ->  Solana

Backend Endpoints

Health Check

GET /health

Returns:

{
  "status": "ok"
}

Create Meta Address

POST /meta-address/create

Generates a new recipient meta-address.


Send Stealth Payment

POST /send

Builds a stealth transaction from a recipient's meta-address.


Relay Transaction

POST /relay

Validates and broadcasts transactions through the relayer.


Scan Payments

GET /payments

Scans transactions for stealth payments intended for a recipient.


Tech Stack

Backend

  • Rust
  • Tokio
  • Axum
  • Curve25519-Dalek
  • Solana SDK
  • Serde

Frontend

  • Next.js
  • React
  • TypeScript
  • Tailwind CSS

Cryptography

  • Curve25519
  • ECDH
  • BLAKE3
  • SHA-256

Project Structure

stealthpay/
│
├── backend/
│   ├── src/
│   │   ├── routes/
│   │   ├── stealth/
│   │   ├── relayer/
│   │   └── main.rs
│   │
│   └── Cargo.toml
│
├── frontend/
│   ├── src/
│   ├── app/
│   ├── components/
│   └── package.json
│
└── README.md

Running the Project

Clone Repository

git clone https://github.com/your-username/stealthpay.git

cd stealthpay

Start Backend

cd backend

cargo build

cargo run

Backend starts on:

http://localhost:8080

Start Frontend

cd frontend

pnpm install

pnpm run dev

Frontend starts on:

http://localhost:3000

Local Development

Run both services:

Frontend → http://localhost:3000

Backend  → http://localhost:8080

The frontend communicates with the backend through HTTP API endpoints.


Current Status

Completed

  • Stealth address generation
  • Meta address generation
  • ECDH shared secret derivation
  • Memo-based ephemeral key publication
  • Payment detection logic
  • Relayer validation architecture
  • Axum backend
  • Next.js frontend

In Progress

  • Transaction fee sponsorship
  • Full relayer signing flow
  • Wallet integration
  • Automated stealth payment scanning

Future Improvements

  • MPC-based relayer signing
  • Secure enclave integration
  • Sponsored gas payments
  • Multi-relayer architecture
  • Wallet adapter integration
  • Mobile support
  • Encrypted payment metadata
  • Payment notifications

License

MIT License


Built with Rust, Solana, and an unreasonable amount of time spent convincing cryptography and frontend tooling to coexist peacefully.

About

StealthPay is a Solana-based privacy payment protocol that uses stealth addresses and relayer-sponsored transactions to enable private, gasless transfers. Recipients publish a meta-address, senders generate one-time destination addresses, and relayers handle transaction fees and broadcasting behind the scenes.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages