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 ¶
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
type PrivateKey ¶
type PrivateKey struct {
// contains filtered or unexported fields
}
PrivateKey represents the pair of private spend and view keys
type PrivateSpend ¶
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 ¶
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
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 ¶
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 ¶
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 ¶
StealthAddress represents a Dusk stealth adress