pub enum EcdsaSighashType {
    All,
    None,
    Single,
    AllPlusAnyoneCanPay,
    NonePlusAnyoneCanPay,
    SinglePlusAnyoneCanPay,
}
Expand description

Hashtype of an input’s signature, encoded in the last byte of the signature.

Fixed values so they can be cast as integer types for encoding (see also SchnorrSighashType).

Variants

All

0x1: Sign all outputs.

None

0x2: Sign no outputs — anyone can choose the destination.

Single

0x3: Sign the output whose index matches this input’s index. If none exists, sign the hash 0000000000000000000000000000000000000000000000000000000000000001. (This rule is probably an unintentional C++ism, but it’s consensus so we have to follow it.)

AllPlusAnyoneCanPay

0x81: Sign all outputs but only this input.

NonePlusAnyoneCanPay

0x82: Sign no outputs and only this input.

SinglePlusAnyoneCanPay

0x83: Sign one output and only this input (see Single for what “one output” means).

Implementations

👎 Deprecated since 0.28.0:

please use from_consensus

Creates a EcdsaSighashType from a raw u32.

Creates a EcdsaSighashType from a raw u32.

Note: this replicates consensus behaviour, for current standardness rules correctness you probably want Self::from_standard.

This might cause unexpected behavior because it does not roundtrip. That is, EcdsaSighashType::from_consensus(n) as u32 != n for non-standard values of n. While verifying signatures, the user should retain the n and use it compute the signature hash message.

👎 Deprecated since 0.28.0:

please use from_standard

Creates a EcdsaSighashType from a raw u32.

Creates a EcdsaSighashType from a raw u32.

Errors

If n is a non-standard sighash value.

Converts EcdsaSighashType to a u32 sighash flag.

The returned value is guaranteed to be a valid according to standardness rules.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. Read more

Formats the value using the given formatter. Read more

Converts to this type from the input type.

Converts to this type from the input type.

The associated error which can be returned from parsing.

Parses a string s to return a value of this type. Read more

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

This method tests for !=.

Serialize this value into the given Serde serializer. 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.

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.