Hacking a Tezos Wallet with Flutter at HackOut 21 | by Sameer Kashyap | Nov, 2021 |

admin

If you are new to blockchain, I would recommend reading a bit more about the basic concepts as I will not be diving a bit deeper in this blog, but you can tag along as it won’t contain too much rocket science. Amongst the ton of blockchain protocols out there, Tezos is a popular one…

If you are new to blockchain, I would recommend reading a bit more about the basic concepts as I will not be diving a bit deeper in this blog, but you can tag along as it won’t contain too much rocket science.

Amongst the ton of blockchain protocols out there, Tezos is a popular one and has some key differentiations.

Features Self Amendment allows Tezos to easily up g rade the protocol without a hard fork to the network, which, chains like Ethereum need to undergo, and unlike Ethereum or other Proof of Work blockchains, Tezos uses a Proof of Stake consensus mechanism to validate transactions.This reduces the carbon footprint while also reducing the cost of transactions since validators, or in Tezos terms, ‘Bakers’ validate the transaction and add a block to the blockchain.

Tezos is certainly one of the top blockchains out there with some great ecosystems and communities growing every day.

Development Tezos supports a wide range of development options, the main language it uses is Michelson , which is slightly low level, but Tezos does provide high-level wrappers in Python, Indigo, and LIGO .To get started you can grab the Tezos CLI and Docker image to run a local node and play around.

A bit about Hackout HackOut is a season hackathon hosted by HeadOut , it usually spans 48 hours, as it did this time too.The tracks are usually around travel, and as blockchain companies are sponsoring more hackathons over the past year, it brought a good amount of opportunity.Specifically Tezos, Tezos had a track prize to build a Tezos wallet app using Flutter.And thus was born Anthos.

Anthos Anthos is a Tezos wallet built using Flutter, through which you can send and receive transactions as well as track the market price of Tezos.Anthos in greek means obsession with Flowers, but we choose it because it rhymed and sounded cool.

Hack Starts The hackathon officially began on 29 Oct at 5 PM, but I couldn’t start right away as I am working full time.Not only was it challenging to build the project, but also manage time along with it.

So I started the next day.

The goal was simple, to build an MVP Tezos wallet using Flutter.I was a bit skeptical if I’d be able to pull it off as I knew very little about Tezos.So I started looking into the docs on the Tezos website, although they have some great resources, there was nothing related to what I was about to build.

Luckily there were some plugins on pub.dev and I chose to go with, tezster_dart had some good documentation and syntax.

The Architecture I’ve tried several state management solutions and architectures in Flutter over the past couple of years and have become a fan of Riverpod, Freezed, and Flutter Hooks for their ease of use and the nature of simplifying things.And, because they are all from the same author, they just all work so well with each other.And Freezed came in especially handy as it could generate Uninion Classes.

Here is a simple diagram that represents how I managed the state.

I used tzkt.io to get indexed data from the Tezos blockchain about account details and transaction details.Below is some sample code that I used to load data into the state.

I also used coingecko.com to get the latest Tezos market price and other metadata.It is one of the few free APIs without an API key and does a pretty good job.

I tried implementing a minimal UI inspired by some of the recent fintech apps.

Some Challenges The biggest challenge was figuring out the complex terms and types of accounts that Tezos supports, I still am quite unaware of the mechanisms of a few of the account types such as fundraiser accounts.And tzkt.io returns data along with the type of account.

This would have been complicated to implement, but it was a piece of cake with Freezed and union classes as Freezed automatically switches the class from which to parse the object using a union key, here, ‘type’.

Hacking without much knowledge about Tezos was a challenge in itself as it made it very hard to do other functionalities like perform transactions, or otherwise known as ‘opertaions’ in Tezos.But, Tezster came in handy.

Sending a transaction was one the of challenging tasks I was stuck as I messed up sending the public key and secret, I was so stuck that I almost gave up on the project halfway but at the last moment, I was able to get it working and hence successfully made a working MVP of a typical Crypto Wallet.

Sending Transaction with tezster Final Pieces Some Final polishing pieces left were adding support for changing between multiple networks and adding support for importing and creating new accounts.Tezster provided an easy way to decode a mnemonic and generate keys.

Winning It Well, it was certainly an amazing experience and worth the effort of coding nonstop for two days and giving up the weekend, as it had been a while since I participated in a short hackathon.Thanks to the organizers for making Hackout awesome.

We won 3rd place with a shared prize along with another blockchain project.

Liked the idea, I’m hoping to make this into an awesome open source project as there is great potential to add new features

Support for more accounts — Baker, Fundraiser Enhance local storage encryption Support for FA1 and FA2 token and NFT collectibles Ability to swap tokens Add a local password for security If you are interested in contributing head over to the repository below, and also don’t forget to give it a 🌟.

GitHub – Sameerkash/Anthos: A Tezos Wallet built with Flutter A Tezos Wallet built with Flutter.Contribute to Sameerkash/Anthos development by creating an account on GitHub.github.com

I will be sharing more content on web3 and Flutter, so be sure to connect with me on Twitter and LinkedIn.

JavaScript is not available.Edit description twitter.com

Sameer Kashyap – Software Engineer – FrontRow | LinkedIn Over the past 2 years, my main interests have been developing cross-platform mobile apps using Flutter and web apps… www.linkedin.com.

Leave a Reply

Next Post

Metis Launches Platform’s Mainnet Andromeda, Confirms Commitment to Decentralization, Announces $100M Ecosystem Fund

The Metis team has launched the platform’s Mainnet Andromeda, a move that confirms a commitment to greater decentralization of Internet-based services. [$METIS] will launch its inaugural Layer 2 mainnet, Andromeda, Friday Nov 19, 3 pm UTC. Join our launch livestream w/ partners [@AssxToken] [@Metacraftpro] [@standarddefi] [@BCharityFi] + more! EVM Equivalence + highest levels of decentralization.Only…
Metis Launches Platform’s Mainnet Andromeda, Confirms Commitment to Decentralization, Announces $100M Ecosystem Fund

Subscribe US Now