address

package
v0.2.4-0...-2c2ceb1 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2020 License: Apache-2.0, BSD-2-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// VersionED25519 represents the address version that uses ED25519 signatures.
	VersionED25519 = byte(1)

	// VersionBLS represents the address version that uses BLS signatures.
	VersionBLS = byte(2)
)
View Source
const Length = 33

Length contains the length of an address (digest length = 32 + version byte length = 1).

Variables

View Source
var Empty = Address{}

Empty represents the 0-value of an address and therefore represents the "empty" address value

Functions

This section is empty.

Types

type Address

type Address [Length]byte

Address represents an address in the IOTA ledger.

func FromBLSPubKey

func FromBLSPubKey(pubKey []byte) (address Address)

FromBLSPubKey creates an address from marshaled BLS public key unmarshaled BLS public key conforms to interface kyber.Point

func FromBase58

func FromBase58(base58String string) (address Address, err error)

FromBase58 creates an address from a base58 encoded string.

func FromBytes

func FromBytes(bytes []byte) (result Address, consumedBytes int, err error)

FromBytes unmarshals an address from a sequence of bytes.

func FromED25519PubKey

func FromED25519PubKey(key ed25519.PublicKey) (address Address)

FromED25519PubKey creates an address from an ed25519 public key.

func Parse

func Parse(marshalUtil *marshalutil.MarshalUtil) (Address, error)

Parse is a wrapper for simplified unmarshaling of a byte stream using the marshalUtil package.

func Random

func Random() (address Address)

Random creates a random address, which can for example be used in unit tests. first byte (version) is also random

func RandomOfType

func RandomOfType(versionByte Version) Address

RandomOfType creates a random address with the given Version.

func (Address) Bytes

func (address Address) Bytes() []byte

Bytes returns a marshaled version of this address.

func (*Address) Digest

func (address *Address) Digest() Digest

Digest returns the digest part of an address (i.e. the hashed version of the ed25519 public key)-

func (Address) String

func (address Address) String() string

String returns a human readable (base58 encoded) version of the address.

func (*Address) Version

func (address *Address) Version() Version

Version returns the version of the address, which corresponds to the signature scheme that is used.

type Digest

type Digest = []byte

Digest represents a hashed version of the consumed public key of the address. Hashing the public key allows us to maintain quantum-robustness for addresses, that have never been spent from, and it allows us to have fixed size addresses.

type Version

type Version = byte

Version represents the version of the address. Different versions are associated to different signature schemes.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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