Sign Metadata

POST /wallets/{walletId}/signatures/{role}/{index}

status: experimental

⚠️ WARNING ⚠️

This endpoint is experimental and for internal use in the Catalyst project. This functionality will be refined in the forthcoming future and the interface is likely to change in NON-BACKWARD COMPATIBLE WAYS.

Note: Only Soft indexes are supported by this endpoint.

Path parameters

  • walletId string(hex) Required

    Minimum length is 40, maximum length is 40.

  • role string Required

    Values are utxo_external, utxo_internal, or mutable_account.

  • 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 0, maximum length is 255.

  • metadata object | null Required

    ⚠️ WARNING ⚠️

    Please note that metadata provided in a transaction will be stored on the blockchain forever. Make sure not to include any sensitive data, in particular personally identifiable information (PII).

    Extra application data attached to the transaction.

    Cardano allows users and developers to embed their own authenticated metadata when submitting transactions. Metadata can be expressed as a JSON object with some restrictions:

    1. All top-level keys must be integers between 0 and 2^64 - 1.

    2. Each metadata value is tagged with its type.

    3. Strings must be at most 64 bytes when UTF-8 encoded.

    4. Bytestrings are hex-encoded, with a maximum length of 64 bytes.

    Metadata aren't stored as JSON on the Cardano blockchain but are instead stored using a compact binary encoding (CBOR).

    The binary encoding of metadata values supports three simple types:

    • Integers in the range -(2^64 - 1) to 2^64 - 1
    • Strings (UTF-8 encoded)
    • Bytestrings

    And two compound types:

    • Lists of metadata values
    • Mappings from metadata values to metadata values

    It is possible to transform any JSON object into this schema.

    However, if your application uses floating point values, they will need to be converted somehow, according to your requirements. Likewise for null or bool values. When reading metadata from chain, be aware that integers may exceed the javascript numeric range, and may need special "bigint" parsing.

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.

  • 200 application/octet-stream

    OK

POST /wallets/{walletId}/signatures/{role}/{index}
curl \
 --request POST https://localhost:8090/v2/wallets/{walletId}/signatures/{role}/1852H \
 --header "Content-Type: application/json" \
 --data '{"passphrase":"Secure Passphrase","metadata":{"0":{"string":"cardano"},"1":{"int":14},"2":{"bytes":"2512a00e9653fe49a44a5886202e24d77eeb998f"},"3":{"list":[{"int":14},{"int":42},{"string":"1337"}]},"4":{"map":[{"k":{"string":"key"},"v":{"string":"value"}},{"k":{"int":14},"v":{"int":42}}]}}}'
Request examples
{
  "passphrase": "Secure Passphrase",
  "metadata": {
    "0": {
      "string": "cardano"
    },
    "1": {
      "int": 14
    },
    "2": {
      "bytes": "2512a00e9653fe49a44a5886202e24d77eeb998f"
    },
    "3": {
      "list": [
        {
          "int": 14
        },
        {
          "int": 42
        },
        {
          "string": "1337"
        }
      ]
    },
    "4": {
      "map": [
        {
          "k": {
            "string": "key"
          },
          "v": {
            "string": "value"
          }
        },
        {
          "k": {
            "int": 14
          },
          "v": {
            "int": 42
          }
        }
      ]
    }
  }
}
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"
}