This is a library for serialization & deserialization of data structures used in Cardano’s Haskell implementation of Shelley along with useful utility functions.
Rust is wonderfully portable! You can easily bind to the native Rust library from any common programming language (even C and WebAssembly)!
Serialization/deserialization code is automatically generated from Cardano’s official specification, which guarantees it can easily stay up to date! We do this using an EMURGO-written tool called cddl-codegen which can be re-used for other tasks such as automatically generating a Rust library for Cardano metadata specifications!
It is also very easy to create scripts in Rust or WASM to share with stake pools, or even embed inside an online tool! No more crazy cardano-cli bash scripts!
Powerful and flexible enough to be used to power wallets and exchanges! (Yes, it’s used in production!)
You can also look in the example folder to see how to use this library from Typescript or just experiment with the library.
If you are looking for legacy bindings, you can find them at the following:
Here are the location of the original CDDL specifications:
If you need to install Rust, do the following:
curl https://sh.rustup.rs -sSf | sh -s -- -yecho 'export PATH=$HOME/.cargo/bin/:$PATH' >> $BASH_ENVrustup install stablerustup target add wasm32-unknown-unknown --toolchain stablecurl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
To build this repository, do the following:
git submodule update --init --recursivenvm usenpm installnpm run rust:build-nodejs
npm run rust:test
To publish a new version to crates.io
npm run rust:publish
To publish new versions to NPM (only needed if you are an admin of this project)
npm run js:publish-nodejsnpm run js:publish-browsernpm run js:publish-asm