Skip to main content
Cardano NFT-marketplace

The First NFT-marketplace on Cardano

5 people
in the team
5 month
of work

Designed and developed in collaboration with IOHK, a decentralized application on the Plutus platform. The created DApp is one of the first NFT marketplaces on Cardano.

See the case

Account Abstraction: A Tool Against Gas Fees in Your dApp

wallet

Modern account abstraction is really elegant because it doesn’t require changes to the underlying protocol like other upgrades before it. This upgrade could be one of the driving catalysts for Web3 adoption around the world.

Vitalik Buterin
Co-founder of Ethereum

In 2016, Vitalik first introduced the idea of account abstractions, and seven years later, in March 2023, we saw its implementation as the ERC-4337 standard.

This technology is quite promising and enables features like:

  • Gasless transactions for users,
  • Paying gas fees with a token (like USDT),
  • Recurring payments,
  • Wallet access recovery via email or SMS.
  • It all sounded so awesome that we could hardly believe it would work as intended.

We spent loads of time getting to grips with how exactly it all works and how it's different from the usual seed-phrase accounts (EOA). Our Solidity developer Pavel Naydanov explained the technology in detail in his article Account Abstraction: What It Is and Why the Crypto World Needs It.

And in this piece, we'll talk about how such technology is implemented and how it solved a problem for one of our long-time clients.

Where we implemented it and why it was tough

The client came to us with an age-old problem: using blockchain is a pain.

Here's what they meant:

  • To send a token to someone, you need to get the native currency to pay for the gas fees.
  • Seed phrases are impossible to remember, so you have to write them down somewhere. And if you lose it, your funds are gone forever.

So, the task they set for us was:

Create a full-fledged Web3 wallet where blockchain newbies don't have to worry about gas and seed phrases, and can access a user-friendly ecosystem with tokens and NFTs.

In our team, we discussed two solutions:

  • The already tried-and-tested relayer (based on ERC-2771),
  • The new, but enticing Account Abstraction (ERC-4337).

At first glance, it seems better to use a time-tested solution rather than a standard that's still in draft. But the client had big plans to collaborate with external DeFi protocols to arrange for sponsoring users' gas fees who would use the wallet.

It's a brilliant idea! A perfect example of a win-win: protocols pay for the gas for using their service and gain more users due to better UX, while the user avoids up to 4 extra steps to acquire the native network token for gas fees. Instead, they would pay a comparable amount in the same token they are operating with.

Also, our client planned an on-ramp integration (like MoonPay) that would allow buying crypto for the wallet using a credit card, Apple Pay, etc.

For all this, a relayer wasn't suitable as it requires changes to be made in the smart contracts of the services we want to partner with. Let's be honest - those willing to adapt their applications for yet-to-be-released wallets were not exactly queuing up.

But Account Abstraction required no changes on the part of other DeFi applications. We just needed to connect to our solution and set some rules, which is much simpler than rewriting and adding additional logic.

Another feature of AA was bundling several transactions into one. While a meta-transaction from a relayer could only contain one transaction, an AA bundler allowed packing several user operations (UserOperations) into one transaction. This helps to save on costs for potential gas sponsors.

What did we decide about the seed phrase?

Another crucial requirement was to free the client from the risk of holding users' funds. This requirement was inspired by the still fresh-in-memory case of FTX.

The client had no plans to manage user funds, so we suggested using Fireblocks as a custody provider. It's a proven and reliable service that would store users' private keys and provide transaction signatures upon request.

Here are a few reasons why we chose Fireblocks:

  1. Key Segmentation: Instead of creating one complete key, MPC (Multi-Party Computation) generates several key shares. Each key share is stored separately and securely.
  2. Transaction Management: To carry out a transaction, all parties (like different modules of your service) must consent. This is done by combining their separate key shares, but without fully disclosing them.
  3. Security: The private key is never fully assembled in one place. Even if a hacker accesses one part of the key, they can't use it without the other parts.
  4. Flexibility and Control: MPC wallets allow setting rules and policies for transactions, providing additional control over funds.

Having ensured we had all the resources and tools to tackle the tasks at hand, we got started on the development!

Development

To get everything up and running, we needed to launch our own service (a Bundler) to repack traditional transactions and set up contracts (like a wallet, wallet factory, paymaster, etc.). The big decision was whether to build everything from scratch or use a service provider.

Building from scratch seemed too much for a project at this stage. It could make the project much more expensive and take a lot longer. Also, there were risks: there were no proven bundler implementations available at that time, and making our own would be too hard and could drag the project on for too long.

So, we looked at service providers. There were a few choices, and they mainly differed in what they had managed to develop. For example, ZeroDev only supported gas payment with USDT and PEPE, which wasn't enough for us.

