Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: edit documentation for Account Abstraction and add Smart Backend Wallets #5516

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

d4mr
Copy link
Member

@d4mr d4mr commented Nov 25, 2024

closes INFRA-411


PR-Codex overview

This PR focuses on enhancing the documentation for Account Abstraction and Backend Wallets in the thirdweb Engine, introducing Smart Backend Wallets and their benefits, along with configuration types and pricing details.

Detailed summary

  • Added a Callout in account-abstraction/page.mdx recommending Smart Backend Wallets for backend operations.
  • Introduced a new section on Smart Backend Wallets in backend-wallets/page.mdx.
  • Listed benefits of Smart Backend Wallets, including gas management and simple integration.
  • Explained how Smart Backend Wallets differ from previous implementations.
  • Provided details on when not to use Smart Backend Wallets.
  • Specified configuration types for smart accounts.
  • Clarified pricing and deployment costs for Smart Backend Wallets.

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

Copy link

changeset-bot bot commented Nov 25, 2024

⚠️ No Changeset found

Latest commit: 3abd74d

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

vercel bot commented Nov 25, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docs-v2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 25, 2024 10:14pm
3 Skipped Deployments
Name Status Preview Comments Updated (UTC)
thirdweb_playground ⬜️ Skipped (Inspect) Nov 25, 2024 10:14pm
thirdweb-www ⬜️ Skipped (Inspect) Nov 25, 2024 10:14pm
wallet-ui ⬜️ Skipped (Inspect) Nov 25, 2024 10:14pm

@github-actions github-actions bot added the Portal Involves changes to the Portal (docs) codebase. label Nov 25, 2024
Copy link

codecov bot commented Nov 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 43.84%. Comparing base (0e98b09) to head (3abd74d).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5516   +/-   ##
=======================================
  Coverage   43.84%   43.84%           
=======================================
  Files        1081     1081           
  Lines       56186    56186           
  Branches     3929     3929           
=======================================
  Hits        24635    24635           
  Misses      30868    30868           
  Partials      683      683           
Flag Coverage Δ *Carryforward flag
legacy_packages 65.68% <ø> (ø) Carriedforward from cce67d3
packages 38.60% <ø> (ø)

*This pull request uses carry forward flags. Click here to find out more.

Copy link

graphite-app bot commented Nov 25, 2024

Your org has enabled the Graphite merge queue for merging into main

Add the label “merge-queue” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “hotfix” to add to the merge queue as a hot fix.

You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link.

Smart backend wallets inherit smart account benefits and offer several advantages over traditional EOAs:

- **Gas Management**: Built-in paymaster eliminates the need to maintain gas tokens. This means you never need to hold crypto or top up for gas.
- **Better Nonce Management**: Smart accounts use multi-dimensnal nonces, which are more efficient than EOAs.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There appears to be a typo in "multi-dimensnal" - it should be "multi-dimensional". This affects readability of an otherwise well-written technical explanation.

Spotted by Graphite Reviewer

Is this helpful? React 👍 or 👎 to let us know.

Smart backend wallets inherit smart account benefits and offer several advantages over traditional EOAs:

- **Gas Management**: Built-in paymaster eliminates the need to maintain gas tokens. This means you never need to hold crypto or top up for gas.
- **Better Nonce Management**: Smart accounts use multi-dimensnal nonces, which are more efficient than EOAs.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There appears to be a typo in "multi-dimensnal" - it should be "multi-dimensional". This affects readability of an otherwise well-written technical explanation.

Spotted by Graphite Reviewer

Is this helpful? React 👍 or 👎 to let us know.

Copy link
Contributor

github-actions bot commented Nov 25, 2024

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 44.97 KB (0%) 900 ms (0%) 909 ms (+57.29% 🔺) 1.9 s
thirdweb (cjs) 105.01 KB (0%) 2.2 s (0%) 1.5 s (-7.81% 🔽) 3.6 s
thirdweb (minimal + tree-shaking) 5.6 KB (0%) 113 ms (0%) 95 ms (+187.49% 🔺) 207 ms
thirdweb/chains (tree-shaking) 506 B (0%) 10 ms (0%) 11 ms (+0.88% 🔺) 21 ms
thirdweb/react (minimal + tree-shaking) 18.38 KB (0%) 368 ms (0%) 82 ms (-55.8% 🔽) 449 ms

Copy link

linear bot commented Nov 25, 2024

INFRA-411 Docs for SBW

