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

[abstraction] Add support for AccountAbstraction #622

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

Conversation

GhostWalker562
Copy link
Contributor

Description

This pull request introduces several new features and improvements related to account abstraction. The changes include adding new examples, new tests, and updating core account classes to support account abstraction.

  • Added support for AbstractedAccount which enables signing AA transactions using a custom signer
  • Added support for account.abstraction namespace which supports basic authentication function apis including adding functions, removing functions, and checking for whether functions exist.
  • Added E2E test suite
  • Added E2E examples

Test Plan

  • tests/e2e/abstraction.test.ts
  • enable and disable account abstraction
  • enable account abstraction, send a transaction, and disable all account abstraction
  • enable custom account abstraction, send a transaction with custom signer, and send a transaction with an invalid signer

Related Links

Checklist

  • Have you ran pnpm fmt?
  • Have you updated the CHANGELOG.md?

@GhostWalker562 GhostWalker562 requested a review from a team as a code owner January 28, 2025 01:56
@GhostWalker562 GhostWalker562 force-pushed the account-abstraction-prod branch from 65d541a to 4a6ea55 Compare January 28, 2025 02:03
Copy link

@lightmark lightmark left a comment

Choose a reason for hiding this comment

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

lgtm in general.
Just 2 cents:

  1. serialize fixed bytes for authenticator?
  2. verify sdk for permissioned delegation works.

src/account/AbstractedAccount.ts Show resolved Hide resolved
src/internal/abstraction.ts Show resolved Hide resolved
src/account/AbstractedAccount.ts Show resolved Hide resolved
serializer.serializeStr(functionName);
serializer.serializeU32AsUleb128(AbstractionAuthDataVariant.V1);
serializer.serializeBytes(this.signingMessageDigest.toUint8Array());
serializer.serializeFixedBytes(this.authenticator.toUint8Array());

Choose a reason for hiding this comment

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

why this one is fixed bytes?

Copy link
Contributor Author

@GhostWalker562 GhostWalker562 Jan 30, 2025

Choose a reason for hiding this comment

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

serializeBytes will add a length prefix to the start which may not be needed. Permission delegation also doesn't account for the length prefix.

By using serializeFixedBytes, the developer has 100% full control over the bytes for the authenticator.

@GhostWalker562 GhostWalker562 force-pushed the account-abstraction-prod branch 3 times, most recently from f77d79e to 5645212 Compare January 31, 2025 03:41
@GhostWalker562 GhostWalker562 force-pushed the account-abstraction-prod branch from 5645212 to 99176a8 Compare January 31, 2025 18:02
@GhostWalker562 GhostWalker562 force-pushed the account-abstraction-prod branch from 99176a8 to 538bc15 Compare January 31, 2025 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants