# timed question pool unlock
once per day...
* a pool is created
* users can log in with wallet account
* and deposit a pre-set amount (say $1)
* the pool is open for 24hrs
* at the end of 24hrs, a question is asked
* answers are accepted for 1 minute
* registered wallets who submit correct answer, win
winnings distribution
* first correct answerer wins 25%
* next five correct answerers win 5%
* remaining 50% divided between the rest of correct answerers
who decides questions and how
* tbd
* are question and answer on-chain?
* eg, answer is cryptographically provably pre-set
* question and answer re encrypted in daily pool contract deployment maybe?
## business model
5% of daily pool
* 3% into dao msig for operations, development and growth
* 2% into msig for charitable donation
## how to play
## rules
* Minimum participation threshold
* Need at least 100 people to register to unlock daily trivia
* If not enough people register, the quiz skips that day, and registers all accounts for the following day's quiz
* TODO: potential for infinite carry forward. should unlock somehow after n days.
* Unclaimed winnings
* Unclaimed winnings are added to the pool for the following day
## architecture
* dapp
* smart contract
* web pages
* to register and make deposit
* to view question and submit answer
* to view results, and wait for next question
Question & Answer
* ideally both on chain, encrypted, in contract deployment or other?
## threat model
* knowing question in advance
* question answer source and submission in deployment flow is still tbd
* brute forcing answer submissions
* one answer per user
* but could automate generation of wallets and submit multiple answers that way
* hacking award deployment
* ?
## ux flows
User:
* Screen:RoundClosed
* state: RoundClosed
* show: String("Game not open, please come back later.")
* screen:RegisterUser
* state: UserNotRegistered
* show: String("Would you like to play?")
* show: String("countdown to
* show: Button("Register")
* event:onclick
* action: connect to wallet
* action: pay $1
* event:onpaid
* action: navigate to screen:UserRegistered
* screen:UserRegistered
* countdown to next question
* show size of pool, number of registered players
* screen:UserAnswer
* show question
* show input for answer
* button to submit answer
* onclick
*
4. question time ends
* show winners, with amount each received
* GOTO 1 (or 2 if already logged in)
## ideas for later
* leaderboard
## Contract review
TODOs
Consts
* startTime
* depositAmount
* currentRoundId
* minAttendance
* daoMsigAddress
* donationMsigAddress
Key components
* ClaimStatus
* RoundInfo
* UserInfo
* TopWinnerStructure
Round static data
* question
* encryptedAnswer
* attendance (num attendees?)
* publicKey
* privateKey
* ClaimStatus
* platformFeeTransferred
Round runtime data
* Round has id, which map to question/answer pair
* Round has array of wallet -> UserInfo
## Architecture Overview
Three main components
* Smart contracts
* Back-end
* Front-end
## Architecture diagram
Player registers for a round
```mermaid
sequenceDiagram
participant browser
participant chain
participant backend
backend->>browser: loads html
browser->>chain: log in with wallet (deposit round cost)
chain->>browser: return registration status
```
Registered player plays round
```mermaid
sequenceDiagram
participant browser
participant chain
participant backend
backend->>browser: loads html
browser->>chain: log in with wallet (checks registration)
chain->>browser: return registration status
```