Docs
Sidechain Overview
Cardano Serialization

Cardano serialization library

This is a library for serialization and deserialization of data structures used in Cardano’s Haskell implementation of Shelley along with useful utility functions.

Using the library

Due to the portability of Rust (opens in a new tab), you can bind to the native Rust library from any common programming language (including C and WebAssembly). This library generates both Typescript (opens in a new tab) and Flow (opens in a new tab) type definitions, and you can check out possible options by just looking at Flow types (opens in a new tab). You can also explore the example folder (opens in a new tab) to see how to use this library from Typescript and experiment with it.

Benefits of using this library

Serialization/deserialization code is automatically generated from Cardano’s official specification, which guarantees it can easily stay up to date. This is enabled due to the use of an EMURGO-written tool called cddl-codegen (opens in a new tab), which can be re-used for other tasks such as the automatic generation of a Rust library for Cardano metadata (opens in a new tab) specifications.

It is also easy to create scripts in Rust or WASM to share with stake pools, or even embed inside an online tool. The library is powerful and flexible enough to be used to power wallets and exchanges.

Other Cardano versions

If you are looking for legacy bindings, you can find them at:

Original binary specifications

You can find original CDDL (opens in a new tab) specifications at:

Instructions

Before you start, see building, testing and publishing tips here (opens in a new tab). Then proceed exploring more in the doc folder (opens in a new tab), or follow the link to the repository below.

For more information: Go to GitHub repo (opens in a new tab)