TaprootKeyInput class

A TaprootInput which spends using the key-path

Inheritance

Constructors

TaprootKeyInput.new({required OutPoint prevOut, SchnorrInputSignature? insig, int sequence = Input.sequenceFinal})

Properties

complete bool
Always true as a simple RawInput is assumed to be fully signed as there is no way to determine if it is or not.
no setteroverride
hashCode int
The hash code for this object.
no setterinherited
insig SchnorrInputSignature?
final
prevOut OutPoint
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
script Script?
The script from the scriptSig bytes or null if the bytes do not represent a valid script.
no setterinherited
scriptSig Uint8List
finalinherited
sequence int
finalinherited
signedSize int?
The maximum total size when fully signed via the default hash type including any witness data of the input. If this is unknown, this is null. The actual signed size may be lower according to the data being encoded.
final
size int
Obtains the cached size of the object
no setterinherited
witness List<Uint8List>
finalinherited

Methods

addSignature(SchnorrInputSignature insig) TaprootKeyInput
Returns a new TaprootKeyInput with the SchnorrInputSignature added. Any existing signature is replaced.
createInputSignature({required Transaction tx, required int inputN, required ECPrivateKey key, required List<Output> prevOuts, SigHashType hashType = const SigHashType.all(), Uint8List? leafHash, int codeSeperatorPos = 0xFFFFFFFF}) SchnorrInputSignature
Creates a signature for the input. Used by subclasses to implement signing.
inherited
filterSignatures(bool predicate(InputSignature insig)) TaprootKeyInput
Removes signatures that the predicate returns false for. This is used to remove invalidated signatures.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
sign({required Transaction tx, required int inputN, required ECPrivateKey key, required List<Output> prevOuts, SigHashType hashType = const SigHashType.all()}) TaprootKeyInput
Return a signed Taproot input using tweaked private key for the key-path spend. The key should be tweaked by Taproot.tweakScalar.
override
toBytes() Uint8List
Obtains a cached Uint8List with data serialized for this object
inherited
toHex() String
inherited
toString() String
A string representation of this object.
inherited
write(Writer writer) → void
Override to write data into writer
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

match(RawInput raw, List<Uint8List> witness) TaprootKeyInput?
Checks if the raw input and witness data match the expected format for a TaprootKeyInput, with a signature. If it does it returns a TaprootKeyInput for the input or else it returns null.
override