Skip to main content

Account abstraction

Definition

The traditional definition of a smart account in Ethereum mostly refers to externally-owned accounts (EOAs) that are secured via private keys and natively hold information about user's balances.

Smart accounts in =nil; differ from this definition. In =nil; a smart account is any smart contract that is able to pay for interactions with real-life users.

A =nil; smart account is always a smart contract, and it must be deployed as such. The smart account handles all the usual functionalities (e.g., authenticating requests) but it can also include complex logic such as multi-sig operations.

This means that in almost all cases an external transaction has to go through a smart account that signs the transaction and assigns a value to it. The transaction is only forwarded to its target smart contract for execution only after this process is complete.

Counterfactual contracts

It is possible to send funds to an address where a contract is supposed to be deployed. These funds will be stored at that address until the contract is finally deployed, at which point the contract will be able to access them.

Funds sent to an address without a deployed contract are safe, and another party cannot claim them by deploying another contract before the owners of the funds is able to deploy their own contract.

Pre-built and custom smart accounts

Because any smart contract can be a smart account. there is a distinction between pre-built and custom smart accounts.

A pre-built smart account is provided as part of =nil;. Such a smart account includes essential smart account functionalities as well as pre-defined constructor bytecode. The =nil; developer tools provide several ways of deploying pre-built smart accounts such as the nil smart-account new =nil; CLI command.

  • To create a new smart account via Nil.js, click here.
  • To create a new smart account via the =nil; CLI, click here
Pre-built smart accounts

Presently, only one type of pre-built smart accounts is available. Additional types of pre-built smart accounts are WIP.

Guarantees

As pre-built smart accounts are provided as part of =nil; they are guaranteed to be valid and tested. An audit process for pre-built smart accounts is currently under consideration.

A custom smart account is any smart contract written by a user. This contract can support any flow permitted by Solidity code such as multi-sig authorization or token vesting. Custom smart accounts can be deployed just like any other smart contract.