Documentation ¶
Index ¶
- Constants
- func DecodeInt64(opcode byte, script []byte) (int64, []byte, error)
- func DecodeMultiSigScript(script []byte) ([][]byte, error)
- func DecodeTimelockScript(timelockScript []byte) (int64, []byte, error)
- func DecodeTransferScript(script []byte, params *chaincfg.Params) (btcutil.Address, error)
- func EncodeMultiSigScript(network types.Network, pubKeys [][]byte, nRequired int) ([]byte, error)
- func EncodeTimeLockScript(lockTime int64, redeemScript []byte) ([]byte, error)
- func EncodeTransferScript(address btcutil.Address) ([]byte, error)
- func OpReturnScript(data []byte) ([]byte, error)
- type AfterNode
- type CompositeNode
- type LeafArgs
- type MultiNode
- type Node
- type NodeType
- type OlderNode
- type PkNode
- type PkhNode
- type ThreshNode
- type TrArgs
Constants ¶
View Source
const (
ScriptVersion = 0
)
Variables ¶
This section is empty.
Functions ¶
func DecodeInt64 ¶
DecodeInt64 decodes a Bitcoin script integer from the provided script. It handles OP_0, OP_1NEGATE, OP_1-OP_16, and minimally encoded integers.
func DecodeMultiSigScript ¶
func DecodeTransferScript ¶
func EncodeMultiSigScript ¶
func EncodeTimeLockScript ¶
func OpReturnScript ¶
Types ¶
type AfterNode ¶
type AfterNode struct {
Time int64
}
AfterNod represents a locktime argument if Time is less than 500000000, it is a block height otherwise, it is a unix timestamp
func (*AfterNode) FromScript ¶
func (*AfterNode) ToScript ¶
func (a *AfterNode) ToScript(builder *txscript.ScriptBuilder)
type CompositeNode ¶
type CompositeNode struct {
Children []Node
}
CompositeNode represents a logical combination ( and, or ) of child nodes
func (*CompositeNode) ToScript ¶
func (a *CompositeNode) ToScript(builder *txscript.ScriptBuilder)
func (*CompositeNode) Validate ¶
func (a *CompositeNode) Validate() error
type LeafArgs ¶
type LeafArgs struct { Script string // Script for this leaf node Version txscript.TapscriptLeafVersion // Leaf version (default: 0xc0 for Taproot v1) }
LeafArgs represents a Taproot leaf node
func (*LeafArgs) FromScript ¶
func (*LeafArgs) ToScript ¶
func (a *LeafArgs) ToScript(builder *txscript.ScriptBuilder)
type MultiNode ¶
MultiNode represents a multisig argument
func (*MultiNode) ToScript ¶
func (a *MultiNode) ToScript(builder *txscript.ScriptBuilder)
type Node ¶
type Node interface { Validate() error ToScript(*txscript.ScriptBuilder) }
type NodeType ¶
type NodeType string
const ( Pk NodeType = "pk" Pkh NodeType = "pkh" Older NodeType = "older" After NodeType = "after" Thresh NodeType = "thresh" And NodeType = "and_b" Or NodeType = "or_b" Multi NodeType = "multi" CheckSig NodeType = "checksig" CheckSigHash NodeType = "checksighash" Tr NodeType = "taproot" Leaf NodeType = "leaf" )
type OlderNode ¶
type OlderNode struct {
Time int64
}
OlderNode represents a relative locktime argument
func (*OlderNode) FromScript ¶
func (*OlderNode) ToScript ¶
func (a *OlderNode) ToScript(builder *txscript.ScriptBuilder)
type PkNode ¶
type PkNode struct {
PubKey []byte
}
PkNode represents a public key argument
func (*PkNode) FromScript ¶
func (*PkNode) ToScript ¶
func (a *PkNode) ToScript(builder *txscript.ScriptBuilder)
type PkhNode ¶
type PkhNode struct {
Hash []byte
}
PkhNode represents a public key hash argument
func (*PkhNode) FromScript ¶
func (*PkhNode) ToScript ¶
func (a *PkhNode) ToScript(builder *txscript.ScriptBuilder)
type ThreshNode ¶
ThreshNode represents a threshold condition
func (*ThreshNode) ToScript ¶
func (a *ThreshNode) ToScript(builder *txscript.ScriptBuilder)
func (*ThreshNode) Validate ¶
func (a *ThreshNode) Validate() error
Click to show internal directories.
Click to hide internal directories.