Versions in this module Expand all Collapse all v0 v0.0.1 Apr 7, 2020 v0.0.0 Apr 5, 2020 Changes in this version + const SighashAll + const SighashAllForkID + const SighashAnyoneCanPay + const SighashForkID + const SighashNone + const SighashSingle + func Base58Encode(input []byte) string + func GetSighashForInput(transaction *BitcoinTransaction, sighashType uint32, inputNumber uint32) string + func GetSighashForInputValidation(transaction *BitcoinTransaction, sighashType uint32, inputNumber uint32, ...) string + type BitcoinTransaction struct + Bytes []byte + Inputs []*Input + Locktime uint32 + Outputs []*Output + Version uint32 + Witness bool + func New() *BitcoinTransaction + func NewFromBytes(bytes []byte) *BitcoinTransaction + func NewFromBytesWithUsed(bytes []byte) (*BitcoinTransaction, int) + func NewFromString(str string) (*BitcoinTransaction, error) + func (bt *BitcoinTransaction) AddInput(input *Input) + func (bt *BitcoinTransaction) AddOutput(output *Output) + func (bt *BitcoinTransaction) AddUTXO(txID string, vout uint32, script string, satoshis uint64) error + func (bt *BitcoinTransaction) ApplySignatures(signingPayload *SigningPayload, sigType uint32) error + func (bt *BitcoinTransaction) ApplySignaturesWithoutP2PKHCheck(signingPayload *SigningPayload, sigType uint32) error + func (bt *BitcoinTransaction) GetInputs() []*Input + func (bt *BitcoinTransaction) GetOutputs() []*Output + func (bt *BitcoinTransaction) GetSighashPayload(sigType uint32) (*SigningPayload, error) + func (bt *BitcoinTransaction) GetTxID() string + func (bt *BitcoinTransaction) HasWitnessData() bool + func (bt *BitcoinTransaction) Hex() []byte + func (bt *BitcoinTransaction) HexWithClearedInputs(index int, scriptPubKey []byte) []byte + func (bt *BitcoinTransaction) InputCount() int + func (bt *BitcoinTransaction) IsCoinbase() bool + func (bt *BitcoinTransaction) OutputCount() int + func (bt *BitcoinTransaction) PayTo(address string, amount uint64) error + func (bt *BitcoinTransaction) Sign(privateKey *btcec.PrivateKey, sigType uint32) error + func (bt *BitcoinTransaction) SignWithoutP2PKHCheck(privateKey *btcec.PrivateKey, sigType uint32) error + type Input struct + PreviousTxHash [32]byte + PreviousTxOutIndex uint32 + PreviousTxSatoshis uint64 + PreviousTxScript *Script + SequenceNumber uint32 + SigScript *Script + func NewInput() *Input + func NewInputFromBytes(bytes []byte) (*Input, int) + func (i *Input) Hex(clear bool) []byte + func (i *Input) String() string + type Output struct + Script []byte + Value uint64 + func NewOutput() *Output + func NewOutputForHashPuzzle(secret string, publicKeyHash string, satoshis uint64) (*Output, error) + func NewOutputForPublicKeyHash(publicKeyHash string, satoshis uint64) (*Output, error) + func NewOutputFromBytes(bytes []byte) (*Output, int) + func NewOutputOpReturn(data []byte) (*Output, error) + func NewOutputOpReturnPush(data [][]byte) (*Output, error) + func (o *Output) GetOutputScript() []byte + func (o *Output) Hex() []byte + func (o *Output) String() string + type RedeemScript struct + PublicKeys [][]byte + Signatures [][]byte + SignaturesRequired int + func NewRedeemScript(signaturesRequired int) (*RedeemScript, error) + func NewRedeemScriptFromElectrum(script string) (*RedeemScript, error) + func (rs *RedeemScript) AddPublicKey(pkey string, derivationPath []uint32) error + func (rs *RedeemScript) GetAddress() string + func (rs *RedeemScript) GetRedeemScript() []byte + func (rs *RedeemScript) GetRedeemScriptHash() []byte + type Script []byte + func NewScript() *Script + func NewScriptFromBytes(b []byte) *Script + func NewScriptFromString(s string) *Script + func (s *Script) AppendOpCode(o uint8) + func (s *Script) AppendPushDataArrayToScript(d [][]byte) error + func (s *Script) AppendPushDataStringToScript(str string) error + func (s *Script) AppendPushDataStringsToScript(strs []string) error + func (s *Script) AppendPushDataToScript(d []byte) error + func (s *Script) GetPublicKeyHash() ([]byte, error) + func (s *Script) IsMultisigOut() bool + func (s *Script) IsPublicKeyHashOut() bool + func (s *Script) IsPublicKeyOut() bool + func (s *Script) IsScriptHashOut() bool + func (s *Script) ToString() string + type SigningItem struct + PublicKey string + PublicKeyHash string + SigHash string + Signature string + type SigningPayload []*SigningItem + func NewSigningPayload() *SigningPayload + func NewSigningPayloadFromTx(bt *BitcoinTransaction, sigType uint32) (*SigningPayload, error) + func (sp *SigningPayload) AddItem(publicKeyHash string, sigHash string)