zcash

package
v0.0.0-...-a2b3504 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2018 License: MIT Imports: 6 Imported by: 2

Documentation

Overview

zcash provides a few tools to manipulate Zcash z-addresses.

Index

Constants

This section is empty.

Variables

View Source
var (
	ProdSpendingKey = []byte{0xAB, 0x36}
	TestSpendingKey = []byte{0xAC, 0x08}
	ProdAddress     = []byte{0x16, 0x9A}
	TestAddress     = []byte{0x16, 0xB6}
	ProdViewingKey  = []byte{0xA8, 0xAB, 0xD3}
	TestViewingKey  = []byte{0xA8, 0xAC, 0x0C}
)
View Source
var (
	ErrChecksum      = errors.New("checksum error")
	ErrInvalidFormat = errors.New("invalid format: version and/or checksum bytes missing")
	ErrInvalidKey    = errors.New("invalid key: must be 32 bytes with first 4 bits set to 0")
)

Functions

func Base58Decode

func Base58Decode(s string) (result []byte, version [2]byte, err error)

Base58Decode decodes a Base58Check encoding with two version bytes.

func Base58Encode

func Base58Encode(data []byte, version []byte) string

Base58Encode encodes in Base58Check with two version bytes.

func GenerateKey

func GenerateKey() []byte

GenerateKey generates a new raw spending key.

func GenerateVanityKey

func GenerateVanityKey(prefix string, version []byte) []byte

GenerateVanityKey generates a raw spending key that when converted to an address and encoded in Base58Check with the given version, has the given prefix.

func KeyToAddress

func KeyToAddress(key []byte) ([]byte, error)

KeyToAddress converts a raw spending key into a raw address.

func KeyToViewingKey

func KeyToViewingKey(key []byte) ([]byte, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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