Skip to content

TransactionInput (Class)

A transaction input referencing a previous output.

Inputs reference UTXOs (unspent transaction outputs) that are being spent.

previous_outpoint property writable

previous_outpoint: TransactionOutpoint

The outpoint referencing the UTXO being spent.

RETURNS DESCRIPTION
TransactionOutpoint

The previous output reference.

TYPE: TransactionOutpoint

sequence property writable

sequence: int

The sequence number used for relative time locks.

RETURNS DESCRIPTION
int

The sequence number.

TYPE: int

sig_op_count property writable

sig_op_count: int

The number of signature operations in this input.

RETURNS DESCRIPTION
int

The signature operation count.

TYPE: int

signature_script_as_hex property

signature_script_as_hex: Optional[str]

The unlocking script (signature) that proves ownership of the UTXO.

RETURNS DESCRIPTION
Optional[str]

str | None: The signature script as a hex string, or None if not set.

utxo property

utxo: Optional[UtxoEntryReference]

The UTXO entry reference for transaction signing.

RETURNS DESCRIPTION
Optional[UtxoEntryReference]

UtxoEntryReference | None: The UTXO reference, or None if not set.

__eq__

__eq__(other: TransactionInput) -> bool

__new__

__new__(previous_outpoint: TransactionOutpoint, signature_script: Binary, sequence: int, sig_op_count: int, utxo: Optional[UtxoEntryReference] = None) -> TransactionInput

Create a new transaction input.

PARAMETER DESCRIPTION
previous_outpoint

Reference to the UTXO being spent.

TYPE: TransactionOutpoint

signature_script

The unlocking script (signature).

TYPE: Binary

sequence

Sequence number for relative time locks.

TYPE: int

sig_op_count

Number of signature operations.

TYPE: int

utxo

Optional UTXO entry reference for signing.

TYPE: Optional[UtxoEntryReference] DEFAULT: None

RETURNS DESCRIPTION
TransactionInput

A new TransactionInput instance.

TYPE: TransactionInput

signature_script

signature_script(value: Binary) -> None

Set the unlocking script (signature).

PARAMETER DESCRIPTION
value

The signature script as bytes or hex string.

TYPE: Binary