Documentation
¶
Index ¶
- Constants
- type Address
- type AddressType
- type BlindInputData
- type BlindOutputData
- type BlindTxOption
- type Block
- type BlockHeader
- type ByteData
- type ConfidentialAddress
- type ConfidentialTx
- type ConfidentialTxIn
- type ConfidentialTxOut
- type Descriptor
- type DescriptorData
- type DescriptorKeyData
- type ElementsUtxoData
- type ExtPrivkey
- type ExtPubkey
- type ExtkeyData
- type ExtkeyType
- type FundRawTxOption
- type HashType
- type HdWallet
- type InputConfidentialTxIn
- type InputConfidentialTxOut
- type InputPeginData
- type InputPegoutData
- type InputTxIn
- type InputTxOut
- type IssuanceBlindingKey
- type IssuanceData
- type NetworkType
- type OutPoint
- type PeginTxOption
- type PeginUtxoData
- type PegoutTxOption
- type Privkey
- type Pubkey
- type Script
- type ScriptWitness
- type SigHashType
- type Transaction
- type TransactionData
- type TxIn
- type TxOut
- type UtxoData
Constants ¶
const ( CommitmentDataSize = 33 CommitmentHexDataSize = 66 EmptyBlinder = "0000000000000000000000000000000000000000000000000000000000000000" )
const ( SequenceLockTimeFinal uint32 = 0xffffffff SequenceLockTimeEnableMax uint32 = 0xfffffffe )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Address ¶
type Address struct { Address string Network NetworkType Type AddressType }
Address ...
type AddressType ¶
type AddressType int
const ( // AddressType UnknownAddress AddressType = iota P2pkhAddress P2shAddress P2wpkhAddress P2wshAddress P2shP2wpkhAddress P2shP2wshAddress TaprootAddress )
func NewAddressTypeByHashType ¶
func NewAddressTypeByHashType(hashType int) AddressType
NewAddressTypeByHashType ...
func NewAddressTypeByString ¶
func NewAddressTypeByString(addressType string) AddressType
NewAddressTypeByString ...
type BlindInputData ¶
type BlindInputData struct { OutPoint OutPoint // OutPoint Asset string // Asset AssetBlindFactor string // Asset BlindFactor Amount int64 // satoshi value ValueBlindFactor string // Value BlindFactor IssuanceKey *IssuanceBlindingKey }
BlindInputData ...
type BlindOutputData ¶
type BlindOutputData struct { Index int // txout index (-1: auto) ConfidentialAddress string // confidential or not address ConfidentialKey string // (optional) confidential key }
BlindOutputData ...
type BlindTxOption ¶
type BlindTxOption struct { MinimumRangeValue int64 // blind minimum range value Exponent int64 // blind exponent MinimumBits int64 // blind minimum bits AppendDummyOutput bool // add dummy output if txout is low }
BlindTxOption BlindRawTransaction option data struct.
type BlockHeader ¶
type BlockHeader struct { Version uint32 // Version PrevBlockHash string // previous block hash MerkleRoot string // merkleroot Time uint32 // block time Bits uint32 // bit flag Nonce uint32 // nonce }
BlockHeader block header information.
type ByteData ¶
type ByteData struct {
// contains filtered or unexported fields
}
ByteData This struct holds a byte array.
func NewByteData ¶
NewByteData This function create a bytedata from a byte array.
func NewByteDataFromHex ¶
NewByteDataFromHex This function create a bytedata from a hex string.
func NewByteDataFromHexIgnoreError ¶
NewByteDataFromHex This function create a bytedata from a hex string. On error, it returns nil.
type ConfidentialAddress ¶
type ConfidentialAddress struct { ConfidentialAddress string Address string Network NetworkType Type AddressType ConfidentialKey *Pubkey }
ConfidentialAddress ...
type ConfidentialTxIn ¶
type ConfidentialTxIn struct { OutPoint OutPoint Sequence uint32 ScriptSig string Issuance IssuanceData WitnessStack ScriptWitness PeginWitness ScriptWitness IssuanceAmountRangeproof string InflationKeysRangeproof string }
ConfidentialTxIn confidential transaction input.
type ConfidentialTxOut ¶
type ConfidentialTxOut struct { Amount int64 // satoshi amount (unblind value) Asset string // asset (or commitment asset) LockingScript string // locking script Address string // address or confidential address. (if locking script is usual hashtype.) CommitmentValue string // commitment value CommitmentNonce string // commitment nonce Surjectionproof string // surjectionprooof of asset Rangeproof string // rangeproof of value }
ConfidentialTxOut confidential transaction output.
type Descriptor ¶
type Descriptor struct { // Output Descriptor OutputDescriptor string // Network Type Network *NetworkType }
Descriptor This struct use for the output descriptor.
type DescriptorData ¶
type DescriptorData struct { // depth (0 - ) Depth uint32 // script type. (CfdDescriptorScriptType) ScriptType int // locking script. LockingScript string // address string. (for ScriptType not KCfdDescriptorScriptRaw) Address string // hash type. (CfdHashType) HashType int // redeem script. (for ScriptType KCfdDescriptorScriptSh or KCfdDescriptorScriptWsh) RedeemScript string // key type. (see CfdDescriptorKeyData.KeyType) KeyType int // pubkey Pubkey string // extend pubkey ExtPubkey string // extend privkey ExtPrivkey string // schnorr pubkey SchnorrPubkey string // has multisig IsMultisig bool // number of multisig require signatures ReqSigNum uint32 // Taproot ScriptTree string TreeString string }
*
- Descriptor data struct.
type DescriptorKeyData ¶
type DescriptorKeyData struct { // key type. (CfdDescriptorKeyType) // - KCfdDescriptorKeyNull // - KCfdDescriptorKeyPublic // - KCfdDescriptorKeyBip32 // - KCfdDescriptorKeyBip32Priv // - KCfdDescriptorKeySchnorr KeyType int // pubkey Pubkey string // extend pubkey ExtPubkey string // extend privkey ExtPrivkey string // schnorr pubkey SchnorrPubkey string }
*
- Descriptor key data struct.
type ElementsUtxoData ¶
type ElementsUtxoData struct { OutPoint OutPoint // OutPoint Asset string // Asset AssetBlindFactor string // Asset BlindFactor Amount int64 // satoshi value ValueBlindFactor string // Value BlindFactor AmountCommitment string // Amount commitment Descriptor string // output descriptor ScriptSigTemplate string // scriptsig template hex (require script hash estimate fee) IssuanceKey *IssuanceBlindingKey // issuance key IsIssuance bool // is issuance output IsBlindIssuance bool // is blind issuance output PeginData *PeginUtxoData // pegin data }
func (ElementsUtxoData) ConvertToCfdUtxo ¶
func (u ElementsUtxoData) ConvertToCfdUtxo() cfd.CfdUtxo
func (ElementsUtxoData) HasBlindUtxo ¶
func (u ElementsUtxoData) HasBlindUtxo() bool
type ExtkeyData ¶
type ExtkeyData struct { // version Version string // parent fingerprint Fingerprint string // chain code ChainCode string // depth Depth uint32 // child number ChildNumber uint32 // key type KeyType ExtkeyType // network Network NetworkType }
type ExtkeyType ¶ added in v0.3.7
type ExtkeyType int
ExtkeyType ...
const ( // ExtkeyType UnknownExtkeyType ExtkeyType = iota ExtPrivkeyType ExtPubkeyType )
func NewExtkeyType ¶ added in v0.3.7
func NewExtkeyType(cfdExtkeyType int) ExtkeyType
NewExtkeyType ...
func NewExtkeyTypeByString ¶ added in v0.3.7
func NewExtkeyTypeByString(extkeyType string) ExtkeyType
NewExtkeyTypeByString ...
type FundRawTxOption ¶
type FundRawTxOption struct { // fee asset FeeAsset string // use blind tx IsBlindTx bool // effective feerate EffectiveFeeRate float64 // longterm feerate LongTermFeeRate float64 // dust feerate DustFeeRate float64 // knapsack min change value. knapsack logic's threshold. Recommended value is 1. KnapsackMinChange int64 // blind exponent. default is 0. Exponent int64 // blind minimum bits. default is -1 (cfd-go auto). MinimumBits int64 }
*
- FundRawTransaction option data struct.
func NewCfdFundRawTxOption ¶
func NewCfdFundRawTxOption(networkType NetworkType) FundRawTxOption
type InputConfidentialTxIn ¶
type InputConfidentialTxIn struct { OutPoint OutPoint Sequence uint32 PeginInput *InputPeginData }
InputConfidentialTxIn ...
type InputConfidentialTxOut ¶
type InputConfidentialTxOut struct { Amount int64 // satoshi amount (unblind value) Asset string // asset (or commitment asset) LockingScript string // locking script Address string // address or confidential address. (if locking script is usual hashtype.) Nonce string // direct nonce PegoutInput *InputPegoutData IsDestroy bool IsFee bool }
InputConfidentialTxOut ...
type InputPeginData ¶
type InputPeginData struct { BitcoinTransaction string BitcoinGenesisBlockHash string BitcoinAssetId string ClaimScript string TxOutProof string }
InputPeginData ...
type InputPegoutData ¶
type InputPegoutData struct { BitcoinGenesisBlockHash string OnlineKey string BitcoinOutputDescriptor string Bip32Counter uint32 Whitelist string }
InputPegoutData ...
type InputTxOut ¶
type IssuanceBlindingKey ¶
type IssuanceBlindingKey struct { AssetBlindingKey string // (option) Asset blinding key TokenBlindingKey string // (option) Token blinding key }
IssuanceBlindingKey ...
type IssuanceData ¶
type IssuanceData struct { Entropy string Nonce string AssetAmount int64 AssetValue string TokenAmount int64 TokenValue string }
IssuanceData confidential transaction issuance input.
type NetworkType ¶
type NetworkType int
const ( // NetworkType Unknown NetworkType = iota Mainnet Testnet Regtest LiquidV1 ElementsRegtest )
func NewNetworkTypeByString ¶
func NewNetworkTypeByString(networkType string) NetworkType
NewNetworkTypeByString ...
func (NetworkType) ToBitcoinType ¶
func (n NetworkType) ToBitcoinType() NetworkType
ToBitcoinType ...
func (NetworkType) ToBitcoinTypePointer ¶
func (n NetworkType) ToBitcoinTypePointer() *NetworkType
ToBitcoinTypePointer ...
type OutPoint ¶
OutPoint : utxo outpoint struct.
type PeginTxOption ¶
type PeginTxOption struct { // fee asset FeeAsset string // use blind tx IsBlindTx bool // effective feerate EffectiveFeeRate float64 // longterm feerate LongTermFeeRate float64 // dust feerate DustFeeRate float64 // knapsack min change value. knapsack logic's threshold. Recommended value is 1. KnapsackMinChange int64 // blind minimum range value MinimumRangeValue int64 // blind exponent. default is 0. Exponent int64 // blind minimum bits. default is -1 (cfd-go auto). MinimumBits int64 }
PeginTxOption ...
type PeginUtxoData ¶
type PegoutTxOption ¶
type PegoutTxOption struct { // fee asset FeeAsset string // use blind tx IsBlindTx bool // effective feerate EffectiveFeeRate float64 // longterm feerate LongTermFeeRate float64 // dust feerate DustFeeRate float64 // knapsack min change value. knapsack logic's threshold. Recommended value is 1. KnapsackMinChange int64 // blind minimum range value MinimumRangeValue int64 // blind exponent. default is 0. Exponent int64 // blind minimum bits. default is -1 (cfd-go auto). MinimumBits int64 }
PegoutTxOption ...
type Privkey ¶
type Privkey struct { Hex string Wif string Network NetworkType IsCompressedPubkey bool }
Privkey ...
type Script ¶
type Script struct {
// contains filtered or unexported fields
}
Script This struct holds a script.
func NewScriptFromAsm ¶
NewScriptFromAsm This function create a script from an asm string.
func NewScriptFromAsmList ¶
NewScriptFromAsmList This function create a script from the asm string list.
func NewScriptFromHex ¶
NewScriptFromHex This function create a script from a hex string.
func NewScriptFromHexIgnoreError ¶
NewScriptFromHex This function create a script from a hex string. On error, it returns nil.
type ScriptWitness ¶
type ScriptWitness struct { // witness stack by hex. Stack []string }
ScriptWitness : witness stack.
type SigHashType ¶
SigHashType This struct use for the sighashtype utility function.
var SigHashTypeAll SigHashType = *NewSigHashType(1)
var SigHashTypeDefault SigHashType = *NewSigHashType(0)
var SigHashTypeNone SigHashType = *NewSigHashType(2)
var SigHashTypeSingle SigHashType = *NewSigHashType(3)
func NewSigHashType ¶
func NewSigHashType(sighashType int) *SigHashType
NewSigHashType This function return a SigHashType.
func (*SigHashType) GetValue ¶
func (obj *SigHashType) GetValue() int
ToHex This function return a sighashtype byte value.
type TransactionData ¶
type TransactionData struct { // txid Txid string // witness txid Wtxid string // witness hash WitHash string // size Size uint32 // virtual size Vsize uint32 // weight Weight uint32 // version Version uint32 // locktime LockTime uint32 }
*
- TransactionData data struct.
type TxIn ¶
type TxIn struct { // utxo outpoint. OutPoint OutPoint // sequence number. Sequence uint32 // script sig. ScriptSig string // witness stack. WitnessStack ScriptWitness }
TxIn : transaction input.
type TxOut ¶
type TxOut struct { // satoshi amount. Amount int64 // locking script. LockingScript string // address (if locking script is usual hashtype.) Address string }
TxOut : transaction output.
type UtxoData ¶
type UtxoData struct { // utxo txid Txid string // utxo vout Vout uint32 // amount Amount int64 // asset Asset string // output descriptor Descriptor string // is issuance output IsIssuance bool // is blind issuance output IsBlindIssuance bool // is peg-in output IsPegin bool // peg-in bitcoin tx size (require when IsPegin is true) PeginBtcTxSize uint32 // fedpegscript hex (require when IsPegin is true) FedpegScript string // scriptsig template hex (require script hash estimate fee) ScriptSigTemplate string // amount commitment hex AmountCommitment string }