Documentation
¶
Index ¶
- Constants
- func BuildDualFeePoolSpendTX(A_Tx *tx.Transaction, totalAmount uint64, serverAmount uint64, ...) (*tx.Transaction, *[]byte, uint64, error)
- func ClientDualFeePoolSpendTXUpdateSign(tx *tx.Transaction, clientPrivateKey *ec.PrivateKey, ...) (*[]byte, error)
- func DualPoolSpentScript(serverPublicKey *ec.PublicKey, clientPublicKey *ec.PublicKey) (*script.Script, error)
- func LoadTx(txHex string, locktime *uint32, sequenceNumber uint32, serverAmount uint64, ...) (*transaction.Transaction, error)
- func MergeDualPoolSigForSpendTx(txHex string, serverSignByte *[]byte, clientSignByte *[]byte) (*tx.Transaction, error)
- func ServerDualFeePoolSpendTXUpdateSign(tx *tx.Transaction, serverPrivateKey *ec.PrivateKey, ...) (*[]byte, error)
- func SpendTXDualFeePoolClientSign(B_Tx *tx.Transaction, targetAmount uint64, clientPrivKey *ec.PrivateKey, ...) (*[]byte, error)
- func SpendTXServerSign(transactionObject *tx.Transaction, targetAmount uint64, ...) (*[]byte, error)
- func SubBuildDualFeePoolSpendTX(prevTxId string, totalAmount uint64, serverAmount uint64, endHeight uint32, ...) (*tx.Transaction, uint64, error)
- type BuildStep1Response
Constants ¶
View Source
const FINAL_LOCKTIME uint32 = 0xffffffff
最终 locaktime
Variables ¶
This section is empty.
Functions ¶
func BuildDualFeePoolSpendTX ¶
func BuildDualFeePoolSpendTX( A_Tx *tx.Transaction, totalAmount uint64, serverAmount uint64, endHeight uint32, clientPrivateKey *ec.PrivateKey, serverPublicKey *ec.PublicKey, isMain bool, feeRate float64, ) (*tx.Transaction, *[]byte, uint64, error)
构建双端费用池花费交易 发起者 utxos, 服务器提供金额, 发起者私钥, 服务器地址 fee 是 server 提供,我只负责精确的金额
func ClientDualFeePoolSpendTXUpdateSign ¶
func ClientDualFeePoolSpendTXUpdateSign( tx *tx.Transaction, clientPrivateKey *ec.PrivateKey, serverPublicKey *ec.PublicKey, ) (*[]byte, error)
双端费用池,分配资金, 客户端签名 client -> server 修改金额和版本号
func DualPoolSpentScript ¶
func DualPoolSpentScript( serverPublicKey *ec.PublicKey, clientPublicKey *ec.PublicKey, ) (*script.Script, error)
构建双端费用池的花费脚本
func LoadTx ¶
func LoadTx( txHex string, locktime *uint32, sequenceNumber uint32, serverAmount uint64, serverPublicKey *ec.PublicKey, clientPublicKey *ec.PublicKey, targetAmount uint64, ) (*transaction.Transaction, error)
合成两个签名
func MergeDualPoolSigForSpendTx ¶
func MergeDualPoolSigForSpendTx( txHex string, serverSignByte *[]byte, clientSignByte *[]byte, ) (*tx.Transaction, error)
从创建花费脚本,客户端签名
func ServerDualFeePoolSpendTXUpdateSign ¶
func ServerDualFeePoolSpendTXUpdateSign( tx *tx.Transaction, serverPrivateKey *ec.PrivateKey, clientPublicKey *ec.PublicKey, ) (*[]byte, error)
双端费用池,分配资金, server 签名 client -> server 修改金额和版本号
func SpendTXDualFeePoolClientSign ¶
func SpendTXDualFeePoolClientSign(B_Tx *tx.Transaction, targetAmount uint64, clientPrivKey *ec.PrivateKey, serverPublicKey *ec.PublicKey) (*[]byte, error)
func SpendTXServerSign ¶
func SpendTXServerSign( transactionObject *tx.Transaction, targetAmount uint64, serverPrivateKey *ec.PrivateKey, clientPublicKey *ec.PublicKey, ) (*[]byte, error)
服务器 回签
Types ¶
type BuildStep1Response ¶
type BuildStep1Response struct {
Tx *tx.Transaction
Amount uint64
Index int
}
func BuildDualFeePoolBaseTx ¶
func BuildDualFeePoolBaseTx( clientUtxo *[]libs.UTXO, clientPrivateKey *ec.PrivateKey, serverPublicKey *ec.PublicKey, isMain bool, feeRate float64, ) (*BuildStep1Response, error)
p2pkh to 2t2多签, 不找零
Click to show internal directories.
Click to hide internal directories.