anon0mesh - P2P mesh offline messaging over Bluetooth Low Energy & confidential transactions using
Arcium
Lightweight peer-to-peer mesh networking for mobile devices. anon0mesh combines BLE (Central + Peripheral), a compact packet format
cryptographic messaging to enable local mesh messaging and simple Solana transaction relay for constrained environments. (Soon with Meshtastic full on integration!)
NEW: First stealth address implementation for Solana blockchain - enabling offline, unlinkable payments via BLE mesh with zero on-chain correlation between sender and receiver.
This repository contains an Expo + React Native app (TypeScript) that demonstrates the mesh stack and provides utilities, examples, and tools to develop and test the stack on Android and iOS devices.
- Install dependencies
npm install
# or using pnpm (preferred in this repo): pnpm install- Start the Metro/Expo server
npx expo start- Run on device/emulator
- Use a development build, Android emulator, or iOS simulator as shown in the Expo output.
- For BLE testing use a real device (recommended). Android often requires granting runtime Bluetooth permissions.
app/— File-based routes and screens (Expo Router). Primary app UI lives here.app/wallet/stealth.tsx— Stealth Wallet UI with QR sharing, Shield/Unshield, activity feed
src/— Application logic, polyfills, background workers, networking, and domain code.src/infrastructure/ble/— BLEAdapter, central+peripheral glue, packet serialization.src/domain/— Entities and value objects (Packet, Peer, PeerId).src/polyfills.ts— Solana & polyfills (includes tweetnacl PRNG config)
lib/— Core library moduleslib/stealth/— Stealth address implementation (see Architecture section below)
hooks/— Custom React hookshooks/useStealthWallet.ts— React hook for stealth wallet operations- Other hooks:
useBLESend, wallet hooks, chat hooks, etc.
components/— Reusable UI, examples and test screens.patches/—patch-packagepatches applied on install (used for Android SDK compatibility)
- Dual-mode BLE (Central + Peripheral) using
@magicred1/ble-meshpackage forked fromkard-network-ble-mesh. - Compact Packet entity + wire format with TTL support.
- Packet send/receive abstractions:
writePacket,notifyPacket,broadcastPacket. - Example hook:
useBLESendto send arbitraryUint8Arraypayloads.
First stealth address implementation for Solana blockchain
-
Stealth Addresses: EIP-5564 adapted for ed25519/Solana
- One-time addresses with zero on-chain sender/receiver linkage
- Meta-address format:
stealth:1:<spending_pk>:<viewing_pk> - Separate spending and viewing key hierarchy
-
Post-Quantum Hybrid Mode: X25519 + ML-KEM 768 (NIST FIPS 203)
- 66% faster scanning per arxiv.org/abs/2501.13733
- Meta-address format:
stealth:2:<spending>:<viewing>:<kyber> - Future-proof against quantum adversaries
-
Offline BLE Mesh Payments
- Send stealth payments via BLE mesh (no internet required)
- Store-and-forward queue with automatic settlement when online
- NetInfo connectivity monitoring
- Payment status tracking (queued → settling → settled)
-
Shield & Unshield Operations
- Shield: Move SOL from main wallet to stealth addresses
- Unshield: Consolidate stealth payments back to main wallet
- Break transaction graph linkage for privacy
📖 Complete Stealth Transfers Documentation
- Android requires runtime permissions:
BLUETOOTH_SCAN,BLUETOOTH_CONNECT,BLUETOOTH_ADVERTISEandACCESS_FINE_LOCATIONwhen scanning/advertising. - Advertising payloads are limited to ~31 bytes — service UUID + device name only (we avoid adding large service data by default).
- For robust testing use two physical devices (one advertising, one scanning/connecting). Dual-mode (scan + advertise) is supported.
Common scripts (check package.json):
# install deps
pnpm install
# start expo
pnpm run start # runs `expo start`
# run TypeScript check
pnpm run typecheck # runs tsc --noEmit
# reset project helper
pnpm run reset-project- Open the
BLETestScreenin the app (look undercomponents/orapp/routes). - Ensure permissions are granted on Android (the app requests them, but confirm in Settings if needed).
- Use
nRF ConnectorLightBlueon a second device to validate advertising/characteristics.
┌─────────────────────────────────────────────────────────────┐
│ React Native App │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────────────┐ │
│ │StealthWallet│ │ MeshChat │ │ WalletView │ │
│ └──────┬──────┘ └──────┬──────┘ └──────────┬──────────┘ │
│ │ │ │ │
│ ┌──────┴────────────────┴─────────────────────┴──────────┐ │
│ │ useStealthWallet / useBLEMesh Hooks │ │
│ └──────────────────────────┬──────────────────────────────┘ │
└─────────────────────────────┼────────────────────────────────┘
│
┌─────────────────────────────┼────────────────────────────────┐
│ Stealth Core Library │
│ ┌──────────────────────────┴──────────────────────────────┐ │
│ │ StealthWalletManager (Coordinator) │ │
│ └──────────────────────────┬──────────────────────────────┘ │
│ ┌───────────────────┼───────────────────┐ │
│ ▼ ▼ ▼ │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────────┐ │
│ │ StealthKey │ │ AddressGen │ │ PaymentQueue │ │
│ │ Pair │ │ & Scanner │ │ & Settlement │ │
│ └──────┬──────┘ └──────┬───────┘ └────────┬────────┘ │
│ │ │ │ │
│ ┌──────┴──────────────────┴─────────────────────┴────────┐ │
│ │ Crypto & Mesh Integration │ │
│ │ StealthCrypto │ HybridStealth │ BLEMeshHandler │ │
│ └──────────────────────────┬──────────────────────────────┘ │
└─────────────────────────────┼────────────────────────────────┘
│
┌─────────┴─────────┐
│ Solana Blockchain │
│ + BLE Mesh Network │
└────────────────────┘
Core Cryptography:
lib/stealth/StealthCrypto.ts- Low-level primitives (ECDH, point ops, hashing)lib/stealth/StealthKeyPair.ts- Meta-address generation & key managementlib/stealth/StealthAddressGenerator.ts- Sender-side stealth address derivationlib/stealth/StealthScanner.ts- Receiver-side blockchain scanning with viewing tagslib/stealth/HybridStealth.ts- Post-quantum hybrid mode (X25519 + ML-KEM 768)
Application Layer:
lib/stealth/StealthWalletManager.ts- High-level wallet operations APIlib/stealth/StealthPaymentQueue.ts- Offline queue with auto-settlementlib/stealth/BLEMeshStealthHandler.ts- BLE mesh integration for offline payments
UI & Hooks:
hooks/useStealthWallet.ts- React hook for stealth wallet state & operationsapp/wallet/stealth.tsx- Complete stealth wallet screen with QR, Shield/Unshield
| Component | Security Measure |
|---|---|
| Key Storage | Expo SecureStore with device-level encryption |
| Mesh Relay | XChaCha20-Poly1305 encryption (NaCl secretbox) |
| Viewing Tags | First 4 bytes of SHA256(shared_secret) for efficient scanning |
| Key Hierarchy | Separate spending/viewing keys (viewing key cannot derive spending key) |
| On-chain Privacy | Stealth addresses break transaction graph linkage |
| Quantum Resistance | Optional ML-KEM 768 hybridization (NIST Level 3) |
import { useStealthWallet } from "./hooks/useStealthWallet";
import { Connection } from "@solana/web3.js";
// Initialize stealth wallet
const connection = new Connection("https://api.devnet.solana.com");
const {
metaAddress,
generatePaymentAddress,
scanForPayments,
shieldFunds,
unshieldFunds,
} = useStealthWallet(connection);
// Share your meta-address to receive payments
console.log(metaAddress); // "stealth:1:ABC...:XYZ..."
// Generate stealth address for recipient
const result = await generatePaymentAddress(recipientMetaAddress);
// Send to: result.stealthAddress
// Include: result.memoData in transaction
// Scan blockchain for incoming payments
const payments = await scanForPayments(100);
// Shield funds (main wallet → stealth)
await shieldFunds(amountLamports, walletKeypair);
// Unshield funds (stealth → main wallet)
await unshieldFunds(mainWalletAddress, selectedPayments);- Implement NIP-17/44 XChaCha20 gift-wrap encryption integration for secure message passing (planned).
- Add message ack/retry and persistent queue to improve reliability over flaky BLE links.
- Expand to have the escrow transaction relay functionality using Arcium circuits.
- Production Kyber Implementation: Replace placeholder with production library (e.g.,
kyber-crystals) - SPL Token Support: Extend stealth addresses to USDC and other SPL tokens
- Multi-hop Mixing: Integrate with Privacy Cash / ShadowWire protocols
- Biometric Auth: Add Face ID/fingerprint for spending from stealth addresses
- Hardware Wallet: Support Ledger integration for enhanced security
- Mainnet Deployment: Complete security audit before mainnet launch
- Stealth Transfers Guide: MESH_STEALTH_README.md
- EIP-5564 Specification: https://eips.ethereum.org/EIPS/eip-5564
- PQ Stealth Research: https://arxiv.org/abs/2501.13733
- NIST ML-KEM Standard: https://csrc.nist.gov/pubs/fips/203/final
Contributions welcome! Please follow the repository coding conventions and run pnpm run typecheck before submitting PRs.
Built for Solana Private Payments powered by Pigeon Tek 🚀
