Versions in this module Expand all Collapse all v0 v0.0.7 Jan 23, 2024 Changes in this version + const MaxOpsPerScript + const MaxPubKeysPerMultiSig + const MaxScriptElementSize + const MaxScriptSize + const MaxStackSize + const Op0 + const Op0NotEqual + const Op1 + const Op10 + const Op11 + const Op12 + const Op13 + const Op14 + const Op15 + const Op16 + const Op1Add + const Op1Negate + const Op1Sub + const Op2 + const Op2Div + const Op2Drop + const Op2Dup + const Op2Mul + const Op2Over + const Op2Rot + const Op2Swap + const Op3 + const Op3Dup + const Op4 + const Op5 + const Op6 + const Op7 + const Op8 + const Op9 + const OpAbs + const OpAdd + const OpAnd + const OpBlake2b + const OpBoolAnd + const OpBoolOr + const OpCat + const OpCheckLockTimeVerify + const OpCheckMultiSig + const OpCheckMultiSigECDSA + const OpCheckMultiSigVerify + const OpCheckSequenceVerify + const OpCheckSig + const OpCheckSigECDSA + const OpCheckSigVerify + const OpCondFalse + const OpCondSkip + const OpCondTrue + const OpData1 + const OpData10 + const OpData11 + const OpData12 + const OpData13 + const OpData14 + const OpData15 + const OpData16 + const OpData17 + const OpData18 + const OpData19 + const OpData2 + const OpData20 + const OpData21 + const OpData22 + const OpData23 + const OpData24 + const OpData25 + const OpData26 + const OpData27 + const OpData28 + const OpData29 + const OpData3 + const OpData30 + const OpData31 + const OpData32 + const OpData33 + const OpData34 + const OpData35 + const OpData36 + const OpData37 + const OpData38 + const OpData39 + const OpData4 + const OpData40 + const OpData41 + const OpData42 + const OpData43 + const OpData44 + const OpData45 + const OpData46 + const OpData47 + const OpData48 + const OpData49 + const OpData5 + const OpData50 + const OpData51 + const OpData52 + const OpData53 + const OpData54 + const OpData55 + const OpData56 + const OpData57 + const OpData58 + const OpData59 + const OpData6 + const OpData60 + const OpData61 + const OpData62 + const OpData63 + const OpData64 + const OpData65 + const OpData66 + const OpData67 + const OpData68 + const OpData69 + const OpData7 + const OpData70 + const OpData71 + const OpData72 + const OpData73 + const OpData74 + const OpData75 + const OpData8 + const OpData9 + const OpDepth + const OpDiv + const OpDrop + const OpDup + const OpElse + const OpEndIf + const OpEqual + const OpEqualVerify + const OpFalse + const OpFromAltStack + const OpGreaterThan + const OpGreaterThanOrEqual + const OpIf + const OpIfDup + const OpInvalidOpCode + const OpInvert + const OpLShift + const OpLeft + const OpLessThan + const OpLessThanOrEqual + const OpMax + const OpMin + const OpMod + const OpMul + const OpNegate + const OpNip + const OpNop + const OpNot + const OpNotIf + const OpNumEqual + const OpNumEqualVerify + const OpNumNotEqual + const OpOr + const OpOver + const OpPick + const OpPubKey + const OpPubKeyHash + const OpPubKeys + const OpPushData1 + const OpPushData2 + const OpPushData4 + const OpRShift + const OpReserved + const OpReserved1 + const OpReserved2 + const OpReturn + const OpRight + const OpRoll + const OpRot + const OpSHA256 + const OpSize + const OpSmallInteger + const OpSub + const OpSubStr + const OpSwap + const OpToAltStack + const OpTrue + const OpTuck + const OpUnknown166 + const OpUnknown167 + const OpUnknown178 + const OpUnknown179 + const OpUnknown180 + const OpUnknown181 + const OpUnknown182 + const OpUnknown183 + const OpUnknown184 + const OpUnknown185 + const OpUnknown186 + const OpUnknown187 + const OpUnknown188 + const OpUnknown189 + const OpUnknown190 + const OpUnknown191 + const OpUnknown192 + const OpUnknown193 + const OpUnknown194 + const OpUnknown195 + const OpUnknown196 + const OpUnknown197 + const OpUnknown198 + const OpUnknown199 + const OpUnknown200 + const OpUnknown201 + const OpUnknown202 + const OpUnknown203 + const OpUnknown204 + const OpUnknown205 + const OpUnknown206 + const OpUnknown207 + const OpUnknown208 + const OpUnknown209 + const OpUnknown210 + const OpUnknown211 + const OpUnknown212 + const OpUnknown213 + const OpUnknown214 + const OpUnknown215 + const OpUnknown216 + const OpUnknown217 + const OpUnknown218 + const OpUnknown219 + const OpUnknown220 + const OpUnknown221 + const OpUnknown222 + const OpUnknown223 + const OpUnknown224 + const OpUnknown225 + const OpUnknown226 + const OpUnknown227 + const OpUnknown228 + const OpUnknown229 + const OpUnknown230 + const OpUnknown231 + const OpUnknown232 + const OpUnknown233 + const OpUnknown234 + const OpUnknown235 + const OpUnknown236 + const OpUnknown237 + const OpUnknown238 + const OpUnknown239 + const OpUnknown240 + const OpUnknown241 + const OpUnknown242 + const OpUnknown243 + const OpUnknown244 + const OpUnknown245 + const OpUnknown246 + const OpUnknown247 + const OpUnknown248 + const OpUnknown249 + const OpUnknown252 + const OpVer + const OpVerIf + const OpVerNotIf + const OpVerify + const OpWithin + const OpXor + var OpcodeByName = make(map[string]byte) + func DisasmString(version uint16, buf []byte) (string, error) + func GetPreciseSigOpCount(scriptSig []byte, scriptPubKey *externalapi.ScriptPublicKey, isP2SH bool) int + func GetSigOpCount(script []byte) int + func IsErrorCode(err error, c ErrorCode) bool + func IsPayToScriptHash(script *externalapi.ScriptPublicKey) bool + func IsUnspendable(scriptPubKey []byte) bool + func PayToAddrScript(addr util.Address) (*externalapi.ScriptPublicKey, error) + func PayToScriptHashScript(redeemScript []byte) ([]byte, error) + func PayToScriptHashSignatureScript(redeemScript []byte, signature []byte) ([]byte, error) + func PushedData(script []byte) ([][]byte, error) + func RawTxInSignature(tx *externalapi.DomainTransaction, idx int, ...) ([]byte, error) + func RawTxInSignatureECDSA(tx *externalapi.DomainTransaction, idx int, ...) ([]byte, error) + func SignTxOutput(dagParams *dagconfig.Params, tx *externalapi.DomainTransaction, idx int, ...) ([]byte, error) + func SignatureScript(tx *externalapi.DomainTransaction, idx int, ...) ([]byte, error) + func SignatureScriptECDSA(tx *externalapi.DomainTransaction, idx int, ...) ([]byte, error) + type AtomicSwapDataPushes struct + LockTime uint64 + RecipientBlake2b [32]byte + RefundBlake2b [32]byte + SecretHash [32]byte + SecretSize int64 + func ExtractAtomicSwapDataPushes(version uint16, scriptPubKey []byte) (*AtomicSwapDataPushes, error) + type Engine struct + func NewEngine(scriptPubKey *externalapi.ScriptPublicKey, tx *externalapi.DomainTransaction, ...) (*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 + ErrorCode ErrorCode + func (e Error) Error() string + type ErrorCode int + const ErrCheckMultiSigVerify + const ErrCheckSigVerify + const ErrCleanStack + const ErrDisabledOpcode + const ErrEarlyReturn + const ErrElementTooBig + const ErrEmptyStack + const ErrEqualVerify + const ErrEvalFalse + const ErrInternal + const ErrInvalidFlags + const ErrInvalidIndex + const ErrInvalidProgramCounter + const ErrInvalidPubKeyCount + const ErrInvalidSigHashType + const ErrInvalidSignatureCount + const ErrInvalidStackOperation + const ErrMalformedPush + const ErrMinimalData + const ErrMinimalIf + const ErrNegativeLockTime + const ErrNotMultisigScript + const ErrNotPushOnly + const ErrNullFail + const ErrNumEqualVerify + const ErrNumberTooBig + const ErrPubKeyFormat + const ErrReservedOpcode + const ErrScriptTooBig + const ErrScriptUnfinished + const ErrSigHighS + const ErrSigLength + const ErrStackOverflow + const ErrTooManyOperations + const ErrTooManyRequiredSigs + const ErrUnbalancedConditional + const ErrUnsatisfiedLockTime + const ErrUnsupportedAddress + const ErrVerify + func (e ErrorCode) String() string + type KeyClosure func(util.Address) (*secp256k1.SchnorrKeyPair, error) + func (kc KeyClosure) GetKey(address util.Address) (*secp256k1.SchnorrKeyPair, error) + type KeyDB interface + GetKey func(util.Address) (*secp256k1.SchnorrKeyPair, 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) AddLockTimeNumber(lockTime uint64) *ScriptBuilder + func (b *ScriptBuilder) AddOp(opcode byte) *ScriptBuilder + func (b *ScriptBuilder) AddOps(opcodes []byte) *ScriptBuilder + func (b *ScriptBuilder) AddSequenceNumber(sequence uint64) *ScriptBuilder + func (b *ScriptBuilder) Reset() *ScriptBuilder + func (b *ScriptBuilder) Script() ([]byte, error) + type ScriptClass byte + const NonStandardTy + const PubKeyECDSATy + const PubKeyTy + const ScriptHashTy + func ExtractScriptPubKeyAddress(scriptPubKey *externalapi.ScriptPublicKey, dagParams *dagconfig.Params) (ScriptClass, util.Address, error) + func GetScriptClass(script []byte) ScriptClass + func (t ScriptClass) String() string + type ScriptClosure func(util.Address) ([]byte, error) + func (sc ScriptClosure) GetScript(address util.Address) ([]byte, error) + type ScriptDB interface + GetScript func(util.Address) ([]byte, error) + type ScriptFlags uint32 + const ScriptNoFlags + type ScriptInfo struct + ExpectedInputs int + NumInputs int + ScriptPubKeyClass ScriptClass + SigOps int + func CalcScriptInfo(sigScript, scriptPubKey []byte, isP2SH bool) (*ScriptInfo, error) + type SigCache struct + func NewSigCache(maxEntries uint) *SigCache + func (s *SigCache) Add(sigHash secp256k1.Hash, sig *secp256k1.SchnorrSignature, ...) + func (s *SigCache) Exists(sigHash secp256k1.Hash, sig *secp256k1.SchnorrSignature, ...) bool + type SigCacheECDSA struct + func NewSigCacheECDSA(maxEntries uint) *SigCacheECDSA + func (s *SigCacheECDSA) Add(sigHash secp256k1.Hash, sig *secp256k1.ECDSASignature, ...) + func (s *SigCacheECDSA) Exists(sigHash secp256k1.Hash, sig *secp256k1.ECDSASignature, ...) bool