5

Substrate supports multiple signature schemes: ecdsa, sr2551, ed25519. When sending a signed transaction how does substrate know what scheme to use for signature verification?

1 Answer 1

7

It is a SCALE-encoded MultiSignature enum. so in SCALE encoding the first byte tells you which variant the value is. So you will notice that ed25519 signatures always start with 0x00, sr25519 with 0x01, and ecdsa with 0x02.

So in a fully serialized transaction, the "signature" is actually 0x <scheme> + <signature>.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.