Psbt

object Psbt

Partially signed bitcoin transactions: see https://github.com/bitcoin/bips/blob/master/bip-0174.mediawiki

Companion:
class
Source:
Psbt.scala
trait Product
trait Mirror
class Object
trait Matchable
class Any
Psbt.type

Type members

Classlikes

object Codecs
Source:
Psbt.scala
case class DataEntry(key: ByteVector, value: ByteVector)
Source:
Psbt.scala
sealed trait DataMap

A PSBT is a collection of key-value maps.

A PSBT is a collection of key-value maps.

Source:
Psbt.scala
case class ExtendedPublicKeyWithMaster(prefix: Long, masterKeyFingerprint: Long, extendedPublicKey: ExtendedPublicKey)
Value parameters:
extendedPublicKey

BIP32 extended public key.

masterKeyFingerprint

fingerprint of the master key.

prefix

extended public key version bytes.

Source:
Psbt.scala
sealed trait FinalizedInput extends Input

A fully signed input.

A fully signed input.

Source:
Psbt.scala
case class FinalizedInputWithoutUtxo(scriptWitness: Option[ScriptWitness], scriptSig: Option[Seq[ScriptElt]], ripemd160: Set[ByteVector], sha256: Set[ByteVector], hash160: Set[ByteVector], hash256: Set[ByteVector], unknown: Seq[DataEntry]) extends FinalizedInput

Input finalizers should keep the utxo to allow transaction extractors to verify the final network serialized transaction, but it's not mandatory so we may not have it available when parsing psbt inputs.

Input finalizers should keep the utxo to allow transaction extractors to verify the final network serialized transaction, but it's not mandatory so we may not have it available when parsing psbt inputs.

Source:
Psbt.scala
case class FinalizedNonWitnessInput(inputTx: Transaction, outputIndex: Int, finalScriptSig: Seq[ScriptElt], ripemd160: Set[ByteVector], sha256: Set[ByteVector], hash160: Set[ByteVector], hash256: Set[ByteVector], unknown: Seq[DataEntry]) extends FinalizedInput with NonWitnessInput
Source:
Psbt.scala
case class FinalizedWitnessInput(txOut: TxOut, nonWitnessUtxo: Option[Transaction], finalScriptWitness: ScriptWitness, scriptSig: Option[Seq[ScriptElt]], ripemd160: Set[ByteVector], sha256: Set[ByteVector], hash160: Set[ByteVector], hash256: Set[ByteVector], unknown: Seq[DataEntry]) extends FinalizedInput with WitnessInput
Source:
Psbt.scala
case class Global(version: Long, tx: Transaction, extendedPublicKeys: Seq[ExtendedPublicKeyWithMaster], unknown: Seq[DataEntry]) extends DataMap

Global data for the PSBT.

Global data for the PSBT.

Value parameters:
extendedPublicKeys

(optional) extended public keys used when signing inputs and producing outputs.

tx

partially signed transaction.

unknown

(optional) unknown global entries.

version

psbt version.

Source:
Psbt.scala
sealed trait Input extends DataMap

A PSBT input. A valid PSBT must contain one such input per input of the Global.tx.

A PSBT input. A valid PSBT must contain one such input per input of the Global.tx.

Source:
Psbt.scala
case class KeyPathWithMaster(masterKeyFingerprint: Long, keyPath: KeyPath)
Value parameters:
keyPath

bip 32 derivation path.

masterKeyFingerprint

fingerprint of the master key.

Source:
Psbt.scala
sealed trait NonWitnessInput extends Input

An input spending a non-segwit output.

An input spending a non-segwit output.

Source:
Psbt.scala
case class NonWitnessOutput(redeemScript: Option[Seq[ScriptElt]], derivationPaths: Map[PublicKey, KeyPathWithMaster], unknown: Seq[DataEntry]) extends Output

A non-segwit output.

A non-segwit output.

Source:
Psbt.scala
sealed trait Output extends DataMap

A PSBT output. A valid PSBT must contain one such output per output of the Global.tx.

A PSBT output. A valid PSBT must contain one such output per output of the Global.tx.

Source:
Psbt.scala
sealed trait PartiallySignedInput extends Input

A partially signed input. More signatures may need to be added before it can be finalized.

A partially signed input. More signatures may need to be added before it can be finalized.

