Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Input ¶
Input represents a transaction input, each input references the output of another transaction.
type OutPoint ¶
type OutPoint struct { // Transaction ID of the previous output TxID []byte // Index of the referenced output in the previous transaction Index int }
OutPoint represents the previous output being spent.
type Output ¶
type Output struct { // Hashed public key of the coins' owner PubKeyHash []byte // Represented in satoshis Value int }
Output represents a transaction output, they are indivisible and the place where coins are actually stored.
func (Output) IsLockedWithKey ¶
IsLockedWithKey checks if the output can be used by the owner of the public key.
type Tx ¶
type Tx struct { ID []byte Inputs []Input Outputs []Output // In Bitcoin, a transaction's fee is equal to the difference between the amount of coins // locked in the inputs' referenced outputs and the ones in the new outputs. // // To make things simpler we just include it as a field, the input surplus will still exist. Fee int }
Tx represents a transaction.
Every new transaction must have at least one input and output, except coinbase.
func NewCoinbase ¶
NewCoinbase returns a new coinbase transaction.
func (*Tx) IsCoinbase ¶
IsCoinbase checks whether the transaction is coinbase
func (*Tx) TrimmedCopy ¶
TrimmedCopy creates a trimmed copy of Transaction to be used in signing.
https://en.bitcoin.it/w/images/en/7/70/Bitcoin_OpCheckSig_InDetail.png
Directories ¶
Path | Synopsis |
---|---|
Package utxo implements operations related to unspent transaction outputs (UTXO), which allow us to check for the balance of every wallet of the network.
|
Package utxo implements operations related to unspent transaction outputs (UTXO), which allow us to check for the balance of every wallet of the network. |