Sign Metadata
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 is40
. -
role
string Required Values are
utxo_external
,utxo_internal
, ormutable_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 aH
suffix are called Soft.
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 is255
. 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:
All top-level keys must be integers between
0
and2^64 - 1
.Each metadata value is tagged with its type.
Strings must be at most 64 bytes when UTF-8 encoded.
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)
to2^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
orbool
values. When reading metadata from chain, be aware that integers may exceed the javascript numeric range, and may need special "bigint" parsing.
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}}]}}}'
{
"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
}
}
]
}
}
}
{
"message": "string",
"code": "an_error_code"
}
{
"message": "string",
"code": "not_acceptable"
}
{
"message": "string",
"code": "bad_request"
}