Zero-Knowledge Social Login for Stellar

Authenticate with Google or a passkey, generate a Groth16 proof, and verify it on Soroban — without revealing your identity on-chain.

Understand the Cryptography

BN254 curves, Poseidon hashing, Groth16 proofs, Circom circuits. Real code from the codebase with developer-focused explanations.

Run the Full Flow

Sign in with Google or a passkey, generate a ZK proof in your browser, and submit it to Soroban testnet for real on-chain verification.

Use Your ZK Wallet

Your proven identity controls a Stellar account. Fund it, send XLM, all client-side. No seed phrase — your identity IS your key.

Architecture

1 Identity Google JWT or WebAuthn passkey
2 Hash SHA-256 → BN254 field element
3 Attestation Poseidon hash binding identity + time
4 ZK Proof Groth16 in browser (2,295 constraints)
5 Verify BN254 pairing check on Soroban

Same pattern as Sui zkLogin and Aptos Keyless, adapted for Stellar/Soroban.

Everything is Real

REAL Identity hashing — SHA-256 + BN254 field truncation (31 bytes)
REAL Poseidon attestation — matches Circom circuit constraints exactly
REAL Groth16 proof generation — 2,295 constraints on BN254, runs in your browser
REAL Off-chain verification — snarkjs BN254 pairing check in the browser
REAL On-chain verification — Groth16 BN254 pairing check via Soroban smart contract
REAL Mini wallet — Stellar account creation, XLM transfers on testnet

Comparison

Stellar ZK Login Sui zkLogin Aptos Keyless
Proof system Groth16 (BN254) Groth16 (BN254) Groth16 (BN254)
Identity providers Google, Passkeys Google, Facebook, Apple, Twitch Google, Apple
JWT verified in circuit No (off-chain attestation) No (salt service) Yes (inside circuit)
Server trust Attestation server Salt service Pepper service
Circuit size ~2,295 constraints ~100M constraints ~100M constraints
On-chain verification Soroban contract Native protocol Native protocol
Replay prevention Nullifier hash Ephemeral keypair Ephemeral keypair

Open Source & Audit-Ready

Every component is public. Review the code, run it yourself, or contribute.

CODE circuits/identity-attestation/ — Circom circuit source (2,295 constraints)
CODE contracts/ — 8 Soroban smart contracts (Rust)
CODE examples/demo/src/ — This demo site (CF Workers + vanilla JS)
DOCS SECURITY.md — Responsible disclosure policy
DOCS CONTRIBUTING.md — Contribution guide

Use with Claude Code

Clone the repo and start building with guided slash commands.

git clone https://github.com/nobak-net/stellar-zklogin.git
cd stellar-zklogin
claude

Then type any command to get started:

/setup — Install deps and build /prove — Generate a ZK proof /deploy-circuit — Compile circuit and keys /deploy-contract — Deploy to Soroban testnet /verify — Verify proof on-chain

Two Identity Providers

GOOGLE OAuth JWT → SHA-256 identity hash. Recoverable from any device.
PASSKEY WebAuthn credential → SHA-256 identity hash. No PII, origin-bound, un-phishable.

The ZK circuit is identity-agnostic — it only sees a 248-bit field element. Same WASM, same zkey, same verification key for both providers.