Create Account Public Key

POST /wallets/{walletId}/keys/{index}

status: stable

Derive an account public key for any account index. For this key derivation to be possible, the wallet must have been created from mnemonic.

It is possible to use the optional purpose field to override that branch of the derivation path with different hardened derivation index. If that field is omitted, the default purpose for Cardano wallets (1852H) will be used.

Note: Only Hardened indexes are supported by this endpoint.

Path parameters

  • walletId string(hex) Required

    Minimum length is 40, maximum length is 40.

  • index string Required

    An individual segment within a derivation path.

    The H suffix indicates a Hardened child private key, which means that children of this key cannot be derived from the public key. Indices without a H suffix are called Soft.

application/json

Body Required

  • passphrase string Required

    A master passphrase to lock and protect the wallet for sensitive operation (e.g. sending funds)

    Minimum length is 10, maximum length is 255.

  • format string Required

    Determines whether extended (with chain code) or normal (without chain code) key is requested

    Values are extended or non_extended.

  • purpose string

    An individual segment within a derivation path.

    The H suffix indicates a Hardened child private key, which means that children of this key cannot be derived from the public key. Indices without a H suffix are called Soft.

Responses

  • 415 application/json

    Unsupported Media Type

    Hide response attributes Show response attributes object
    • message string Required

      A descriptive error message.

    • code string Required

      A specific error code for this error, more precise than HTTP ones.

  • 406 application/json

    Not Acceptable

    Hide response attributes Show response attributes object
    • message string Required

      May occur when providing an invalid 'Accept' header.

    • code string Required

      Value is not_acceptable.

  • 400 application/json

    Bad Request

    Hide response attributes Show response attributes object
    • message string Required

      May occur when a request is not well-formed; that is, it fails to parse successfully. This could be the case when some required parameters are missing or, when malformed values are provided.

    • code string Required

      Value is bad_request.

  • 202 application/json

    Accepted

    Format should match the following pattern: ^((acct_xvk)|(acct_vk)|(acct_shared_xvk)|(acct_shared_vk))1[0-9a-z]*$.

POST /wallets/{walletId}/keys/{index}
curl \
 --request POST https://localhost:8090/v2/wallets/{walletId}/keys/1852H \
 --header "Content-Type: application/json" \
 --data '{"passphrase":"Secure Passphrase","format":"extended","purpose":"1852H"}'
Request examples
{
  "passphrase": "Secure Passphrase",
  "format": "extended",
  "purpose": "1852H"
}
Response examples (415)
{
  "message": "string",
  "code": "an_error_code"
}
Response examples (406)
{
  "message": "string",
  "code": "not_acceptable"
}
Response examples (400)
{
  "message": "string",
  "code": "bad_request"
}
Response examples (202)
string