Skip to main content

Address

type 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

`ObjectId`s and `Address`es 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​

The BCS serialized form of this type is specified in [`bcs-schema.abnf`](https://github.com/iotaledger/iota-rust-sdk/blob/develop/crates/iota-sdk-types/bcs-schema.abnf\).

type Address struct {
// contains filtered or unexported fields
}

func AddressAuthenticatorState​

func AddressAuthenticatorState() *Address

func AddressClock​

func AddressClock() *Address

func AddressDenyList​

func AddressDenyList() *Address

func AddressFramework​

func AddressFramework() *Address

func AddressFromBcs​

func AddressFromBcs(bcs []byte) (*Address, error)

Create this type from BCS encoded bytes.

func AddressFromBytes​

func AddressFromBytes(bytes []byte) (*Address, error)

func AddressFromHex​

func AddressFromHex(hex string) (*Address, error)

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).

func AddressFromJson​

func AddressFromJson(json string) (*Address, error)

Create this type from a JSON encoded string.

func AddressFromPrefixedHex​

func AddressFromPrefixedHex(hex string) (*Address, error)

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).

func AddressFromPrefixedShortHex​

func AddressFromPrefixedShortHex(hex string) (*Address, error)

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 `0`s.

func AddressFromRawHex​

func AddressFromRawHex(hex string) (*Address, error)

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

func AddressFromRawShortHex​

func AddressFromRawShortHex(hex string) (*Address, error)

Parses an Address from a hex string 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 `0`s. Will return an error if the string has a `0x` prefix.

func AddressFromShortHex​

func AddressFromShortHex(hex string) (*Address, error)

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 `0`s.

func AddressGenesisBridge​

func AddressGenesisBridge() *Address

func AddressGenesisIotaBridge​

func AddressGenesisIotaBridge() *Address

func AddressMax​

func AddressMax() *Address

func AddressRandom​

func AddressRandom() *Address

func AddressRandomnessState​

func AddressRandomnessState() *Address

func AddressStardust​

func AddressStardust() *Address

func AddressStd​

func AddressStd() *Address

func AddressSystem​

func AddressSystem() *Address

func AddressSystemState​

func AddressSystemState() *Address

func AddressTransactionDenyRules​

func AddressTransactionDenyRules() *Address

func AddressZero​

func AddressZero() *Address

func LiftFromExternalAddress​

func LiftFromExternalAddress(handle uint64) *Address

func (*Address) DebugString​

func (_self *Address) DebugString() string

func (*Address) Destroy​

func (object *Address) Destroy()

func (*Address) Eq​

func (_self *Address) Eq(other *Address) bool

func (*Address) Hash​

func (_self *Address) Hash() uint64

func (*Address) Ne​

func (_self *Address) Ne(other *Address) bool

func (*Address) NextLexicographical​

func (_self *Address) NextLexicographical() *Address

Returns the next digest in byte-increasing order.

func (*Address) NextLexicographicalOpt​

func (_self *Address) NextLexicographicalOpt() **Address

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

func (*Address) String​

func (_self *Address) String() string

func (*Address) ToBcs​

func (_self *Address) ToBcs() ([]byte, error)

Convert this type to BCS encoded bytes.

func (*Address) ToBytes​

func (_self *Address) ToBytes() []byte

func (*Address) ToCanonicalString​

func (_self *Address) ToCanonicalString(withPrefix bool) string

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

func (*Address) ToDisplayString​

func (_self *Address) ToDisplayString() string

Render this type as human-readable text.

Some types also print this through the binding's native string conversion; this method is the spelling every object type has.

The layout is meant for reading and can change between releases. Use the JSON or BCS conversions for output that gets parsed.

func (*Address) ToHex​

func (_self *Address) ToHex() string

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

func (*Address) ToJson​

func (_self *Address) ToJson() (string, error)

Convert this type to a JSON encoded string.

func (*Address) ToRawHex​

func (_self *Address) ToRawHex() string

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

func (*Address) ToRawShortHex​

func (_self *Address) ToRawShortHex() string

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

func (*Address) ToShortHex​

func (_self *Address) ToShortHex() string

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