dero-auth
Overview

DeroAuth Overview

Sign in with your DERO wallet. No email. No password. Just cryptographic proof of wallet ownership.

dero-auth is a TypeScript library that provides wallet-based authentication for DERO. It works like "Sign in with Ethereum" (SIWE), but for DERO's privacy chain.

🔒

Privacy advantage: Unlike Ethereum auth (which exposes your full transaction history), authenticating with DERO reveals nothing about your on-chain activity. All transactions are encrypted.

Features

  • Pure TypeScript signature verification (Schnorr on BN256) — no wallet needed server-side
  • React components — drop-in <SignInWithDero /> button and useDeroAuth() hook
  • Next.js integration — ready-made API route handlers and auth middleware
  • XSWD client — connects to DERO wallets (Engram, CLI) via WebSocket
  • SIWE-style message format — human-readable, domain-bound, replay-protected
  • JWT sessions — standard token-based session management
  • Zero personal data — just a cryptographic address

How It Works

  1. Server generates a challenge (human-readable message with domain, nonce, expiry)
  2. User's wallet signs the challenge via XSWD (WebSocket to local wallet)
  3. Server verifies the Schnorr signature purely in TypeScript — no RPC call to a node
  4. JWT session is issued

The entire verification is mathematical — no blockchain query needed.

Why Not Just Use Ethereum Auth?

Ethereum (SIWE)DERO Auth
Transaction privacyAll transactions visible on-chainTransactions encrypted, invisible to verifier
Wallet extensionMetaMask requiredConnects to local wallet via WebSocket
Personal data exposedAddress links to full historyAddress reveals nothing about activity
VerificationPure JS (ecrecover)Pure JS (Schnorr on BN256)

Wallet Compatibility

WalletConnectionStatus
Engram (desktop)XSWD (ws://localhost:44326)Supported
DERO CLI walletXSWD (ws://localhost:10103)Supported

Package Exports

ImportPurpose
dero-authCore types and message format
dero-auth/cryptoPure crypto: Schnorr verify, BN256, address parsing
dero-auth/serverChallenge generation, verification, JWT sessions
dero-auth/clientBrowser SDK: XSWD wallet connection, signing flow
dero-auth/react<SignInWithDero /> button, provider, hooks
dero-auth/nextNext.js API route handlers, auth middleware

Next Steps