Source:
Psbt.scala
case class PartiallySignedInputWithoutUtxo(sighashType: Option[Int], derivationPaths: Map[PublicKey, KeyPathWithMaster], ripemd160: Set[ByteVector], sha256: Set[ByteVector], hash160: Set[ByteVector], hash256: Set[ByteVector], unknown: Seq[DataEntry]) extends PartiallySignedInput
Source:
Psbt.scala
case class PartiallySignedNonWitnessInput(inputTx: Transaction, outputIndex: Int, sighashType: Option[Int], partialSigs: Map[PublicKey, ByteVector], derivationPaths: Map[PublicKey, KeyPathWithMaster], redeemScript: Option[Seq[ScriptElt]], ripemd160: Set[ByteVector], sha256: Set[ByteVector], hash160: Set[ByteVector], hash256: Set[ByteVector], unknown: Seq[DataEntry]) extends PartiallySignedInput with NonWitnessInput
Source:
Psbt.scala
case class PartiallySignedWitnessInput(txOut: TxOut, nonWitnessUtxo: Option[Transaction], sighashType: Option[Int], partialSigs: Map[PublicKey, ByteVector], derivationPaths: Map[PublicKey, KeyPathWithMaster], redeemScript: Option[Seq[ScriptElt]], witnessScript: Option[Seq[ScriptElt]], ripemd160: Set[ByteVector], sha256: Set[ByteVector], hash160: Set[ByteVector], hash256: Set[ByteVector], unknown: Seq[DataEntry]) extends PartiallySignedInput with WitnessInput
Source:
Psbt.scala
case class SignPsbtResult(psbt: Psbt, sig: ByteVector)
Source:
Psbt.scala
case class UnspecifiedOutput(derivationPaths: Map[PublicKey, KeyPathWithMaster], unknown: Seq[DataEntry]) extends Output

An output for which usage of segwit is currently unknown.

An output for which usage of segwit is currently unknown.

Source:
Psbt.scala
sealed trait WitnessInput extends Input

An input spending a segwit output.

An input spending a segwit output.

Source:
Psbt.scala
case class WitnessOutput(witnessScript: Option[Seq[ScriptElt]], redeemScript: Option[Seq[ScriptElt]], derivationPaths: Map[PublicKey, KeyPathWithMaster], unknown: Seq[DataEntry]) extends Output

A segwit output.

A segwit output.

Source:
Psbt.scala

Inherited types

type MirroredElemLabels <: Tuple

The names of the product elements

The names of the product elements

Inherited from:
Mirror
Source:
Mirror.scala

The name of the type

The name of the type

Inherited from:
Mirror
Source:
Mirror.scala

Value members

Concrete methods

Implements the PSBT creator role; initializes a PSBT for the given unsigned transaction.

Implements the PSBT creator role; initializes a PSBT for the given unsigned transaction.

Value parameters:
tx

unsigned transaction skeleton.

Returns:

the psbt with empty inputs and outputs.

Source:
Psbt.scala
def combine(psbts: Psbt*): Try[Psbt]

Implements the PSBT combiner role: combines multiple psbts for the same unsigned transaction.

Implements the PSBT combiner role: combines multiple psbts for the same unsigned transaction.

Value parameters:
psbts

partially signed bitcoin transactions to combine.

Returns:

a psbt that contains data from all the input psbts.

Source:
Psbt.scala
def fromBase64(input: String): Try[Psbt]
Source:
Psbt.scala
def join(psbts: Psbt*): Try[Psbt]

Joins multiple distinct PSBTs with different inputs and outputs into one PSBT with inputs and outputs from all of the PSBTs. No input in any of the PSBTs can be in more than one of the PSBTs.

Joins multiple distinct PSBTs with different inputs and outputs into one PSBT with inputs and outputs from all of the PSBTs. No input in any of the PSBTs can be in more than one of the PSBTs.

Value parameters:
psbts

partially signed bitcoin transactions to join.

Returns:

a psbt that contains data from all the input psbts.

Source:
Psbt.scala
def read(input: InputStream): Try[Psbt]
Source:
Psbt.scala
def read(input: Array[Byte]): Try[Psbt]
Source:
Psbt.scala
def read(input: ByteVector): Try[Psbt]
Source:
Psbt.scala
def toBase64(psbt: Psbt): String
Source:
Psbt.scala
def write(psbt: Psbt, output: OutputStream): Unit
Source:
Psbt.scala
def write(psbt: Psbt): Array[Byte]
Source:
Psbt.scala

Concrete fields

Only version 0 is supported for now.

Only version 0 is supported for now.

Source:
Psbt.scala