-
Notifications
You must be signed in to change notification settings - Fork 789
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
Move crypto implementations out of sp-core #1975
Comments
#133 relevant. |
This is something I've been thinking about for a while. Even though it doesn't help with the supply chain size I'd like to first identify and move all the crypto-related stuff in the As a potential follow-up we can then consider "one crate per primitive" or "feature gated primitives"..
Maybe feature flags are better than separate crates here (don't know... just asking for opinions)? Let's collect some opinions first (cc @paritytech/sdk-node) |
Personally I'd probably move all crypto related stuff into |
My two cents:
|
Step towards #1975 As reported #1975 (comment) I'd like to encapsulate crypto related stuff in a dedicated folder. Currently all cryptographic primitive wrappers are all sparsed in `substrate/core` which contains "misc core" stuff. To simplify the process, as the first step with this PR I propose to move the cryptographic hashing there. The `substrate/crypto` folder was already created to contains `ec-utils` crate. Notes: - rename `sp-core-hashing` to `sp-crypto-hashing` - rename `sp-core-hashing-proc-macro` to `sp-crypto-hashing-proc-macro` - As the crates name is changed I took the freedom to restart fresh from version 0.1.0 for both crates --------- Co-authored-by: Robert Hambrock <roberthambrock@gmail.com>
) Step towards paritytech#1975 As reported paritytech#1975 (comment) I'd like to encapsulate crypto related stuff in a dedicated folder. Currently all cryptographic primitive wrappers are all sparsed in `substrate/core` which contains "misc core" stuff. To simplify the process, as the first step with this PR I propose to move the cryptographic hashing there. The `substrate/crypto` folder was already created to contains `ec-utils` crate. Notes: - rename `sp-core-hashing` to `sp-crypto-hashing` - rename `sp-core-hashing-proc-macro` to `sp-crypto-hashing-proc-macro` - As the crates name is changed I took the freedom to restart fresh from version 0.1.0 for both crates --------- Co-authored-by: Robert Hambrock <roberthambrock@gmail.com>
Motivation
Currently compiling sp-core with std will compile:
And that's for elliptic curves alone. Several hash algorithms/transcripts also get pulled in.
Request
Decrease tree size, ideally not only via feature flags yet completely in order to ensure minimal
Cargo.lock
s (making supply chain evaluations much easier).Solution
Move all of these literals into their own primitives crates.
For secp256k1/Ed25519/Ristretto specifically, their use is almost fully abstracted behind traits. Accordingly, it should be feasible to have sp-schnorrkel, sp-ed25519, and sp-ecdsa preventing sp-core compilations from forcing inclusion of so many dependencies.
I'd hope to see this expanded to the Arkworks section, yet I know that's under active development and don't want to throw a wrench at it while it moves.
I'd be fine helping with this yet I'm unwilling and/or not-reasonably-able to sign the CLA at this time, sorry.
Are you willing to help with this request?
Maybe (please elaborate above)
Status
sp-crypto-hashing
(Move cryptographic hashing procedures to crypto folder. #2306)sp-core-hashing
and `sp-core-hashing-proc-macro (scheduled removal Jun 2024)The text was updated successfully, but these errors were encountered: