SigHashType class
Encapsulates the signature hash type to be used for an input signature. Signatures may sign different output and inputs to allow for transaction modifications. To sign an entire transaction the all constructor should be used.
Constructors
- SigHashType.all({bool anyOneCanPay = false})
-
Sign all of the outputs. If
anyOneCanPay
is true, then only the input containing the signature will be signed. IfanyOneCanPay
is false and a Taproot input is being signed, this will be treated as "SIGHASH_DEFAULT".const - SigHashType.fromValue(int value)
- Constructs from the byte representation of the sighash type.
- SigHashType.none({bool anyOneCanPay = false})
-
Sign no outputs. If
anyOneCanPay
is true, then only the input containing the signature will be signed.const - SigHashType.schnorrDefault()
-
Functions as SigHashType.all but produces distinct signatures and is
only acceptable for Taproot Schnorr signatures.
const
- SigHashType.single({bool anyOneCanPay = false})
-
Sign the output at the same index as the input. If
anyOneCanPay
is true, then only the input containing the signature will be signed.const
Properties
- all → bool
-
All outputs shall be signed
no setter
- anyOneCanPay → bool
-
Only the input receiving the signature shall be signed
no setter
- hashCode → int
-
The hash code for this object.
no setteroverride
- none → bool
-
No outputs shall be signed
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- schnorrDefault → bool
-
If this is the default hash type for a Schnorr signature.
no setter
- single → bool
-
Only the output with the same index as the input shall be signed
no setter
- value → int
-
The single byte representation of the sighash type. Use all, none,
single and anyOneCanPay to extract details of the type.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override
Static Methods
-
checkValue(
int value) → void - Checks if the sighash value is valid and returns an ArgumentError if not.
-
validValue(
int value) → bool - Returns true if the sighash type value is valid.
Constants
- allValue → const int
- Value to sign all outputs
- anyOneCanPayFlag → const int
- Flag that can be combined with other hash type values to only sign the input containing the signature
- noneValue → const int
- Value to sign no outputs
- schnorrDefaultValue → const int
- Special value representing the default Schnorr behaviour to sign everything. This is encoded as an absent byte.
- singleValue → const int
- Value to sign the output at the same index as the input