@vercel vercel bot temporarily deployed to Preview – wallet-ui November 25, 2024 21:57 Inactive
@vercel vercel bot temporarily deployed to Preview – thirdweb-www November 25, 2024 21:57 Inactive
@vercel vercel bot temporarily deployed to Preview – thirdweb_playground November 25, 2024 21:57 Inactive
@d4mr d4mr added the merge-queue Adds the pull request to Graphite's merge queue. label Nov 25, 2024
Copy link
Member Author

d4mr commented Nov 25, 2024

Merge activity

  • Nov 25, 4:57 PM EST: The merge label 'merge-queue' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.

@@ -8,6 +8,19 @@ export const metadata = createMetadata({

# Account Abstraction

<Callout variant="info" title="Looking to use account abstraction for your backend operations?">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this prompt is unclear.

Engine's concept of "account abstraction" typically refers to Engine backend EOA wallets managing smart accounts.

So this callout is suggesting a different type of account abstraction that they may be looking for (which is incompatible with the above AA use cases).

I think we can downplay the fact that smart backend wallets are AA-based and just mention the benefits. I wouldn't put too much detail here since it's hard to convey what it is without the person just reading the other page.

Your backend wallets can be smart accounts too!

Use Smart Backend Wallets to get the benefits of account abstraction for your backend wallets, including:
...
Learn more about Smart Backend Wallets

Let's also put this below the intro sentence (line 24 below) since the developer doesn't even know what this page is about yet, and we're prompting them they might be looking for something else.

@@ -12,6 +13,50 @@ Engine performs blockchain actions using backend wallets that you own and manage

There are multiple options for securing backend wallets.

## Smart Backend Wallets
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO less detail around "how it works" so we can focus the content on "why you should care" and "how to use it".

  • Remove the note about EOA internally managed and default factory. It's sufficient to just say "it uses a smart account".
  • Probably remove comment on multi-dimensional nonces. We can just say "Higher throughput: Transactions are sent from thirdweb's bundler to maximize onchain throughput."


The smart account is automatically deployed the first time you send a transaction on a chain. You don't need to think about deploying or managing the smart account - Engine handles everything behind the scenes. All transactions are sent as UserOperations to the EntryPoint contract on chain.

<Details summary="How are Smart Backend Wallets different from existing engine AA features?">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: always capitalize Engine (product name)

Unlike the [previous account abstraction implementation in
Engine](account-abstraction) where you had to manage both the account address
(`x-account-address`) and the backend wallet address
(`x-backend-wallet-address`) separately, smart backend wallets simplify this.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: I've also been capitalizing Smart Backend Wallets.

"backend wallet" = a concept, lowercase is fine
"Smart Backend Wallet" = product/feature name (like "Contract Subscriptions")

The backend wallet address is now the smart account address itself.
</Details>

<Details summary="When not to use Smart Backend Wallets?">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm would someone need this, or would we build this in the future? Maybe this just belongs in an FAQ section at the bottom:

## FAQ

#### Can I import a smart account?
No, importing a smart account is currently not supported.


### Configuration Types

- `smart:local` - Smart account backed by a local key
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"backed up locally in Engine" or something. Don't need to reference the EOA

### Pricing

Smart backend wallets have no additional costs to use with your Engine instance. Transactions sent from smart backend wallets follow the [same billing model as regular account abstraction transactions with thirdweb](/connect/account-abstraction/infrastructure#pricing--billing).
Smart accounts need to be deployed on each chain. This costs gas and is billed to your account like any other transaction.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A little more clear:

Note: Smart Backend Wallets deploy a smart account on each chain they send transactions on. You are billed for this deployment cost.

- `smart:aws-kms` - Smart account backed by AWS KMS
- `smart:gcp-kms` - Smart account backed by Google Cloud KMS

For AWS and Google Cloud KMS options, follow the setup instructions in the respective sections below.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To configure AWS and Google Cloud KMS, ...


### Pricing

Smart backend wallets have no additional costs to use with your Engine instance. Transactions sent from smart backend wallets follow the [same billing model as regular account abstraction transactions with thirdweb](/connect/account-abstraction/infrastructure#pricing--billing).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should note the customer is charged for mainnet usage only.

You are billed for mainnet transactions sent from Smart Backend Wallets (see Account Abstraction pricing). There is no cost for testnet transactions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge-queue Adds the pull request to Graphite's merge queue. Portal Involves changes to the Portal (docs) codebase.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants