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

Extend orders signatures support #1

Open
Alirun opened this issue Mar 25, 2020 · 0 comments
Open

Extend orders signatures support #1

Alirun opened this issue Mar 25, 2020 · 0 comments

Comments

@Alirun
Copy link
Member

Alirun commented Mar 25, 2020

Extend orders signatures support

Problem

Currently Opium's Matching and SwapRateMatching contracts support only orders signed with EIP712 compatible signatures. This makes impossible few use cases of Opium orders settlement mechanisms.

1. Smart contract wallets

Smart contract wallets can't sign messages, thus require different mechanism for order validation such as external call to smart contract wallet.

Verifying contract should call external function of smart contract wallet and pass the order to it.
Smart Contract Wallet should has implemented special interface in order to support such calls.
This verifying function should return whether it permits settlement of the order or no.

2. Legacy and Hardware wallets

Legacy and Hardware wallets (i.e. Ledger and Trezor) doesn't have implementations of EIP712 thus only support personal signatures

In current firmware of Trezor and Ledger JSON RPC method eth_sign adds prefix

"\x19Ethereum Signed Message:\n" + len(message)

to the message before it's being signed making signature incompatible with EIP712 and require this signature to be verified differently.

So we need to implement additional check for signatures made using eth_sign JSON RPC call.

Solutions

Reference implementation: 0x

  • Implement SignatureType property in the order for wider support of different signature types
  • Implement Upgradability with Proxy contract in order to prevent orders invalidity after upgrades (see AAVE's versioned initializer and OZ's Upgradability Proxy)
@Alirun Alirun changed the title Extend orders signatures support OIP-1 Extend orders signatures support Sep 23, 2020
@Alirun Alirun changed the title OIP-1 Extend orders signatures support Extend orders signatures support Sep 23, 2020
Alirun added a commit that referenced this issue Sep 6, 2021
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

No branches or pull requests

1 participant