TransactionInterface

Bitcoin transaction. An authenticated movement of coins.

Inheritors

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
abstract fun computeTxid(): String

Computes the Txid. Hashes the transaction excluding the segwit data (i.e. the marker, flag bytes, and the witness fields themselves).

Link copied to clipboard
abstract fun input(): List<TxIn>

List of transaction inputs.

Link copied to clipboard
abstract fun isCoinbase(): Boolean

Checks if this is a coinbase transaction. The first transaction in the block distributes the mining reward and is called the coinbase transaction. It is impossible to check if the transaction is first in the block, so this function checks the structure of the transaction instead - the previous output must be all-zeros (creates satoshis “out of thin air”).

Link copied to clipboard
abstract fun isExplicitlyRbf(): Boolean

Returns true if the transaction itself opted in to be BIP-125-replaceable (RBF).

Link copied to clipboard
abstract fun isLockTimeEnabled(): Boolean

Returns true if this transactions nLockTime is enabled (BIP-65).

Link copied to clipboard
abstract fun lockTime(): UInt

Block height or timestamp. Transaction cannot be included in a block until this height/time.

Link copied to clipboard
abstract fun output(): List<TxOut>

List of transaction outputs.

Link copied to clipboard
abstract fun serialize(): ByteArray

Serialize transaction into consensus-valid format. See https://docs.rs/bitcoin/latest/bitcoin/struct.Transaction.html#serialization-notes for more notes on transaction serialization.

Link copied to clipboard
abstract fun totalSize(): ULong

Returns the total transaction size

Link copied to clipboard
abstract fun version(): Int

The protocol version, is currently expected to be 1 or 2 (BIP 68).

Link copied to clipboard
abstract fun vsize(): ULong

Returns the "virtual size" (vsize) of this transaction.

Link copied to clipboard
abstract fun weight(): ULong

Returns the weight of this transaction, as defined by BIP-141.