Skip to main content

Address

Overview

Represents a public address of an Aleo account. The Address class provides methods for creating addresses from various sources (private keys, view keys, compute keys), converting between different formats (bytes, bits, fields, groups), and verifying signatures.

Methods

from_private_key

Derive an Aleo address from a private key

from_private_key(private_key)Address
ParamTypeDescription
private_keyPrivateKeyThe private key to derive the address from
returnAddressAddress corresponding to the private key

from_view_key

Derive an Aleo address from a view key

from_view_key(view_key)Address
ParamTypeDescription
view_keyViewKeyThe view key to derive the address from
returnAddressAddress corresponding to the view key

from_compute_key

Derive an Aleo address from a compute key

from_compute_key(compute_key)Address
ParamTypeDescription
compute_keyComputeKeyThe compute key to derive the address from
returnAddressAddress corresponding to the compute key

fromBytesLe

Get an address from a series of bytes

fromBytesLe(bytes)Address
ParamTypeDescription
bytesUint8ArrayA left endian byte array representing the address
returnAddressThe address object

toBytesLe

Get the left endian byte array representation of the address

toBytesLe()Uint8Array
ParamType
returnUint8Array

fromBitsLe

Get an address from a series of bits represented as a boolean array

fromBitsLe(bits)Address
ParamTypeDescription
bitsArrayA left endian boolean array representing the bits of the address
returnAddressThe address object

toBitsLe

Get the left endian boolean array representation of the bits of the address

toBitsLe()Array.<any>
ParamType
returnArray.<any>

fromFields

Get an address object from an array of fields

fromFields(fields)Plaintext
ParamTypeDescription
fieldsArrayAn array of fields
returnPlaintextThe address object

toFields

Get the field array representation of the address

toFields()Array.<any>
ParamType
returnArray.<any>

fromGroup

Get an address object from a group

fromGroup(group)Address
ParamTypeDescription
groupGroupThe group object
returnAddressThe address object

toGroup

Get the group representation of the address object

toGroup()Group
ParamType
returnGroup

from_string

Create an aleo address object from a string representation of an address

from_string(address)Address
ParamTypeDescription
addressstringString representation of an address
returnAddressAddress object

to_string

Get a string representation of an Aleo address object

to_string(Address) ► string
ParamType
AddressAddress
returnstring

toPlaintext

Get the plaintext representation of the address

toPlaintext()Plaintext
ParamType
returnPlaintext

verify

Verify a signature for a message signed by the address

verify(Byte) ► boolean
ParamTypeDescription
ByteUint8Arrayarray representing a message signed by the address
returnbooleanBoolean representing whether or not the signature is valid