project screenshot 1
project screenshot 2
project screenshot 3
project screenshot 4
project screenshot 5
project screenshot 6

Metaloot

Metaloot is a launchpad for games which brings on chain logic capability to players and game devs. Metaloot connects games to Flow, so that in game items can be stored on chain as NFT, allowing not only for player ownership, but also to bring your items cross game.

Metaloot

Created At

ETHGlobal Bangkok

Winner of

Flow Foundation - Best Gaming App on Flow

ETHGlobal - 🏆 ETHGlobal Bangkok 2024 Finalist

Project Description

Metaloot is a launchpad for games who wish to take their players' experience on chain. That means owning the items you earn within games, obtaining new items from outside of the game or from different seemingly unrelated games to use in game. This is important because too often you spend countless hours as a gamer on one game, grinding achievements, acquiring rare loot, only to then move on to the next game and start from scratch. Or worse swill, when a game studio decides to shut down/patch their game to oblivion, leaving you with nothing to show for all of the time you spent playing.

Metaloot solves this by enabling game devs to launch from Metaloot and utilize the Flow Chain (game items are NFTs on Flow and player account is a Flow account abstraction account) and Metaloot API to create custom on chain game logic, allow players to own items, and because Metaloot is a platform, enabling players to take those items into different games.

Metaloot is a Desktop Application that runs a server in a separate thread, allowing devs to connect to Flow from within their games also running on Desktop.

Metaloot is a launchpad for games which can utilize Metaloot's API and the Flow Blockchain to encode items/events as NFTs, giving players the ownership of their in game items and making them sharable cross games.

MetaLoot is a comprehensive platform built entirely on the Flow blockchain, leveraging Cadence smart contracts to enable seamless integration of Non-Fungible Tokens (NFTs), gaming sessions, and a marketplace. Our project includes three key smart contracts that work together to provide a robust, decentralized gaming ecosystem:

MetaLootNFT Contract: Conforms to the NonFungibleToken standard on Flow, ensuring compatibility and adherence to blockchain standards for NFTs. GameSessions Contract: Manages active and historical game sessions, linking them to individual user addresses and storing session states securely on-chain. Marketplace Contract: Facilitates NFT listing and sales, providing a decentralized space for trading NPC and in-game NFTs. How It Works GameSessions Smart Contract

The GameSessions smart contract is the backbone of the gaming experience on MetaLoot. Here's how it functions:

Starting a Session: A game session begins automatically when a user launches a game on MetaLoot. The contract initializes the session and stores the user’s address. Session Management: Users can: Add items to their inventory during gameplay. Extend the session for as long as they wish without fear of losing progress, even in the event of connection interruptions. The session's state is securely stored on-chain, ensuring data integrity. Ending a Session: When the user decides to end the game: The GameSessions Contract automatically creates NFT items representing the session’s outcome. These NFTs are minted and deposited directly into the user’s wallet. Only after this process is the game session marked as ended. This design ensures a seamless and worry-free gaming experience, with all progress immutably stored on the blockchain.

Marketplace Contract

The Marketplace contract provides a user-friendly and secure way to list and trade NFTs. Here's how it works:

Listing an NFT: Users can list any NFT they own by providing its ID and proving ownership. The Marketplace contract stores the listing in a structured format, linking the NFT ID to metadata or any additional details required for the sale. Purchasing an NFT: When a buyer initiates a purchase, the Marketplace contract triggers a transferNFT function: The NFT is transferred from the original owner to the buyer. Ownership is updated in the MetaLootNFT Contract. The NFT is withdrawn from the original user's account, deposited into the buyer's account, and removed from the Marketplace listing. This process ensures transparency, efficiency, and security for all marketplace transactions.

NPC 3D-Model NFTs

MetaLoot includes unique NPC 3D-Model NFTs, where the actual 3D model files (in .glb format) are securely stored on FileChain. These files are accessible only to the rightful owner of the NFT. Key features include:

NFT Ownership Validation: Only verified owners can download the .glb file via an accessible link. FileChain Integration: The use of FileChain ensures that high-value assets are protected and remain accessible to the appropriate parties. Key Features On-Chain Game Session Management: State-preserving sessions that prevent data loss and enhance the gaming experience. NFT Creation and Minting: Automatic generation and minting of session-based NFTs, directly deposited into user wallets. Decentralized Marketplace: A secure and efficient trading platform for NPCs and in-game items. Exclusive 3D Content: Rights-protected access to .glb files for NPC NFTs, providing real-world utility for token ownership. Technical Highlights Built on the Flow blockchain, leveraging its developer-friendly environment and Cadence's resource-oriented programming. State persistence and seamless NFT management ensure users retain control over their in-game progress and digital assets. Designed to integrate gaming, trading, and ownership into a unified, decentralized ecosystem. MetaLoot redefines gaming on the blockchain, blending decentralized asset management with unparalleled user experience.

