Skip to content

tokamak-network/toki

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

250 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Toki welcomes you

TOKI

TON Staking, Simplified.

Features Quick Start Achievement Cards

Next.js TypeScript Tailwind Ethereum EIP-7702


What is Toki?

Toki is a TON staking platform built on Tokamak Network. It reduces the 8-15 step staking process down to 3 simple steps — no MetaMask, no ETH gas fees, no WTON complexity.

The Problem
Staking TON currently requires installing MetaMask, managing seed phrases, registering wallets on exchanges (Travel Rule), acquiring ETH for gas, understanding WTON wrapping (27 decimals), choosing among 10+ operators, and navigating deprecated UIs.
Toki's Solution
Sign in with Google. Send TON. Click stake. That's it. Gas is paid in TON via EIP-7702 + Paymaster.

Features

Gasless Staking (EIP-7702)

  • TON Paymaster — Gas fees paid in TON, no ETH needed
  • Session Key Delegation — Sign once, stake gaslessly for 7 days
  • Auto WTON Wrapping — TON → WTON conversion handled automatically
  • Auto Operator Selection — Best operator chosen by commission rate and activity

Visual Novel Onboarding

A guided tutorial with Toki as your companion through 5 quests:


Quest 1
Create Account

Quest 2
Bridge to MetaMask

Quest 3
Exchange Verification

Quest 4
Receive TON

Quest 5
First Gasless Stake

Each quest features dialogue sequences, mood-based character expressions, and XP rewards.

Toki Character System

Toki has 17 mood expressions that respond to context throughout the UI:


welcome

explain

thinking

excited

proud

cheer

wink

surprised

shy

determined

pointing

reading

confused

laughing

peace

worried

moved

Bilingual (i18n)

Full Korean/English support via custom LanguageProvider with locale files in src/locales/.


Achievement Cards

Collect 19 unique cards across 5 categories as you progress through your staking journey.


Bronze
Common

Silver
Uncommon

Gold
Rare

Platinum
Epic

Black
Legendary
View all 19 cards

Onboarding (5 cards)

Card Trigger
First Account Create your first wallet
Bridge Master Complete MetaMask bridge
Exchange Verified Verify exchange address
TON Received Receive first TON
Onboarding Complete Finish all 5 quests

Staking (6 cards)

Card Trigger
First Stake Stake any amount of TON
Staker 10 Cumulative 10+ TON staked
Whale Staker Cumulative 100+ TON staked
Gasless Pioneer Use gasless staking
Delegation User Use session key delegation
First Unstake Complete first unstake

Explore (3 cards)

Card Trigger
Explorer Visit the ecosystem page
Service Surfer Click 3+ different services
Category Master View all 4 categories

Social (3 cards)

Card Trigger
Chat Starter Start first chat with Toki
Dialogue Veteran Visit 10+ dialogue nodes
Free Spirit Use free text input 3+ times

Special (1 card)

Card Trigger
Power User Unlock 15+ achievements

Architecture

User (Social Login)
  → Privy SDK (EOA creation)
  → EIP-7702 (EOA → Smart Account delegation)
  → TON Paymaster (gas fees in TON, not ETH)
  → Tokamak Contracts (TON → WTON → DepositManager → SeigManager)
Key Design Decisions
  • L1-only — Staking contracts live on Ethereum L1. No L2 bridge needed.
  • EIP-7702 — EOA stays exchange-compatible (Travel Rule) while gaining Smart Account capabilities.
  • TON Paymaster — Users never need ETH. Gas fees are deducted from their TON balance.
  • Auto operator selection — Best operator chosen automatically based on commission rate and activity.
  • Compound seigniorage — No restaking needed. Rewards compound automatically via coinage tokens.
Tech Stack
Layer Technology
Frontend Next.js 14, TypeScript, Tailwind CSS
Auth Privy SDK (Google OAuth)
Web3 viem (EIP-7702 + UserOperation signing)
Bundler Pimlico (EntryPoint v0.8)
Paymaster Custom TonPaymaster (TON → ETH swap)
Contracts Tokamak Network (TON, WTON, SeigManager, DepositManager)
Contracts
Contract Address
EntryPoint v0.8 0x4337084d9e255ff0702461cf8895ce9e3b5ff108
TON 0x2be5e8c109e2197D077D13A82dAead6a9b3433C5
WTON 0xc4A11aaf6ea915Ed7Ac194161d2fC9384F15bff2
SeigManager 0x0b55a0f463b6defb81c6063973763951712d0e5f
DepositManager 0x0b58ca72b12f01fc05f8f252e226f3e2089bd00e
TonPaymaster Custom (accepts TON as gas payment)

Getting Started

Step 1: Clone & Install

git clone https://github.com/tokamak-network/toki.git
cd toki
npm install

Step 2: Configure

Create a .env.local file:

NEXT_PUBLIC_PRIVY_APP_ID=your_privy_app_id
NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID=your_project_id
NEXT_PUBLIC_ENABLE_TESTNETS=true
Get your Privy App ID from dashboard.privy.io and WalletConnect Project ID from cloud.walletconnect.com

Step 3: Launch

npm run dev

Open http://localhost:3000.


Project Structure

src/
  app/              # Next.js App Router pages
  components/
    landing/        # Landing page (hero, profit simulator, FAQ)
    layout/         # Header, Footer
    onboarding/     # Visual novel quest system + intro cinematic
    dashboard/      # Staking panel + wallet management
    staking/        # Staking screen (gasless flow)
    achievements/   # Achievement toast + card reveal effects
    explore/        # Ecosystem explorer
    chat/           # Toki dialogue chat (visual novel)
    providers/      # Privy, Language, Achievement, Web3 providers
    ui/             # Reusable UI components
  constants/        # Contract addresses, ABIs
  hooks/            # useEip7702, useStakingData
  locales/          # en.ts, ko.ts (i18n strings)
  lib/              # achievements, staking utils, dialogue tree

Contributing

Contributions are welcome! Please open an issue first to discuss changes.

Never commit .env files or private keys to version control.

License

MIT



Built with Tokamak Network

About

Stake TON in 3 steps — no ETH gas. Visual novel onboarding + EIP-7702 gasless staking on Tokamak Network.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors