-
Notifications
You must be signed in to change notification settings - Fork 38
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
web3/schnorrkel
failed to verify ext_sr_sign
generated signatures
#256
Comments
Moving the issue to w3f/schnorrkel#77 |
From the extension the data is actually wrapped in a wrapper before signing. It is not signed as-is passed in. (This is to ensure users cannot be duped I to signing transactions with the raw sign functionality) The data is passed to wrapBytes before being signed - https://github.com/polkadot-js/common/blob/master/packages/util/src/u8a/wrap.ts |
Also derivation path maybe? |
Here is your test data adapted to use the signature supplied by the extension - It is your first test above (same public, same signature), the only change is to adapt the message to It passes -
|
@jacogr now works using the wrapper! Example using the go-schnorrkel pkg! https://gist.github.com/EclesioMeloJunior/bb1a65e22aa2a4e27263206b42e34c43 |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue if you think you have a related problem or query. |
Description
Hello! I'm trying to use the repository
https://github.com/w3f/schnorrkel
, more specifically the function verify_simple to verify signatures generated by polkadot-js using thesignRaw
function and unforunately it's not working. However the functionsignatureVerify
from@polkadot/util-crypto
verify correctly the same signature.Steps to reproduce
scren-record.mov
https://github.com/w3f/schnorrkel
cloned at my machine I created the following test case (which fails) atsrc/sign.rs
file:Debugging the polkadot-js
signatureVerify
function I noticed that this function calls the rust functionext_sr_verify
under the hoods by a WASM biding (very interestingly 😄 ) and the rust function uses the samew3f/schnorrkel
repository, then I assumed the functionext_sr_sign
is used to generate the signature so I decided to create the following test case that uses these 2 functions to generate and verify a signature:And unfortunately, this test case fails. The same thing happens with the
https://github.com/ChainSafe/go-schnorrkel
package, the original issue was reported into Gossamer discord channel.Thanks in advance!
The text was updated successfully, but these errors were encountered: