The wasm wrapper for the signature verification message in gn-wasm accepts a String and passes it directly to gn_common::utils::verification_msg. However a String is encoded differently than an AccountId on-chain, where the signer of the pallet call is the input for verification_msg. Thus, the message generated at frontend differs from the message generated on-chain, thus verification fails with an AccessDenied error.
Solution
Thankfully, the solution is simple, only the wasm wrapper has to be updated to perform a conversion from the input String into an AccountId and pass that to the verification_msg.
Description
The wasm wrapper for the signature verification message in
gn-wasm
accepts aString
and passes it directly togn_common::utils::verification_msg
. However aString
is encoded differently than anAccountId
on-chain, where the signer of the pallet call is the input forverification_msg
. Thus, the message generated at frontend differs from the message generated on-chain, thus verification fails with anAccessDenied
error.Solution
Thankfully, the solution is simple, only the wasm wrapper has to be updated to perform a conversion from the input
String
into anAccountId
and pass that to theverification_msg
.