oasisprotocol / oasis-sdk

Official SDK for the Oasis Network.
Apache License 2.0
75 stars 20 forks source link

sr25519 precompile for EVM sdk #1968

Open CedarMist opened 2 months ago

CedarMist commented 2 months ago

Re: #304

In evm/src/precompile/confidential.rs we support Ed25519, Secp256k1, Secp256r1 and Secp384r1.

Sr25519 is also supported in crypto/signature/mod.rs

For Polkadot compatibility, we should support sr25519 signing & verification, as all the necessary support is there.

However, it seems substrate key derivation is not compatible with our ADR-8. To make sure it's compatible with Polkadot it will be necessary to take test vectors from Polkadot ecosystem to be sure signatures, keygen & verification works correctly.

kostko commented 2 months ago

However, it seems substrate key derivation is not compatible with our ADR-8.

I don't think this is relevant here as the precompiles allow raw signatures and don't do any derivation?

kostko commented 2 months ago

Also note that currently there is no MemorySigner implementation for sr25519, so only verification is implemented. It should be easy to add one though and update the relevant parts. For EVM support, the main thing is calibrating the gas costs. Should probably be similar to ed25519?