Skip to main content

Crate pallas

Crate pallas 

Source
Expand description

Rust-native building blocks for the Cardano blockchain ecosystem.

Pallas is a collection of modules that re-implements core Ouroboros / Cardano logic in native Rust. It does not provide any single application; it is a base layer for higher-level use-cases — explorers, indexers, wallets, transaction builders, validators, and (eventually) full nodes.

§Crate layout

The umbrella pallas crate re-exports every building block under a single module tree, organised by domain:

pallas
├── network         — Ouroboros networking stack
├── network2        — P2P-first networking stack (feature `network2`)
├── ledger
│   ├── primitives  — multi-era CBOR primitives
│   ├── traverse    — multi-era traversal helpers
│   ├── addresses   — Cardano address codec
│   └── validate    — phase-1 / phase-2 transaction validation
├── crypto          — cryptographic primitives
├── codec           — CBOR codec (minicbor)
├── interop
│   ├── utxorpc     — UTxO RPC interop
│   └── hardano     — Haskell-node interop (feature `hardano`)
└── txbuilder       — ergonomic transaction builder

Each module is a thin re-export of a standalone pallas-* crate published on crates.io (pallas-network, pallas-primitives, …). If you only need a subset, depend on the individual crates directly.

§Examples

Runnable demonstrations of common integration patterns live in the examples/ directory of the repository:

ExampleDescription
block-decodeDecode a Byron-era block from CBOR
block-downloadDownload a single block from a remote node by chain point
crawlerConsume the chain-sync mini-protocol with pluggable block/tx filters
n2n-miniprotocolsNode-to-node mini-protocols over TCP
n2c-miniprotocolsNode-to-client mini-protocols over a local Unix socket
p2p-initiatorInitiate a P2P connection using pallas-network2
p2p-responderAccept incoming P2P connections using pallas-network2
p2p-discoveryPeer discovery using pallas-network2
walletWallet key generation, BIP-39 mnemonics, address derivation

§Feature flags

FeatureEnables
hardanoHaskell-node interop (pallas::interop::hardano)
phase2Plutus script validation in ledger::validate
network2The P2P-first networking stack (pallas::network2)
relaxedRelaxed validation modes across primitives and crypto
unstableAggregates feature gates that are not yet stable

Features are additive: enabling one never removes APIs exposed by another. docs.rs builds with all-features.

§Minimum Supported Rust Version

Pallas’s MSRV is Rust 1.88. Bumping it is treated as a breaking change and is called out in the changelog.

§License

Distributed under the terms of the Apache License 2.0. To report a security issue, follow the disclosure process in SECURITY.md rather than opening a public issue.

Modules§

codec
Shared CBOR codec for Cardano data structures.
crypto
Cryptographic primitives used across Cardano.
interop
Adapters for systems built outside Pallas.
ledger
Cardano’s on-chain data model.
network
Wire-level Ouroboros networking stack.
network2
P2P-first rewrite of the Ouroboros networking stack.
txbuilder
Ergonomic builder for Cardano transactions.