Skip to main content
Solana programs (smart contracts) for stealth address operations, written in Rust with the Anchor framework.

Program Set


wraith-announcer

Emits announcement events via Anchor’s emit!() macro. Stateless — no on-chain storage.

Instruction

Accounts

Event

Usage


wraith-sender

Atomic SOL or SPL token transfer + announcement in one instruction. Sends funds to the stealth address and emits an announcement event.

Instructions

send_sol

Transfer SOL to a stealth address and emit an announcement.
Accounts:

send_spl

Transfer SPL tokens to a stealth address’s associated token account and emit an announcement.
Accounts:

Usage


wraith-names

PDA-based name to meta-address mapping. Names are stored in Program Derived Addresses (PDAs) seeded by ["name", nameBytes].

Instructions

register

Register a new .wraith name.

update

Update the meta-address for a name you own.

release

Release a name. Closes the PDA account and returns rent to the owner.

resolve

Look up a name’s meta-address. Read-only.

Account Structure

PDA Derivation

Name records are stored at PDAs derived from the name:
This means names are globally unique and can be resolved without knowing the owner.

Validation

  • Name: 3-32 characters, lowercase alphanumeric and hyphens only
  • Meta-address: must be exactly 64 bytes (two 32-byte ed25519 public keys)
  • Only the owner can update or release a name

Error Codes

Usage


Project Structure

Deployment

Build

Deploy to Devnet

Test

Tests cover:
  • wraith-announcer — event emission, multiple callers, metadata preservation
  • wraith-sendersend_sol transfers + emits, send_spl token transfer + emits, insufficient funds rejection
  • wraith-names — register/resolve, name validation (too short, invalid chars), update by owner, update by non-owner (rejected), release and re-register

Differences from EVM and Stellar Contracts