Enum elements::EcdsaSighashType
source · pub enum EcdsaSighashType {
All = 1,
None = 2,
Single = 3,
AllPlusAnyoneCanPay = 129,
NonePlusAnyoneCanPay = 130,
SinglePlusAnyoneCanPay = 131,
}
Expand description
Hashtype of a transaction, encoded in the last byte of a signature Fixed values so they can be casted as integer types for encoding
Variants§
All = 1
0x1: Sign all outputs
None = 2
0x2: Sign no outputs — anyone can choose the destination
Single = 3
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 = 129
0x81: Sign all outputs but only this input
NonePlusAnyoneCanPay = 130
0x82: Sign no outputs and only this input
SinglePlusAnyoneCanPay = 131
0x83: Sign one output and only this input (see Single
for what “one output” means)
Implementations§
source§impl EcdsaSighashType
impl EcdsaSighashType
sourcepub fn from_u32(n: u32) -> EcdsaSighashType
pub fn from_u32(n: u32) -> EcdsaSighashType
Reads a 4-byte uint32 as a sighash type
sourcepub fn from_standard(n: u32) -> Result<EcdsaSighashType, NonStandardSighashType>
pub fn from_standard(n: u32) -> Result<EcdsaSighashType, NonStandardSighashType>
Trait Implementations§
source§impl Clone for EcdsaSighashType
impl Clone for EcdsaSighashType
source§fn clone(&self) -> EcdsaSighashType
fn clone(&self) -> EcdsaSighashType
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for EcdsaSighashType
impl Debug for EcdsaSighashType
source§impl Display for EcdsaSighashType
impl Display for EcdsaSighashType
source§impl From<EcdsaSighashType> for PsbtSighashType
impl From<EcdsaSighashType> for PsbtSighashType
source§fn from(ecdsa_hash_ty: EcdsaSighashType) -> Self
fn from(ecdsa_hash_ty: EcdsaSighashType) -> Self
Converts to this type from the input type.
source§impl FromStr for EcdsaSighashType
impl FromStr for EcdsaSighashType
source§impl PartialEq for EcdsaSighashType
impl PartialEq for EcdsaSighashType
source§fn eq(&self, other: &EcdsaSighashType) -> bool
fn eq(&self, other: &EcdsaSighashType) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Copy for EcdsaSighashType
impl Eq for EcdsaSighashType
impl StructuralPartialEq for EcdsaSighashType
Auto Trait Implementations§
impl RefUnwindSafe for EcdsaSighashType
impl Send for EcdsaSighashType
impl Sync for EcdsaSighashType
impl Unpin for EcdsaSighashType
impl UnwindSafe for EcdsaSighashType
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more