-
Notifications
You must be signed in to change notification settings - Fork 120
ARC-0058: Plugin-Based Account Abstraction #269
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
Draft
joe-p
wants to merge
25
commits into
algorandfoundation:main
Choose a base branch
from
joe-p:plugin_abstraction
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 2 commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
3094996
plugin-based account abstraction
joe-p b206344
fix typo
joe-p f797187
add EOA definition, finish app vs logic sig
joe-p 638d666
Assign number Fixing format
SudoWeezy 0364851
add reference contract in ARC, minor updates
joe-p 11cce9a
updated TEALScript
joe-p e04e42f
named plugins
joe-p 6257d60
add named plugins
joe-p a750301
reword named plugins
joe-p 55e6308
fix typos
joe-p e1b114e
update implementation
joe-p 20f89fd
add plugin permissions to ARC
joe-p 7814757
Wallet and Application Support
joe-p 57d7f2b
add sequence diagrams and new implementation
joe-p d1754b1
allow rekey/verify anywhere in group, implementation updates
joe-p b37c8bf
minor updates/rewording
joe-p 0843736
feat: arc58 implementation
kylebeee 4efe6e8
wip: updating the readme
kylebeee 0e82ef0
chore: more tests & updates to the ARC
kylebeee 695a1c3
feat: small adjustments + ARC readme update
kylebeee 167e403
chore: constants for purpose clarity
kylebeee 42763aa
wip: escrow locking, executions, fix for plugin change admin & fix fo…
kylebeee 49a473a
wip: fixing tests
kylebeee 23f622a
feat: upgraded to puya-ts 1.0.1 & fixed a registration bug with the e…
kylebeee de2de81
fix: bad execution validity window check causing erroneous errors
kylebeee File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,177 @@ | ||
| --- | ||
| arc: <to be assigned> | ||
| title: Plugin-Based Account Abstraction | ||
| description: An extendable standard for account abstraction using stateful applciations | ||
| author: Joe Polny (@joe-p), Kyle Breeding aka krby.algo (@kylebeee) | ||
| discussions-to: <URL> | ||
| status: Draft | ||
| type: Standards Track | ||
| category: ARC | ||
| created: 2024-01-08 | ||
| requires: 4 | ||
| --- | ||
|
|
||
| ## Abstract | ||
| This ARC proposes a standard for using stateful applications and rekey transactions to enable account abstraction on Algorand. The abstracted account is controlled by a single stateful application which is the auth address of the abstracted account. Other applications can be used as plugin to provide additional functionality to the abstracted account. | ||
|
|
||
| ## Motivation | ||
| Manually signing transactions for every dApp interaction can be rather fatiguing for the end-user, which results in a frustrating UX. In some cases, it makes specfific app designs that require a lot of transactions borderline impossible without delegation or an escrow account. | ||
|
|
||
| Another common point of friction for end-users in the Algorand ecosystem is ASA opt-in transactions. This is a paticularly high point of friction for onboarding new accounts since they must be funded and then initiate a transaction. This standard can be used to allow mass creation of non-custodial accounts and trigger opt-ins on their behalf. | ||
|
|
||
| ## Specification | ||
|
|
||
| ### Definitions | ||
| **Abstracted Account** - An account that has functionality beyond a typical keypair-based account. | ||
|
|
||
| **Abstracted Account App** - The stateuful application used to control the abstracted account. This app's address is the `auth-addr` of the abstracted account. | ||
|
|
||
| **Plugin** - An additional application that adds functionality to the **Abstracted Account App** (and thus the **Abstracted Account**). | ||
|
|
||
| **Admin** - An account, sepererate from the **Abstracted Account**, that controls the **Abstracted Account App**. In patiular, this app can initiate rekeys, add plugins, and transfer admin. | ||
|
|
||
|
|
||
| ### ARC4 Methods | ||
|
|
||
| An abstracted app account that adheres to this standard **MUST** implement the following methods | ||
|
|
||
| ```json | ||
| "methods": [ | ||
| { | ||
| "name": "createApplication", | ||
| "desc": "Create an abstracted account application", | ||
| "args": [ | ||
| { | ||
| "name": "address", | ||
| "type": "address", | ||
| "desc": "The address of the abstracted account. If zeroAddress, then the address of the contract account will be used" | ||
| }, | ||
| { | ||
| "name": "admin", | ||
| "type": "address", | ||
| "desc": "The admin for this app" | ||
| } | ||
| ], | ||
| "returns": { | ||
| "type": "void" | ||
| } | ||
| }, | ||
| { | ||
| "name": "verifyAppAuthAddr", | ||
| "desc": "Verify the abstracted account is rekeyed to this app", | ||
| "args": [], | ||
| "returns": { | ||
| "type": "void" | ||
| } | ||
| }, | ||
| { | ||
| "name": "rekeyTo", | ||
| "desc": "Rekey the abstracted account to another address. Primarily useful for rekeying to an EOA.", | ||
| "args": [ | ||
| { | ||
| "name": "addr", | ||
| "type": "address", | ||
| "desc": "The address to rekey to" | ||
| }, | ||
| { | ||
| "name": "flash", | ||
| "type": "bool", | ||
| "desc": "Whether or not this should be a flash rekey. If true, the rekey back to the app address must done in the same txn group as this call" | ||
| } | ||
| ], | ||
| "returns": { | ||
| "type": "void" | ||
| } | ||
| }, | ||
| { | ||
| "name": "rekeyToPlugin", | ||
| "desc": "Temporarily rekey to an approved plugin app address", | ||
| "args": [ | ||
| { | ||
| "name": "plugin", | ||
| "type": "application", | ||
| "desc": "The app to rekey to" | ||
| } | ||
| ], | ||
| "returns": { | ||
| "type": "void" | ||
| } | ||
| }, | ||
| { | ||
| "name": "changeAdmin", | ||
| "desc": "Change the admin for this app", | ||
| "args": [ | ||
| { | ||
| "name": "newAdmin", | ||
| "type": "account", | ||
| "desc": "The new admin" | ||
| } | ||
| ], | ||
| "returns": { | ||
| "type": "void" | ||
| } | ||
| }, | ||
| { | ||
| "name": "addPlugin", | ||
| "desc": "Add an app to the list of approved plugins", | ||
| "args": [ | ||
| { | ||
| "name": "app", | ||
| "type": "application", | ||
| "desc": "The app to add" | ||
| } | ||
| ], | ||
| "returns": { | ||
| "type": "void" | ||
| } | ||
| }, | ||
| { | ||
| "name": "removePlugin", | ||
| "desc": "Remove an app from the list of approved plugins", | ||
| "args": [ | ||
| { | ||
| "name": "app", | ||
| "type": "application", | ||
| "desc": "The app to remove" | ||
| } | ||
| ], | ||
| "returns": { | ||
| "type": "void" | ||
| } | ||
| } | ||
| ] | ||
| ``` | ||
|
|
||
| ### Plugins | ||
| TODO | ||
|
|
||
| ### Wallet and dApp Support | ||
| TODO | ||
|
|
||
| ## Rationale | ||
|
|
||
| ### App vs Logic Sig | ||
| There have similar propsoals for reducing end-user friction, such as [ARC47](./arc-0047.md) which enables safer usage of delegated logic signatures. The major downside of logic signatures is that they are not | ||
|
joe-p marked this conversation as resolved.
Outdated
|
||
|
|
||
| ### Plugins | ||
| TODO | ||
|
|
||
| ## Backwards Compatibility | ||
| Existing Algorand accounts can transition to an abstracted account by creating a new abstracted account application and setting the address to their current address. This requires them to create a new account to act as the admin. | ||
|
|
||
| End-users can use an abstracted account with any dApp provided they rekey the account to an externally owned account. | ||
|
|
||
| ## Test Cases | ||
|
|
||
| TODO: Some functional tests are in this repo https://github.com/joe-p/account_abstraction.git | ||
|
|
||
| ## Reference Implementation | ||
| https://github.com/joe-p/account_abstraction.git | ||
|
|
||
| TODO: Migrate to ARC repo, but waiting until development has settled. | ||
|
|
||
| ## Security Considerations | ||
| By adding a plugin to an abstracted account, that plugin can be called by anyone which will initiate a rekey from the abstracted account to the plugin app address. While the plugin must rekey back, there is no safeguards on what the plugin does when it has authority over the abstracted account. As such, extreme diligance must be taken by the end-user to ensure they are adding safe and/or trusted plugins. | ||
|
|
||
| ## Copyright | ||
| Copyright and related rights waived via <a href="https://creativecommons.org/publicdomain/zero/1.0/">CCO</a>. | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.