Enum bitcoin::util::sighash::SchnorrSighashType
source · pub enum SchnorrSighashType {
Default,
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.
Variants§
Default
0x0: Used when not explicitly specified, defaults to SchnorrSighashType::All
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§
source§impl SchnorrSighashType
impl SchnorrSighashType
sourcepub fn from_u8(hash_ty: u8) -> Result<Self, Error>
👎Deprecated since 0.29.0: use from_consensus_u8 instead
pub fn from_u8(hash_ty: u8) -> Result<Self, Error>
Creates a SchnorrSighashType
from raw u8
.
sourcepub fn from_consensus_u8(hash_ty: u8) -> Result<Self, Error>
pub fn from_consensus_u8(hash_ty: u8) -> Result<Self, Error>
Constructs a SchnorrSighashType
from a raw u8
.
Trait Implementations§
source§impl Clone for SchnorrSighashType
impl Clone for SchnorrSighashType
source§fn clone(&self) -> SchnorrSighashType
fn clone(&self) -> SchnorrSighashType
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for SchnorrSighashType
impl Debug for SchnorrSighashType
source§impl<'de> Deserialize<'de> for SchnorrSighashType
impl<'de> Deserialize<'de> for SchnorrSighashType
source§fn deserialize<D>(deserializer: D) -> Result<SchnorrSighashType, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<SchnorrSighashType, D::Error>where D: Deserializer<'de>,
source§impl Display for SchnorrSighashType
impl Display for SchnorrSighashType
source§impl From<EcdsaSighashType> for SchnorrSighashType
impl From<EcdsaSighashType> for SchnorrSighashType
source§fn from(s: EcdsaSighashType) -> Self
fn from(s: EcdsaSighashType) -> Self
source§impl From<SchnorrSighashType> for PsbtSighashType
impl From<SchnorrSighashType> for PsbtSighashType
source§fn from(schnorr_hash_ty: SchnorrSighashType) -> Self
fn from(schnorr_hash_ty: SchnorrSighashType) -> Self
source§impl FromStr for SchnorrSighashType
impl FromStr for SchnorrSighashType
source§impl Hash for SchnorrSighashType
impl Hash for SchnorrSighashType
source§impl Ord for SchnorrSighashType
impl Ord for SchnorrSighashType
source§fn cmp(&self, other: &SchnorrSighashType) -> Ordering
fn cmp(&self, other: &SchnorrSighashType) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere Self: Sized,
source§impl PartialEq<SchnorrSighashType> for SchnorrSighashType
impl PartialEq<SchnorrSighashType> for SchnorrSighashType
source§fn eq(&self, other: &SchnorrSighashType) -> bool
fn eq(&self, other: &SchnorrSighashType) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<SchnorrSighashType> for SchnorrSighashType
impl PartialOrd<SchnorrSighashType> for SchnorrSighashType
source§fn partial_cmp(&self, other: &SchnorrSighashType) -> Option<Ordering>
fn partial_cmp(&self, other: &SchnorrSighashType) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read more