pub enum SighashType {
Default,
All,
None,
Single,
AllPlusAnyoneCanPay,
NonePlusAnyoneCanPay,
SinglePlusAnyoneCanPay,
}
Expand description
Signature hash types for Bitcoin transactions.
These types specify which parts of a transaction are included in the signature
hash calculation when signing transaction inputs. Used with wallet signing
operations like wallet_process_psbt
.
§Note
These correspond to the SIGHASH flags defined in Bitcoin’s script system and BIP 143 (witness transaction digest).
Variants§
Default
Use the default signature hash type (equivalent to SIGHASH_ALL).
All
Sign all inputs and all outputs of the transaction.
This is the most common and secure signature type, ensuring the entire transaction structure cannot be modified after signing.
None
Sign all inputs but no outputs.
Allows outputs to be modified after signing, useful for donation scenarios where the exact destination amounts can be adjusted.
Single
Sign all inputs and the output with the same index as this input.
Used in scenarios where multiple parties contribute inputs and want to ensure their corresponding output is protected.
AllPlusAnyoneCanPay
Combination of SIGHASH_ALL with ANYONECANPAY flag.
Signs all outputs but only this specific input, allowing other inputs to be added or removed. Useful for crowdfunding transactions.
NonePlusAnyoneCanPay
Combination of SIGHASH_NONE with ANYONECANPAY flag.
Signs only this specific input with no outputs committed, providing maximum flexibility for transaction modification.
SinglePlusAnyoneCanPay
Combination of SIGHASH_SINGLE with ANYONECANPAY flag.
Signs only this input and its corresponding output, allowing other inputs and outputs to be modified independently.
Trait Implementations§
Source§impl Clone for SighashType
impl Clone for SighashType
Source§fn clone(&self) -> SighashType
fn clone(&self) -> SighashType
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for SighashType
impl Debug for SighashType
Source§impl<'de> Deserialize<'de> for SighashType
impl<'de> Deserialize<'de> for SighashType
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for SighashType
impl PartialEq for SighashType
Source§impl Serialize for SighashType
impl Serialize for SighashType
impl Eq for SighashType
impl StructuralPartialEq for SighashType
Auto Trait Implementations§
impl Freeze for SighashType
impl RefUnwindSafe for SighashType
impl Send for SighashType
impl Sync for SighashType
impl Unpin for SighashType
impl UnwindSafe for SighashType
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.