Cargo Features

bitcoin = { version = "0.31.0", default-features = false, features = ["rand-std", "rand", "serde", "secp-lowmemory", "secp-recovery", "bitcoinconsensus-std", "std", "no-std", "base64", "bitcoinconsensus"] }
default = secp-recovery, std

These default features are set whenever bitcoin is added without default-features = false somewhere in the dependency tree.

rand-std = std

Enables rand-std of secp256k1


Enables rand of secp256k1

serde = actual-serde

Enables serde of bitcoin_hashes, bitcoin-internals, and secp256k1

Affects amount::serde, consensus::serde, network::as_core_arg


Enables lowmemory of secp256k1

secp-recovery default

Enables recovery of secp256k1

bitcoinconsensus-std = std

Enables std of bitcoinconsensus

Only use this feature for no-std builds, otherwise use bitcoinconsensus-std.

std default bitcoinconsensus-std? rand-std?

At least one of std, no-std must be enabled.

The no-std feature doesn't disable std - you need to turn off the std feature for that by disabling default.
Instead no-std enables additional features required for this crate to be usable without std.
As a result, both can be enabled without conflict.

Enables std of bech32, bitcoin_hashes, hex-conservative, bitcoin-internals, and secp256k1

Affects p2p::address, p2p::message, p2p::message_blockdata, p2p::message_bloom, p2p::message_compact_blocks, p2p::message_filter, p2p::message_network

no-std = core2

Enables alloc of bech32, alloc of secp256k1, alloc and core2 of bitcoin_hashes and hex-conservative

Features from optional dependencies

In crates that don't use the dep: syntax, optional dependencies automatically become Cargo features.

base64 implicit feature

With default (std)

bitcoinconsensus implicit feature

Affects consensus::validation

core2 no-std?

Enables alloc of core2 ^0.3.2

There is no reason to use this dependency directly, it is activated by the "no-std" feature.

actual-serde serde?

Enables derive and alloc of serde

Do NOT use this as a feature! Use the serde feature instead.