
Senku's Elixir
Science will save the world, one drop at a time.
Demo
About
The problem it solves **Senku's Elixir** tackles one of the biggest hurdles in the Web3 space: the high barrier to entry for mainstream users. Many blockchain-based applications are either too complex, financially demanding, or lack the engaging user experience necessary to attract people from outside the crypto-native world. Our project solves this by: * **Making Web3 Accessible & Fun:** We use a universally understood and addictive puzzle game as a Trojan horse for Web3 concepts. Users don't need to understand complex tokenomics to start playing; they just solve puzzles. The free initial FLUOR tokens remove any financial risk, allowing anyone to start earning and participating immediately. * **Simplifying Digital Ownership:** Instead of abstract financial products, our project provides tangible rewards for in-game achievements. Players earn FLUOR tokens for their skill and can mint collectible KOSB NFTs to showcase their dedication. This makes the concept of digital ownership intuitive and meaningful—your assets are a direct reflection of your progress and effort in the game. * **Providing a Safe On-Ramp:** For many, Senku's Elixir will be their first interaction with a decentralized application. By providing a polished, fun, and low-stakes environment, we make it easier and safer for people to create a wallet, handle tokens, and understand the value of NFTs without being overwhelmed.
How it's made
Challenges we ran into The biggest architectural challenge was designing a secure and gas-efficient system for tracking player progress on the blockchain. The core question was: **How do you prove a player legitimately won a level without putting the entire game logic on-chain?** My initial thought was to make the game fully decentralized, where every move a player makes is a transaction sent to the smart contract. The contract itself would then check if the puzzle was solved. I quickly realized this approach was completely unworkable for several reasons: * **Prohibitive Gas Costs:** Forcing players to pay a gas fee for every single move would make the game unplayably expensive. * **Extremely Slow Gameplay:** Waiting for transaction confirmation after every move would destroy the fast-paced, interactive feel of a puzzle game. * **Complex Contract Logic:** Writing a smart contract to validate puzzle solutions would be incredibly complex and costly to deploy and execute. To overcome this, I implemented a **hybrid on-chain and off-chain model** that provides the best of both worlds: 1. **Off-Chain Gameplay:** The actual puzzle-solving happens entirely in the user's browser (frontend). This ensures the gameplay is fast, responsive, and free, providing a smooth user experience identical to a traditional web game. 2. **Backend Validation "Oracle":** When a player solves a puzzle on the frontend, they don't interact with the blockchain directly. Instead, their solution is sent to a secure backend server. This server acts as a trusted "oracle" by quickly re-simulating the level off-chain to instantly verify the win. This prevents a user from simply telling the contract they won without proof. 3. **On-Chain State Update:** Only *after* the backend successfully validates the win does it perform the crucial on-chain step. Using its administrative privileges (Owner role), the backend makes a **single, authorized transaction** to call the recordLevelComplete() function in our SenkuGameController smart contract. This single transaction updates the player's levelsCompleted state on the blockchain, making their progress official and unlocking their ability to claim FLUOR token rewards. This approach solves all the initial challenges: it keeps gameplay fast and free, prevents cheating through secure backend validation, and maintains gas efficiency by reducing potentially hundreds of on-chain moves to just one authoritative transaction per level.