#substrate #polkadot #cryptography #crypto #no-std

no-std substrate-crypto-light

Cryptographic code for Substrate chains in pure rust with better baremetal support

1 unstable release

0.2.0 Jan 30, 2025
0.1.0 Nov 21, 2024

#262 in #polkadot

Download history 160/week @ 2024-11-20 69/week @ 2024-11-27 32/week @ 2024-12-04 39/week @ 2024-12-11 7/week @ 2024-12-18 110/week @ 2025-01-01 20/week @ 2025-01-08 4/week @ 2025-01-22 144/week @ 2025-01-29 9/week @ 2025-02-05 35/week @ 2025-02-12 3/week @ 2025-02-19 19/week @ 2025-02-26

72 downloads per month
Used in 3 crates

GPL-3.0-or-later

43KB
876 lines

Cryptographic code for Substrate chains in pure rust with better baremetal support.

This is largely based on sp_core crate.

Key differences here:

  • no-std compatible with arm,
  • sr25519 supports external Rng, for usability on baremetal
  • ecdsa support based on pure Rust crate k256, to avoid compiling difficulties (original sp-core has ecdsa from secp256k1 C wrapper crate and it does not compile on certain no-std targets and creates extremely large binary blob on others)

lib.rs:

This is largely based on sp_core crate. Draft.

Key differences here:

  • no-std compatible with arm
  • sr25519 supports external Rng, for usability on baremetal
  • ecdsa support based on pure Rust crate k256, to avoid no-std target compiling difficulties (original sp-core has ecdsa from secp256k1, a C wrapper crate, and as a result ecdsa parts from sp-core do not compile on certain no-std targets and create extremely large binary blob on others)
  • ecdsa pair has zeroize on drop

Dependencies

~6–9.5MB
~189K SLoC