# Serialization Formats

## Serialization formats

Serialization in CosmWasm allows you to inspect and debug messages sent on the blockchain, as well as parse results, without the need for complex libraries or downloading custom schemas and ABIs.

## JSON

JSON is self-describing, human-readable, and used in APIs everywhere. It does have some downsides, such as handling numbers over 2^53 (in that case, you can use strings), having no clear distinction between strings and base64-encoded binary, and having no hard-coded schema. We auto-generate JSON Schema descriptors for the public API of contracts, which can be used to inspect the supported API and optionally used in client-side tooling for auto-validation of messages.

Note that contracts define their parsing logic for messages, and the code is not enforced by the framework. While there is extended support for JSON through cosmwasm::serde and cw-template, anyone can change it as long as client support for the custom format is provided.

## Protobuf

Protobuf is a well-known and widely-supported binary format that provides a stricter schema guarantee than JSON and a more compact format. Support for Protocol Buffers and gRPC was added with the Cosmos SDK v0.39.0 upgrade.

## Cap'n proto

Cap'n Proto is a super-lean encoding format with zero-copy reads and no parsing needed. This has been suggested for use in CosmWasm as an optional addition. It may be considered an opt-in format for contracts desiring such efficiency or strict schema, or possibly just used for encoding internal data structures (Params).

<br>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.burnt.com/xion/others/archived/cosmwasm-resources/architecture-of-multi-chain-contracts/serialization-formats.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
