Skip to main content

Derive an AccountIdentifier from a PublicKey

Retrieves the Account Identifier information based on a Public Key for a given network

Request Body REQUIRED
network_identifier object REQUIRED

The network_identifier specifies which network a particular object is associated with.

blockchain string REQUIRED

Blockchain name

network string REQUIRED

If a blockchain has a specific chain-id or network identifier, it should go in this field. It is up to the client to determine which network-specific identifier is mainnet or testnet.

sub_network_identifier object

In blockchains with sharded state, the SubNetworkIdentifier is required to query some object on a specific shard. This identifier is optional for all non-sharded blockchains.

network string REQUIRED

Network name

metadata object

Meta data from subnetwork identifier

producer string REQUIRED

producer

public_key object REQUIRED

PublicKey contains a public key byte array for a particular CurveType encoded in hex. Note that there is no PrivateKey struct as this is NEVER the concern of an implementation.

hex_bytes string REQUIRED

Hex-encoded public key bytes in the format specified by the CurveType.

curve_type string REQUIRED

Possible values: [secp256k1, edwards25519]

CurveType is the type of cryptographic curve associated with a PublicKey.

metadata object
Responses
200

Success

Schema OPTIONAL
address string OPTIONAL

[DEPRECATED by account_identifier in v1.4.4] Address in network-specific format.

account_identifier object OPTIONAL

The account_identifier uniquely identifies an account within a network. All fields in the account_identifier are utilized to determine this uniqueness (including the metadata field, if populated).

address string

The address may be a cryptographic public key (or some encoding of it) or a provided username.

sub_account object OPTIONAL

An account may have state specific to a contract address (ERC-20 token) and/or a stake (delegated balance). The sub_account_identifier should specify which state (if applicable) an account instantiation refers to.

address string

The address may be a cryptographic public key (or some encoding of it) or a provided username.

metadata object OPTIONAL

If the SubAccount address is not sufficient to uniquely specify a SubAccount, any other identifying information can be stored here. It is important to note that two SubAccounts with identical addresses but differing metadata will not be considered equal by clients.

metadata object OPTIONAL

Blockchains that utilize a username model (where the address is not a derivative of a cryptographic public key) should specify the public key(s) owned by the address in metadata.

metadata object OPTIONAL
400

Error

Schema OPTIONAL
code integer

Code is a network-specific error code. If desired, this code can be equivalent to an HTTP status code.

message string

Message is a network-specific error message. The message MUST NOT change for a given code. In particular, this means that any contextual information should be included in the details field.

retriable boolean

An error is retriable if the same request may succeed if submitted again.

details object OPTIONAL

Often times it is useful to return context specific to the request that caused the error (i.e. a sample of the stack trace or impacted account) in addition to the standard error message.

address string OPTIONAL
error string OPTIONAL