Skip to content

Conversation

@legion2002
Copy link
Collaborator

@legion2002 legion2002 commented Sep 23, 2025

Overview

This subaccount design is based of a new function that we introduce in the account called spend specifically for ERC20 token payments.
A super admin key can approve spends spend permissions on the account, and since we handle the transfers inside the spend function, we can guarantee that the limits are tracked and enforced correctly.

We then use this spend function to create a parent <> subaccount architecture using 2 way spend permissions.

Flow

  1. Create a parent Ithaca account which holds a large amount of funds.
  2. Create another independent Ithaca Account and call it a subaccount. This account is controlled by the DApp, and the DApp can have any kind of super admin or session keys, depending on its needs.
  3. Add a Spend Permission in the subaccount, with isParent=true, which allows the parent account to sweep any amount of funds, whenever it wants from the subaccounts.
  4. Add a Spend Permission in the parent account, with isParent=false, which allows the sub account to pull some limited amount of funds from the accounts, whenever the DApp requires it.

This architecture is different from PR #232 , because that PR treats the parent account as a master key of the subaccount, which means it transfers funds to and from the subaccount using authentication.
But this architecture transfers funds between the 2 accounts, using a dedicated spend function where you can control the flow of funds in either direction.

Note: You don't need to always create a subaccount to use the spend permission. For simple use cases, you can assign a spend permission directly to the DApp. But in this case, the DApp will have to be aware that it can pull funds from the account only using the spend function and direct transfer/transferFrom requests will not work ( since this is not a session key )

@github-actions
Copy link
Contributor

🤖 Bytecode changes detected! EIP-712 domain versions have been automatically updated for: IthacaAccount

1 similar comment
@github-actions
Copy link
Contributor

🤖 Bytecode changes detected! EIP-712 domain versions have been automatically updated for: IthacaAccount

@legion2002 legion2002 added this to the v1.0.0 milestone Sep 23, 2025
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