Skip to main content

Class: Address

Unique identifier for an Account on the IOTA blockchain.

An Address is a 32-byte pseudonymous identifier used to uniquely identify an account and asset-ownership on the IOTA blockchain. Often, human-readable addresses are encoded in hexadecimal with a 0x prefix. For example, this is a valid IOTA address: 0x02a212de6a9dfa3a69e22387acfbafbb1a9e591bd9d636e7895dcfc8de05f331.

Deriving an Address

Addresses are cryptographically derived from a number of user account authenticators, the simplest of which is an Ed25519PublicKey.

Deriving an address consists of the Blake2b256 hash of the sequence of bytes of its corresponding authenticator, prefixed with a domain-separator (except ed25519, for compatibility reasons). For each other authenticator, this domain-separator is the single byte-value of its SignatureScheme flag. E.g. hash(signature schema flag || authenticator bytes).

Each authenticator has a method for deriving its Address as well as documentation for the specifics of how the derivation is done. See Ed25519PublicKey::derive_address for an example.

Relationship to ObjectIds​

ObjectIds and Addresses share the same 32-byte addressable space but are derived leveraging different domain-separator values to ensure that, cryptographically, there won't be any overlap, e.g. there can't be a valid Object who's ObjectId is equal to that of the Address of a user account.

BCS

An Address's BCS serialized form is defined by the following:

address = 32OCTET

Extends​

  • UniffiAbstractObject

Implements​

Properties​

[destructorGuardSymbol]​

readonly [destructorGuardSymbol]: UniffiGcObject;

[pointerLiteralSymbol]​

readonly [pointerLiteralSymbol]: bigint;

[uniffiTypeNameSymbol]​

readonly [uniffiTypeNameSymbol]: "Address" = "Address";

Methods​

equals()​

equals(other): boolean;

Parameters​

other​

Address

Returns​

boolean


hashCode()​

hashCode(): bigint;

Returns​

bigint


nextLexicographical()​

nextLexicographical(): AddressLike;

Returns the next digest in byte-increasing order.

Returns​

AddressLike

Implementation of​

AddressLike.nextLexicographical


nextLexicographicalOpt()​

nextLexicographicalOpt(): AddressLike | undefined;

Returns the next digest in byte-increasing order, or None if the result would overflow.

Returns​

AddressLike | undefined

Implementation of​

AddressLike.nextLexicographicalOpt


toBytes()​

toBytes(): ArrayBuffer;

Returns​

ArrayBuffer

Implementation of​

AddressLike.toBytes


toCanonicalString()​

toCanonicalString(withPrefix): string;

Returns the string representation of this address using the canonical display, with or without a 0x prefix.

Parameters​

withPrefix​

boolean

Returns​

string

Implementation of​

AddressLike.toCanonicalString


toDebugString()​

toDebugString(): string;

Returns​

string


toHex()​

toHex(): string;

Returns the string representation of this address in hex format with 0x prefix.

Returns​

string

Implementation of​

AddressLike.toHex


toRawHex()​

toRawHex(): string;

Returns the string representation of this address in hex format without 0x prefix.

Returns​

string

Implementation of​

AddressLike.toRawHex


toRawShortHex()​

toRawShortHex(): string;

Returns the shortest possible string representation of the address (i.e. with leading zeroes trimmed), without 0x prefix.

Returns​

string

Implementation of​

AddressLike.toRawShortHex


toShortHex()​

toShortHex(): string;

Returns the shortest possible string representation of the address (i.e. with leading zeroes trimmed).

Returns​

string

Implementation of​

AddressLike.toShortHex


toString()​

toString(): string;

Returns a string representation of an object.

Returns​

string


uniffiDestroy()​

uniffiDestroy(): void;

Explicitly tell Rust to destroy the native peer that backs this object.

Once this method has been called, any following method calls will throw an error.

Can be called more than once.

Returns​

void

Overrides​

UniffiAbstractObject.uniffiDestroy

uniffiUse()​

uniffiUse<T>(block): T;

A convenience method to use this object, then destroy it after its use.

Type Parameters​

T​

T

Parameters​

block​

(obj) => T

Returns​

T

Inherited from​

UniffiAbstractObject.uniffiUse

authenticatorState()​

static authenticatorState(): AddressLike;

Returns​

AddressLike


clock()​

static clock(): AddressLike;

Returns​

AddressLike


denyList()​

static denyList(): AddressLike;

Returns​

AddressLike


framework()​

static framework(): AddressLike;

Returns​

AddressLike


fromBytes()​

static fromBytes(bytes): AddressLike;

Parameters​

bytes​

ArrayBuffer

Returns​

AddressLike


fromHex()​

static fromHex(hex): AddressLike;

Parses an Address from a full-length hex string (64 hex characters), with or without a 0x prefix. Will return an error if the string is not exactly 64 hex characters long (excluding the 0x prefix).

Parameters​

hex​

string

Returns​

AddressLike


fromPrefixedHex()​

static fromPrefixedHex(hex): AddressLike;

Parses an Address from a full-length hex string (64 hex characters), with a mandatory 0x prefix. Will return an error if the string is not exactly 64 hex characters long (excluding the 0x prefix).

Parameters​

hex​

string

Returns​

AddressLike


fromPrefixedShortHex()​

static fromPrefixedShortHex(hex): AddressLike;

Parses an Address from a hex string with a mandatory 0x prefix. The string can be of variable length; if it's shorter than 64 hex characters, it will be left-padded with 0s.

Parameters​

hex​

string

Returns​

AddressLike


fromShortHex()​

static fromShortHex(hex): AddressLike;

Parses an Address from a hex string, with or without a 0x prefix. The string can be of variable length; if it's shorter than 64 hex characters, it will be left-padded with 0s.

Parameters​

hex​

string

Returns​

AddressLike


genesisBridge()​

static genesisBridge(): AddressLike;

Returns​

AddressLike


genesisIotaBridge()​

static genesisIotaBridge(): AddressLike;

Returns​

AddressLike


instanceOf()​

static instanceOf(obj_): obj_ is Address;

Parameters​

obj_​

any

Returns​

obj_ is Address


max()​

static max(): AddressLike;

Returns​

AddressLike


random()​

static random(): AddressLike;

Returns​

AddressLike


randomnessState()​

static randomnessState(): AddressLike;

Returns​

AddressLike


stardust()​

static stardust(): AddressLike;

Returns​

AddressLike


std()​

static std(): AddressLike;

Returns​

AddressLike


system()​

static system(): AddressLike;

Returns​

AddressLike


systemState()​

static systemState(): AddressLike;

Returns​

AddressLike


transactionDenyRules()​

static transactionDenyRules(): AddressLike;

Returns​

AddressLike


zero()​

static zero(): AddressLike;

Returns​

AddressLike