POST
/
construction
/
derive
Derive an AccountIdentifier from a PublicKey
curl --request POST \
  --url https://example.com/construction/derive \
  --header 'Content-Type: application/json' \
  --data '{
  "network_identifier": {
    "blockchain": "bitcoin",
    "network": "mainnet",
    "sub_network_identifier": {
      "network": "shard 1",
      "metadata": {
        "producer": "0x52bc44d5378309ee2abf1539bf71de1b7d7be3b5"
      }
    }
  },
  "public_key": {
    "hex_bytes": "<string>",
    "curve_type": "secp256k1"
  },
  "metadata": {}
}'
{
  "address": "<string>",
  "account_identifier": {
    "address": "0x3a065000ab4183c6bf581dc1e55a605455fc6d61",
    "sub_account": {
      "address": "0x6b175474e89094c44da98b954eedeac495271d0f",
      "metadata": {}
    },
    "metadata": {}
  },
  "metadata": {}
}

Body

application/json

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
object
required

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

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.

metadata
object

Response

Expected response to a valid request

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
object

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