Construction

Derive an AccountIdentifier from a PublicKey

Changed on

Derive returns the AccountIdentifier associated with a public key.

Blockchains that require an on-chain action to create an account should not implement this method.

post/construction/derive

Request

  • The document declares no server URL.
  • Auth
    none declared

Request body

ConstructionDeriveRequest required

ConstructionDeriveRequest is passed to the /construction/derive endpoint. Network is provided in the request because some blockchains have different address formats for different networks. Metadata is provided in the request because some blockchains allow for multiple address types (i.e. different address for validators vs normal accounts).

network_identifier, NetworkIdentifier required

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

public_key, PublicKey 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.

metadata, object

Example request

{
  "network_identifier": {
    "blockchain": "bitcoin",
    "network": "mainnet",
    "sub_network_identifier": {
      "network": "shard 1",
      "metadata": {
        "producer": "0x52bc44d5378309ee2abf1539bf71de1b7d7be3b5"
      }
    }
  }
}

Response

Expected response to a valid request

ConstructionDeriveResponse required

ConstructionDeriveResponse is returned by the /construction/derive endpoint.

address, string

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

account_identifier, AccountIdentifier

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

metadata, object

Example response

{
  "account_identifier": {
    "address": "0x3a065000ab4183c6bf581dc1e55a605455fc6d61",
    "sub_account": {
      "address": "0x6b175474e89094c44da98b954eedeac495271d0f"
    }
  }
}

Changes

    • breaking

      added the new required request property network_identifier/blockchain

    • breaking

      added the new required request property network_identifier/network

    • breaking

      added the new required request property public_key/curve_type

    8 more changes in this revision