Skip to content
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

decode verify fail, help #65

Closed
gith-u-b opened this issue Sep 5, 2022 · 1 comment
Closed

decode verify fail, help #65

gith-u-b opened this issue Sep 5, 2022 · 1 comment

Comments

@gith-u-b
Copy link

gith-u-b commented Sep 5, 2022

uni-arts-chain/sr25519#1

hi,

params:

{
    "message": "I'm verifying my DOT address",
    "address": "5HBwjWDWZTqRCv98pku9NwoSRo7euCowciut12tviPNAt7WK",
    "signature": "0xc02fd26ba216daa8cd285314a8059aa60744fd5cff1af606e14a9160c854a57c6b42abe0a986ae6b868703359c32c55069b819d23217f01ac513f8bc51482683"
}

use codes:

  server.post<{ Body: { message: string, signature: string, address: string } }>("/worker/dotSignatureVerify", async (request, reply) => {
    let {message, signature, address} = request.body

    await cryptoWaitReady();

    const isValid  = signatureVerify(stringToU8a(message), signature, address);

    return { isValid: isValid }
  });

image

is_valid is true, but use:

verify_result = SR25519.verify("5HBwjWDWZTqRCv98pku9NwoSRo7euCowciut12tviPNAt7WK", "I'm verifying my DOT address", "0xc02fd26ba216daa8cd285314a8059aa60744fd5cff1af606e14a9160c854a57c6b42abe0a
986ae6b868703359c32c55069b819d23217f01ac513f8bc51482683")

is false

use sign a message:
image

@freehere107
Copy link
Collaborator

You should open an issue at https://github.com/uni-arts-chain/sr25519/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants