[B2] - Hunter Z Hunter 🏅

Hunter Z Hunter is an on-chain scavenger hunt that uses zero knowledge machine learning with the ezkl library. When a user finds the item, they snap a photo to generate a proof. If the proof verifies (ML recognizes it), the user wins the prize.

0
1

Challenges

Deploy your smart contract on Scroll

Pool 10,000 USDC

We deployed our prize smart contracts to Scroll [https://blockscout.scroll.io/address/0xA26CdC22ACC8DFA71036F40Be158C66c84D99b98] Repo example https://github.com/scroll-tech/scroll-contract-deploy-demo/blob/main/hardhat.config.ts doesn’t contains verification of SC as well as docs Docs and chats are operating with terms of L1, L2, Alpha, pre-Alpha without clear explanation how all of them relates to each other Bridge didn’t work for me https://prealpha--scroll-io.netlify.app/prealpha/bridge transaction example https://l1scan.scroll.io/tx/0xc8886b3fe2b7634a36184fbc59b0e6491cac02ab87261fb26b81459c97d433fc (at least I don’t see balance updated here https://l2scan.scroll.io/address/0x1ee01F7a3425f00931B00aAd20A5A3E559D4f868 for the moment of writing the comment, waited for a few hours)

#BUIDLathon 2023 Infrastructure + Scalability

Pool 15,000 USDC

HunterZHunter is qualified for infrastructure and scalability because our proof of concept gives eyes to the blockchain. On-chain machine learning can be used for several applications from DeFi to account abstraction / security. We are excited to see how zkml improves web3.

Most Useful Web3 Tool

Ranked 2,500 ETH

Hunter Z Hunter can be used for more than scavenger hunts. It can be used for access control too. Prompting people to find a certain item and submit it can be quite useful. We deployed our verifier and prize smart contracts to Polygon Mumbai testnet [https://mumbai.polygonscan.com/address/0x24681548c0dfc0c8b3c6822cbe40c3fff5a972f7#code ... https://mumbai.polygonscan.com/address/0x5040860f30ca29ff4faa45f9cb03625e5467c3d5]

OpenZeppelin Defender Integration

Ranked 10,000 USDC

We used OpenZeppelin's sentinals to keep track of our hunt security. We also used a relayer to call our hunt creations from the backend for our intensive testing. OpenZeppelin Relayer Sentinels: https://defender.openzeppelin.com/#/sentinel/265485ad-3a73-4a0b-b847-13695c236a8c https://defender.openzeppelin.com/#/sentinel/02e0cd45-d848-4d75-ba93-4c86a897796e Relayer: https://defender.openzeppelin.com/#/relay/e0424481-a252-4cc4-b4c3-11ab38184ea6/

Best new subgraph(s)

Ranked 5,500 USDC

The Graph Deployed a subgraph for our hunts https://api.thegraph.com/subgraphs/name/richwarner/hunter-z-hunter/graphql?query=%7B%0A++huntAddeds+%7B%0A++++transactionHash%0A++++target%0A++++prize%0A++++id%0A++++endTime%0A++++name%0A++++huntId%0A++++blockTimestamp%0A++++blockNumber%0A++%7D%0A%7D Used in our project here: https://github.com/hunter-z-hunter/hunter-z-hunter/blob/main/frontend/src/subgraph/hunts.graphql

Best Use of Polygon

Ranked 10,000 ETH

We deployed our verifier and prize contracts to Mumbai. We were able to use account abstraction on Polygon to make transactions without wallets. We deployed our verifier and prize smart contracts to Polygon Mumbai testnet [https://mumbai.polygonscan.com/address/0x24681548c0dfc0c8b3c6822cbe40c3fff5a972f7#code ... https://mumbai.polygonscan.com/address/0x5040860f30ca29ff4faa45f9cb03625e5467c3d5]

Web3Modal Creative Challenge

Ranked 5,000 USDC

We used web3Modal with wagmi to give people the opportunity to claim their prize.

Applied ZK, with a side of Scroll

Pool 3,000 USDC

We learned the halo2 proving system in depth for this project. We even contributed to ezkl to fine tune for our use case. Outside of deploying our contract on Scroll, we generated a zk circuit from an ml model.

BUIDL on Fireblocks

Ranked 25,000 USDC

We needed to fund our contract to pay for transactions with account abstraction. We chose Fireblocks to make this as secure as possible. When I tried to call some API according to the documentation I got HTML code. Discussed in the fireblocks discord of the event https://discord.com/channels/541487144884240436/1075106624571711612/1081709150179967046 the issue was with the wrong URL. Proposal: better to not return HTTP 200 with some html if URL is not correct Also some of the links a leading to the zendesk which requires separate account instead of leading to the main docs Smart contract triggered from Fireblocks https://mumbai.polygonscan.com/address/0x5040860f30cA29Ff4fAA45F9Cb03625E5467C3d5 Fireblocks wallet used to trigger our contract https://mumbai.polygonscan.com/address/0xa82bfaae4f125587593a2a3ba4c1a75d7195beee Reported in Discord a few issues and potential improvements Implemented Fireblocks here: https://github.com/hunter-z-hunter/hunter-z-hunter/commit/0656295de53892c02a09c1dbf3e8d186b34240c0#diff-3b030de2b172ba21c9b95bb0751c7024be2dde7d129d92b176166526297f3d58R113

Project details

  • We used the ezkl library to generate a proof and verifier for a 4 layer machine learning neural net. Ezkl [https://github.com/zkonduit/ezkl] is a library that is used to convert machine learning models to zero knowledge circuits using the halo2 proving system

  • We deployed our verifier and prize smart contracts to Polygon Mumbai testnet [https://mumbai.polygonscan.com/address/0x24681548c0dfc0c8b3c6822cbe40c3fff5a972f7#code ... https://mumbai.polygonscan.com/address/0x5040860f30ca29ff4faa45f9cb03625e5467c3d5]

  • We deployed our prize smart contracts to Scroll [https://blockscout.scroll.io/address/0xA26CdC22ACC8DFA71036F40Be158C66c84D99b98]

    • Repo example https://github.com/scroll-tech/scroll-contract-deploy-demo/blob/main/hardhat.config.ts doesn’t contains verification of SC as well as docs

    • Docs and chats are operating with terms of L1, L2, Alpha, pre-Alpha without clear explanation how all of them relates to each other

    • Bridge didn’t work for me https://prealpha--scroll-io.netlify.app/prealpha/bridge transaction example https://l1scan.scroll.io/tx/0xc8886b3fe2b7634a36184fbc59b0e6491cac02ab87261fb26b81459c97d433fc (at least I don’t see balance updated here https://l2scan.scroll.io/address/0x1ee01F7a3425f00931B00aAd20A5A3E559D4f868 for the moment of writing the comment, waited for a few hours)

  • Fireblocks

    • When I tried to call some API according to the documentation I got HTML code. Discussed in the fireblocks discord of the event https://discord.com/channels/541487144884240436/1075106624571711612/1081709150179967046 the issue was with the wrong URL. Proposal: better to not return HTTP 200 with some html if URL is not correct

    • Also some of the links a leading to the zendesk which requires separate account instead of leading to the main docs

    • Smart contract triggered from Fireblocks https://mumbai.polygonscan.com/address/0x5040860f30cA29Ff4fAA45F9Cb03625E5467C3d5

    • Fireblocks wallet used to trigger our contract https://mumbai.polygonscan.com/address/0xa82bfaae4f125587593a2a3ba4c1a75d7195beee

    • Reported in Discord a few issues and potential improvements

    • Implemented Fireblocks here: https://github.com/hunter-z-hunter/hunter-z-hunter/commit/0656295de53892c02a09c1dbf3e8d186b34240c0#diff-3b030de2b172ba21c9b95bb0751c7024be2dde7d129d92b176166526297f3d58R113

  • The Graph

    • Deployed a subgraph for our hunts

    • https://api.thegraph.com/subgraphs/name/richwarner/hunter-z-hunter/graphql?query=%7B%0A++huntAddeds+%7B%0A++++transactionHash%0A++++target%0A++++prize%0A++++id%0A++++endTime%0A++++name%0A++++huntId%0A++++blockTimestamp%0A++++blockNumber%0A++%7D%0A%7D

    • Used in our project here: https://github.com/hunter-z-hunter/hunter-z-hunter/blob/main/frontend/src/subgraph/hunts.graphql

  • OpenZeppelin Relayer

    • Sentinels:

      https://defender.openzeppelin.com/#/sentinel/265485ad-3a73-4a0b-b847-13695c236a8c

      https://defender.openzeppelin.com/#/sentinel/02e0cd45-d848-4d75-ba93-4c86a897796e

    • Relayer:

      https://defender.openzeppelin.com/#/relay/e0424481-a252-4cc4-b4c3-11ab38184ea6/