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

Sign message via coinbase generates invalid signature #4230

Closed
1 task done
AndreyBS1 opened this issue Aug 28, 2024 · 2 comments
Closed
1 task done

Sign message via coinbase generates invalid signature #4230

AndreyBS1 opened this issue Aug 28, 2024 · 2 comments
Labels
Needs Reproduction Misc: Needs Reproduction

Comments

@AndreyBS1
Copy link

Check existing issues

Describe the bug

What I am doing:

  1. Connect wallet via "metaMask" / "coinbase" connector.
  2. Use "signMessage" / "signMessageAsync" from "useSignMessage".

What I expected:

Same signatures from MetaMask and CoinBase which I can verify with "verifyMessage" from "viem"

What is actually happening:

Signature from CoinBase is invalid: it's much longer and contains a lot of "0" chars. Also I can't verify it.

I tried to transform message to hash, to bites and prepare message through siwe library (according to CoinBase Smart Wallet documentation), but result was always the same.

Link to Minimal Reproducible Example

No response

Steps To Reproduce

// use-sign-message.ts
export const useSignMessage = () => {
const { isConnected, address } = useAccount()
const { signMessageAsync } = useSignMessage()

const sign = async () => {
if (!isConnected || !address) {
throw new Error('Wallet is not connected')
}

  const message = 'message'
  const signature = await signMessageAsync({ message })
  console.log('signature:', signature)
  // With MetaMask --- "signature: 0xc41fc1885f5bf07fd63ad159104b88300dba8847455ab15c350931ea7aba8e980f6010b315dcba426be097b6d0e5fe43946cba2f7d8df59ca9797bca9f106fda1c"
  // With CoinBase --- "signature: 0x000000000000000000000000ca11bde05977b3631167028862be2a173976ca110000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000028000000000000000000000000000000000000000000000000000000000000001e482ad56cb0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000ba5ed0c6aa8c49038f819e587e2633c4a9f428a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000e43ffba36f0000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004038d876f77121cc20878349b671305165aa9349e6e2261575b127dfc04834f583024121bb8e98e7f6b2d4857d61a702e5345fbd609703e24e2793233602e17334000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002800000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000017000000000000000000000000000000000000000000000000000000000000000170f89d2fb7f3e544f6202c3868159889318290437c95661d8a7c775140f8ff73641c2428b6d4ed218a55cc26d768318092e71f7c1f7a2df94461b4dd0caa38860000000000000000000000000000000000000000000000000000000000000025f198086b2db17256731bc456673b96bcef23f51d1fbacdd7c4379ef65465572f1d00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008a7b2274797065223a22776562617574686e2e676574222c226368616c6c656e6765223a22326973714a4865795849527149734f706f5a355f416d344a546f413351616f4152626c695958386f75336b222c226f726967696e223a2268747470733a2f2f6b6579732e636f696e626173652e636f6d222c2263726f73734f726967696e223a66616c73657d000000000000000000000000000000000000000000006492649264926492649264926492649264926492649264926492649264926492"

  return signature

}

return { sign }
}

What Wagmi package(s) are you using?

wagmi

Wagmi Package(s) Version(s)

2.13.3

Viem Version

2.19.1

TypeScript Version

5.5.4

Anything else?

react version: 18.3.1
vite version: 5.3.5

@tmm tmm added the Needs Reproduction Misc: Needs Reproduction label Aug 28, 2024
Copy link
Contributor

Hello @AndreyBS1.

Please provide a minimal reproduction using StackBlitz, TypeScript Playground (for type issues), or a separate minimal GitHub repository.

Minimal reproductions are required as they save us a lot of time reproducing your config/environment and issue, and allow us to help you faster.

Once a minimal reproduction is added, a team member will confirm it works, then re-open the issue.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Aug 28, 2024
Copy link
Contributor

This issue has been locked since it has been closed for more than 14 days.

If you found a concrete bug or regression related to it, please open a new bug report with a reproduction against the latest Wagmi version. If you have any questions or comments you can create a new discussion thread.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Needs Reproduction Misc: Needs Reproduction
Projects
None yet
Development

No branches or pull requests

3 participants
@tmm @AndreyBS1 and others