jamtis

package
v0.0.0-...-34c5cda Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2023 License: LGPL-3.0 Imports: 6 Imported by: 0

Documentation

Overview

Package jamtis is for libraries to manage the keys and addresses used when Monero switches to the Seraphis protocol. See here for details: https://gist.github.com/tevador/50160d160d24cfc6c52ae02eb3d17024?permalink_comment_id=4240591#47-wallet-public-keys

Index

Constants

View Source
const (
	// AddressIndexLen is the length of the jamtis sub-address identifier in
	// bytes. This index is is generated randomly and not a sequential counter.
	AddressIndexLen = 16
)

Variables

This section is empty.

Functions

func GenCipherTagSecret

func GenCipherTagSecret(genAddressSecret []byte) ([]byte, error)

GenCipherTagSecret generates the cipher-tag secret which is used to encrypt/create the address tag.

func GenFindReceivedPrivKey

func GenFindReceivedPrivKey(viewBalancePrivKey []byte) ([]byte, error)

GenFindReceivedPrivKey generates the private key used to scan for received transaction outputs.

func GenFindReceivedPubKey

func GenFindReceivedPubKey(findReceivedPrivKey []byte, unlockAmountsPubKey []byte) []byte

GenFindReceivedPubKey generates the public key from the find received private key.

func GenGenAddressSecret

func GenGenAddressSecret(viewBalanceKey []byte) ([]byte, error)

GenGenAddressSecret generates the secret key used to generate a new address. (Note: All addresses in Jamtis are subaddresses.)

func GenSeraphisSpendKey

func GenSeraphisSpendKey(viewBalanceKey []byte, masterKey []byte) ([]byte, error)

GenSeraphisSpendKey returns the ed25519 calculation viewBalance*X + masterKey*U

func GenUnlockAmountsPrivKey

func GenUnlockAmountsPrivKey(viewBalancePrivKey []byte) ([]byte, error)

GenUnlockAmountsPrivKey generates the private key used to encrypt/decrypt the amount of a transaction.

func GenUnlockAmountsPubKey

func GenUnlockAmountsPubKey(unlockAmountsPrivKey []byte) []byte

GenUnlockAmountsPubKey generates the public key from the unlock amounts private key.

func GenViewBalancePrivKey

func GenViewBalancePrivKey(masterPrivKey []byte) ([]byte, error)

GenViewBalancePrivKey generates the view balance private key which, in turn, is a master key for generating the find-received, unlock-amounts and generate-addresses keys.

Types

type Address

type Address struct {
	K1  []byte // Spend Public Key (32 bytes) - k^j_g G + k^j_x X + k^j_u U + K_s
	K2  []byte // View Public Key (32 bytes) - xk^j_a xK_fr
	K3  []byte // DH Base key (32 bytes) - xk^j_a xK_ua
	Tag []byte // Address tag (18 bytes, does not include tag hint)
}

Address holds the binary fields that make up a Jamtis user address (a destination for funds). In the C++ code, this struct is called JamtisDestinationV1.

func GenJamtisAddressV1

func GenJamtisAddressV1(
	spendPubKey []byte,
	unlockAmountsPubKey []byte,
	findReceivedPubKey []byte,
	generateAddressPrivKey []byte,
	addressIndex []byte,
) (*Address, error)

GenJamtisAddressV1 generates the Jamtis address data for the passed address index.

Jump to

Keyboard shortcuts

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