SignedTransaction

SignedTransaction wraps a serialized CoreTransaction, though it will almost exclusively be a WireTransaction. It contains one or more signatures, each one for a public key (including composite keys) that is mentioned inside a transaction command. SignedTransaction is the top level transaction type and the type most frequently passed around the network and stored. The identity of a transaction is the hash of Merkle root of a WireTransaction, therefore if you are storing data keyed by WT hash be aware that multiple different STs may map to the same key (and they could be different in important ways, like validity!). The signatures on a SignedTransaction might be invalid or missing: the type does not imply validity. A transaction ID should be the hash of the WireTransaction Merkle tree root. Thus adding or removing a signature does not change it.

Parameters

sigs

a list of signatures from individual (non-composite) public keys. This is passed as a list of signatures when verifying composite key signatures, but may be used as individual signatures where a single key is expected to sign.

Constructors

Link copied to clipboard

Types

Link copied to clipboard

Properties

Link copied to clipboard

Lazily calculated access to the deserialised/hashed transaction data.

Link copied to clipboard
Link copied to clipboard
open override val id: SecureHash

The id of the contained WireTransaction.

Link copied to clipboard

Helper to access the inputs of the contained transaction.

Link copied to clipboard

Helper to access the network parameters hash for the contained transaction.

Link copied to clipboard

Helper to access the notary of the contained transaction.

Link copied to clipboard

Returns the contained NotaryChangeWireTransaction, or throws if this is a normal transaction.

Link copied to clipboard

Helper to access the unspendable inputs of the contained transaction.

Link copied to clipboard
open override val requiredSigningKeys: Set<PublicKey>

Specifies all the public keys that require signatures for the transaction to be valid.

Link copied to clipboard
open override val sigs: List<TransactionSignature>
Link copied to clipboard

Returns the contained WireTransaction, or throws if this is a notary change or contract upgrade transaction.

Link copied to clipboard

Functions

Link copied to clipboard

Helper function to directly build a FilteredTransaction using provided filtering functions, without first accessing the WireTransaction.

Link copied to clipboard

Mathematically validates the signatures that are present on this transaction. This does not imply that the signatures are by the right keys, or that there are sufficient signatures, just that they aren't corrupt. If you use this function directly you'll need to do the other checks yourself. Probably you want verifyRequiredSignatures instead.

Link copied to clipboard
open override fun getKeyDescriptions(keys: Set<PublicKey>): <Error class: unknown class><String>

Get a human readable description of where signatures are required from, and are missing, to assist in debugging the underlying cause.

Link copied to clipboard

Return the PublicKeys for which we still need signatures.

Link copied to clipboard

Alias for withAdditionalSignatures to let you use Kotlin operator overloading.

Alias for withAdditionalSignature to let you use Kotlin operator overloading.

Link copied to clipboard

Resolves the underlying base transaction and then returns it, handling any special case transactions such as NotaryChangeWireTransaction.

Link copied to clipboard
Link copied to clipboard

Resolves the underlying transaction with signatures and then returns it, handling any special case transactions such as NotaryChangeWireTransaction.

Link copied to clipboard
fun toLedgerTransaction(services: ServiceHub, checkSufficientSignatures: Boolean = true): LedgerTransaction

Checks the transaction's signatures are valid, optionally calls verifyRequiredSignatures to check all required signatures are present, and then calls WireTransaction.toLedgerTransaction with the passed in ServiceHub to resolve the dependencies, returning an unverified LedgerTransaction.

Link copied to clipboard
Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
fun verify(services: ServiceHub, checkSufficientSignatures: Boolean = true)

Checks the transaction's signatures are valid, optionally calls verifyRequiredSignatures to check all required signatures are present. Resolves inputs and attachments from the local storage and performs full transaction verification, including running the contracts.

Link copied to clipboard
open fun verifyRequiredSignatures(): <Error class: unknown class>

Verifies the signatures on this transaction and throws if any are missing. In this context, "verifying" means checking they are valid signatures and that their public keys are in the requiredSigningKeys set.

Link copied to clipboard
open fun verifySignaturesExcept(vararg allowedToBeMissing: PublicKey)
open fun verifySignaturesExcept(allowedToBeMissing: Collection<PublicKey>)

Verifies the signatures on this transaction and throws if any are missing which aren't passed as parameters. In this context, "verifying" means checking they are valid signatures and that their public keys are in the requiredSigningKeys set.

Link copied to clipboard

Returns the same transaction but with an additional (unchecked) signature.

Link copied to clipboard

Returns the same transaction but with an additional (unchecked) signatures.