Cut down version of: github.com/bitgoin/tx See that repo for further info
This has the following changes
- P2SH functions have been removed as they are not used by this program
- P2PK now call a better base58decoder
- the bigoin/address/DecodeAddress is broken and just drops the version byte
- this call was replace by function correctly decodes Bitcoin/Litecoin address versions
- now unsupported address will cause error rather than the original generation of nonredeemable TXO
- P2PK will work with scriptPubKey.type of "scripthash" and "pubkeyhash"
- func DefaultP2PKScript(btcadr string) (byte, error)
- func FillP2PKsign(result *Tx, used *UTXO) error
- func NewP2PKunsign(fee uint64, coins UTXOs, locktime uint32, sends ...*Send) (*Tx, *UTXO, error)
- type Send
- type Tx
- type TxIn
- type TxOut
- type UTXO
- type UTXOs
const ( //Unit is unit to convert BTC to satoshi Unit = 100000000 )
This section is empty.
func DefaultP2PKScript ¶
DefaultP2PKScript returns default p2pk script.
func FillP2PKsign ¶
FillP2PKsign embeds sign script to result Tx.
Send is information about addrress and amount to send.
Tx describes a bitcoin transaction,
TxIn is the info of input transaction.
TxOut is the info of output transaction.
UTXO represents an available transaction.