Unified zero-FFI pure MoonBit cryptography stack compiled to native JavaScript ES Modules. Explore password-hardened 3DH authentication, unlinkable anonymous AI quota tokens with DLEQ proofs, and 2-of-3 decentralized Pedersen DKG threshold signatures live in your browser.
moon build opaque/js_api --target js --release python -m http.server 8080 # Then open: http://localhost:8080/examples/web-demo/
RegistrationRecord.
Blinds password via shared voprf OPRF, derives sealed
Envelope and client-only export_key. Server stores only
RegistrationRecord.
Runs full KE1 → KE2 → KE3 → ServerFinish. Verifies both
parties derive identical session_key and recovers
export_key.
Probes unregistered user ghost@example.com. Server emits a wire-identical
Fake KE2; client rejects with InvalidEnvelopeTag.
Attempts login for the registered user with a wrong password. Constant-time envelope
tag check blocks recovery with InvalidEnvelopeTag.
Flips 1 bit in KE2.server_mac (InvalidServerMac) and 1 bit
in KE3.client_mac (InvalidClientMac).
Executes all 5 OPAQUE-3DH scenarios back-to-back with fresh WebCrypto entropy and logs every wire frame below.
TokenRequest, Proof, and Token.authenticator
frames in pure MoonBit.
Every run executes full 3-round decentralized Pedersen DKG with Feldman VSS & Schnorr Proofs of Knowledge, then runs 2-round threshold signing between Signers #1 & #2 with single-use zeroized nonces.