Files
golang-blockchain/blockchain/tx.go
T
2022-12-12 09:19:55 -08:00

21 lines
290 B
Go

package blockchain
type TxOutput struct {
Value int
PubKey string
}
type TxInput struct {
ID []byte
Out int
Sig string
}
func (in *TxInput) CanUnlock(data string) bool {
return in.Sig == data
}
func (out *TxOutput) CanBeUnlocked(data string) bool {
return out.PubKey == data
}