> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mpcvault.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Data types and encodings

> How every field of the REST and gRPC APIs is encoded.

The REST API is a JSON mapping of the gRPC API. Both expose the same messages, so every field has one type and two encodings: its protobuf type over gRPC, and the JSON value described below over REST.

## JSON conventions

* Requests and responses use `Content-Type: application/json` and UTF-8.
* Responses use `lowerCamelCase` field names (`vaultUuid`). Requests also accept the `snake_case` name (`vault_uuid`). Unknown request fields are ignored without an error, so a misspelled optional field is read as omitted: for example, a misspelled `callbackClientSignerPublicKey` sends a transaction or structured message request to the MPCVault app for manual signing.
* Every field of a message is present in a response. A scalar that is unset has its zero value (`""`, `"0"`, `false`, the first enum value, `[]`). A message or wrapper that is unset is `null`.
* A field that belongs to a `oneof` is present only when it is set, so a response contains at most one of the members.
* Field order is not significant.
* The OpenAPI schemas list the canonical form: `lowerCamelCase` names, enum names and decimal strings for 64-bit integers. The other forms in the table below are accepted but not listed.

## Types

| Protobuf type | JSON in responses | JSON accepted in requests | gRPC |
| - | - | - | - |
| `string` | UTF-8 string | string | UTF-8 string |
| `bool` | `true` or `false` | boolean | bool |
| `int32`, `uint32` | number | number or decimal string | varint |
| `int64`, `uint64` | **decimal string**, for example `"1759400600000"` | decimal string or number | varint (64-bit) |
| `bytes` | **base64**, standard alphabet (`A-Z a-z 0-9 + /`) with `=` padding | base64, standard or URL-safe, padded or not | raw bytes |
| enum | the value name, for example `"STATUS_PENDING"` | the value name or its number | varint |
| message | object; `null` when unset | object, or omitted | nested message |
| `repeated` | array; `[]` when empty | array | repeated field |
| `google.protobuf.StringValue` | string, or `null` when unset | string or `null` | wrapper message |
| `google.protobuf.Int64Value` | decimal string, or `null` when unset | decimal string, number or `null` | wrapper message |
| `google.protobuf.BoolValue` | `true`, `false` or `null` when unset | boolean or `null` | wrapper message |

An enum can gain values. Treat a name you do not recognize as unknown instead of failing.

## Field conventions

These conventions hold across the API. A field that follows another rule says so in its description.

* **Timestamps** are Unix time in milliseconds, in a 64-bit integer (a decimal string in JSON).
* **UUIDs** are hyphenated strings in the form `xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx`.
* **Amounts** are decimal strings in the unit stated by the field (for example wei, satoshi or lamports), never floating-point numbers. A request created through the API holds an integer in that unit. For a request created in the MPCVault app, the stored amount is returned scaled to that unit without rounding, so it can have a fractional part if more precision was entered than the unit has. The stored amount can differ from the amount entered (for example, a Bitcoin send is capped to the value of the first 30 spendable outputs less a reserve for the fee).
* **Addresses** use the address format of the field's network. The signing request payloads state the format of each address field.
* **Hex strings** are stated as such in the field description, with or without the `0x` prefix as that field specifies.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.