Documentation
¶
Index ¶
- Variables
- func BuildOptionalOpReturnScript(proof []byte) (*script.Script, error)
- func BuildSignScript(signs *[][]byte) (*script.Script, error)
- func FakeSign(m uint32) (*script.Script, error)
- func GetAddressFromPubKey(pubKey *ec.PublicKey, isMain bool) (*script.Address, error)
- func GetAddressFromPublicKey(pubKey *ec.PublicKey, isMain bool) (*script.Address, error)
- func Lock(pubKeys []*ec.PublicKey, m int) (*script.Script, error)
- type FeePoolInfo
- type MultiSig
- type UTXO
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func BuildOptionalOpReturnScript ¶
BuildOptionalOpReturnScript 为费用池付款证明构造可选 OP_RETURN 锁定脚本。 设计说明: - proof 按原始字节处理,库层不猜测文本编码,避免二进制 proof 被误改; - 空 proof 直接返回 nil,调用方据此维持旧交易结构,不生成额外输出; - 使用 OP_FALSE OP_RETURN,保持数据输出的标准表达。
func GetAddressFromPubKey ¶
GetAddressFromPubKey is kept for backward compatibility.
func GetAddressFromPublicKey ¶
Types ¶
type FeePoolInfo ¶
func GetInfoFromTxOne ¶
func GetInfoFromTxOne( tx *transaction.Transaction, ) (info *FeePoolInfo, err error)
type MultiSig ¶
type MultiSig struct {
PrivateKeys []*ec.PrivateKey
PublicKeys []*ec.PublicKey
M int // Required signatures
N int // Total number of public keys
SigHashFlag *sighash.Flag
}
MultiSig represents an M-of-N multisig template
func Unlock ¶
func Unlock(privKeys []*ec.PrivateKey, pubKeys []*ec.PublicKey, m int, sigHashFlag *sighash.Flag) (*MultiSig, error)
Unlock creates a new MultiSig unlocking instance
func (*MultiSig) EstimateLength ¶
func (ms *MultiSig) EstimateLength(_ *transaction.Transaction, _ uint32) uint32
EstimateLength estimates the length of the unlocking script
func (*MultiSig) Sign ¶
func (ms *MultiSig) Sign(tx *transaction.Transaction, inputIndex uint32) (*script.Script, error)
Sign creates an unlocking script for the multisig
func (*MultiSig) SignOne ¶
func (ms *MultiSig) SignOne(tx *transaction.Transaction, inputIndex uint32, privateKey *ec.PrivateKey) (*[]byte, error)
分别签名
Click to show internal directories.
Click to hide internal directories.