Derive

Derive an AccountIdentifier from a PublicKey

post

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.

Body

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

metadataobjectOptional
Responses
200
Expected response to a valid request
application/json
post
POST /construction/derive HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 256

{
  "network_identifier": {
    "blockchain": "bitcoin",
    "network": "mainnet",
    "sub_network_identifier": {
      "network": "shard 1",
      "metadata": {
        "producer": "0x52bc44d5378309ee2abf1539bf71de1b7d7be3b5"
      }
    }
  },
  "public_key": {
    "hex_bytes": "text",
    "curve_type": "secp256k1"
  },
  "metadata": {}
}
{
  "address": "text",
  "account_identifier": {
    "address": "0x3a065000ab4183c6bf581dc1e55a605455fc6d61",
    "sub_account": {
      "address": "0x6b175474e89094c44da98b954eedeac495271d0f",
      "metadata": {}
    },
    "metadata": {}
  },
  "metadata": {}
}