Onchain Fun for Telegram

Imagine you could send stables, mint NFTs, buy tokens, and even sign multisig transactions on your favorite EVM chains — without leaving Telegram. That's what we've built.

  • 0 Raised
  • 531 Views
  • 0 Judges

Categories

  • Ethereum Track Bounty
  • Optimism
  • Neon EVM
  • BNB Chain

Gallery

Description

Links

Videos: https://photos.app.goo.gl/xtc6RM931N848sXT6

Code: https://github.com/alyavasilyeva/hackathon-belgrade-2024/

Project overview

Onchain Fun for Telegram is a non-custodial EVM wallet embedded into Telegram. It allows users to transfer tokens and perform more complex transactions offered by chats, channels, or bots, all without leaving the comforts of Telegram.

Problem statement

Telegram is the default social network for crypto enthusiasts with a thriving ecosystem of crypto-related channels and chats, but crypto interactions on Telegram are limited. For example, if you want to send a fellow group member some tokens, you must confirm their address, open an external wallet app, then send. If a channel wants to offer its readers a token or an NFT, it must redirect users to an external dapp, which reduces conversion rates due to additional steps and poor mobile wallet support in the ecosystem.

Solution description

We have developed a bot and miniapp that act as a non-custodial EVM wallet. This enables users to perform various onchain actions directly from Telegram.

Actions initiated by the wallet user can be invoked by bot commands, while offering a transaction to a user can be done with a simple Farcaster Frames-like transaction description format.

To simplify onboarding, accounts are attached to Telegram accounts using Web3Auth and have their gas fees sponsored via a ZeroDev paymaster.

Technical stack

  • Next.js, TypeScript, EdgeDB
  • Telegram Bot API with Grammy, Telegram WebApp API
  • ZeroDev for account abstractions
  • Web3Auth for social login with Telegram
  • Viem, Wagmi

Interesting challenges

  • We originally attempted to invoke actions with Telegram inline queries (the way @gif bot works). It turned out that inline actions receive basically no information about their execution context, so we were unable to make use of them and opted for slash commands (like `/tip@onchainfun_bot`) instead.
  • We discovered that ZeroDev Kernel v3 contract is missing ERC721 and ERC1155 callback hooks, which makes it incompatible with many NFTs. We had to downgrade to v2.4 — including downgrading from Account Abstraction EntryPoint v0.7 to v0.6 — to solve that.
  • 50% of the team went down with a headcold on the second day, which made it very hard to code. Solved by applying copious amounts of tea!

Future plans

  • Add functionality like transaction history and asset balances overview.
  • Design and stuff!
  • Audit the application for security.