Skip to content

Commit

Permalink
feat: light account doc update (#219)
Browse files Browse the repository at this point in the history
  • Loading branch information
denniswon committed Nov 7, 2023
1 parent 9229fb5 commit 2e30c92
Showing 1 changed file with 31 additions and 21 deletions.
52 changes: 31 additions & 21 deletions site/smart-accounts/accounts/light-account.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,41 +12,51 @@ head:
content: Follow this guide to use Light Account with Account Kit, a vertically integrated stack for building apps that support ERC-4337.
- - meta
- name: twitter:title
content: Light Account Smart Contract
content: Light Account
- - meta
- name: twitter:description
content: Follow this guide to use Light Account with Account Kit, a vertically integrated stack for building apps that support ERC-4337.
---

# Light Account Smart Contract
# Light Account

Light Account is a secure, gas-optimized, [ERC-4337](https://eips.ethereum.org/EIPS/eip-4337) smart account implementation.
**Secure, optimized, and extendable**

We started with the Ethereum Foundation’s canonical [SimpleAccount](https://github.com/eth-infinitism/account-abstraction/blob/develop/contracts/samples/SimpleAccount.sol) and added key improvements for production app developers:
## Overview

- significantly reduced gas costs
- [ERC-1271](https://eips.ethereum.org/EIPS/eip-1271) signature support to ensure users can sign messages, such as on OpenSea
- ownership transfer so that users won’t get locked into a single `Signer`
Light Account is an [ERC-4337](https://eips.ethereum.org/EIPS/eip-4337) smart account. We started with the Ethereum Foundation’s canonical [SimpleAccount](https://github.com/eth-infinitism/account-abstraction/blob/develop/contracts/samples/SimpleAccount.sol) and added key improvements. It's fully production-ready with a security [audit](https://github.com/alchemyplatform/light-account/blob/main/Quantstamp-Audit.pdf), gas optimizations, and [ERC-1271](https://eips.ethereum.org/EIPS/eip-1271) signature support. Additionally, Light Account support ownership transfer to ensure you and your user don't get locked into a particular signer.

## Using Light Account
## Why Light Account

### Gas-optimized

Light Account is engineered to minimize gas costs, as measured by the following benchmarks for common operations like native token transfers, ERC20 transfers, and account creation.

#### Benchmarks

The code snippet below demonstrates the usage of Light Account with Account Kit. It creates a Light Account and sends a `UserOperation` from it:
| Account | Native transfer | ERC20 transfer | Creation |
| ----------------------------------------------------------------------------------------------------------------------- | --------------- | -------------- | -------- |
| Alchemy LightAccount | 100844 | 90345 | 279746 |
| Kernel v2.1-lite | 101002 | 90321 | 230968 |
| [SimpleAccount](https://github.com/eth-infinitism/account-abstraction/blob/develop/contracts/samples/SimpleAccount.sol) | 101319 | 90907 | 383218 |
| Etherspot | 103719 | 93324 | 279219 |
| Biconomy | 104408 | 93730 | 270013 |
| Kernel v2.1 | 106460 | 96038 | 265215 |
| Kernel v2.0 | 110018 | 99622 | 339882 |

<!--@include: ../../getting-started.md{56,68}-->
### Secure, Audited, Open Source

## Benchmarks
Light Account has been audited by Quantstamp. You can find the audit report [here](https://github.com/alchemyplatform/light-account/blob/main/Quantstamp-Audit.pdf). Light Account is is also fully open source so you can validate the [source code](https://github.com/alchemyplatform/light-account).

### Modular 6900 Accounts (Coming Soon)

We're pioneering the future of modular smart accounts with [EIP-6900](https://www.alchemy.com/blog/account-abstraction-erc-6900). We're developing a [Modular Account](./modular-account.md) to support EIP-6900 coming soon. Light Account is designed with that future in mind. It is forward-compatible with EIP-6900 so you can upgrade it to 6900-compatible account once the Modular Account is ready.

## Using Light Account

Here are some benchmarks for Light Account and other smart account implementations you might consider:
The code snippet below demonstrates how to use Light Account with Account Kit. It creates a Light Account and sends a `UserOperation` from it:

| Account | Creation | Native transfer | ERC20 transfer | Total Gas |
| -------------------- | -------- | --------------- | -------------- | --------- |
| Alchemy LightAccount | 279746 | 100844 | 90345 | 470935 |
| Kernel v2.1-lite | 230968 | 101002 | 90321 | 422291 |
| Kernel v2.1 | 265215 | 106460 | 96038 | 467713 |
| Biconomy | 270013 | 104408 | 93730 | 468151 |
| Etherspot | 279219 | 103719 | 93324 | 476262 |
| Kernel v2.0 | 339882 | 110018 | 99622 | 549522 |
| SimpleAccount | 383218 | 101319 | 90907 | 575444 |
<<< @/snippets/light-account.ts

## Developer Links

Expand Down

0 comments on commit 2e30c92

Please sign in to comment.