key

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Key

type Key struct {
	// contains filtered or unexported fields
}

Key represents the private/public spend/view key pairs

func NewKeyPair

func NewKeyPair(seed []byte) *Key

NewKeyPair returns a pair of public and private keys

func (*Key) DidReceiveTx

func (k *Key) DidReceiveTx(R ristretto.Point, stealth StealthAddress, index uint32) (*ristretto.Scalar, bool)

DidReceiveTx takes P the stealthAddress/ one time pubkey and the tx pubkey R checks whether the tx was intended for the key assosciated

func (Key) PrivateSpend

func (k Key) PrivateSpend() (*PrivateSpend, error)

PrivateSpend returns the private spend key

func (Key) PrivateView

func (k Key) PrivateView() (*PrivateView, error)

PrivateView returns the private view key Used when decrypting amounts and masks

func (Key) PublicKey

func (k Key) PublicKey() *PublicKey

PublicKey returns the corresponding public key pair

type PrivateKey

type PrivateKey struct {
	// contains filtered or unexported fields
}

PrivateKey represents the pair of private spend and view keys

type PrivateSpend

type PrivateSpend ristretto.Scalar

PrivateSpend represents a private spend key

func (PrivateSpend) Bytes

func (pr PrivateSpend) Bytes() []byte

func (PrivateSpend) PrivateView

func (pr PrivateSpend) PrivateView() *PrivateView

PrivateView converts a private spend key to a private view key

func (PrivateSpend) PublicSpend

func (pr PrivateSpend) PublicSpend() *PublicSpend

PublicSpend converts a private spend key to a public spend key

type PrivateView

type PrivateView ristretto.Scalar

PrivateView represents the private view key

func (PrivateView) Bytes

func (pv PrivateView) Bytes() []byte

func (PrivateView) PublicView

func (pv PrivateView) PublicView() *PublicView

PublicView returns a public view key from a private view key

type PublicAddress

type PublicAddress string

PublicAddress is the encoded prefix + publicSpend + PublicView

func (PublicAddress) String

func (pa PublicAddress) String() string

func (PublicAddress) ToKey

func (pa PublicAddress) ToKey(netPrefix byte) (*PublicKey, error)

ToKey will take a public address and return a Key object with the public parameters filled

type PublicKey

type PublicKey struct {
	PubSpend *PublicSpend
	PubView  *PublicView
}

PublicKey represents a pair of PublicSpend and PublicView keys

func (*PublicKey) PublicAddress

func (k *PublicKey) PublicAddress(netPrefix byte) (*PublicAddress, error)

PublicAddress will return the base58 encoded public address The stealth addresses are referred to as the one time addresses derived when a user wants to send funds to another user

func (*PublicKey) StealthAddress

func (k *PublicKey) StealthAddress(r ristretto.Scalar, index uint32) *StealthAddress

StealthAddress Returns P, R P = H(r* PubView || Index)G + Pubspend = (H(r * PubView || Index) + privSpend)G

type PublicSpend

type PublicSpend ristretto.Point

PublicSpend represents the public spend key

func (PublicSpend) Bytes

func (ps PublicSpend) Bytes() []byte

func (PublicSpend) ScalarMult

func (ps PublicSpend) ScalarMult(s ristretto.Scalar) PublicSpend

func (PublicSpend) String

func (ps PublicSpend) String() string

type PublicView

type PublicView ristretto.Point

PublicView is the public view key

func (PublicView) Bytes

func (pv PublicView) Bytes() []byte

func (PublicView) ScalarMult

func (pv PublicView) ScalarMult(s ristretto.Scalar) PublicView

func (PublicView) String

func (pv PublicView) String() string

type StealthAddress

type StealthAddress struct {
	P ristretto.Point
}

StealthAddress represents a Dusk stealth adress

Jump to

Keyboard shortcuts

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