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

EIP712 signatures with salt in domain causes wrong signature #947

Open
mrwillis opened this issue May 1, 2023 · 2 comments
Open

EIP712 signatures with salt in domain causes wrong signature #947

mrwillis opened this issue May 1, 2023 · 2 comments

Comments

@mrwillis
Copy link

mrwillis commented May 1, 2023

Expected Behavior

Signatures should match with JS signature

Current Behavior

Signatures don't match

Possible Solution

Not sure

Steps to Reproduce

Check out code here mrwillis/SigningExampleNethereum#1

Steps:

  1. export PRIVATE_KEY_NO_PREFIX="abadcdacdavv..."
  2. export CHAIN_ID=123
  3. Follow README.md to build node_signatures
  4. dotnet run
  5. Output will look something like
Cancel all orders signature (c#): 0x19044621d620e3f1cb8be691d647117d374f1b3032784217a4057a19184fa9e62249ae97dcb38352876a4815239fc2b7dac414713b23d36a4e05bb88e01d910d1c
Cancel all orders signature (js): 0x4ca7f419722c2c497044b8b8fc0ee0a66de4b583bd27889449530154efe18dcf0e6a69f96f8fb992d198a847cb170d5dda14dbbef896a70a6ffae69ddd6c3d171c

They should match

Context (Environment)

We are trying to port existing JS signature generation to Nethereum for our SDK since support was added.

@mrwillis mrwillis changed the title EIP712 signatures with salt in domain mismatched signature EIP712 signatures with salt in domain causes wrong signature May 1, 2023
@mrwillis
Copy link
Author

mrwillis commented Jun 7, 2023

@juanfranblanco could you take a look at this? i do believe there is some issue when salt is being used.

@juanfranblanco
Copy link
Member

@mrwillis i missed this, but looking at your code your signatures will defer as the salt is different, you will require the same salt for the signatures to match

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

2 participants