Versions in this module Expand all Collapse all v3 deprecated v3.0.1 Jun 10, 2023 v3.0.0 Sep 26, 2020 Changes in this version + const CltvMaxScriptNumLen + const CsvMaxScriptNumLen + const ErrCheckMultiSigVerify + const ErrCheckSigAltVerify + const ErrCheckSigVerify + const ErrCleanStack + const ErrDisabledOpcode + const ErrDiscourageUpgradableNOPs + const ErrDivideByZero + const ErrEarlyReturn + const ErrElementTooBig + const ErrEmptyStack + const ErrEqualVerify + const ErrEvalFalse + const ErrInvalidIndex + const ErrInvalidProgramCounter + const ErrInvalidPubKeyCount + const ErrInvalidSigHashSingleIndex + const ErrInvalidSigHashType + const ErrInvalidSignatureCount + const ErrInvalidStackOperation + const ErrMalformedPush + const ErrMinimalData + const ErrNegativeLockTime + const ErrNegativeRotation + const ErrNegativeShift + const ErrNegativeSubstrIdx + const ErrNotMultisigScript + const ErrNotPushOnly + const ErrNumEqualVerify + const ErrNumOutOfRange + const ErrOverflowRotation + const ErrOverflowShift + const ErrOverflowSubstrIdx + const ErrP2SHStakeOpCodes + const ErrP2SHTreasuryOpCodes + const ErrPubKeyType + const ErrReservedOpcode + const ErrScriptTooBig + const ErrScriptUnfinished + const ErrSigHighS + const ErrSigInvalidDataLen + const ErrSigInvalidRIntID + const ErrSigInvalidSIntID + const ErrSigInvalidSLen + const ErrSigInvalidSeqID + const ErrSigMissingSLen + const ErrSigMissingSTypeID + const ErrSigNegativeR + const ErrSigNegativeS + const ErrSigTooLong + const ErrSigTooMuchRPadding + const ErrSigTooMuchSPadding + const ErrSigTooShort + const ErrSigZeroRLen + const ErrSigZeroSLen + const ErrStackOverflow + const ErrTooManyOperations + const ErrTooManyRequiredSigs + const ErrTooMuchNullData + const ErrUnbalancedConditional + const ErrUnsatisfiedLockTime + const ErrUnsupportedAddress + const ErrUnsupportedScriptVersion + const ErrVerify + const LockTimeThreshold + const MathOpCodeMaxScriptNumLen + const MaxDataCarrierSize + const MaxOpsPerScript + const MaxPubKeysPerMultiSig + const MaxScriptElementSize + const MaxScriptSize + const MaxStackSize + const OP_0 + const OP_0NOTEQUAL + const OP_1 + const OP_10 + const OP_11 + const OP_12 + const OP_13 + const OP_14 + const OP_15 + const OP_16 + const OP_1ADD + const OP_1NEGATE + const OP_1SUB + const OP_2 + const OP_2DIV + const OP_2DROP + const OP_2DUP + const OP_2MUL + const OP_2OVER + const OP_2ROT + const OP_2SWAP + const OP_3 + const OP_3DUP + const OP_4 + const OP_5 + const OP_6 + const OP_7 + const OP_8 + const OP_9 + const OP_ABS + const OP_ADD + const OP_AND + const OP_BLAKE256 + const OP_BOOLAND + const OP_BOOLOR + const OP_CAT + const OP_CHECKLOCKTIMEVERIFY + const OP_CHECKMULTISIG + const OP_CHECKMULTISIGVERIFY + const OP_CHECKSEQUENCEVERIFY + const OP_CHECKSIG + const OP_CHECKSIGALT + const OP_CHECKSIGALTVERIFY + const OP_CHECKSIGVERIFY + const OP_CODESEPARATOR + const OP_DATA_1 + const OP_DATA_10 + const OP_DATA_11 + const OP_DATA_12 + const OP_DATA_13 + const OP_DATA_14 + const OP_DATA_15 + const OP_DATA_16 + const OP_DATA_17 + const OP_DATA_18 + const OP_DATA_19 + const OP_DATA_2 + const OP_DATA_20 + const OP_DATA_21 + const OP_DATA_22 + const OP_DATA_23 + const OP_DATA_24 + const OP_DATA_25 + const OP_DATA_26 + const OP_DATA_27 + const OP_DATA_28 + const OP_DATA_29 + const OP_DATA_3 + const OP_DATA_30 + const OP_DATA_31 + const OP_DATA_32 + const OP_DATA_33 + const OP_DATA_34 + const OP_DATA_35 + const OP_DATA_36 + const OP_DATA_37 + const OP_DATA_38 + const OP_DATA_39 + const OP_DATA_4 + const OP_DATA_40 + const OP_DATA_41 + const OP_DATA_42 + const OP_DATA_43 + const OP_DATA_44 + const OP_DATA_45 + const OP_DATA_46 + const OP_DATA_47 + const OP_DATA_48 + const OP_DATA_49 + const OP_DATA_5 + const OP_DATA_50 + const OP_DATA_51 + const OP_DATA_52 + const OP_DATA_53 + const OP_DATA_54 + const OP_DATA_55 + const OP_DATA_56 + const OP_DATA_57 + const OP_DATA_58 + const OP_DATA_59 + const OP_DATA_6 + const OP_DATA_60 + const OP_DATA_61 + const OP_DATA_62 + const OP_DATA_63 + const OP_DATA_64 + const OP_DATA_65 + const OP_DATA_66 + const OP_DATA_67 + const OP_DATA_68 + const OP_DATA_69 + const OP_DATA_7 + const OP_DATA_70 + const OP_DATA_71 + const OP_DATA_72 + const OP_DATA_73 + const OP_DATA_74 + const OP_DATA_75 + const OP_DATA_8 + const OP_DATA_9 + const OP_DEPTH + const OP_DIV + const OP_DROP + const OP_DUP + const OP_ELSE + const OP_ENDIF + const OP_EQUAL + const OP_EQUALVERIFY + const OP_FALSE + const OP_FROMALTSTACK + const OP_GREATERTHAN + const OP_GREATERTHANOREQUAL + const OP_HASH160 + const OP_HASH256 + const OP_IF + const OP_IFDUP + const OP_INVALID249 + const OP_INVALIDOPCODE + const OP_INVERT + const OP_LEFT + const OP_LESSTHAN + const OP_LESSTHANOREQUAL + const OP_LSHIFT + const OP_MAX + const OP_MIN + const OP_MOD + const OP_MUL + const OP_NEGATE + const OP_NIP + const OP_NOP + const OP_NOP1 + const OP_NOP10 + const OP_NOP2 + const OP_NOP3 + const OP_NOP4 + const OP_NOP5 + const OP_NOP6 + const OP_NOP7 + const OP_NOP8 + const OP_NOP9 + const OP_NOT + const OP_NOTIF + const OP_NUMEQUAL + const OP_NUMEQUALVERIFY + const OP_NUMNOTEQUAL + const OP_OR + const OP_OVER + const OP_PICK + const OP_PUBKEY + const OP_PUBKEYHASH + const OP_PUBKEYS + const OP_PUSHDATA1 + const OP_PUSHDATA2 + const OP_PUSHDATA4 + const OP_RESERVED + const OP_RETURN + const OP_RIGHT + const OP_RIPEMD160 + const OP_ROLL + const OP_ROT + const OP_ROTL + const OP_ROTR + const OP_RSHIFT + const OP_SHA1 + const OP_SHA256 + const OP_SIZE + const OP_SMALLINTEGER + const OP_SSGEN + const OP_SSRTX + const OP_SSTX + const OP_SSTXCHANGE + const OP_SUB + const OP_SUBSTR + const OP_SWAP + const OP_TADD + const OP_TGEN + const OP_TOALTSTACK + const OP_TRUE + const OP_TSPEND + const OP_TUCK + const OP_UNKNOWN196 + const OP_UNKNOWN197 + const OP_UNKNOWN198 + const OP_UNKNOWN199 + const OP_UNKNOWN200 + const OP_UNKNOWN201 + const OP_UNKNOWN202 + const OP_UNKNOWN203 + const OP_UNKNOWN204 + const OP_UNKNOWN205 + const OP_UNKNOWN206 + const OP_UNKNOWN207 + const OP_UNKNOWN208 + const OP_UNKNOWN209 + const OP_UNKNOWN210 + const OP_UNKNOWN211 + const OP_UNKNOWN212 + const OP_UNKNOWN213 + const OP_UNKNOWN214 + const OP_UNKNOWN215 + const OP_UNKNOWN216 + const OP_UNKNOWN217 + const OP_UNKNOWN218 + const OP_UNKNOWN219 + const OP_UNKNOWN220 + const OP_UNKNOWN221 + const OP_UNKNOWN222 + const OP_UNKNOWN223 + const OP_UNKNOWN224 + const OP_UNKNOWN225 + const OP_UNKNOWN226 + const OP_UNKNOWN227 + const OP_UNKNOWN228 + const OP_UNKNOWN229 + const OP_UNKNOWN230 + const OP_UNKNOWN231 + const OP_UNKNOWN232 + const OP_UNKNOWN233 + const OP_UNKNOWN234 + const OP_UNKNOWN235 + const OP_UNKNOWN236 + const OP_UNKNOWN237 + const OP_UNKNOWN238 + const OP_UNKNOWN239 + const OP_UNKNOWN240 + const OP_UNKNOWN241 + const OP_UNKNOWN242 + const OP_UNKNOWN243 + const OP_UNKNOWN244 + const OP_UNKNOWN245 + const OP_UNKNOWN246 + const OP_UNKNOWN247 + const OP_UNKNOWN248 + const OP_UNKNOWN252 + const OP_VER + const OP_VERIF + const OP_VERIFY + const OP_VERNOTIF + const OP_WITHIN + const OP_XOR + const ProactiveEvictionDepth + const SigHashSerializePrefix + const SigHashSerializeWitness + var OpcodeByName = make(map[string]byte) + func AsSmallInt(op byte) int + func CalcMultiSigStats(script []byte) (int, int, error) + func CalcSignatureHash(script []byte, hashType SigHashType, tx *wire.MsgTx, idx int, ...) ([]byte, error) + func CanonicalDataSize(data []byte) int + func CheckHashTypeEncoding(hashType SigHashType) error + func CheckPubKeyEncoding(pubKey []byte) error + func CheckSignatureEncoding(sig []byte) error + func ContainsStakeOpCodes(pkScript []byte, isTreasuryEnabled bool) (bool, error) + func DisasmString(script []byte) (string, error) + func ExtractPkScriptAltSigType(pkScript []byte) (dcrec.SignatureType, error) + func ExtractScriptHash(script []byte) []byte + func GenerateProvablyPruneableOut(data []byte) ([]byte, error) + func GenerateSSGenBlockRef(blockHash chainhash.Hash, height uint32) ([]byte, error) + func GenerateSSGenVotes(votebits uint16) ([]byte, error) + func GenerateSStxAddrPush(addr dcrutil.Address, amount dcrutil.Amount, limits uint16) ([]byte, error) + func GetPreciseSigOpCount(scriptSig, scriptPubKey []byte, isTreasuryEnabled bool) int + func GetSigOpCount(script []byte, isTreasuryEnabled bool) int + func IsDERSigError(err error) bool + func IsMultisigScript(script []byte) bool + func IsMultisigSigScript(script []byte) bool + func IsPayToScriptHash(script []byte) bool + func IsPubKeyHashScript(script []byte) bool + func IsPushOnlyScript(script []byte) bool + func IsSmallInt(op byte) bool + func IsStakeChangeScript(scriptVersion uint16, script []byte) bool + func IsStrictCompressedPubKeyEncoding(pubKey []byte) bool + func IsStrictNullData(scriptVersion uint16, script []byte, requiredLen uint32) bool + func IsStrictSignatureEncoding(signature []byte) bool + func IsUnspendable(amount int64, pkScript []byte) bool + func MultiSigScript(pubkeys []*dcrutil.AddressSecpPubKey, nrequired int) ([]byte, error) + func MultisigRedeemScriptFromScriptSig(script []byte) []byte + func PayToAddrScript(addr dcrutil.Address) ([]byte, error) + func PayToSSGen(addr dcrutil.Address) ([]byte, error) + func PayToSSGenPKHDirect(pkh []byte) ([]byte, error) + func PayToSSGenSHDirect(sh []byte) ([]byte, error) + func PayToSSRtx(addr dcrutil.Address) ([]byte, error) + func PayToSSRtxPKHDirect(pkh []byte) ([]byte, error) + func PayToSSRtxSHDirect(sh []byte) ([]byte, error) + func PayToSStx(addr dcrutil.Address) ([]byte, error) + func PayToSStxChange(addr dcrutil.Address) ([]byte, error) + func PayToScriptHashScript(scriptHash []byte) ([]byte, error) + func PushedData(script []byte) ([][]byte, error) + func RawTxInSignature(tx *wire.MsgTx, idx int, subScript []byte, hashType SigHashType, key []byte, ...) ([]byte, error) + func SignTxOutput(chainParams dcrutil.AddressParams, tx *wire.MsgTx, idx int, pkScript []byte, ...) ([]byte, error) + func SignatureScript(tx *wire.MsgTx, idx int, subscript []byte, hashType SigHashType, ...) ([]byte, error) + func TSpendSignatureScript(msgTx *wire.MsgTx, privKey []byte) ([]byte, error) + func UseLogger(logger slog.Logger) + type AtomicSwapDataPushes struct + LockTime int64 + RecipientHash160 [20]byte + RefundHash160 [20]byte + SecretHash [32]byte + SecretSize int64 + func ExtractAtomicSwapDataPushes(version uint16, pkScript []byte) (*AtomicSwapDataPushes, error) + type Engine struct + func NewEngine(scriptPubKey []byte, tx *wire.MsgTx, txIdx int, flags ScriptFlags, ...) (*Engine, error) + func (vm *Engine) CheckErrorCondition(finalScript bool) error + func (vm *Engine) DisasmPC() (string, error) + func (vm *Engine) DisasmScript(idx int) (string, error) + func (vm *Engine) Execute() (err error) + func (vm *Engine) GetAltStack() [][]byte + func (vm *Engine) GetStack() [][]byte + func (vm *Engine) SetAltStack(data [][]byte) + func (vm *Engine) SetStack(data [][]byte) + func (vm *Engine) Step() (done bool, err error) + type ErrScriptNotCanonical string + func (e ErrScriptNotCanonical) Error() string + type Error struct + Description string + Err error + func (e Error) Error() string + func (e Error) Unwrap() error + type ErrorKind string + func (e ErrorKind) Error() string + type KeyClosure func(dcrutil.Address) ([]byte, dcrec.SignatureType, bool, error) + func (kc KeyClosure) GetKey(address dcrutil.Address) ([]byte, dcrec.SignatureType, bool, error) + type KeyDB interface + GetKey func(dcrutil.Address) ([]byte, dcrec.SignatureType, bool, error) + type ScriptBuilder struct + func NewScriptBuilder() *ScriptBuilder + func (b *ScriptBuilder) AddData(data []byte) *ScriptBuilder + func (b *ScriptBuilder) AddFullData(data []byte) *ScriptBuilder + func (b *ScriptBuilder) AddInt64(val int64) *ScriptBuilder + func (b *ScriptBuilder) AddOp(opcode byte) *ScriptBuilder + func (b *ScriptBuilder) AddOps(opcodes []byte) *ScriptBuilder + func (b *ScriptBuilder) Reset() *ScriptBuilder + func (b *ScriptBuilder) Script() ([]byte, error) + type ScriptClass byte + const MultiSigTy + const NonStandardTy + const NullDataTy + const PubKeyHashTy + const PubKeyTy + const PubkeyAltTy + const PubkeyHashAltTy + const ScriptHashTy + const StakeGenTy + const StakeRevocationTy + const StakeSubChangeTy + const StakeSubmissionTy + const TreasuryAddTy + const TreasuryGenTy + func ExtractPkScriptAddrs(version uint16, pkScript []byte, chainParams dcrutil.AddressParams, ...) (ScriptClass, []dcrutil.Address, int, error) + func GetScriptClass(version uint16, script []byte, isTreasuryEnabled bool) ScriptClass + func GetStakeOutSubclass(pkScript []byte, isTreasuryEnabled bool) (ScriptClass, error) + func (t ScriptClass) String() string + type ScriptClosure func(dcrutil.Address) ([]byte, error) + func (sc ScriptClosure) GetScript(address dcrutil.Address) ([]byte, error) + type ScriptDB interface + GetScript func(dcrutil.Address) ([]byte, error) + type ScriptFlags uint32 + const ScriptDiscourageUpgradableNops + const ScriptVerifyCheckLockTimeVerify + const ScriptVerifyCheckSequenceVerify + const ScriptVerifyCleanStack + const ScriptVerifySHA256 + const ScriptVerifySigPushOnly + const ScriptVerifyTreasury + type ScriptNum int64 + func MakeScriptNum(v []byte, scriptNumLen int) (ScriptNum, error) + func (n ScriptNum) Bytes() []byte + func (n ScriptNum) Int32() int32 + type ScriptTokenizer struct + func MakeScriptTokenizer(scriptVersion uint16, script []byte) ScriptTokenizer + func (t *ScriptTokenizer) ByteIndex() int32 + func (t *ScriptTokenizer) Data() []byte + func (t *ScriptTokenizer) Done() bool + func (t *ScriptTokenizer) Err() error + func (t *ScriptTokenizer) Next() bool + func (t *ScriptTokenizer) Opcode() byte + func (t *ScriptTokenizer) Script() []byte + type SigCache struct + func NewSigCache(maxEntries uint) (*SigCache, error) + func (s *SigCache) Add(sigHash chainhash.Hash, sig *ecdsa.Signature, pubKey *secp256k1.PublicKey, ...) + func (s *SigCache) EvictEntries(block *wire.MsgBlock) + func (s *SigCache) Exists(sigHash chainhash.Hash, sig *ecdsa.Signature, pubKey *secp256k1.PublicKey) bool + type SigHashSerType uint16 + type SigHashType byte + const SigHashAll + const SigHashAnyOneCanPay + const SigHashNone + const SigHashSingle Other modules containing this package github.com/decred/dcrd/txscript github.com/decred/dcrd/txscript/v2 github.com/decred/dcrd/txscript/v4