Skip to content

Commit

Permalink
docs: begin refactoring the light account docs sections
Browse files Browse the repository at this point in the history
  • Loading branch information
moldy530 committed Feb 1, 2024
1 parent 92ec65c commit 3d4c707
Show file tree
Hide file tree
Showing 11 changed files with 105 additions and 28 deletions.
8 changes: 5 additions & 3 deletions site/.vitepress/sidebar/new.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,11 @@ export const newSidebar: DefaultTheme.Sidebar = [
{
text: "Choosing a Smart Account",
items: [
{ text: "Introduction", link: "/" },
{ text: "Introduction", link: "/smart-accounts/" },
{
text: "Modular Account",
collapsed: false,
base: "/smart-accounts/modular-account",
items: [
{ text: "Introduction", link: "/" },
{ text: "Getting started", link: "/" },
Expand All @@ -42,10 +43,11 @@ export const newSidebar: DefaultTheme.Sidebar = [
{
text: "Light Account",
collapsed: true,
base: "/smart-accounts/light-account",
items: [
{ text: "Introduction", link: "/" },
{ text: "Getting started", link: "/" },
{ text: "Deployments", link: "/" },
{ text: "Getting started", link: "/getting-started" },
{ text: "Deployments", link: "/deployments" },
],
},
{
Expand Down
6 changes: 3 additions & 3 deletions site/getting-started/deploy-an-account.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ Before diving into smart accounts, it's important to [set up your Alchemy accoun

The next step is to select the right smart account implementation for your application. We recommend using `ModularAccount`, [TODO: WILL HALP ME WITH YOUR WORDS]. We'll cover all the options in detail in the following sections:

- [Using Modular Accounts](/smart-accounts/accounts/guides/modular-account)
- [Using Light Account](/smart-accounts/accounts/guides/light-account)
- [Using Modular Accounts](/smart-accounts/modular-account/)
- [Using Light Account](/smart-accounts/light-account/)
- [Using your own account implementation](/smart-accounts/accounts/guides/using-your-own)

::: tip Note
The `LightAccount` implementation is not [ERC-6900](/smart-accounts/accounts/guides/modular-account) compliant. The `ModularAccount` implementation is launching later this year and will be EIP-6900 compatible. However, `LightAccount` is forward-compatible with `ModularAccount` and can be upgraded to it in the future.
The `LightAccount` implementation is not [ERC-6900](/smart-accounts/modular-account/) compliant. The `ModularAccount` implementation is launching later this year and will be EIP-6900 compatible. However, `LightAccount` is forward-compatible with `ModularAccount` and can be upgraded to it in the future.
:::

## 3. Choosing a Signer
Expand Down
6 changes: 3 additions & 3 deletions site/glossary/terms.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@ Alchemy’s implementation of a [Paymaster](https://www.alchemy.com/overviews/wh

## Light Account

[Light Account](https://accountkit.alchemy.com/smart-accounts/accounts/guides/light-account.html) is a production-ready [ERC-4337](https://eips.ethereum.org/EIPS/eip-4337) [smart account](#smart-account) implementation developed by Alchemy. It builds on top of Ethereum Foundation’s [SimpleAccount](https://github.com/eth-infinitism/account-abstraction/blob/develop/contracts/samples/SimpleAccount.sol) to add key improvements such as support for ownership transfer, ERC-1271 signature support, and gas optimizations. It is [audited by Quantstamp](https://github.com/alchemyplatform/light-account/blob/main/Quantstamp-Audit.pdf).
[Light Account](https://accountkit.alchemy.com/smart-accounts/light-account/.html) is a production-ready [ERC-4337](https://eips.ethereum.org/EIPS/eip-4337) [smart account](#smart-account) implementation developed by Alchemy. It builds on top of Ethereum Foundation’s [SimpleAccount](https://github.com/eth-infinitism/account-abstraction/blob/develop/contracts/samples/SimpleAccount.sol) to add key improvements such as support for ownership transfer, ERC-1271 signature support, and gas optimizations. It is [audited by Quantstamp](https://github.com/alchemyplatform/light-account/blob/main/Quantstamp-Audit.pdf).

## Modular Account

A type of smart account enabled by the [ERC-6900](https://eips.ethereum.org/EIPS/eip-6900) standard and characterized by its [modular structure](https://accountkit.alchemy.com/smart-accounts/accounts/guides/modular-account.html). This structure segments different functionalities of the account into distinct, independently upgradeable modules or plugins. Each plugin can have specific functions such as validation, execution, or hooks, enabling the smart account to extend its capabilities or modify its behavior without altering the core account logic. Modular accounts enhance flexibility, upgradeability, and interoperability of [ERC-4337](https://eips.ethereum.org/EIPS/eip-4337) smart accounts.
A type of smart account enabled by the [ERC-6900](https://eips.ethereum.org/EIPS/eip-6900) standard and characterized by its [modular structure](https://accountkit.alchemy.com/smart-accounts/modular-account/.html). This structure segments different functionalities of the account into distinct, independently upgradeable modules or plugins. Each plugin can have specific functions such as validation, execution, or hooks, enabling the smart account to extend its capabilities or modify its behavior without altering the core account logic. Modular accounts enhance flexibility, upgradeability, and interoperability of [ERC-4337](https://eips.ethereum.org/EIPS/eip-4337) smart accounts.

## Plugin

Expand All @@ -75,7 +75,7 @@ A service or application that manages the private key and signs `UserOperation`s

## Smart Account

A [smart account](https://accountkit.alchemy.com/smart-accounts/accounts/choosing-a-smart-account.html#what-s-a-smart-account) is an individual on-chain account located at a public address where an ERC-4337 smart contract account is deployed. This address is controlled by one or more owners of the smart contract account. The [aa-sdk](https://github.com/alchemyplatform/aa-sdk) supports different smart account implementations such as [Light Account](https://accountkit.alchemy.com/smart-accounts/accounts/guides/light-account.html), [Simple Account](https://github.com/eth-infinitism/account-abstraction/blob/develop/contracts/samples/SimpleAccount.sol) and [Modular Account](https://accountkit.alchemy.com/smart-accounts/accounts/guides/modular-account.html) (coming soon). You can also [add add your own account implementation in aa-sdk](https://accountkit.alchemy.com/smart-accounts/accounts/contributing.html).
A [smart account](https://accountkit.alchemy.com/smart-accounts/.html#what-s-a-smart-account) is an individual on-chain account located at a public address where an ERC-4337 smart contract account is deployed. This address is controlled by one or more owners of the smart contract account. The [aa-sdk](https://github.com/alchemyplatform/aa-sdk) supports different smart account implementations such as [Light Account](https://accountkit.alchemy.com/smart-accounts/light-account/.html), [Simple Account](https://github.com/eth-infinitism/account-abstraction/blob/develop/contracts/samples/SimpleAccount.sol) and [Modular Account](https://accountkit.alchemy.com/smart-accounts/modular-account/.html) (coming soon). You can also [add add your own account implementation in aa-sdk](https://accountkit.alchemy.com/smart-accounts/accounts/contributing.html).

## `UserOperation`

Expand Down
4 changes: 2 additions & 2 deletions site/overview/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,15 @@ Get started with `aa-sdk` in our [Getting Started guide](/getting-started/setup)

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 development:

- Significantly [reduced gas costs](/smart-accounts/accounts/choosing-a-smart-account#benchmarks)
- Significantly [reduced gas costs](/smart-accounts/#benchmarks)
- ERC-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

`LightAccount` was audited by Quantstamp ([report](https://github.com/alchemyplatform/light-account/blob/main/Quantstamp-Audit.pdf)).

`LightAccount` is forward-compatible with [ERC-6900](https://eips.ethereum.org/EIPS/eip-6900), a new standard for **modular** smart accounts. Once we stabilize the ERC with the [community](https://ethereum-magicians.org/t/erc-6900-modular-smart-contract-accounts-and-plugins/13885/35) and publish a reference implementation, we will release an optional upgrade for `LightAccount` to upgrade to modular EIP-6900 compliant accounts. [Join the discussion](https://ethereum-magicians.org/t/erc-6900-modular-smart-contract-accounts-and-plugins/13885/35) on ERC-6900!

To learn how to deploy a `LightAccount`, see [Light Account](/smart-accounts/accounts/guides/light-account).
To learn how to deploy a `LightAccount`, see [Light Account](/smart-accounts/light-account/).

### Signers

Expand Down
2 changes: 1 addition & 1 deletion site/smart-accounts/accounts/guides/using-your-own.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ The `BaseSmartContractAccount` class also exposes some additional implementation

## `LightSmartContractAccount` as an Example

We have built an extension of the eth-infinitism `SimpleAccount` called [LightAccount.sol](https://github.com/alchemyplatform/light-account/blob/main/src/LightAccount.sol). You can learn more about Light Account in the [Light Account documentation](/smart-accounts/accounts/guides/light-account).
We have built an extension of the eth-infinitism `SimpleAccount` called [LightAccount.sol](https://github.com/alchemyplatform/light-account/blob/main/src/LightAccount.sol). You can learn more about Light Account in the [Light Account documentation](/smart-accounts/light-account/).

We provide an implementation of `ISmartContractAccount` that works with `LightAccount.sol` which can be used as an example of how to implement your own Smart Contract Account:
::: details LightSmartContractAccount
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,19 @@ next:

## What's a Smart Account?

A smart account is an [ERC-4337](https://eips.ethereum.org/EIPS/eip-4337) smart account. You can use it to manage assets, execute transactions (known as `userOperations` or `userOps`), and more. There are many different implementations of a smart account, including our [Light Account](/smart-accounts/accounts/guides/light-account).
A smart account is an [ERC-4337](https://eips.ethereum.org/EIPS/eip-4337) smart account. You can use it to manage assets, execute transactions (known as `userOperations` or `userOps`), and more. There are many different implementations of a smart account, including our [Light Account](/smart-accounts/light-account/).

## Light Account

Account Kit provides a default smart account called `LightAccount`.

[Light Account](/smart-accounts/accounts/guides/light-account) is a secure, audited, gas-optimized, ERC-4337 compatible smart account implementation. It comes equipped with features like owner transfers, [ERC-1271](https://eips.ethereum.org/EIPS/eip-1271) message signing, and batched transactions. It's also [open source](https://github.com/alchemyplatform/light-account)!
[Light Account](/smart-accounts/light-account/) is a secure, audited, gas-optimized, ERC-4337 compatible smart account implementation. It comes equipped with features like owner transfers, [ERC-1271](https://eips.ethereum.org/EIPS/eip-1271) message signing, and batched transactions. It's also [open source](https://github.com/alchemyplatform/light-account)!

For most applications, we recommend using Light Account. It is [deployed](/smart-accounts/accounts/deployment-addresses) on Ethereum, Optimism, Arbitrum, Polygon, Base, and the respective testnets.

## Modular Account (coming soon)

We are authoring a standard for modular smart accounts called [ERC-6900](https://eips.ethereum.org/EIPS/eip-6900). Soon we will release an ERC-6900 compatible [Modular Account](/smart-accounts/accounts/guides/modular-account). This will be an optional upgrade from Light Account to unlock an ecosystem of plugins for your smart account stack.
We are authoring a standard for modular smart accounts called [ERC-6900](https://eips.ethereum.org/EIPS/eip-6900). Soon we will release an ERC-6900 compatible [Modular Account](/smart-accounts/modular-account/). This will be an optional upgrade from Light Account to unlock an ecosystem of plugins for your smart account stack.

## Use Your Own Account

Expand Down
32 changes: 32 additions & 0 deletions site/smart-accounts/light-account/deployments.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
outline: deep
head:
- - meta
- property: og:title
content: Light Account • Deployment Addresses
- - meta
- name: description
content: Deployment Addresses for Light Account
- - meta
- property: og:description
content: Deployment Addresses for Light Account
---

# [Deployment Addresses](https://github.com/alchemyplatform/light-account/blob/v1.1.0/Deployments.md)

The following tables list the deployed factory and account implementation contract addresses for `LightAccount` on different chains:

| Chain | Factory Address | Account Implementation |
| ---------------- | ------------------------------------------ | ------------------------------------------ |
| Eth Mainnet | 0x00004EC70002a32400f8ae005A26081065620D20 | 0xae8c656ad28F2B59a196AB61815C16A0AE1c3cba |
| Eth Sepolia | 0x00004EC70002a32400f8ae005A26081065620D20 | 0xae8c656ad28F2B59a196AB61815C16A0AE1c3cba |
| Eth Goerli | 0x00004EC70002a32400f8ae005A26081065620D20 | 0xae8c656ad28F2B59a196AB61815C16A0AE1c3cba |
| Polygon Mainnet | 0x00004EC70002a32400f8ae005A26081065620D20 | 0xae8c656ad28F2B59a196AB61815C16A0AE1c3cba |
| Polygon Mumbai | 0x00004EC70002a32400f8ae005A26081065620D20 | 0xae8c656ad28F2B59a196AB61815C16A0AE1c3cba |
| Optimism | 0x00004EC70002a32400f8ae005A26081065620D20 | 0xae8c656ad28F2B59a196AB61815C16A0AE1c3cba |
| Optimism Goerli | 0x00004EC70002a32400f8ae005A26081065620D20 | 0xae8c656ad28F2B59a196AB61815C16A0AE1c3cba |
| Base | 0x00004EC70002a32400f8ae005A26081065620D20 | 0xae8c656ad28F2B59a196AB61815C16A0AE1c3cba |
| Base Goerli | 0x00004EC70002a32400f8ae005A26081065620D20 | 0xae8c656ad28F2B59a196AB61815C16A0AE1c3cba |
| Arbitrum | 0x00004EC70002a32400f8ae005A26081065620D20 | 0xae8c656ad28F2B59a196AB61815C16A0AE1c3cba |
| Arbitrum Goerli | 0x00004EC70002a32400f8ae005A26081065620D20 | 0xae8c656ad28F2B59a196AB61815C16A0AE1c3cba |
| Arbitrum Sepolia | 0x00004EC70002a32400f8ae005A26081065620D20 | 0xae8c656ad28F2B59a196AB61815C16A0AE1c3cba |
49 changes: 49 additions & 0 deletions site/smart-accounts/light-account/getting-started.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
outline: deep
head:
- - meta
- property: og:title
content: Light Account • Getting Started
- - meta
- name: description
content: Follow this guide to use Light Account with Account Kit, a vertically integrated stack for building apps that support ERC-4337.
- - meta
- property: og:description
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
- - 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.
---

# Getting started

Getting started with Light Account is really simple! Simply create a `SmartAccountClient` and an instance of `LightAccount` and you're ready to go.

## Import

::: code-group

```ts [aa-alchemy]
import { createLightAccountAlchemyClient } from "@alchemy/aa-alchemy";
```

```ts [aa-core]
import { createLightAccount } from "@alchemy/aa-accounts";
import { createSmartAccountClient } from "@alchemy/aa-core";
```

:::

## Usage

The code snippet below demonstrates how to use Light Account with Account Kit. It creates a Light Account and sends a `UserOperation` from it:
::: code-group

<<< @/snippets/aa-alchemy/light-account.ts [aa-alchemy]

<<< @/snippets/aa-core/smartAccountClient.ts [aa-core]

::: code-group
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@ outline: deep
head:
- - meta
- property: og:title
content: Light Account Smart Contract
content: Light Account
- - meta
- name: description
content: Follow this guide to use Light Account with Account Kit, a vertically integrated stack for building apps that support ERC-4337.
content: What is Light Account?
- - meta
- property: og:description
content: Follow this guide to use Light Account with Account Kit, a vertically integrated stack for building apps that support ERC-4337.
content: What is Light Account?
- - meta
- name: twitter:title
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.
content: What is Light Account?
---

# Light Account
Expand Down Expand Up @@ -48,13 +48,7 @@ Light Account has been audited by Quantstamp. You can find the audit report [her

### 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/?a=ak-docs). 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

The code snippet below demonstrates how to use Light Account with Account Kit. It creates a Light Account and sends a `UserOperation` from it:

<<< @/snippets/aa-alchemy/light-account.ts
We're pioneering the future of modular smart accounts with [EIP-6900](https://www.alchemy.com/blog/account-abstraction-erc-6900/?a=ak-docs). We're developing a [Modular Account](../modular-account/) 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.

## Developer Links

Expand Down
4 changes: 2 additions & 2 deletions site/smart-accounts/signers/choosing-a-signer.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ head:
content: Explore Account Kit integration guides for signers including Magic.Link, Privy, Web3Auth, EOAs, and many more!
prev:
text: Smart Accounts
link: /smart-accounts/accounts/choosing-a-smart-account
link: /smart-accounts/
next:
text: How to Send a User Operation
link: /tutorials/send-user-operation
Expand All @@ -28,7 +28,7 @@ next:

A **Signer** is a service (e.g. Magic or Turnkey) or application (e.g. MetaMask) that manages the private key and signs operations. Most web3 users today use an [Externally Owned Account (EOA)](https://ethereum.org/en/developers/docs/accounts/#externally-owned-accounts-and-key-pairs) with a self-custodial Signer such as MetaMask to manage the private key.

With Account Kit, you will deploy a **smart account** for each user instead of an EOA wallet. This smart account stores the user’s assets (e.g. tokens or NFTs). The default smart account in Account Kit is called [`LightAccount`](/smart-accounts/accounts/guides/light-account) and it uses a typical single-owner architecture.
With Account Kit, you will deploy a **smart account** for each user instead of an EOA wallet. This smart account stores the user’s assets (e.g. tokens or NFTs). The default smart account in Account Kit is called [`LightAccount`](/smart-accounts/light-account/) and it uses a typical single-owner architecture.

The smart account is controlled by an **Owner** address. The smart account will only execute a transaction if it was signed by the owner’s private key.

Expand Down

0 comments on commit 3d4c707

Please sign in to comment.