package script
- Alphabetic
- Public
- Protected
Package Members
- package descriptor
Type Members
- sealed trait CLTVScriptPubKey extends ScriptPubKey with LockTimeScriptPubKey
Represents a scriptPubKey that contains
OP_CHECKLOCKTIMEVERIFY.
Adds an absolute/defined locktime condition to any scriptPubKey.Represents a scriptPubKey that contains
OP_CHECKLOCKTIMEVERIFY.
Adds an absolute/defined locktime condition to any scriptPubKey. BIP65 Format:<locktime> OP_CLTV OP_DROP <scriptPubKey>
- sealed trait CLTVScriptSignature extends ScriptSignature with LockTimeScriptSignature
- sealed trait CSVScriptPubKey extends ScriptPubKey with LockTimeScriptPubKey
Represents a scriptPubKey that contains OP_CHECKSEQUENCEVERIFY Adds a relative lockTime condition to any
scriptPubKey
.Represents a scriptPubKey that contains OP_CHECKSEQUENCEVERIFY Adds a relative lockTime condition to any
scriptPubKey
. BIP112 Format:<locktime> OP_CSV OP_DROP <scriptPubKey>
- sealed trait CSVScriptSignature extends ScriptSignature with LockTimeScriptSignature
- sealed trait ConditionalScriptPubKey extends ScriptPubKey with RawScriptPubKey
Currently only supports a single OP_IF ...
Currently only supports a single OP_IF ... OP_ELSE ... OP_ENDIF ScriptPubKey
- sealed trait ConditionalScriptSignature extends ScriptSignature
ScriptSignature for both OP_IF and OP_NOTIF ScriptPubKeys
- sealed abstract class ControlBlock extends NetworkElement
Control block as defined by BIP341
Control block as defined by BIP341
The last stack element is called the control block c, and must have length 33 + 32m, for a value of m that is an integer between 0 and 128[6], inclusive. Fail if it does not have such a length.
- See also
https://github.com/bitcoin/bips/blob/master/bip-0341.mediawiki#script-validation-rules
- sealed trait IfConditionalScriptPubKey extends ScriptPubKey with ConditionalScriptPubKey
- sealed trait LockTimeScriptPubKey extends ScriptPubKey with RawScriptPubKey
- sealed trait LockTimeScriptSignature extends ScriptSignature
Parent type for all lock time script signatures, these spend LockTimeScriptPubKey
- sealed trait MultiSignatureScriptPubKey extends ScriptPubKey with RawScriptPubKey
Represents a multisignature script public key https://bitcoin.org/en/developer-guide#multisig Format: <m> <A pubkey> [B pubkey] [C pubkey...] <n> OP_CHECKMULTISIG
- sealed trait MultiSignatureScriptSignature extends ScriptSignature
Represents a multisignature script signature https://bitcoin.org/en/developer-guide#multisig Multisig script sigs have the following format OP_0 <A sig> [B sig] [C sig...]
- sealed trait MultiSignatureWithTimeoutScriptPubKey extends ScriptPubKey with IfConditionalScriptPubKey
- sealed trait NonStandardScriptPubKey extends ScriptPubKey with RawScriptPubKey
- sealed trait NonStandardScriptSignature extends ScriptSignature
- sealed trait NonWitnessScriptPubKey extends ScriptPubKey
Trait for all Non-SegWit ScriptPubKeys
- sealed trait NotIfConditionalScriptPubKey extends ScriptPubKey with ConditionalScriptPubKey
- sealed trait P2PKHScriptPubKey extends ScriptPubKey with RawScriptPubKey
Represents a pay-to-pubkey hash script pubkey
Represents a pay-to-pubkey hash script pubkey
Format:
OP_DUP OP_HASH160 <PubKeyHash> OP_EQUALVERIFY OP_CHECKSIG
- sealed trait P2PKHScriptSignature extends ScriptSignature
P2PKH script signatures have only one public key https://bitcoin.org/en/developer-guide#pay-to-public-key-hash-p2pkh P2PKH scriptSigs follow this format <sig> <pubkey>
- sealed trait P2PKScriptPubKey extends ScriptPubKey with RawScriptPubKey
Represents a pay to public key script public key Format:
<pubkey> OP_CHECKSIG
- sealed trait P2PKScriptSignature extends ScriptSignature
Represents a pay to public key script signature https://bitcoin.org/en/developer-guide#pubkey Signature script: <sig>
- sealed trait P2PKWithTimeoutScriptPubKey extends ScriptPubKey with RawScriptPubKey
The type for ScriptPubKeys of the form: OP_IF <Public Key> OP_ELSE <Timeout> OP_CHECKSEQUENCEVERIFY OP_DROP <Timeout Public Key> OP_ENDIF OP_CHECKSIG
- sealed trait P2SHScriptPubKey extends ScriptPubKey with NonWitnessScriptPubKey
Represents a pay-to-scripthash public key Format:
OP_HASH160 <Hash160(redeemScript)> OP_EQUAL
- sealed trait P2SHScriptSignature extends ScriptSignature
Represents a pay-to-script-hash script signature https://bitcoin.org/en/developer-guide#pay-to-script-hash-p2sh P2SH scriptSigs have the following format <sig> [sig] [sig...] <redeemScript>
- sealed abstract class P2WPKHWitnessSPKV0 extends WitnessScriptPubKeyV0
Represents the pay-to-witness-pubkeyhash script pubkey type as defined in BIP141
- sealed abstract class P2WPKHWitnessV0 extends ScriptWitnessV0
Represents a org.bitcoins.core.protocol.script.ScriptWitness that is needed to spend a P2WPKHWitnessV0 scriptPubKey https://github.com/bitcoin/bips/blob/master/bip-0141.mediawiki#p2wpkh-nested-in-bip16-p2sh Format: <pubKey> <signature>
- sealed abstract class P2WSHWitnessSPKV0 extends WitnessScriptPubKeyV0
Reprents the pay-to-witness-scripthash script pubkey type as defined in BIP141
- sealed abstract class P2WSHWitnessV0 extends ScriptWitnessV0
Represents a ScriptWitness that is needed to spend a P2WSHWitnessV0 scriptPubKey https://github.com/bitcoin/bips/blob/master/bip-0141.mediawiki#p2wsh Format: <redeem script> <scriptSig data1> <scriptSig data2> ...
Represents a ScriptWitness that is needed to spend a P2WSHWitnessV0 scriptPubKey https://github.com/bitcoin/bips/blob/master/bip-0141.mediawiki#p2wsh Format: <redeem script> <scriptSig data1> <scriptSig data2> ... <scriptSig dataN>
- sealed trait RawScriptPubKey extends ScriptPubKey with NonWitnessScriptPubKey
Trait for all raw, non-nested ScriptPubKeys (no P2SH)
Trait for all raw, non-nested ScriptPubKeys (no P2SH)
Note that all WitnessScriptPubKeys including P2WPKH are not considered to be non-nested and hence not RawScriptPubKeys.
- abstract class Script extends NetworkElement
This is meant to be a super type for scripts in the bitcoin protocol.
This is meant to be a super type for scripts in the bitcoin protocol. This gives us access to the asm representation, and how to serialize the script
- trait ScriptFactory[T <: Script] extends Factory[T]
Created by chris on 12/9/16.
- sealed abstract class ScriptPubKey extends Script
Created by chris on 12/26/15.
- sealed trait ScriptPubKeyUpdateIndicator extends AnyRef
Created by chris on 1/19/16.
- sealed abstract class ScriptSignature extends Script
Created by chris on 12/26/15.
Created by chris on 12/26/15.
We only give standard types to ScriptSignatures that are Policy compliant. This is because if we wanted to be closer to Consensus compliant then it would be near impossible to type things.
For example almost anything could be a ConditionalScriptSignature since in consensus logic almost any ScriptToken is interpreted as True, while under Policy only OP_TRUE is True.
- sealed abstract class ScriptWitness extends NetworkElement
Created by chris on 11/10/16.
Created by chris on 11/10/16. The witness used to evaluate a RawScriptPubKey inside of Bitcoin https://github.com/bitcoin/bitcoin/blob/57b34599b2deb179ff1bd97ffeab91ec9f904d85/src/script/script.h#L648-L660
- sealed abstract class ScriptWitnessV0 extends ScriptWitness
- sealed trait SigVersionTaproot extends SignatureVersion
- sealed trait SignatureVersion extends AnyRef
Represents the transaction digest algorithm for signature verification in Bitcoin Core With the implementation of segwit, we have added different algorithm, the first alternative being BIP143 https://github.com/bitcoin/bips/blob/master/bip-0143.mediawiki https://github.com/bitcoin/bitcoin/blob/53133c1c041d113c2a480a18e6ff38681d135dca/src/script/interpreter.h#L120-L124
- case class TapBranch(tree1: TapscriptTree, tree2: TapscriptTree) extends TapscriptTree with Product with Serializable
- case class TapLeaf(leafVersion: Byte, spk: ScriptPubKey) extends TapscriptTree with Product with Serializable
- case class TaprootKeyPath(signature: SchnorrDigitalSignature, hashTypeOpt: Option[HashType], annexOpt: Option[ByteVector]) extends ScriptWitness with TaprootWitness with Product with Serializable
Spending a taproot output via the key path spend
- case class TaprootScriptPath(stack: Vector[ByteVector]) extends ScriptWitness with TaprootWitness with Product with Serializable
Spending a taproot output via the script path
- case class TaprootScriptPubKey(asm: Vector[ScriptToken]) extends ScriptPubKey with WitnessScriptPubKey with Product with Serializable
- case class TaprootUnknownPath(stack: Vector[ByteVector]) extends ScriptWitness with TaprootWitness with Product with Serializable
- sealed trait TaprootWitness extends ScriptWitness
- case class TapscriptControlBlock(bytes: ByteVector) extends ControlBlock with Product with Serializable
- sealed abstract class TapscriptTree extends NetworkElement
- case class UnassignedWitness(version: ScriptNumberOperation) extends WitnessVersion with Product with Serializable
The witness version that represents all witnesses that have not been allocated yet
- sealed trait UnassignedWitnessScriptPubKey extends ScriptPubKey with WitnessScriptPubKey
Type to represent all WitnessScriptPubKeys we have not used yet in the bitcoin protocol
- case class UnknownControlBlock(bytes: ByteVector) extends ControlBlock with Product with Serializable
A control block that does not have a leaf version defined as per BIP342 This is needed for future soft fork compatability where we introduce new leaf versions to correspond to new spending rules
- case class UpdateScriptPubKeyAsm(asm: Seq[ScriptToken]) extends ScriptPubKeyUpdateIndicator with Product with Serializable
- case class UpdateScriptPubKeyBytes(bytes: ByteVector) extends ScriptPubKeyUpdateIndicator with Product with Serializable
- sealed trait WitnessCommitment extends ScriptPubKey with RawScriptPubKey
This trait represents the witness commitment found in the coinbase transaction This is needed to commit to the wtxids of all of the witness transactions, since the merkle tree does not commit to the witnesses for all WitnessTransaction See BIP141 for more info https://github.com/bitcoin/bips/blob/master/bip-0141.mediawiki#commitment-structure
- sealed trait WitnessScriptPubKey extends ScriptPubKey
This type represents a ScriptPubKey to evaluate a ScriptWitness
- sealed abstract class WitnessScriptPubKeyV0 extends ScriptPubKey with WitnessScriptPubKey
Represents a BIP141 Witness program
- sealed trait WitnessVersion extends AnyRef
Created by chris on 11/10/16.
Created by chris on 11/10/16. The version of the WitnessScriptPubKey, this indicates how a ScriptWitness is rebuilt. BIP141
Value Members
- object CLTVScriptPubKey extends Factory[CLTVScriptPubKey] with ScriptFactory[CLTVScriptPubKey]
- object CLTVScriptSignature extends Factory[CLTVScriptSignature] with ScriptFactory[CLTVScriptSignature]
Note that extend org.bitcoins.core.protocol.script.ScriptFactory here but technically ANYTHING can be a CLTVScriptSignature since the CLTVScriptPubKey does not manipulate the stack
- object CSVScriptPubKey extends Factory[CSVScriptPubKey] with ScriptFactory[CSVScriptPubKey]
- object CSVScriptSignature extends Factory[CSVScriptSignature] with ScriptFactory[CSVScriptSignature]
- object ConditionalScriptPubKey
- object ConditionalScriptSignature extends Factory[ConditionalScriptSignature] with ScriptFactory[ConditionalScriptSignature]
- object ControlBlock extends Factory[ControlBlock]
- case object EmptyScriptPubKey extends ScriptPubKey with RawScriptPubKey with Product with Serializable
Represents the empty ScriptPubKey
- case object EmptyScriptSignature extends ScriptSignature with Product with Serializable
Represents the empty script signature
- case object EmptyScriptWitness extends ScriptWitness with Product with Serializable
- object LockTimeScriptPubKey extends Factory[LockTimeScriptPubKey] with ScriptFactory[LockTimeScriptPubKey]
- object MultiSignatureScriptPubKey extends Factory[MultiSignatureScriptPubKey] with ScriptFactory[MultiSignatureScriptPubKey]
- object MultiSignatureScriptSignature extends Factory[MultiSignatureScriptSignature] with ScriptFactory[MultiSignatureScriptSignature]
- object MultiSignatureWithTimeoutScriptPubKey extends Factory[MultiSignatureWithTimeoutScriptPubKey] with ScriptFactory[MultiSignatureWithTimeoutScriptPubKey]
- object NonStandardIfConditionalScriptPubKey extends Factory[IfConditionalScriptPubKey] with ScriptFactory[IfConditionalScriptPubKey]
- object NonStandardNotIfConditionalScriptPubKey extends Factory[NotIfConditionalScriptPubKey] with ScriptFactory[NotIfConditionalScriptPubKey]
- object NonStandardScriptPubKey extends Factory[NonStandardScriptPubKey] with ScriptFactory[NonStandardScriptPubKey]
- object NonStandardScriptSignature extends Factory[NonStandardScriptSignature] with ScriptFactory[NonStandardScriptSignature]
- object NonWitnessScriptPubKey extends Factory[NonWitnessScriptPubKey] with ScriptFactory[NonWitnessScriptPubKey]
- object P2PKHScriptPubKey extends Factory[P2PKHScriptPubKey] with ScriptFactory[P2PKHScriptPubKey]
- object P2PKHScriptSignature extends Factory[P2PKHScriptSignature] with ScriptFactory[P2PKHScriptSignature]
- object P2PKScriptPubKey extends Factory[P2PKScriptPubKey] with ScriptFactory[P2PKScriptPubKey]
- object P2PKScriptSignature extends Factory[P2PKScriptSignature] with ScriptFactory[P2PKScriptSignature]
- object P2PKWithTimeoutScriptPubKey extends Factory[P2PKWithTimeoutScriptPubKey] with ScriptFactory[P2PKWithTimeoutScriptPubKey]
- object P2PKWithTimeoutScriptSignature extends Factory[ConditionalScriptSignature] with ScriptFactory[ConditionalScriptSignature]
- object P2SHScriptPubKey extends Factory[P2SHScriptPubKey] with ScriptFactory[P2SHScriptPubKey]
- object P2SHScriptSignature extends Factory[P2SHScriptSignature] with ScriptFactory[P2SHScriptSignature]
- object P2WPKHWitnessSPKV0 extends Factory[P2WPKHWitnessSPKV0] with ScriptFactory[P2WPKHWitnessSPKV0]
- object P2WPKHWitnessV0
- object P2WSHWitnessSPKV0 extends Factory[P2WSHWitnessSPKV0] with ScriptFactory[P2WSHWitnessSPKV0]
- object P2WSHWitnessV0
- object RawScriptPubKey extends Factory[RawScriptPubKey] with ScriptFactory[RawScriptPubKey]
- object ScriptPubKey extends Factory[ScriptPubKey] with ScriptFactory[ScriptPubKey]
Factory companion object used to create ScriptPubKey objects
- object ScriptSignature extends Factory[ScriptSignature] with ScriptFactory[ScriptSignature]
- object ScriptWitness extends Factory[ScriptWitness]
- case object SigVersionBase extends SignatureVersion with Product with Serializable
The original digest algorithm created by Satoshi
- case object SigVersionTaprootKeySpend extends SigVersionTaproot with Product with Serializable
For keypath spends
For keypath spends
- See also
https://github.com/bitcoin/bitcoin/blob/e826b22da252e0599c61d21c98ff89f366b3120f/src/script/interpreter.h#L191
- case object SigVersionTapscript extends SigVersionTaproot with Product with Serializable
For script path spends
For script path spends
- See also
https://github.com/bitcoin/bitcoin/blob/e826b22da252e0599c61d21c98ff89f366b3120f/src/script/interpreter.h#L192
- case object SigVersionWitnessV0 extends SignatureVersion with Product with Serializable
The digest algorithm implemented by BIP143 https://github.com/bitcoin/bips/blob/master/bip-0143.mediawiki
- object TapLeaf extends Serializable
- object TaprootKeyPath extends Factory[TaprootKeyPath] with Serializable
- object TaprootScriptPath extends Factory[TaprootScriptPath] with Serializable
- object TaprootScriptPubKey extends Factory[TaprootScriptPubKey] with ScriptFactory[TaprootScriptPubKey] with Serializable
- object TaprootWitness extends Factory[TaprootWitness]
- object TapscriptControlBlock extends Factory[TapscriptControlBlock] with Serializable
- object TapscriptTree
- case object TrivialTrueScriptSignature extends ScriptSignature with Product with Serializable
A script signature to be used in tests for signing EmptyScriptPubKey.
A script signature to be used in tests for signing EmptyScriptPubKey. This script pushes a true onto the stack, causing a successful spend.
- object UnassignedWitnessScriptPubKey extends Factory[UnassignedWitnessScriptPubKey] with ScriptFactory[UnassignedWitnessScriptPubKey]
- object UnknownControlBlock extends Factory[UnknownControlBlock] with Serializable
- object WitnessCommitment extends Factory[WitnessCommitment] with ScriptFactory[WitnessCommitment]
- object WitnessScriptPubKey extends Factory[WitnessScriptPubKey] with ScriptFactory[WitnessScriptPubKey]
- object WitnessScriptPubKeyV0 extends Factory[WitnessScriptPubKeyV0] with ScriptFactory[WitnessScriptPubKeyV0]
- object WitnessVersion
- case object WitnessVersion0 extends WitnessVersion with Product with Serializable
- case object WitnessVersion1 extends WitnessVersion with Product with Serializable