Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
Pull Request: Web3 Message Signer & Verifier (Take-Home Task)
📌 Overview
This PR implements the Decentralized Masters Test Task, delivering a full-stack Web3 application that allows users to:
Authenticate with Dynamic.xyz headless email OTP (no widget)
Automatically create & connect an embedded non-custodial wallet
Sign custom user messages with the wallet
Verify signatures server-side using ethers.js
Maintain a local signing history for transparency
The project is split into two workspaces:
frontend/ → React (CRA + TypeScript + Tailwind)
backend/ → Node.js + Express + ethers v6
🔑 Features Implemented
Frontend (frontend/)
Authentication: Headless Dynamic email login with OTP input (react-otp-input) styled via Tailwind
Embedded Wallet: Automatic creation and connection for new users
UI/UX:
Clean, responsive Tailwind interface
Pixel-perfect OTP flow similar to Privy/Dynamic
Clear error and loading states
Message Signing:
Enter custom message → sign with wallet
Submit { message, signature } to backend
History:
Persist signed message history in localStorage
Display signer, message, signature, and timestamp
Backend (backend/)
API Endpoint: POST /verify-signature
Input: { message, signature }
Verification via ethers.verifyMessage
Returns { isValid, signer, originalMessage }
Security & Structure:
Express middleware setup (CORS, JSON body parser)
Configurable via .env
Testing:
Added tests with Vitest + Supertest for valid & invalid signatures
🛠️ Tech Stack
Frontend: React 18, TypeScript, TailwindCSS, Dynamic SDK (headless), Axios
Backend: Node.js, Express, ethers.js v6, Vitest, Supertest
Tooling: GitHub Actions (CI), ESLint, Prettier
Storage: LocalStorage (client), in-memory (server; no DB per requirements)
📖 Setup Instructions
Detailed setup instructions are included in:
frontend/README.md
backend/README.md
Quick start:
Backend
cd backend && cp .env.example .env && npm i && npm run dev
Frontend
cd frontend && cp .env.example .env && npm i && npm start
🚀 Improvements & Next Steps
Add EIP-712 typed data signing support
Implement headless MFA (Dynamic) for stronger security
Add persistent DB layer for server-side audit logs
Deploy to Vercel (frontend) + Render/Fly (backend) for demo
✅ Deliverables Checklist
Frontend: headless auth + wallet + signing + history
Backend: verify signature endpoint (ethers.js)
Tests included (frontend & backend)
README setup docs
Code structured & styled with Tailwind
👉 This PR delivers the full test assignment implementation as described.