What if every correct answer in a quiz rewarded you with crypto?
I decided to test this idea and built Solana Quiz - a decentralized app where users answer daily quiz questions generated by OpenAI and earn Solana tokens for correct answers.
Yes, it really works. And yes - we even mint our own token π.
π The Idea
Iβve long wanted to combine AI, Rust, and blockchain into a single project where each piece actually works, not just βfor show.β
The result:
- OpenAI generates fresh questions daily.
- Node.js checks answers and handles the business logic.
- Rust mints tokens on Solana.
- Kafka ties all the services together in a clean event-driven system.
The outcome? A smart, fair, and transparent quiz where rewards donβt land in your email - they land in your Phantom Wallet.
π‘ How It Works
1οΈβ£ Solana Wallet Authentication
Users connect their Phantom Wallet and sign a message. Node.js verifies the signature and confirms wallet ownership.
No passwords, tokens, or logins - just pure blockchain authentication.
Currently, only Phantom Wallet is supported, but adding more wallets is possible.
2οΈβ£ Questions Powered by OpenAI
Every morning, Node.js queries the OpenAI API (gpt-4.1-nano) to get a new set of questions.
OPEN_AI_API_KEY=your_openai_api_key_here
OPEN_AI_MODEL=gpt-4.1-nano
OPEN_AI_LANGUAGE=English
π‘ You need an OpenAI account and API key. Without it, the quiz stays silent π€
The questions are varied: from blockchain history to logic puzzles.
3οΈβ£ Checking Answers & Rewards
Once the quiz is submitted, Node.js publishes an event to Kafka, and the Rust worker listens for it. It then connects to Solana RPC andβ¦ πΈ sends tokens straight to your wallet.
Every correct answer instantly becomes real crypto on the blockchain.
π Architecture
| Service | Technologies | Description |
|---|---|---|
| Frontend | Next.js, React, TailwindCSS | User interface and wallet integration |
| Backend | Node.js, Express, Prisma, KafkaJS, OpenAI API | Quiz logic, question generation, API |
| Rust Worker | Rust, Solana SDK, rdkafka | Token minting and Solana transactions |
| Database | PostgreSQL | User data and quiz results storage |
| Infra | Docker Compose | Service orchestration |
πͺ Creating Your Own Token
The heart of the quiz is a custom SPL token on Solana. This isnβt just a demo coin - it powers the whole quiz economy and makes the reward system transparent and decentralized.
β οΈ Before running the Rust commands, make sure your .env file is ready:
SOLANA_NETWORK=devnet
SOLANA_RPC_ENDPOINT=https://api.devnet.solana.com
SOLANA_AUTHORITY_KEYPAIR_PATH=./secret/authority.json
SOLANA_MINT_KEYPAIR_PATH=./secret/mint.json
SOLANA_TOKEN_NAME="Solana Quiz Token"
SOLANA_TOKEN_SYMBOL="SQT"
SOLANA_TOKEN_METADATA_URI="https://raw.githubusercontent.com/di-zed/internal-storage/refs/heads/main/solana-quiz-token/metadata.json"
π‘ Important: You can change the token name, symbol, description, and metadata - itβs your token, your universe.
π Step-by-step: Minting your own Solana token
Let's go through the full process β from building the binary to minting your first million tokens πͺ
# π¦ Enter the Rust container
docker-compose exec rust /bin/bash
# βοΈ Build the release binary
cargo build --release
# π§ Request some SOL for your authority account
./target/release/solana request-airdrop --sol-amount 5
# πͺ Create a new token mint
./target/release/solana create-mint
# πΌ Create a token account to store your tokens
./target/release/solana create-token-account
# π° Mint 1,000,000 tokens
./target/release/solana mint-tokens --amount 1000000
π‘ These tokens are your reward bank β
every time someone answers correctly in the quiz, the Rust worker distributes tokens from this pool.
To make your token display nicely in Phantom Wallet and Solana Explorer, add metadata such as:
π§ Why Rust
Rust is perfect for working with the Solana SDK - safe, async-friendly, and memory-safe.
Even if you were a bit intimidated by Rust before, this project will make it your new crypto buddy π¦.
π Use Cases
- π EdTech: tokenize learning - correct answers = real rewards.
- π’ Corporate quizzes: motivate employees with tokens.
- π Crypto communities: daily activities and rewards on Solana.
- π° Loyalty & gamification: on-chain incentives for engagement.
π§ Roadmap
- π NFT rewards - issue NFTs for streaks of correct answers.
- π Solana Program - store quiz history and auto-distribute NFTs.
- π Mainnet-beta migration.
The Solana program will eventually track quiz history on-chain and automatically reward users who maintain a streak (e.g., 7 days in a row).
NFTs can be created manually via Metaplex - your collection, your designs, your rewards π¨
π§© A Bit of Technical Info
I didnβt dive into setup commands in this article - we want it to be easy to read π
If you want to actually run the project, mint your own token, connect OpenAI, and see Solana deliver real rewards - check the README on GitHub.
It has step-by-step instructions, .env examples, and Docker, Rust, and Node.js commands - everything you need to dig deeper.
π§± Bottom Line
Solana Quiz isnβt a demo or experiment. Itβs a live app where AI, Rust, and blockchain work together:
- OpenAI generates content
- Node.js manages logic
- Kafka connects everything
- Rust handles real transactions
The result? A fair reward system where knowledge brings you crypto, not just points.
βοΈ The project runs entirely via Docker - clone the repo, follow the README, and youβre good to go. Everything is covered, including key generation and OpenAI/Solana setup.
π¦ GitHub: github.com/di-zed/solana-quiz
π License: MIT
βοΈ Author: @di-zed


Top comments (0)