Self-Custody for Everyone

Candide Labs
5 min readJul 25, 2022

--

Why Layer 2 will unlock the full potential of Account Abstraction

Table of content:

Why self-custody matters

Externally Owned Account vs Contract Accounts

Account Abstraction without protocol changes

Account Abstraction on Rollups

Candide Beta

Why self-custody matters

If you don’t self-custody an asset, you don’t really own it. If you have trusted your funds with someone else, then you trust your counter-party to safeguards your assets. The sad reality is that your counter-party is usually a business, and businesses can go, well, out of business. We have seen this played out this year with multiple financial crypto institutions who had regularly advertised their services as safe and guaranteed, but in reality they were gambling with their customers funds.

Even if you hold your assets at a reputable European bank, you are sure your securities are not held by that institution. In fact, the banking system relies on large numbers of customers depositing their money electronically to loan and invest their customers’ funds. Your full deposit isn’t necessarily covered in cold, hard cash at any given time. So your bank can also go bankrupt, and your compensation may be limited. In every single country, the maximum amount you can recover is capped.

Luckily, digital assets can be self-custodial, but it does come at the cost of full responsibility of their owner safe guarding a 12 / 24 word phrase. This might be convenient, but we do acknowledge that the risk of loosing this phrase is here. In fact, it’s been common seeing many people loose access to their funds simply because they lost access to their seed phrase. There is also the risk of a someone gaining access to your seed phrase stored on your computer if you use a browser wallet / desktop wallet.

The reason why self-custody is hard is because of the way accounts on Ethereum are currently setup. Let’s briefly explain the two types of accounts:

  1. Externally Owned Account — (Your typical wallet)
  2. Contract Account (A smart contract)

Externally Owned Account vs Contract Accounts

Externally Owned Account (EOA)

Users own an EOA through a Signer that consists of two keys:

  • A public key — The address of the account is derived from it
  • A private key — A transaction is signed by it

The Signer, which is authorized to spend your tokens and the Account which holds your tokens are bonded together on Ethereum. That means that if you lose your signer, you loose your access to your account (which has the funds).

Now, what if the signer was designed as separated from the Account? Enter the second option: Contract Accounts.

Contract Accounts

A Contract Account is separated from the Signer, who is just an authorizer. It can have its own logic for signing and recovery. That means that if you loose access to your Signer, it doesn’t necessarily means that you loose access to your account. This is where the name Account Abstraction comes it. The Account is abstracted away from the signer.

Having a contract account comes with many benefits, and the most important is that it can contain some logic that recovers your funds. One type of logic pioneered by Argent Wallet is Social Recovery. Social recovery is a way to assign guardians to your account in the case something happens and you want to recover it. This method takes in a huge burden safeguarding your own assets alone, and can bring self-custody to the masses. So aren’t contract accounts popular?

The reason why contract accounts aren’t popular are for two reasons:

  • They cannot initiate transactions without relying on centralized intermediaries relayer. Only EOA can initiate transactions by design.
  • Contract Accounts require more gas to execute, and on Ethereum Mainnet; your transaction can be quite expensive.

Initiating transactions through contracts have been the long dream of every Ethereum developer, and there has been some serious efforts throughout the years to change that hard coded design on Ethereum through Account Abstraction. It is a huge change to the Ethereum Protocol, and it does require focus when all stakes are currently on the Merge.

Luckily, a proposal is finally here to bring the benefits of Account Abstraction without Protocol Changes: meet ERC-4337.

Account Abstraction through ERC-4337

ERC-4337 is a proposal to bring Account Abstraction by solving the centralized relayer problem. It replicates the functionality of the transaction mempool in a higher-level system.

How does it work?

  1. Users send their intent to submit transactions along with signatures and other data for verification.
  2. Anyone (We call them Bundlers) can participate to take what users have sent, package up multiple user intents into a single “bundle transaction”, which then gets included into an Ethereum block. Blunders pay the fee for the bundle transaction in ETH, and gets compensated though fees paid as part of all the individual user’s executions. This solves the problem of centralized relayers; where everything is done through a peer-to-peer mempool.
  3. ERC-4337 also introduces a set of necessary global contracts for smart contract wallets to operate; to simplify the wallet’s logic and to ensure safety is done not in the wallet itself, but in a global contract called the entry point.

We won’t cover the technically specification of the ERC, but for a deep dive, we suggest this article by vitalk. For the developers out there, we recommend this article by Kristof and Ismael.

Now, ERC-4337 still requires somewhat more gas than regular transactions. Luckily, rollups are finally here.

Account Abstraction on Rollups

Account Abstraction on rollups are game changers, because it allows contract accounts to execute transactions with less fees for users than on Mainnet. Some of the exciting features that will Account Abstraction brings to lower the friction to participate on Ethereum are the following:

Gasless transactions

ERC-4337 brings in the ability for gas sponsoring through something called Paymaster. This allows for gasless transactions and less friction for user to start using Ethereum.

Batched Transactions

Also known as multicalls; it allows you to execute a sequence of transactions. The Account Contract will orchestrate the execution the sequence of calls. It only takes one signature from the user. The common case for many smart contract interactions are 2 transactions: Approve ERC-20 Spend + Transact.

Considering all these, it is imperatively crucial for Account Abstractions to be developed on Rollups if we want self-custody to scale.

That’s why Candide is experimenting with a new Beta on Top of Account Abstraction on Optimism. The beta will include all the main features found in regular EOAs, along with features that we are most excited about: Social Recovery and Batched Transactions.

If you are excited to try out the beta to bring in self-custody to the masses, or if you are a developer looking to integrate AA, join our discord to give feedback and shape the next wave of wallet development.

Discord: https://discord.gg/NM5HakA9nC

Twitter: @candidewallet

Website: https://candidewallet.com

--

--