← Back to home

PFP WAR

PFP Pixel War is a collaborative game where the players use NFTs they own on L1 Ethereum mainnet to use them in L2 via Storage proofs and MUD. It's inspired from r/place by Reddit

Screenshots

PFP WAR screenshot 1
PFP WAR screenshot 2
PFP WAR screenshot 3

Problem Statement

PFP War is a collaborative experience in which participants place their NFT on pixel (or β€œtile”) on an online canvas of 2500 (50 x 50) pixel squares, and wait a certain amount of time before placing another.Technical motivationsChallenge to prove the ownership of an L1 NFT on L2Challenge to make this verifier a precompile in op-gethDiscovery and Stress test the MUD frameworkWhat have we done ?Ethereum Merkle Patricia Trie proof verifier (Solidity smart-contract)PFP War: A web game that uses our verifier (MUD React Client)A op-geth precompile of this verifier (Go)More details on our project README : https://github.com/cometh-game/pixel-war/blob/master/README.md

Solution

We made an autonomous world using MUD and Storage Proof verifier on OP-stack.About the Ethereum Merkle Patricia Trie proof verifier:The Ethereum state is a data structure (a modified Merkle Patricia Trie) which keeps all accounts (nonce, balance, codeHash, storageRoot) linked by hashes and reducible to a single root hash stored on the blockchain.We developed the Solidity Library that verify the Merkle Patricia Trie (MPT)We developed a precompile of this LibAbout PFP War that use the MPT verifier and MUD frameworkWe developed our project entirely with MUD / React. We have deployed our contracts with the MUD system and interacted with the hooks provided.Really simplifies the work on the front-endSome issues with the public testnet indexerGreat support from the MUD teamUltra-simplified smart-contract dev and managementBinding between UI and contract state is really coolAbout Optimism and Storage proofThe implementation of the Ethereum Merkle Patricia Trie was an interesting tech challenge.We deepened our understanding of EVM, precompiles and how the state is stored.The full feedback about our experiment is available here https://medium.com/@vincentlg/pfp-war-project-use-the-l1-state-on-optimism-l2-with-storage-proof-fc0124db7caf

Hackathon

Autonomous Worlds

2024

Prizes

  • πŸ†

    πŸ₯‰ Optimism β€” Mod the Stack

  • πŸ†

    πŸ₯ˆ 0xPARC β€” Best use of Advanced Cryptography

  • πŸ†

    πŸ† Autonomous Worlds Finalist

Contributors