Runner

class Runner(context: Context, scriptFlag: Int, callback: Option[Callback])

Bitcoin script runner

Value parameters:
callback

optional callback

context

script execution context

scriptFlag

script flags

Companion:
object
Source:
Script.scala
class Object
trait Matchable
class Any

Value members

Concrete methods

def checkSignature(pubKey: ByteVector, sigBytes: ByteVector, scriptCode: ByteVector, signatureVersion: Int): Boolean
def checkSignatures(pubKeys: Seq[ByteVector], sigs: Seq[ByteVector], scriptCode: ByteVector, signatureVersion: Int): Boolean
def decodeNumber(input: ByteVector, maximumSize: Int): Long
def run(script: ByteVector): Stack

execute a serialized script, starting from an empty stack

execute a serialized script, starting from an empty stack

Value parameters:
script

serialized script

Returns:

the stack created by the script

Source:
Script.scala
def run(script: List[ScriptElt]): Stack

execute a script, starting from an empty stack

execute a script, starting from an empty stack

Returns:

the stack created by the script

Source:
Script.scala
def run(script: ByteVector, stack: Stack): Stack

execute a serialized script, starting from an existing stack

execute a serialized script, starting from an existing stack

Value parameters:
script

serialized script

stack

initial stack

Returns:

the stack updated by the script

Source:
Script.scala
def run(script: List[ScriptElt], stack: Stack): Stack
def run(script: List[ScriptElt], stack: Stack, signatureVersion: Int): Stack

execute a script, starting from an existing stack

execute a script, starting from an existing stack

Value parameters:
script

serialized script

signatureVersion

signature version (0: use pre-segwit tx hash, 1: use segwit tx hash)

stack

initial stack

Returns:

the stack updated by the script

Source:
Script.scala
final def run(script: List[ScriptElt], stack: Stack, state: State, signatureVersion: Int): Stack

execute a bitcoin script

execute a bitcoin script

Value parameters:
script

script

stack

initial stack

state

initial state

Returns:

the stack updated by the script

Source:
Script.scala
def verifyScripts(scriptSig: ByteVector, scriptPubKey: ByteVector): Boolean
def verifyScripts(scriptSig: ByteVector, scriptPubKey: ByteVector, witness: ScriptWitness): Boolean

verify a script sig/script pubkey pair:

verify a script sig/script pubkey pair:

  • parse and run script sig
  • parse and run script pubkey using the stack generated by the previous step
  • check the final stack
  • extract and run embedded pay2sh scripts if any and check the stack again
Value parameters:
scriptPubKey

public key script

scriptSig

signature script

Returns:

true if the scripts were successfully verified

Source:
Script.scala
def verifyWitnessProgram(witness: ScriptWitness, witnessVersion: Long, program: ByteVector): Unit