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
sourceimpl 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
sourceimpl Clone for SchnorrSighashType
impl Clone for SchnorrSighashType
sourcefn clone(&self) -> SchnorrSighashType
fn clone(&self) -> SchnorrSighashType
1.0.0 · sourceconst fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source
. Read moresourceimpl Debug for SchnorrSighashType
impl Debug for SchnorrSighashType
sourceimpl<'de> Deserialize<'de> for SchnorrSighashType
Available on crate feature serde
only.
impl<'de> Deserialize<'de> for SchnorrSighashType
serde
only.sourcefn 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>,
sourceimpl Display for SchnorrSighashType
impl Display for SchnorrSighashType
sourceimpl From<EcdsaSighashType> for SchnorrSighashType
impl From<EcdsaSighashType> for SchnorrSighashType
sourcefn from(s: EcdsaSighashType) -> Self
fn from(s: EcdsaSighashType) -> Self
sourceimpl From<SchnorrSighashType> for PsbtSighashType
impl From<SchnorrSighashType> for PsbtSighashType
sourcefn from(schnorr_hash_ty: SchnorrSighashType) -> Self
fn from(schnorr_hash_ty: SchnorrSighashType) -> Self
sourceimpl FromStr for SchnorrSighashType
impl FromStr for SchnorrSighashType
sourceimpl Hash for SchnorrSighashType
impl Hash for SchnorrSighashType
sourceimpl Ord for SchnorrSighashType
impl Ord for SchnorrSighashType
sourcefn cmp(&self, other: &SchnorrSighashType) -> Ordering
fn cmp(&self, other: &SchnorrSighashType) -> Ordering
1.21.0 · sourceconst fn max(self, other: Self) -> Selfwhere
Self: Sized,
const fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 · sourceconst fn min(self, other: Self) -> Selfwhere
Self: Sized,
const fn min(self, other: Self) -> Selfwhere
Self: Sized,
1.50.0 · sourceconst fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
const fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
sourceimpl PartialEq<SchnorrSighashType> for SchnorrSighashType
impl PartialEq<SchnorrSighashType> for SchnorrSighashType
sourcefn eq(&self, other: &SchnorrSighashType) -> bool
fn eq(&self, other: &SchnorrSighashType) -> bool
sourceimpl PartialOrd<SchnorrSighashType> for SchnorrSighashType
impl PartialOrd<SchnorrSighashType> for SchnorrSighashType
sourcefn partial_cmp(&self, other: &SchnorrSighashType) -> Option<Ordering>
fn partial_cmp(&self, other: &SchnorrSighashType) -> Option<Ordering>
1.0.0 · sourceconst fn le(&self, other: &Rhs) -> bool
const fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresourceimpl Serialize for SchnorrSighashType
Available on crate feature serde
only.
impl Serialize for SchnorrSighashType
serde
only.