Cardano Multiplatform Library (CML)
Introduction​
Cardano Multiplatform Library (CML) is a Rust library that provides core Cardano functionality across multiple platforms. Written in Rust and compiled to various targets, it offers consistent serialization, deserialization, and utility functions for building dApps and wallets on any platform.
The library can be deployed as a Rust crate, JavaScript/TypeScript package, WASM module, or mobile binding, making it ideal for cross-platform Cardano development.
Key Features​
CML handles three main areas of Cardano development:
- Serialization & Deserialization - Complete support for Cardano's core data structures with consistent behavior across all platforms
- Utility Functions - Essential helpers for dApps and wallets including transaction building, address handling, and cryptographic operations
- Multi-Platform Support - Single codebase that works in browsers, Node.js, Rust applications, and mobile apps
Platform Support​
JavaScript / TypeScript​
CML provides NPM packages for different JavaScript environments:
- Browser - Full WASM-based implementation for web browsers
- Node.js - Native module optimized for server-side JavaScript
- asm.js - Legacy JavaScript fallback (strongly discouraged for new projects)
# For browsers
npm install @dcspark/cardano-multiplatform-lib-browser
# For Node.js
npm install @dcspark/cardano-multiplatform-lib-nodejs
Rust​
Available as a standard Rust crate:
cargo add cardano-multiplatform-lib
Mobile​
CML can be integrated into mobile applications using Ionic + Capacitor or equivalent frameworks to enable WASM bindings on iOS and Android.
Getting Started​
For detailed documentation, examples, and API reference, visit the official CML documentation.