Module sp_core::crypto[][src]

Expand description

Cryptographic utilities.


Known key types; this also functions as a global registry of key types for projects wishing to avoid collisions with each other.


An opaque 32-byte cryptographic identifier.

An identifier for a specific cryptographic algorithm used by a key pair

A type alias of CryptoTypeId & a public key

Dummy cryptography. Doesn’t do anything.

An identifier for a type of cryptographic key.

Error encountered while parsing Ss58AddressFormat from &’_ str unit struct for now.


A since derivation junction description. It is the single parameter used when creating a new secret key from an existing secret key and, in the case of SoftRaw and SoftIndex a new public key from an existing public key.

The infallible type.

An error type for SS58 decoding.

An error with the interpretation of a secret.

A known address (sub)format/network ID for SS58.


The address of the associated root phrase for our publicly known keys.

The root phrase for our publicly known keys.

The length of the junction identifier. Note that this is also referred to as the CHAIN_CODE_LENGTH in the context of Schnorrkel.


Type which has a particular kind of crypto associated with it.

Derivable key trait.

Trait for accessing reference to SecretString.

One type is wrapped by another.

Trait suitable for typical cryptographic PKI key pair type.

Trait suitable for typical cryptographic PKI key public type.

Key that can be encoded to/from SS58.

Similar to From, except that the onus is on the part of the caller to ensure that data passed in makes sense. Basically, you’re not guaranteed to get anything sensible out.

The counterpart to UncheckedFrom.

Opposite of IsWrappedBy - denotes a type which is a simple wrapper around another type.

Trait to zeroize a memory buffer.


Set the default “version” (actually, this is a bit of a misnomer and the version byte is typically used not just to encode format/version but also network identity) that is used for encoding and decoding SS58 addresses. If an unknown version is provided then it fails.

Type Definitions

A store for sensitive data.

Derive Macros

Trait to zeroize a memory buffer.