We then considered Alchemy, which had just started developing their bundler and already had a partnership with our client. Alchemy is also a well-respected brand in Web3, so we went with them.

We were one of the first to work with them, so we experienced all the early challenges alongside their team.

At one point, we set up joint chats and calls with the Alchemy team. Our engineers gave a lot of feedback on their solution, and their technical team quickly took our recommendations on board and updated their product. We worked side by side on implementing the technology and contributed to many of its improvements.

Nico Bordunenko
Project manager

The biggest issue was the documentation. It was just a bunch of step-by-step tutorials. If you had a question that went off-script, you had to dig through some pretty complex source code. Also, some features, like webhooks notification, didn't work as described in the docs. You could set GraphQL variables, but they wouldn't pull through in the actual request on Alchemy's side. In the end, we had to use some makeshift solutions because the Alchemy team couldn't help with this. Moreover, Alchemy's approach is based on reusing other products from their company, which ties the project tightly to their infrastructure. Our client really wanted the product to not be solely dependent on Alchemy. It was a tough but super important task because the whole project's stability was at stake. Nevertheless, we managed it within a reasonable timeframe, and now the AA provider in the app is easily replaceable. In the end, despite all the challenges, I'm really happy with how we worked with the Alchemy team. It left us with nothing but good vibes with the Alchemy team. Only positive impressions remain from working with them.

Anton Korpysenko
Backend Lead of the project

Project Summary

We completed the project in six weeks, including research and extensive communication with the provider team and other services. After setting up the infrastructure for AA, we handed the code over to the in-house team. They focused on the frontend, connecting the on-ramp service, and other features.

Two full-time Node.js developers worked on the project, supported by a tech lead who conducted code reviews and developed the system design of the service.

The client received all the required functionality within the set deadlines, along with documentation and a technical demo to show investors and partners that the promises in the pitch decks were substantial.

A pleasant bonus and a karmic plus was working with Alchemy and contributing to a product that, in our opinion, will be used by millions of people.

Now, the MetaLamp team has a nearly out-of-the-box solution for implementing AA in any wallet or dApp, making the lives of users of these applications easier.

In the end, we implemented all the features the client was waiting for without resorting to total centralization and without holding onto any user private keys. This allows the users of the project to avoid the typical expenses and complexities of web3, such as managing seed phrases and paying for gas, while still enjoying many benefits and gaining a user-friendly entry into the cryptocurrency world.

Nico Bordunenko
Project manager

Subscribe to our weekly newsletter to receive the most interesting materials in your inbox. We don't include any ads in our newsletter, just content from our Magazine :)

More articles about web3

Featured story
tokens

Articles

web3
business
startup
How real businesses tokenize assets: Step-by-Step guide

Elizaveta Chernaya

Brand Media Editor

Featured story
myths

Articles

web3
dApps
startup
Myths about Blockchain Product Development

Nico Bordunenko

Project manager at MetaLamp

squares

Articles

cardano
web3
NFT
The first NFT marketplace on Cardano

Stanislav Zhdanovich

Haskell developer

zksync
Hot
rwa
New
anonymus
New
Zero-knowledge proof explained and 2024 Trends

Yevgeniy Biktimirov

Venture Analyst

Articles

ethereum
web3
dApps
cpay
Featured story
stock market chart
Featured story
planets
fundraising
Featured story
cto
wallet
Account Abstraction: A Tool Against Gas Fees in Your dApp

Nico Bordunenko

Project manager at MetaLamp

Articles

ethereum
web3
tokens
Featured story
rocketcomputer
Featured story
How to create a design for a startup MVP in 7 days

Julia Cherepanova

Head of Design Office

Articles

startup
MVP
design
crypto wallets
Featured story
speed up development
myths
Featured story
Myths about Blockchain Product Development

Nico Bordunenko

Project manager at MetaLamp

Articles

web3
dApps
startup
mvp launching rocket
Featured story
Who should be hired on the team to launch an MVP?

Alexey Sukharev

HEAD OF Sales DEPARTMENT

Articles

business
startup
MVP
galaxy
Featured story
magazine
Top 6 Trends in Crypto Apps 2023

Roman Shtih

CEO Metalamp

Articles

web3
dApps
cryptocoffee
investments
investors
squares
The first NFT marketplace on Cardano

Stanislav Zhdanovich

Haskell developer

Articles

cardano
web3
NFT
stair
bridge
abstraction
How we use our own training program to hire Plutus engineers

Svetlana Dulceva

The Education Program Supervisor

Articles

education
cardano
web3
mountains
computer in space
A perfect HR: why are IT companies happy with our junior developers?

Svetlana Dulceva

The Education Program Supervisor

Articles

education
web2
business
salary
IT developer
cardano
chains
abstraction
salary
Featured story
rocket
a man with books
Featured story