meso-network / meso-ios-example

A reference implementation for integration Meso's on/off ramps into an iOS application.
0 stars 0 forks source link

MessageSigner does not sign message with privateKey. #4

Open MattEllison95 opened 6 months ago

MattEllison95 commented 6 months ago

When you sign a message, you have to sign it with the private key of the wallet to verify the actual wallet's address.

I was able to solve this with https://github.com/bitmark-inc/tweetnacl-swiftwrap/blob/master/Sources/TweetNacl/TweetNacl.swift

You have to sign it with the signDetached function, with the messageToSign's .utf8 data and the wallet's private key data. It must also be encoded with Base58.

Doing this allows you to bypass signing in with your Meso account via email.

kyledetella commented 6 months ago

Thanks @MattEllison95! We will get the demo updated to be more explicit that signing requires more than what we have in there.