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

research(contracts): delegated eip1271 signing scheme #10

Open
mfw78 opened this issue Apr 11, 2024 · 1 comment
Open

research(contracts): delegated eip1271 signing scheme #10

mfw78 opened this issue Apr 11, 2024 · 1 comment

Comments

@mfw78
Copy link
Contributor

mfw78 commented Apr 11, 2024

Problem

Only the owner of the order can sign for the order - this creates the limitation that all smart orders MUST belong to a smart contract (supporting ERC-1271).

Acceptance criteria

  • All account types can support smart order types without vendor dependencies (e.g. no ERC-1271 smart contract wallets, EOAs, etc).

Details

Signing schemes supported currently include:

  1. eth_sign
  2. eip712 (i.e. eth_signTypedData_v4)
  3. preSign (i.e. GPv2Settlement.setPreSignature)
  4. eip1271

All of these signing schemes must be called by, or initiated by the owner of the order.

Possible Solutions

  1. Add delegateEip1271 as a signing scheme, which allows for an smart contract supporting a constrained version of ERC-1271 to sign on-behalf of the user. Security wise, could allow a user to specify if the order asserts the receiver is equal to the order's owner.
  2. Smart order types themselves implement eip1271 and take custody of user's funds, similar in style to Eth-Flow.

Research track

  • User Experience
  • Protocol Security
@fleupold
Copy link

This could also be implemented as a separate trade handling logic implementation (cf. #3 (comment)) but might be important enough to make it part of the default order type.

In particular this would be needed to allow TWAP and StopLoss orders for EOA without massive account abstraction implementation overhead (as EOA could simply defer signature to TWAP/StopLoss ERC1271 implementations).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants