You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are trying to have users sign a string which is used to generate another asymmetric key pair. We initially thought to use the raw signing type, but that isn't well supported by most Tezos wallet providers. In order to get around this, @klassare from Kukai recommended that we use Micheline encoding for a string instead. When I tested this, the string was rendered with quotes around it and with newlines escaped. After looking into the Kukai implementation a bit, I found that they use emitMicheline() to create the rendered text. Is that its intended use? Why are strings ran through JSON.stringify() when converting a Micheline expression to a string? Is the output of emitMicheline() supposed to be ran through JSON.parse() afterwards to get the JSON equivalent to the original Micheline expression?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
We are trying to have users sign a string which is used to generate another asymmetric key pair. We initially thought to use the raw signing type, but that isn't well supported by most Tezos wallet providers. In order to get around this, @klassare from Kukai recommended that we use Micheline encoding for a string instead. When I tested this, the string was rendered with quotes around it and with newlines escaped. After looking into the Kukai implementation a bit, I found that they use
emitMicheline()
to create the rendered text. Is that its intended use? Why are strings ran throughJSON.stringify()
when converting a Micheline expression to a string? Is the output ofemitMicheline()
supposed to be ran throughJSON.parse()
afterwards to get the JSON equivalent to the original Micheline expression?For reference:
Kukai's Micheline rendering: https://github.com/kukai-wallet/kukai/blob/155350fd013d133eb5dfe44da3e4bccd6a629a58/src/app/components/sign-expr/sign-expr.component.ts#L47
JSON.stringify: https://github.com/ecadlabs/taquito/blob/master/packages/taquito-michel-codec/src/micheline-emitter.ts#L67L68
Beta Was this translation helpful? Give feedback.
All reactions