0

When I try to verify a signature using Alice address I got a SignatureInvalid message.

echo "blabla" | ./target/release/subkey verify
102f4f19773b0157c87561b9b6bfa07558246cbe0155a74ffd8f6365d4d14865a92f58a928b504dd6dd392b67e8a52a58832822c3f1b89f262f1921a286f8c8 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY


Error: SignatureInvalid

Any help is welcome, thank you.

1 Answer 1

0

How are you doing the signature? Following the account generated in the example from the docs https://docs.substrate.io/reference/command-line-tools/subkey/

You can create a signature of a message:

echo "blabla" | ./target/release/subkey sign --suri 0xc8fa03532fb22ee1f7f6908b9c02b4e72483f0dbd66e4cd456b8f34c6230b849

It gives you this result:

c4273e58b19b582330577f380041171d7aa9def2922e492e1b5510bc17a03f3fe19ae2b4f8089a7b4ba821fabffb97596245aa6caecf686a9ff119010374af8f

That then you can validate with its corresponding account: 5Gv8YYFu8H1btvmrJy9FjjAWfb99wrhV3uhPFoNEr918utyR

echo "blabla" | ./target/release/subkey verify c4273e58b19b582330577f380041171d7aa9def2922e492e1b5510bc17a03f3fe19ae2b4f8089a7b4ba821fabffb97596245aa6caecf686a9ff119010374af8f 5Gv8YYFu8H1btvmrJy9FjjAWfb99wrhV3uhPFoNEr918utyR

And the result is ok:

Signature verifies correctly.
7
  • Thank you Alex, how we can sign this data inside a pallet ? you think it is a good idea to sign and store some data regarding some busniss logic or it is a bad idea to do so ?
    – lsroudi
    Commented Feb 17, 2023 at 12:28
  • you can verify it on the pallet, see this old question substrate.stackexchange.com/questions/305/…
    – Alex Bean
    Commented Feb 17, 2023 at 12:30
  • the sign has to be done offchain
    – Alex Bean
    Commented Feb 17, 2023 at 12:30
  • Thanks, still dont know how i can sign a bunch of data inside a pallet ?
    – lsroudi
    Commented Feb 17, 2023 at 13:21
  • Ok thank you Alex i got the idea
    – lsroudi
    Commented Feb 17, 2023 at 13:27

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.