Features and MSRV
Cargo features, what each adds, TLS for PostgreSQL, and the MSRV policy.
On this page
The features
One feature is on by default: getrandom. With none at all
(default-features = false), the crate is the rule core, both façades,
MemoryStore, proofs, reports, the export view and every C2SP text format — no
async runtime, no database driver, no signature library, no randomness. The
same list is rendered under "Feature flags" on the
crate root.
| Feature | Adds | Brings |
|---|---|---|
getrandom (default) | memo salts from the operating system | getrandom |
serde | Serialize / Deserialize on all public types; the hashed encoding never goes through serde | serde |
sqlite | SqlStore<Sqlite>, SQLite bundled | sqlx (tokio runtime) |
postgres | SqlStore<Postgres>, no TLS stack | sqlx (tokio runtime) |
postgres-tls | postgres with TLS: rustls on aws-lc-rs, Mozilla's root set | rustls, aws-lc-rs, webpki-roots |
witness | Ed25519: LogKey signs checkpoints; cosignatures and policies verify; WitnessSession, Verifier | ed25519-dalek |
testing | doubleentry::testing: the conformance suite for stores (with witness, also TestWitness) | tokio |
tracing | a span per façade operation and per SQL store write — never an amount, memo or account path | tracing |
Always on: sha2, time, unicode-normalization (NFC for names),
thiserror and document-features.
Without witness, notes, checkpoints, vkeys, policies, requests, bundles and
tiles still parse and render, so a monitor that only reads checkpoints needs no
Ed25519. The crate has no HTTP client and no witness: it builds
add-checkpoint requests and reads replies as bytes.
WebAssembly and builds without randomness
For wasm32-unknown-unknown, or to show a build draws no randomness:
cargo add doubleentry --no-default-features
A memo then needs its salt from you: give the façade a source
(with_salt_source, 16 bytes from a secure generator per call) or salt each
memo (Entry::memo_salted). An unsalted memo is refused with rejection 114.
To keep OS salts on the web instead, keep the default and add
getrandom with its wasm_js feature to your binary.
TLS for PostgreSQL
cargo add doubleentry --features postgres-tls
Then ask for it in the URL:
postgres://app@db/books?sslmode=verify-full&sslrootcert=/etc/ssl/db-ca.pem.
Only require, verify-ca and verify-full guarantee encryption; prefer,
the default, may fall back to plain text. Without the feature, a URL that
requires TLS fails with an error naming it. The provider is aws-lc-rs, which
offers the post-quantum key exchange X25519MLKEM768.
The driver
sqlx is an implementation detail: no sqlx type is in the API (CI checks it),
you never add it for doubleentry, and its upgrades ship without an API change.
The driver's error behind source() is for logging, not covered by semver.
Runtime
Ledger's methods are plain async fns. The SQL stores run on sqlx's tokio
runtime, so SqlStore is used inside a tokio runtime — #[tokio::main] or one
the program builds
(With a database).
Journal needs no runtime.
MSRV
Rust 1.94, edition 2024, set by rust-version in Cargo.toml. CI builds every feature and target with exactly that toolchain and
--locked. The MSRV is a stable release at least six months old when adopted,
and rises only in a non-patch release, with a CHANGELOG line naming the reason.
Limits
tracingonly emits spans; the subscriber is the application's.testing::TestWitnessis a test double; the crate ships no production witness.- The MSRV covers the locked dependencies; newer versions an application's own lock file picks may need a newer compiler.