1

Currently I am integrating a solution that requires the user to sign a message in order to verify their identity. The solution is currently based on the breacon-sdk. The message is prefixed with 04 according to Sign Payload HEX Prefixed With 05 and formatted according to Generating a signature with Beacon SDK.

The issue we are facing currently is that the message we are displaying to the user in a way that that the new line characters of "\n" are not displayed with new line, instead they are displayed as "\n". This is the case only is some wallets, like: Temple browser extension, Kukai, Umami desktop app.

Our original raw is:

Welcome to Mailchain!

Please sign to start using this address with Mailchain. This will not trigger a blockchain transaction or cost any gas fees.

What's happening?
A messaging key will be registered with this address and used only for messaging. It will replace any existing registered messaging keys.

Technical Details:
Address: tz1P1xs3qkYNk6cBW273W2UbEVhpWYbwxwZ6
Messaging key: 0xe27bc7aaff2005e0d6530fcff163e046cd450259b1db284680c40cd4388f13017a
Nonce: 14

This results in byte payload of:

0501000001d057656c636f6d6520746f204d61696c636861696e210a0a506c65617365207369676e20746f207374617274207573696e67207468697320616464726573732077697468204d61696c636861696e2e20546869732077696c6c206e6f742074726967676572206120626c6f636b636861696e207472616e73616374696f6e206f7220636f737420616e792067617320666565732e0a0a5768617427732068617070656e696e673f0a41206d6573736167696e67206b65792077696c6c206265207265676973746572656420776974682074686973206164647265737320616e642075736564206f6e6c7920666f72206d6573736167696e672e2049742077696c6c207265706c61636520616e79206578697374696e672072656769737465726564206d6573736167696e67206b6579732e0a0a546563686e6963616c2044657461696c733a0a416464726573733a20747a315031787333716b594e6b3663425732373357325562455668705759627778775a360a4d6573736167696e67206b65793a2030786532376263376161666632303035653064363533306663666631363365303436636434353032353962316462323834363830633430636434333838663133303137610a4e6f6e63653a203134

The final message that is displayed to the user is the same as the original, only difference being that the new lines are not shown, instead there are \n in their places. The final signature is done against the correct payload and the signature is verified successfully.

Is there are way to get the new line characters (line terminators) to be displayed with new line instead of like a character?

1 Answer 1

1

That message is not formatted as described in the documentation you are referring to. You are missing the Tezos Signed Message: string prefix. If you fix that, Kukai will respect the \n character.

Kukai with correct prefix

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.