-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Contracts pallet - Add support for recovering public key from elliptic curve signatures (ECDSA) #9609
Comments
If we want to have this it would have to be implemented in the cc @athei |
Makes sense to me. Contracts should not contain cryptographic code as it makes them way to big.
A quick grep in substrate seems to suggest that it is in some |
Hello @athei substrate/primitives/core/src/ecdsa.rs Line 511 in 16e17ae
|
@athei you probably want to use this here: substrate/primitives/io/src/lib.rs Line 784 in b79e2b9
And as @PierreOssun already pointed out, we use it in several places. |
Yeah I messed up my grep. This is great. We can use existing client functions for that. |
@athei |
That would be great. But keep in mind that the biggest part of implementing this feature will be adding tests and benchmarks. |
related to #8989, we think we not only need ecdsa recover, we also need more functions. |
Yea, but recovery is a feature only for ECDSA when verifying and signing must be implemented for all three supported key pairs. |
Can we add support for recovering public key from elliptic curve signatures (ECDSA) to !ink ?
We are trying to implement an ECDSA verifier in a contract. For this we are using recover function from the libsecp256k1 library developed by Parity and also used in Substrate.
The problem is that it uses a big list of constants that made cargo build fail due to its huge file size.
As a note : We could compile the contract using rustflags to increase memory and the optimized WASM file size was 1.3 Mb
In Ethereum, the ecrecover function is implemented as a precompiled contract and can be called from any contract.
A suggested solution is to implement the EDCSA recover pub key logic in contracts-pallet level, so that it can be used by !ink contracts via ext calls (as it was implemented for hashes).
What do you think ?
The text was updated successfully, but these errors were encountered: