Skip to main content

Web3 Wallet Setup

G3Engine makes it effortless to add Web3 functionality to your games. Enable wallet connections, token launches, NFT minting, and blockchain interactions without writing smart contracts.

Why Web3 in Games?

Add blockchain features to:
  • Launch tokens on Pump.fun bonding curves for in-game economies
  • Mint NFTs for collectibles, achievements, or unique items
  • Token-gate content (require token holdings to access areas)
  • Reward players with crypto for completing challenges
  • Enable tipping so players can support creators
  • Create on-chain leaderboards with permanent records

Enabling Web3

1
Toggle Web3 Mode
2
  • Open your project in the G3Engine editor
  • Locate the Web3 toggle in the Top Bar (next to Play/Stop)
  • Click the toggle to enable Web3
  • The Web3 Panel opens on the right side
  • 3
    {
      "web3Enabled": true
    }
    
    4
    Enabling Web3 is optional. Games work perfectly without blockchain features. Only enable if you want token/NFT functionality.
    5
    Understanding the Web3 Panel
    6
    When Web3 is enabled, the Right Panel gains four tabs:
    7
    🪙 Tokens Tab:
    8
  • Launch new tokens on Pump.fun
  • View your created tokens
  • See token balances and prices
  • 9
    🎨 NFTs Tab:
    10
  • Mint game NFTs
  • Add NFT gates to scenes
  • View minted NFTs
  • 11
    💰 Economy Tab:
    12
  • Configure reward tokens
  • Set tokens-per-level-complete
  • Enable tip jar for players to support you
  • 13
    ⚙️ Settings Tab:
    14
  • Switch between Devnet (testing) and Mainnet (real money)
  • View wallet address and balance
  • See transaction history
  • 15
    Connect a Wallet
    16
    To use Web3 features:
    17
  • Click Connect Wallet in the Web3 Panel
  • Choose your wallet provider:
    • Phantom (recommended for Solana)
    • Backpack
    • Solflare
    • Any Solana wallet
  • Approve the connection in your wallet extension
  • Your wallet address and SOL balance appear in Settings tab
  • 18
    First time with Web3?Start on Devnet (test network) to experiment without real money:
    1. Go to Settings tab
    2. Select “Devnet”
    3. Get free test SOL from a Solana faucet

    Launching a Token on Pump.fun

    Pump.fun is a bonding curve platform where anyone can launch a token in seconds.
    1
    Launch Your Game Token
    2
  • Switch to the 🪙 Tokens tab in the Web3 Panel
  • Click 🚀 Launch Token on Pump.fun
  • Fill out the token details:
  • 3
    {
      "name": "My Game Coin",
      "symbol": "GAME",
      "imageUri": "https://example.com/token-icon.png",
      "description": "The official currency of My Awesome Game"
    }
    
    4
    Fields:
    5
  • Name: Full token name (e.g., “My Game Coin”)
  • Symbol: Ticker (3-5 letters, e.g., “GAME”)
  • Image URI: Link to your token logo (PNG/JPG, recommended 512×512px)
  • Description: What your token is for
  • 6
  • Click Launch
  • Approve the transaction in your wallet
  • Wait 10-30 seconds for confirmation
  • Your token appears in the Tokens list!
  • 7
    What Happens Under the Hood
    8
    G3Engine:
    9
  • Calls the Pump.fun SDK to create a bonding curve
  • Mints your token on Solana
  • Stores the token mint address
  • Makes it available in your game via Web3 nodes
  • 10
    You receive:
    11
  • Token Mint Address (the token’s unique ID on Solana)
  • Initial supply of tokens
  • Bonding curve where players can buy/sell
  • 12
    View Your Token
    13
    In the Tokens tab:
    14
    ┌─────────────────────────────────┐
    │ 🪙 GAME                         │
    │ My Game Coin                    │
    │ Balance: 1,000,000              │
    │ Price: 0.00001 SOL              │
    └─────────────────────────────────┘
    
    15
    Click the token to:
    16
  • Copy mint address
  • View on Solscan
  • See bonding curve chart
  • Using Web3 Nodes in Visual Scripting

    Once Web3 is enabled, Web3 nodes (purple) appear in the Node Editor.
    1
    Reward Players with Tokens
    2
    Use Case: Give players 10 tokens when they complete a level.
    3
    Nodes:
    4
  • On Collision (player reaches goal)
  • 🎁 Reward Player (Web3 node)
  • 5
    Setup:
    6
    [On Collision (Goal)]
    
       └──→ [Reward Player]
              Token Mint: [Your token mint address]
              Amount: 10
    
    7
    When the player collides with the goal object:
    8
  • The Reward Player node executes
  • 10 tokens transfer to the player’s wallet
  • Transaction appears in Settings → Recent Transactions
  • 9
    Token-Gate Content
    10
    Use Case: Only let players enter a VIP room if they hold 100+ tokens.
    11
    Nodes:
    12
  • On Collision (player touches door)
  • 🔐 Token Gate (Web3 node)
  • Set Visible (show hidden room)
  • 13
    Setup:
    14
    [On Collision (VIP Door)]
    
       └──→ [Token Gate]
              Token Mint: [Your token]
              Min Balance: 100
    
              ├─ Has Access ──→ [Set Visible (Room, true)]
    
              └─ No Access ──→ [Print String ("Need 100 tokens!")]
    
    15
    The Token Gate node:
    16
  • Checks the player’s wallet
  • Compares token balance to Min Balance
  • Executes “Has Access” if balance ≥ 100
  • Executes “No Access” if balance < 100
  • 17
    Dynamic Token Pricing
    18
    Use Case: Display current token price in-game.
    19
    Nodes:
    20
  • Event Tick
  • 📊 Get Token Price (Web3 node)
  • Print String (display price)
  • 21
    Setup:
    22
    [Event Tick]
    
       └──→ [Get Token Price]
              Token Mint: [Your token]
    
              └─ Price (SOL) ──→ [Print String ("Price: X SOL")]
    
    23
    The price updates every frame from the Pump.fun bonding curve.

    Minting NFTs

    1
    Mint a Game NFT
    2
  • Switch to the 🎨 NFTs tab
  • Click 🎨 Mint Game NFT
  • Configure the NFT:
  • 3
    {
      "name": "Victory Badge",
      "imageUri": "https://example.com/badge.png",
      "attributes": {
        "rarity": "legendary",
        "level": "10",
        "score": "9999"
      }
    }
    
    4
  • Click Mint
  • Approve in your wallet
  • NFT appears in your NFTs list
  • 5
    Use NFT Nodes
    6
    🎨 Mint NFT Node (in visual scripting):
    7
    [On Level Complete]
    
       └──→ [Mint NFT]
              Name: "Level 1 Complete"
              Image URI: "..."
              Attributes: {level: "1"}
    
              └─ Mint Address ──→ [Print String ("NFT minted!")]
    
    8
    Mints an NFT directly to the player’s wallet when they complete a level.
    9
    NFT Gate:
    10
    Similar to Token Gate, but checks for NFT ownership:
    11
    [On Collision (Secret Door)]
    
       └──→ [NFT Gate]
              Collection: [NFT collection address]
    
              ├─ Has NFT ──→ [Open Door]
              └─ No NFT ──→ [Show Message]
    

    Configuring In-Game Economy

    1
    Automatic Rewards
    2
  • Go to 💰 Economy tab
  • Select Reward Token from your created tokens
  • Set Tokens per Level Complete (e.g., 10)
  • Players automatically receive tokens when they finish levels
  • 3
    {
      "economy": {
        "rewardTokenMint": "YourTokenMintAddress",
        "rewardPerLevel": 10,
        "tipJarEnabled": true
      }
    }
    
    4
    Enable Tip Jar
    5
  • In Economy tab, toggle Tip Jar on
  • A “Tip Creator” button appears in your published game
  • Players can send SOL directly to your wallet
  • Great for supporting game creators!
  • Web3 Node Reference

    Token Operations

    🚀 Launch Token (Pump.fun)
    • Creates a new token on the bonding curve
    • Inputs: name, symbol, imageUri
    • Outputs: tokenMint, txHash
    💰 Buy Token (Pump.fun)
    • Buy tokens from the bonding curve
    • Inputs: tokenMint, solAmount, slippage
    • Outputs: tokensReceived, txHash
    💸 Sell Token (Pump.fun)
    • Sell tokens to the bonding curve
    • Inputs: tokenMint, tokenAmount, slippage
    • Outputs: solReceived, txHash
    🎁 Reward Player
    • Send tokens to the connected wallet
    • Inputs: tokenMint, amount
    • Outputs: txHash
    💎 Check Balance
    • Get token balance for connected wallet
    • Inputs: tokenMint
    • Outputs: balance (float)
    🔐 Token Gate
    • Check if wallet has minimum token balance
    • Inputs: tokenMint, minBalance
    • Outputs: exec-pass (has access), exec-fail (no access), balance
    📊 Get Token Price
    • Query current price from bonding curve
    • Inputs: tokenMint
    • Outputs: priceInSol, marketCap

    NFT Operations

    🎨 Mint NFT
    • Create an NFT and send to wallet
    • Inputs: name, imageUri, attributes
    • Outputs: mintAddress, txHash

    Solana Operations

    ⬡ Send SOL
    • Transfer SOL to another wallet
    • Inputs: recipient, amount
    • Outputs: txHash
    🏦 Airdrop Tokens
    • Send tokens to a specific address
    • Inputs: tokenMint, recipient, amount
    • Outputs: txHash

    Testing on Devnet

    1
    Switch to Devnet
    2
  • Go to ⚙️ Settings tab
  • Click 🧪 Devnet
  • Your wallet switches to test network
  • 3
    Get Test SOL
    4
  • Copy your wallet address from Settings
  • Visit Solana Faucet
  • Paste your address
  • Request 1-2 SOL (test tokens, no value)
  • Wait 10-30 seconds for confirmation
  • Your balance updates in Settings
  • 5
    Test Your Web3 Features
    6
  • Launch a test token on Devnet
  • Mint test NFTs
  • Test all Web3 nodes
  • Verify transactions in Settings → Recent Transactions
  • Check on Solscan (Devnet)
  • 7
    Switch to Mainnet
    8
    When ready for real money:
    9
  • Go to Settings
  • Click 🌐 Mainnet
  • Ensure you have real SOL in your wallet
  • Repeat token launch (this costs real SOL!)
  • Update your nodes with the new mainnet token mint address
  • 10
    Mainnet costs real money!Always test thoroughly on Devnet before deploying to Mainnet. Transactions on Mainnet cannot be reversed.

    Published Game Wallet UI

    When you publish a Web3-enabled game:
    1. A Connect Wallet button automatically appears in the game UI
    2. Players connect their Solana wallet (Phantom, Backpack, etc.)
    3. Web3 nodes execute transactions using the player’s wallet
    4. Transaction confirmations appear as notifications
    5. The player must approve each transaction in their wallet extension
    Player Experience:
    Game loads → [Connect Wallet] button appears
               → Player clicks and approves
               → Wallet connected
               → Web3 features now work
               → Player completes level
               → Wallet prompt: "Approve reward of 10 GAME tokens?"
               → Player approves
               → Tokens sent to wallet
    

    Best Practices

    Start on Devnet

    Always develop and test on Devnet. Only switch to Mainnet when your game is fully tested.

    Clear Token Info

    Explain to players what tokens/NFTs they’ll earn and why. Add in-game tooltips.

    Reasonable Rewards

    Don’t give away too many tokens too quickly. Balance your in-game economy.

    Transaction Feedback

    Use Print String or UI elements to confirm when tokens are sent or gates are checked.

    Common Issues

    Check that:
    • You have a Solana wallet extension installed (Phantom recommended)
    • You’re on the correct network (Devnet vs Mainnet)
    • The wallet extension is unlocked
    • You’ve approved the connection request
    Verify:
    • You have enough SOL for transaction fees (~0.01 SOL)
    • You’re on the correct network
    • Token symbol is 3-5 characters
    • Image URI is a valid URL
    Check:
    • Token mint address is correct (copy from Tokens tab)
    • Player’s wallet is connected
    • Player actually owns the tokens (check on Solscan)
    • Min Balance is set correctly
    Solana congestion can delay transactions. Wait 1-2 minutes. Check:
    • Transaction signature in Settings → Recent Transactions
    • Status on Solscan
    • Network status at Solana Status

    Example: Complete Web3 Game Economy

    Game: Platformer with token economy
    
    1. Launch token "JUMP" on Pump.fun
    2. Set Economy:
       - Reward Token: JUMP
       - Per Level: 10 JUMP
       - Tip Jar: Enabled
    
    3. Level 1: Tutorial (free)
       On Complete → Reward 10 JUMP
    
    4. Level 2: Standard
       On Complete → Reward 10 JUMP
    
    5. VIP Level: Token-Gated
       Entry Requirement: 100 JUMP
       On Complete → Reward 50 JUMP + Mint NFT
    
    6. Secret Level: NFT-Gated
       Entry Requirement: Victory NFT from VIP Level
       On Complete → Reward 100 JUMP
    

    Next Steps

    Build docs developers (and LLMs) love