safe-react icon indicating copy to clipboard operation
safe-react copied to clipboard

Support EIP712 signature method from Safe Apps

Open samuveth opened this issue 1 year ago • 17 comments

Would it be possible to update the safe-core-sdk to the latest version which supports EIP712?

samuveth avatar Jul 20 '22 14:07 samuveth

Although this would be very nice indeed, it's not on our radar atm. We'll happily review and merge your pull request though. Keep in mind the calls will need to be updated to the new method. I think it currently affects Owner and Module management, possibly some other types of transactions.

katspaugh avatar Jul 20 '22 14:07 katspaugh

Thanks for your quick response. We are thinking about starting a bounty on Gitcoin for this, would you be interested in funding this bounty with us?

samuveth avatar Jul 20 '22 15:07 samuveth

No, we're not interested at this time. We're currently working on the next version of the app, where Safe Core SDK is already the latest version. It's only a matter of time (a few weeks?) until this reaches production. If you require this sooner, feel free to contribute.

For reference, this call:

sdk.signTransaction(safeTx, 'eth_sign')

will have to be changed to

sdk.signTransaction(safeTx, 'eth_signTypedData')

and that's pretty much it. 🤓

katspaugh avatar Jul 20 '22 15:07 katspaugh

Hey @katspaugh I tried to find the function call in the safe-react codebase. Can you tell me which repository are you referring to?

I will create a PR so that we can get this out sooner.

midgerate avatar Jul 21 '22 03:07 midgerate

Hi @midgerate! Sorry, I gave you misleading information.

This repository, although it uses the Safe Core SDK for transaction creation (in Module and Owner management), doesn't use it for signing transactions.

For signing, there's custom code which already supports EIP712.

In the new version of the app (which is not a public repo yet, but soon will be), we're using Safe Core SDK exclusively, and we use the new method there.

katspaugh avatar Jul 21 '22 06:07 katspaugh

@katspaugh that means, technically gnosis ui already supports EIP712. On snapshot we use safe-apps-sdk and safe-apps-sdk-provider

It always calls signTransaction instead of signTypedData as implemented in safe-core-sdk.

Do you know already what changes we need to do to safe-apps-sdk so that it calls the correct method?

midgerate avatar Jul 22 '22 02:07 midgerate

I've double-checked, and from what I see in the code, all transaction signing in safe-react goes through the same function I linked above.

Except for signing with hardware wallets, in which case it does eth_sign (so does the Safe Core SDK).

@dasanra @mikhailxyz any idea?

katspaugh avatar Jul 22 '22 06:07 katspaugh

@midgerate safe-apps-sdk only supports eth_sign for now. You can follow this issue https://github.com/safe-global/safe-react-apps/issues/255

mmv08 avatar Jul 22 '22 11:07 mmv08

As per @mikhailxyz's message, this will need to be added in the Apps SDK, and safe-react also will need to be updated accordingly. Namely this modal.

@mikhailxyz do we have a timeline for the Apps SDK implementation?

katspaugh avatar Jul 22 '22 11:07 katspaugh

@mikhailxyz do we have a timeline for the Apps SDK implementation?

not really, because of the upcoming new app

mmv08 avatar Jul 22 '22 11:07 mmv08

Now that we clarified what needs to be done exactly, I’ll forward the funding proposal to the team. 👍

katspaugh avatar Jul 22 '22 14:07 katspaugh

Hey @katspaugh, is there any update on this? If there is anything we can help with please let us know!

samuveth avatar Aug 01 '22 09:08 samuveth

Summoning @ennisjo. :) Any update on this?

katspaugh avatar Aug 01 '22 10:08 katspaugh

hey @samuveth - would you be willing to co-fund this bounty with us with a 50/50 split?

We estimate that this would take a developer 5 days to complete this task.

ennisjo avatar Aug 02 '22 13:08 ennisjo

Hey @ennisjo, yes we would love to contribute 50% to this bounty!

You can contact us for the billing at [email protected] or fabien#4765 on Discord

samuveth avatar Aug 02 '22 16:08 samuveth

@ennisjo Feel free to reach out on Discord and let us know if we can help on the next steps, we can provide some test app link to trigger a Safe to sign an EIP712 message

bonustrack avatar Aug 02 '22 16:08 bonustrack

@bonustrack - dm'd you on discord. Will proceed from there and look to get this bounty public.

ennisjo avatar Aug 04 '22 13:08 ennisjo

I think we can close this ticket. Thank you all for the awesome job! ;)

JagoFigueroa avatar Sep 22 '22 09:09 JagoFigueroa