pub struct XPrv(_);
Expand description

HDWallet extended private key

Effectively this is an ed25519 extended secret key (64 bytes) followed by a chain code (32 bytes).

Implementations

takes the given raw bytes and perform some modifications to normalize to a valid Ed25519 extended key, but it does also force the 3rd highest bit to be cleared too.

Takes the given raw bytes and perform some modifications to normalize to a valid Ed25519 extended key. It doesn’t touch the 3rd highest bit as expected in the ed25519-bip32 paper.

Check if the 3rd highest bit is clear as expected from the paper

Clear the 3rd highest bit as expected from the paper setting

Takes a non-extended Ed25519 secret key and hash through SHA512 it in the same way the standard Ed25519 signature system make extended key, but also force clear the 3rd highest bit of the key instead of returning an error

Takes a non-extended Ed25519 secret key and hash through SHA512 it in the same way the standard Ed25519 signature system make extended key. If the 3rd highest bit is set, then return an error

bip32-ed25519 paper:

“2) We admit only those ~k such that the third highest bit of the last byte of kL is zero.”

create a XPrv by its components (a 64 bytes extended secret key, and a 32 bytes chain code)

No verification is done on the extended secret key

Create a XPrv by taking ownership of the given array

This function may returns an error if it does not have the expected format.

This function allow the 3rd highest bit to not be clear (to handle potential derived valid xprv), but self.is_3rd_highest_bit_clear() can be called to check if the 3rd highest bit is assumed to be clear or not.

Get the associated XPub

sign the given message with the XPrv.

verify a given signature

Trait Implementations

Performs the conversion.

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

Executes the destructor for this type. Read more

Performs the conversion.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

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

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

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

Converts the given value to a String. 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.