Encoding
Evolution SDK handles multiple encoding formats used across the Cardano ecosystem — hex for raw bytes, Bech32 for addresses, CBOR for on-chain data, and JSON for interchange. The encoding modules provide type-safe conversion between these formats.
CBOR
Low-level CBOR encoding, decoding, and byte-identical re-encoding
Bech32
Bech32 encoding for Cardano addresses
Hex
Hexadecimal encoding for bytes, hashes, and binary data
JSON
JSON representation of Plutus data structures
PlutusData
On-chain data structures for Cardano smart contracts
TSchema
Type-safe schema definitions for Plutus data structures
Plutus Types
Pre-built type-safe schemas for common Cardano data structures
UPLC
Working with Untyped Plutus Lambda Calculus programs
How They Connect
Typical flow: Define a schema with TSchema → encode values to PlutusData → serialize to CBOR → get hex for transactions. Addresses use a separate Bech32 path.
Encoding Formats
| Format | Use Case | Example |
|---|---|---|
| Hex | Raw bytes, hashes, policy IDs | "a1b2c3d4..." |
| Bech32 | Addresses | "addr_test1vr..." |
| CBOR | On-chain data, transactions | Binary format |
| PlutusData | Smart contract datums/redeemers | Structured data |
| TSchema | Type-safe Plutus schema definitions | Schema + codec |
| JSON | API interchange, debugging | { "int": 42 } |
Next Steps
- CBOR — Low-level CBOR encoding and decoding
- Bech32 — Address encoding format
- Hex — Hexadecimal encoding for bytes and hashes
- JSON — JSON data interchange
- PlutusData — On-chain data structures
- TSchema — Type-safe schema definitions
- Plutus Types — Pre-built schemas for Cardano types
- UPLC — Untyped Plutus Lambda Calculus programs