Cargo Features

sp-core = { version = "34.0.0", default-features = false, features = ["std", "serde", "full_crypto", "bls-experimental"] }
default = std

The std feature is set by default whenever sp-core is added without default-features = false somewhere in the dependency tree.

std default = dyn-clonable, full_crypto, futures, itertools, parking_lot, rand, thiserror, tracing

Enables thread-pool of futures, byteorder, rustc-hex, serde and std of primitive-types, alloc and std of zeroize, std of scale-info and schnorrkel, std of blake2, bounded-collections, bs58, parity-scale-codec, and ed25519-zebra and rand and std of parity-bip39

personal fork here as workaround for:

and global-context and std of secp256k1 ^0.28.0

secp256k1 crate, better performance, intended to be used on host side (std)

and std of hash-db, hash256-std-hasher, impl-serde, k256, libsecp256k1, log, and merlin


k256 crate, better portability, intended to be used in substrate-runtimes (no-std)

and std of serde, sp-crypto-hashing, sp-debug-derive, sp-externalities, sp-runtime-interface, sp-std, sp-storage, ss58-registry, substrate-bip39, and optional w3f-bls


bls crypto

Affects crypto::Ss58Codec.from_string, crypto::Ss58Codec.from_string_with_version, crypto::Pair.generate, crypto::Pair.generate_with_phrase, hexdisplay::ascii_format, sp-core::traits, offchain::storage, offchain::testing, offchain::TransactionPool, testing::TaskExecutor

serde std = blake2, impl-serde

Serde support without relying on std features.

Enables serde, serde of bounded-collections, alloc of bs58, serde of k256, serde_no_std of primitive-types, serde of scale-info, serde of sp-storage

Affects crypto::Ss58Codec.from_ss58check, crypto::Ss58Codec.from_ss58check_with_version, crypto::Ss58Codec.to_ss58check_with_version, crypto::Ss58Codec.to_ss58check, crypto::Derive.derive, crypto::default_ss58_version, crypto::unwrap_or_default_ss58_version, crypto::set_default_ss58_version, crypto::PublicError

full_crypto std = blake2

This feature enables all crypto primitives for no_std builds like microcontrollers or Intel SGX. For the regular wasm runtime builds this should not be used.

Enables disable_target_static_assertions of sp-runtime-interface

Affects crypto::Pair.sign, crypto::PublicError

bls-experimental = w3f-bls

This feature adds BLS crypto primitives.
It should not be used in production since the implementation and interface may still be subject to significant changes.

Affects sp-core::bls, paired_crypto::ecdsa_bls377

Features from optional dependencies

In crates that don't use the dep: syntax, optional dependencies automatically become Cargo features. These features may have been created by mistake, and this functionality may be removed in the future.

impl-serde serde? std
bs58 serde? std
rand std
parking_lot std
sp-externalities std
futures std
dyn-clonable std
thiserror std
tracing std
itertools std

Enables itertools ^0.11

blake2 full_crypto? serde? std
secp256k1 std

Enables secp256k1 ^0.28.0

w3f-bls bls-experimental?