Module network

Expand description

Bitcoin network.

The term “network” is overloaded, here Network refers to the specific Bitcoin network we are operating on e.g., signet, regtest. The terms “network” and “chain” are often used interchangeably for this concept.

§Example: encoding a network’s magic bytes

use bitcoin::Network;
use bitcoin::consensus::encode::serialize;

let network = Network::Bitcoin;
let bytes = serialize(&network.magic());

assert_eq!(&bytes[..], &[0xF9, 0xBE, 0xB4, 0xD9]);

Modules§

as_core_arg
Module for serialization/deserialization of network variants into/from Bitcoin Core values

Structs§

ParseNetworkError
An error in parsing network string.
UnknownChainHashError
Error in parsing network from chain hash.

Enums§

Network
The cryptocurrency network to act on.
NetworkKind
What kind of network we are on.