A hybrid Web2/Web3 system for point-to-token exchange and governance voting, built on zkSync Era with Account Abstraction (gasless via paymaster).
Connects a traditional Web2 point system with a Web3 governance token. Users earn points, convert them, exchange for governance tokens (BLOOM), and participate in proposals and voting.
- Dual point system: Sub Points → Main Points at a 10:1 ratio
- Token exchange: Main Points → BLOOM governance token (10:1)
- Governance: Create proposals and vote (For/Against)
- Google OAuth: Simple login; AA smart wallet shown in UI
- Gasless UX: Paymaster-backed transactions explained in UI
- Spring Boot 3.5.x — REST API server
- Spring Security + OAuth2 — Google auth
- Spring Data JPA — Database ORM
- H2 (dev) / PostgreSQL (prod-ready)
- Web3j — Ethereum blockchain interaction
- Next.js 15 (App Router) + TypeScript + Tailwind CSS
- Google OAuth via backend redirects
- English-only UI,
en-USdate formatting
- zkSync Era Sepolia (testnet)
- Solidity smart contracts
- Hardhat / Foundry (as needed) for development and deployment
| Contract | Address | Network |
|---|---|---|
| GovernanceToken | 0x21341E1672ee0A7ddADB5D7BFF72F93C8E81EF3e |
zkSync Era Sepolia |
| Paymaster | 0x10219E515c3955916d79A1aC614B86187f0872BC |
zkSync Era Sepolia |
- Node.js 18+
- Java 21+
- Git
git clone <repository-url>
cd P2E_Paymaster_AccountAbstractioncd spring-backend
./gradlew bootRun- Backend runs at
http://localhost:8080 - H2 Console:
http://localhost:8080/h2-console
cd ../next-frontend
npm install
npm run dev- Frontend runs at
http://localhost:3000
- Open
http://localhost:3000 - Click Google Login
- Earn points, create a proposal, and vote
- Sub Points → Main Points: 10:1
- Main Points → BLOOM governance token: 10:1
- User earns Sub Points (demo actions)
- Convert Sub → Main
- Exchange Main → BLOOM token
- Vote on proposals using tokens
- Any authenticated user can create a proposal
- Proposal metadata is stored and surfaced via the UI
- For/Against votes
- Voting stats displayed per proposal
- Sign in with Google
- Confirm AA wallet address is displayed in UI
- Verify user info and initial balances
- Earn Sub Points (demo buttons)
- Convert Sub → Main (10:1)
- Exchange Main → BLOOM (10:1)
- Check point history and balances
- Create a new proposal
- View active proposals
- Vote For/Against
- Review vote results and stats
GET /api/auth/user— Current user- OAuth login is handled via backend redirect (see frontend button)
GET /api/points/main— Main point accountGET /api/points/sub— Sub point accountPOST /api/points/convert— Convert Sub → MainPOST /api/points/exchange— Exchange Main → Token
GET /api/proposals— List proposalsPOST /api/proposals— Create proposalPOST /api/votes/vote— Vote on proposalGET /api/votes/stats/proposal/{id}— Vote stats for proposal
- Governance token deployed on zkSync Era Sepolia
- Hybrid architecture: Web2 database + Web3 integration as needed
- Account Abstraction: gasless UX explained via paymaster in UI
- OAuth2 + JWT
- CORS configured for frontend-backend communication
- Input validation on all APIs
- Modular services by domain (auth, points, proposals, votes)
- Strong typing via TypeScript (frontend) and Java (backend)
- Integration tests for critical flows
Additional docs are available under the Documentation/ directory in the repository.