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

feat: Rust<>JS bindings for Schnorrkel signature verification #454

Merged
merged 7 commits into from
Nov 9, 2019

Conversation

pmespresso
Copy link
Contributor

No description provided.

@hanwencheng
Copy link
Contributor

LGTM, though I do not have much knowledge about the Rust code part.

Questions are:

  1. What is the usage of testing context part?
  2. What is the difference of signing data compared with transactions and extrinsic, they are all string here, if there is a difference, is it possible to set up a test for some trasactions bytes or extrinsic bytes?

@maciejhirsz
Copy link
Contributor

Don't forget the swift part for iOS :)

@hanwencheng: not sure what you mean by context part. As for signing data vs extrinsics - there is no difference. I don't know if we have any concept of signing messages that are distinct from extrinsics/transactions in Substrate, if so we should at least deploy a similar protection Ethereum is using there (adding some salt to messages, so you can't craft a message that is actually a transaction).

@pmespresso
Copy link
Contributor Author

pmespresso commented Nov 7, 2019

Doing my best to answer this accurately as I just learned from Maciej.

  1. The context is like a consistent magic number used to sign along with the payload, in this case Substrate to indicate we are signing for Substrate

  2. Messages, Transactions, Extrinsics can all be represented as byte slices and hexadecimal strings - the signature will always be created from the byte slice. The specifics of the Ristretto signing algorithm goes over my head but I know that it must use the byte slice as part of the signature requires setting the high bit of byte 31 to distinguish between sr25519 and ed25519 signature. But we take as input the hexadecimal representation from JS. The conversion from hex to u8a in this case happens in lib.rs.

@pmespresso pmespresso changed the title Rust<>JS bindings for Schnorrkel signature verification feat: Rust<>JS bindings for Schnorrkel signature verification Nov 8, 2019
@pmespresso pmespresso merged commit 8faa7b0 into master Nov 9, 2019
@pmespresso pmespresso deleted the yj-verify branch November 9, 2019 12:30
pmespresso added a commit that referenced this pull request Nov 9, 2019
* fix: bump kusama metadata

* feat: rust schnorrkel verify bindings

* fix: add ios bindings
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

Successfully merging this pull request may close these issues.

4 participants