object BitcoinScriptUtil extends BitcoinScriptUtil
- Alphabetic
- By Inheritance
- BitcoinScriptUtil
- BitcoinScriptUtil
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def asmToBytes(asm: Seq[ScriptToken]): ByteVector
Converts a sequence of script tokens to them to their byte values
Converts a sequence of script tokens to them to their byte values
- Definition Classes
- BitcoinScriptUtil
- def asmToHex(asm: Seq[ScriptToken]): String
Takes in a sequence of script tokens and converts them to their hexadecimal value
Takes in a sequence of script tokens and converts them to their hexadecimal value
- Definition Classes
- BitcoinScriptUtil
- def calculatePushOp(bytes: ByteVector): Seq[ScriptToken]
- Definition Classes
- BitcoinScriptUtil
- def calculatePushOp(scriptToken: ScriptToken): Seq[ScriptToken]
Calculates the push operation for the given ScriptToken
Calculates the push operation for the given ScriptToken
- Definition Classes
- BitcoinScriptUtil
- def calculateScriptForChecking(txSignatureComponent: TxSigComponent, signature: ECDigitalSignature, script: Seq[ScriptToken]): Seq[ScriptToken]
Prepares the script we spending to be serialized for our transaction signature serialization algorithm We need to check if the scriptSignature has a redeemScript In that case, we need to pass the redeemScript to the TransactionSignatureChecker
Prepares the script we spending to be serialized for our transaction signature serialization algorithm We need to check if the scriptSignature has a redeemScript In that case, we need to pass the redeemScript to the TransactionSignatureChecker
In the case we have a P2SH(P2WSH) we need to pass the witness's redeem script to the TransactionSignatureChecker instead of passing the WitnessScriptPubKey inside of the P2SHScriptSignature's redeem script.
- Definition Classes
- BitcoinScriptUtil
- def calculateScriptForSigning(spendingTransaction: Transaction, signingInfo: InputSigningInfo[InputInfo], asm: Seq[ScriptToken]): Seq[ScriptToken]
- Definition Classes
- BitcoinScriptUtil
- def calculateScriptForSigning(txSignatureComponent: TxSigComponent, script: Seq[ScriptToken]): Seq[ScriptToken]
- Definition Classes
- BitcoinScriptUtil
- def castToBool(token: ScriptToken): Boolean
Casts the given script token to a boolean value Mimics this function inside of Bitcoin Core https://github.com/bitcoin/bitcoin/blob/8c1dbc5e9ddbafb77e60e8c4e6eb275a3a76ac12/src/script/interpreter.cpp#L38 All bytes in the byte vector must be zero, unless it is the last byte, which can be 0 or 0x80 (negative zero)
Casts the given script token to a boolean value Mimics this function inside of Bitcoin Core https://github.com/bitcoin/bitcoin/blob/8c1dbc5e9ddbafb77e60e8c4e6eb275a3a76ac12/src/script/interpreter.cpp#L38 All bytes in the byte vector must be zero, unless it is the last byte, which can be 0 or 0x80 (negative zero)
- Definition Classes
- BitcoinScriptUtil
- def checkPubKeyEncoding(key: ECPublicKeyBytes, flags: Seq[ScriptFlag]): Boolean
- Definition Classes
- BitcoinScriptUtil
- def checkPubKeyEncoding(key: ECPublicKeyBytes, program: ExecutionInProgressScriptProgram): Boolean
Checks the ECPublicKey encoding according to bitcoin core's function: https://github.com/bitcoin/bitcoin/blob/master/src/script/interpreter.cpp#L202.
Checks the ECPublicKey encoding according to bitcoin core's function: https://github.com/bitcoin/bitcoin/blob/master/src/script/interpreter.cpp#L202.
- Definition Classes
- BitcoinScriptUtil
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def countOpCodes(opcodes: Vector[ScriptToken]): Int
- Definition Classes
- BitcoinScriptUtil
- def countSigOps(script: Seq[ScriptToken]): Long
Counts the amount of sigops in a script.
Counts the amount of sigops in a script. Bitcoin Core script.cpp
- script
the script whose sigops are being counted
- returns
the number of signature operations in the script
- Definition Classes
- BitcoinScriptUtil
- def countsTowardsScriptOpLimit(token: ScriptToken): Boolean
Returns true if the given script token counts towards our max script operations in a script See interpreter.cpp#L269-L271 which is how Bitcoin Core handles this
Returns true if the given script token counts towards our max script operations in a script See interpreter.cpp#L269-L271 which is how Bitcoin Core handles this
- Definition Classes
- BitcoinScriptUtil
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def filterOpCodes(tokens: Vector[ScriptToken]): Vector[ScriptToken]
- Definition Classes
- BitcoinScriptUtil
- def filterPushOps(asm: Seq[ScriptToken]): Seq[ScriptToken]
Filters out push operations in our sequence of script tokens this removes OP_PUSHDATA1, OP_PUSHDATA2, OP_PUSHDATA4, and all ByteToPushOntoStack tokens
Filters out push operations in our sequence of script tokens this removes OP_PUSHDATA1, OP_PUSHDATA2, OP_PUSHDATA4, and all ByteToPushOntoStack tokens
- Definition Classes
- BitcoinScriptUtil
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def getDataTokens(asm: Seq[ScriptToken]): Seq[ScriptToken]
Returns only the data ScriptTokens in a script that are pushed onto the stack
Returns only the data ScriptTokens in a script that are pushed onto the stack
- Definition Classes
- BitcoinScriptUtil
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def isCompressedOrUncompressedPubKey(key: ECPublicKeyBytes): Boolean
Returns true if the key is compressed or uncompressed, false otherwise https://github.com/bitcoin/bitcoin/blob/master/src/script/interpreter.cpp#L66
Returns true if the key is compressed or uncompressed, false otherwise https://github.com/bitcoin/bitcoin/blob/master/src/script/interpreter.cpp#L66
- key
the public key that is being checked
- returns
true if the key is compressed/uncompressed otherwise false
- Definition Classes
- BitcoinScriptUtil
- def isCompressedPubKey(key: ECPublicKeyBytes): Boolean
Checks if the given public key is a compressed public key
Checks if the given public key is a compressed public key
- Definition Classes
- BitcoinScriptUtil
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def isMinimalPush(pushOp: ScriptToken, token: ScriptToken): Boolean
Determines if the token being pushed onto the stack is being pushed by the SMALLEST push operation possible This is equivalent to Bitcoin Core interpreter.cpp#L209
Determines if the token being pushed onto the stack is being pushed by the SMALLEST push operation possible This is equivalent to Bitcoin Core interpreter.cpp#L209
- pushOp
the operation that is pushing the data onto the stack
- token
the token that is being pushed onto the stack by the pushOp
- Definition Classes
- BitcoinScriptUtil
- def isMinimalToken(token: ScriptToken): Boolean
Checks if the token is minimially encoded
Checks if the token is minimially encoded
- Definition Classes
- BitcoinScriptUtil
- def isOnlyCompressedPubKey(spk: ScriptPubKey): Boolean
Checks that all the ECPublicKey in this script is compressed public keys, this is required for BIP143
Checks that all the ECPublicKey in this script is compressed public keys, this is required for BIP143
- Definition Classes
- BitcoinScriptUtil
- def isPushOnly(script: Seq[ScriptToken]): Boolean
Determines if a script contains only script operations This is equivalent to Bitcoin Core script.cpp#L213
Determines if a script contains only script operations This is equivalent to Bitcoin Core script.cpp#L213
- Definition Classes
- BitcoinScriptUtil
- def isShortestEncoding(hex: String): Boolean
Whenever a script constant is interpreted to a number BIP62 should enforce that number to be encoded in the smallest encoding possible https://github.com/bitcoin/bitcoin/blob/a6a860796a44a2805a58391a009ba22752f64e32/src/script/script.h#L220-L237
Whenever a script constant is interpreted to a number BIP62 should enforce that number to be encoded in the smallest encoding possible https://github.com/bitcoin/bitcoin/blob/a6a860796a44a2805a58391a009ba22752f64e32/src/script/script.h#L220-L237
- Definition Classes
- BitcoinScriptUtil
- def isShortestEncoding(bytes: ByteVector): Boolean
- Definition Classes
- BitcoinScriptUtil
- def isShortestEncoding(constant: ScriptConstant): Boolean
Whenever a ScriptConstant is interpreted to a number BIP62 could enforce that number to be encoded in the smallest encoding possible https://github.com/bitcoin/bitcoin/blob/a6a860796a44a2805a58391a009ba22752f64e32/src/script/script.h#L220-L237
Whenever a ScriptConstant is interpreted to a number BIP62 could enforce that number to be encoded in the smallest encoding possible https://github.com/bitcoin/bitcoin/blob/a6a860796a44a2805a58391a009ba22752f64e32/src/script/script.h#L220-L237
- Definition Classes
- BitcoinScriptUtil
- def isValidPubKeyEncoding(pubKey: ECPublicKeyBytes, sigVersion: SignatureVersion, flags: Seq[ScriptFlag]): Option[ScriptError]
Determines if the given pubkey is valid in accordance to the given ScriptFlags and SignatureVersion.
Determines if the given pubkey is valid in accordance to the given ScriptFlags and SignatureVersion. Mimics this function inside of Bitcoin Core https://github.com/bitcoin/bitcoin/blob/528472111b4965b1a99c4bcf08ac5ec93d87f10f/src/script/interpreter.cpp#L214-L223
- Definition Classes
- BitcoinScriptUtil
- def minimalDummy(asm: Seq[ScriptToken]): Seq[ScriptToken]
Replaces the OP_0 dummy for OP_CHECKMULTISIG with ScriptNumber.zero
Replaces the OP_0 dummy for OP_CHECKMULTISIG with ScriptNumber.zero
- Definition Classes
- BitcoinScriptUtil
- def minimalIfOp(asm: Seq[ScriptToken]): Seq[ScriptToken]
Since witnesses are not run through the interpreter, replace
OP_0
/OP_1
withScriptNumber.zero
/ScriptNumber.one
Since witnesses are not run through the interpreter, replace
OP_0
/OP_1
withScriptNumber.zero
/ScriptNumber.one
- Definition Classes
- BitcoinScriptUtil
- def minimalScriptNumberRepresentation(num: ScriptNumber): ScriptNumber
- Definition Classes
- BitcoinScriptUtil
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def numPossibleSignaturesOnStack(program: ExecutionInProgressScriptProgram): ScriptNumber
Parses the number of signatures on the stack This can only be called when an OP_CHECKMULTISIG operation is about to be executed on the stack For instance if this was a 2/3 multisignature script, it would return the number 3
Parses the number of signatures on the stack This can only be called when an OP_CHECKMULTISIG operation is about to be executed on the stack For instance if this was a 2/3 multisignature script, it would return the number 3
- Definition Classes
- BitcoinScriptUtil
- def numRequiredSignaturesOnStack(program: ExecutionInProgressScriptProgram): ScriptNumber
Returns the number of required signatures on the stack, for instance if this was a 2/3 multisignature script, it would return the number 2
Returns the number of required signatures on the stack, for instance if this was a 2/3 multisignature script, it would return the number 2
- Definition Classes
- BitcoinScriptUtil
- def parseScript[T <: Script](bytes: ByteVector, f: (Vector[ScriptToken]) => T): T
- Definition Classes
- BitcoinScriptUtil
- def removeOpCodeSeparator(program: ExecutionInProgressScriptProgram): Seq[ScriptToken]
Removes the OP_CODESEPARATOR in the original script according to the last code separator index in the script.
Removes the OP_CODESEPARATOR in the original script according to the last code separator index in the script.
- Definition Classes
- BitcoinScriptUtil
- def removeSignatureFromScript(signature: ECDigitalSignature, script: Seq[ScriptToken]): Seq[ScriptToken]
Removes the given ECDigitalSignature from the list of ScriptToken if it exists.
Removes the given ECDigitalSignature from the list of ScriptToken if it exists.
- Definition Classes
- BitcoinScriptUtil
- def removeSignaturesFromScript(sigs: Seq[ECDigitalSignature], script: Seq[ScriptToken]): Seq[ScriptToken]
Removes the list of ECDigitalSignature from the list of ScriptToken
Removes the list of ECDigitalSignature from the list of ScriptToken
- Definition Classes
- BitcoinScriptUtil
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- def verifyPSBTInputScript(tx: Transaction, inputMap: InputPSBTMap, index: Int, outputMap: PreviousOutputMap, flags: Seq[ScriptFlag] = Policy.standardFlags): Try[Transaction]
- Definition Classes
- BitcoinScriptUtil
- def verifyScript(tx: Transaction, utxos: Seq[ScriptSignatureParams[InputInfo]]): Boolean
- Definition Classes
- BitcoinScriptUtil
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()