How it's Made

How It’s Made

Metaloot is a Desktop Application build with Tauri Apps. The serverside of the application is Rust and that's where the API server is running (multithreaded so as not to hang the rest of the operations). Games can call this API from inside of their games. The frontend of the appliation is NextJS. that's where the connections and transactions to the flow is made. rust gets api called from games, it emits events, frontend picks up on events, executes txns based on event body, and call s rust back to give data back to the game.

MetaLoot was crafted entirely on the Flow blockchain using Cadence, Flow's resource-oriented smart contract language. We embraced Flow's developer-friendly architecture and ecosystem to build a gaming platform that is decentralized, seamless, and scalable. Here’s a detailed breakdown of how we pieced it all together:

Core Technologies Flow Blockchain: Provides the foundation for the entire project, leveraging its high performance and low latency to handle game state management, NFT minting, and marketplace operations. Built with scalability and usability in mind, Flow enabled us to focus on the application logic without worrying about the underlying blockchain constraints. Cadence: The project was written 100% in Cadence, Flow’s resource-oriented smart contract language. Cadence’s resource model was particularly beneficial for: Ensuring the security of NFTs by treating them as unique resources. Preventing accidental duplication or loss of NFTs and game session data. All contracts (MetaLootNFT, GameSessions, and Marketplace) were written to maximize composability and reusability. FCL (Flow Client Library): Used in our frontend to interact with Cadence smart contracts. FCL provided seamless wallet integration for transactions like starting game sessions, minting NFTs, and listing assets on the marketplace. FileChain: Integrated for decentralized file storage of NPC 3D models (.glb files). Ensured that asset files were securely stored and accessible only to rightful NFT owners via verifiable links. IPFS: Used for NFT metadata storage, ensuring decentralization and immutability. Metadata included links to FileChain-hosted .glb files and session-generated NFTs. How the Pieces Fit Together Smart Contracts

MetaLootNFT Contract: Implements Flow’s NonFungibleToken standard to manage ownership and transfer of NFTs. Designed to support complex metadata, such as 3D model links and attributes. Used for minting session-based NFTs and NPC 3D models. GameSessions Contract: Tracks active and historical gaming sessions for each user. Stores game state on-chain to prevent progress loss due to disconnections. Generates NFTs automatically when a session ends, depositing them directly into the user’s wallet. Marketplace Contract: Implements listing and trading functionality for NFTs. Ensures secure ownership validation before processing sales. Automates NFT transfer between users, linking seamlessly with the MetaLootNFT contract. Frontend

Built using React for an intuitive and responsive user interface. FCL enabled wallet integration, allowing users to connect their Flow wallets and interact with the platform. The frontend dynamically fetches and displays NFTs and marketplace listings using Flow queries. File Handling

FileChain: Stores large .glb files for NPC NFTs. IPFS: Hosts metadata for in-game items, session NFTs, and marketplace listings. Links to files are stored in smart contracts, ensuring they are always accessible via decentralized systems. Hacky and Notable Features On-Chain Game State Persistence: Implemented a system where game session states are saved on-chain in real-time. This prevents users from losing progress even if their connection drops unexpectedly. Hacky Aspect: We utilized Cadence’s resource-oriented model to create lightweight, session-specific storage units, ensuring minimal on-chain overhead while maintaining scalability. Dynamic NFT Minting: NFTs are dynamically generated at the end of each game session, with metadata reflecting session-specific details like game achievements or earned items. Hacky Aspect: We used Cadence’s ability to handle composable resources to mint multiple NFTs simultaneously for a single session. File Access Control: NPC 3D models are accessible only to rightful NFT owners. File access links are dynamically generated and verified via smart contract interactions. Hacky Aspect: We tied the NFT ownership logic directly to FileChain, ensuring seamless access control without requiring centralized verification. Composable Contracts: All three contracts were designed to interact with each other seamlessly. For example: The Marketplace contract interacts with the MetaLootNFT contract to validate ownership before executing a trade. The GameSessions contract directly triggers NFT minting in MetaLootNFT upon session completion. Why Flow and Cadence? Scalability: Flow’s architecture (Execution Nodes, Collection Nodes, etc.) handles high transaction throughput efficiently, making it ideal for gaming and NFT operations. Developer Experience: Cadence’s clarity and resource-oriented design made it easier to implement complex features like session management and NFT minting. Composability: Flow’s modular contract design allowed us to create interoperable contracts, reducing redundancy and improving maintainability. Partner Technologies and Benefits Flow Ecosystem: Enabled us to build with a clear focus on user experience and security. FileChain: Simplified secure storage and access to large .glb files, providing a scalable solution for hosting 3D assets. IPFS: Ensured metadata was decentralized, immutable, and accessible to any Flow-compatible platform.

background image mobile

Join the mailing list

Get the latest news and updates