Skip to content

Conversation

@bartosz0718
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant