transaction

package
v0.0.0-...-31eb2eb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 19, 2022 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HashPubKey

func HashPubKey(pubKey []byte) []byte

Types

type TXInput

type TXInput struct {
	TxId      []byte
	Vout      int
	ScriptSig string
}

func (*TXInput) CanUnlockOutputWith

func (in *TXInput) CanUnlockOutputWith(unlockingData string) bool

type TXOutput

type TXOutput struct {
	Value        int
	ScriptPubKey string
}

func (*TXOutput) CanBeUnlockedWith

func (out *TXOutput) CanBeUnlockedWith(unlockingData string) bool

type Transaction

type Transaction struct {
	Id   []byte
	Vin  []TXInput
	Vout []TXOutput
}

func NewCoinbaseTX

func NewCoinbaseTX(to, data string) *Transaction

func (*Transaction) IsCoinbaseTx

func (tx *Transaction) IsCoinbaseTx() bool

func (*Transaction) SetId

func (tx *Transaction) SetId()

type Wallet

type Wallet struct {
	PrivateKey ecdsa.PrivateKey
	PublicKey  []byte
}

func NewWallet

func NewWallet() *Wallet

func (Wallet) GetAddress

func (w Wallet) GetAddress() []byte

* get public key hash * get checksum from version, public key hash * generate adress by encoding checksum, public key hash, version

type Wallets

type Wallets struct {
	Wallets map[string]*Wallet
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL