web3modal icon indicating copy to clipboard operation
web3modal copied to clipboard

[bug] After using the email sign in, the signMessage function doesn't sign the message in a same way when you connected trough a wallet.

Open Daargajedan opened this issue 6 months ago • 8 comments

Link to minimal reproducible example

https://dev.densitydeck.com/

Steps to Reproduce

Connect with a wallet and try to sign in, this works.

Connect trough email, sign in and it doesnt work.

See the requests wich holds the signature.

Summary

After connecting with any wallet we have a short signature from the signMessageAsync function.

The code is the same, only difference is the way of connecting

Correct: (Normal wallet connect) {"address":"0xMYADDRESS HERE","signature":"0x25c50f83e207dc6243636eeb7eb20b3ebea0c82ec2ee4b9299dd156af0a44aca571ca951911f806c1929017bd38ec5d83bff8c2a8fb529a4b8f3f55118b962461c"}

Wrong: (Email connect) {"address":"0xMYADDRESS HERE","signature":"0x0000000000000000000000004e1dcf7ad4e460cfd30791ccc4f9c8a4f820ec67000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000003c000000000000000000000000000000000000000000000000000000000000003241688f0b900000000000000000000000041675c099f32341bf84bfc5382af534df5c7461a0000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000007a6733696a79300000000000000000000000000000000000000000000000000000000000000000000284b63e800d0000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000100000000000000000000000038869bf66a61cf6bdb996a6ae40d5853fd43b5260000000000000000000000000000000000000000000000000000000000000140000000000000000000000000a581c4a4db7175302464ff3c06380bc3270b403700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000005354c3b6c6fd4470fd100565e521d948f2e20c6a00000000000000000000000000000000000000000000000000000000000001048d80ff0a000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000b9018ecd4ec46d4d2a6b64fe960b3d64e8b94b2234eb000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000648d0dc49f00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000001000000000000000000000000a581c4a4db7175302464ff3c06380bc3270b40370000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000413da45273a63d0b87bda7a65d8318d8d6bcfb36b512e01ebef065ab3e9b2a73ce4c1c6941be5eb1f1921870d3447a900b9267c3986c5604f04538f92ce6fa37961f000000000000000000000000000000000000000000000000000000000000006492649264926492649264926492649264926492649264926492649264926492"}

List of related npm package versions

"@reown/appkit": "^1.7.9-f49d3d03911133c721eea4ee9afd9436e093cabe.0", "@reown/appkit-adapter-wagmi": "^1.7.9-f49d3d03911133c721eea4ee9afd9436e093cabe.0", "viem": "^2.30.7-canary-20250605150520", "wagmi": "^2.15.5",

Node.js Version

v20.18.1

Package Manager

10.8.2

Daargajedan avatar Jun 09 '25 12:06 Daargajedan

happening to me too

mbarr1111 avatar Jun 09 '25 12:06 mbarr1111

Hi Thanks for raising this - I tried to reproduce internally and I was able to sign messages using the email wallet without an issue. please can you add a screen recording?

Sam-Newman avatar Jun 11 '25 12:06 Sam-Newman

This is the sign in with a weird/other signature https://youtu.be/qTntXoTFcL8

This is the expected behavior, as you can see it sign in aswel. https://youtu.be/VhK-UPQW8pw

You can try youreself on https://dev.densitydeck.com/

Daargajedan avatar Jun 11 '25 12:06 Daargajedan

the main issue is for brand new accounts that login with social , eos is not working by default, so the signatures are in the other format.

mbarr1111 avatar Jun 11 '25 16:06 mbarr1111

@Daargajedan

The signature you are seeing looks strange because the email login is a smart account by default instead of an EOA.

If you want to default to an EOA try setting the defaultAccountType to an EOA in the config

createAppKit({ //... defaultAccountTypes: { eip155: "eoa" }, });

More information is in the docs here:

https://docs.reown.com/appkit/javascript/core/options#defaultaccounttypes

Sam-Newman avatar Jun 12 '25 19:06 Sam-Newman

Thank you this was one thing. Only thing now is that it doesnt work right after i connected the wallet i need to refresh before it is affected. See:

https://youtu.be/YcHPh5Ok3Ok

Daargajedan avatar Jun 12 '25 20:06 Daargajedan

I cannot reproduce this in our Demo, so I think this is an issue with your implementation. If you want to get more support you can try our Devrel team via discord or upgrade to a paid plan for priority support, you can contact the team at [email protected]

https://demo.reown.com/

Sam-Newman avatar Jun 12 '25 21:06 Sam-Newman

This is not hard to implement:

createAppKit({
  adapters: [wagmiAdapter],
  enableWalletConnect: true,
  defaultAccountTypes: { eip155: "eoa" },
  networks: networks,
  projectId,
  metadata: metadata,
  features: {
    analytics: true, // Optional - defaults to your Cloud configuration,
  },
})

Then the signMessageAsync from wagmi package should return the right signature. It does not work on first try after refreshing the page it does...

Daargajedan avatar Jun 18 '25 11:06 Daargajedan

Hi @Daargajedan Long messages signatures are related with the smart account that were not yet deployed.

We used to have an issue with defaultAccountTypes. Please try with latest version. v1.7.10

Thanks

rtomas avatar Jun 20 '25 02:06 rtomas

Just upgraded, looks like its working thank you @rtomas.

I will do some more tests when i wake up!

Daargajedan avatar Jun 20 '25 03:06 Daargajedan