pub struct Secp256k1;
Expand description

This elliptic curve cryptography implements both the AsymmetricCrypto and KeyDerivationCrypto traits so for BTC, ETH and IOP as examples.

Trait Implementations

The ID (also called fingerprint or address in some literature) of the public key. See PublicKey::key_id for more details. Read more

See PublicKey for more details. Read more

See PrivateKey for more details. Read more

The signature of a given message with a given private key. Its size and representation is up to the implementation. Read more

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Normal derivation allows the neutered extended public key to calculate child extended public keys without revealing any private keys. Read more

Hardened derivation makes it impossible to the neutered extended public key to calculate children. It uses a different derivation algorithm. Read more

Neutering an extended private key gives an extended public key that contains the private key neutered, plus the chain code. It is useless to reveal the chain code when hardened derivation is used. Read more

Throws away the chain code and gives back only the private key from the extended private key.

Derive child extended public keys. Useful for auditing hierarchical deterministic wallets, or generating a new address for each on-chain transaction knowing the owner of the corresponding extended private key can spend the received coins. Read more

Throws away the chain code and gives back only the public key from the extended public key.

See ExtendedPrivateKey for more details. Read more

See ExtendedPublicKey for more details. Read more

Does not seem to completely belong here, but calculates the master extended private key - the root of a hierarchical deterministic wallet - from a given seed. All other keys are derived from this one extended private key. Read more

Panics

There is a 2^-256 chance this message cannot be signed by this key. The C implementation in bitcoin does not fail, but this pure rust version does. Then we panic.

Calculates the PublicKey that belongs to this private key. These two keys together form an asymmetric keypair, where the private key cannot be calculated from the public key with a reasonable effort, but the public key can be calculated from the private key cheaply. Read more

Calculates the ID (also called fingerprint or address in some literature) of the public key. In some algorithms the public key is only revealed in point-to-point communications and a keypair is identified only by the digest of the public key in all other channels. Read more

We do not have multiple versions of KeyIds for the same multicipher public key, so for now this comparison is trivial. But when we introduce newer versions, we need to take the version of the key_id argument into account and calculate that possibly older version from self. Read more

This method can be used to verify if a given signature for a message was made using the private key that belongs to this public key. See also PrivateKey::sign Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.