rust-bitcoin-unsafe-fast/p2p
rustaceanrob d9cf7270eb
Move `bitcoin/p2p` into `p2p`
Moves all of the content from `bitcoin/p2p` into `p2p`.

`TryFrom<Network>` must be implemented for `Network -> Magic` now that
`Network` is a foreign, non-exhaustive type. Ser/de test is updated
accordingly, as well as the `Magic::from_network` constructor, which I
have opted to return an `Option<Self>`. The `TryFrom` implementation
uses a new `UnknownNetworkError(Network)` that mirrors the `Magic ->
Network` error.

The example handshake does not generate a random nonce for the version
message, as there is no `rand` dependency in this crate and the program
only makes a single, user-defined connection.

It appears we can do better than copying and pasting the consensus
encoding macros and functions from `bitcoin` without doing weird
cross-crate macros that require some special knowledge of the crate to
know when they will compile.
2025-06-18 14:11:35 +01:00
..
contrib Introduce empty p2p messages crate 2025-05-28 09:44:00 +01:00
examples Move `bitcoin/p2p` into `p2p` 2025-06-18 14:11:35 +01:00
src Move `bitcoin/p2p` into `p2p` 2025-06-18 14:11:35 +01:00
CHANGELOG.md Introduce empty p2p messages crate 2025-05-28 09:44:00 +01:00
Cargo.toml Move `bitcoin/p2p` into `p2p` 2025-06-18 14:11:35 +01:00
README.md Introduce empty p2p messages crate 2025-05-28 09:44:00 +01:00

README.md

Rust Bitcoin Peer to Peer Message Types

This crate provides data types used in the Bitcoin peer-to-peer protocol.

Minimum Supported Rust Version (MSRV)

This library should always compile with any combination of features on Rust 1.63.0.

Licensing

The code in this project is licensed under the Creative Commons CC0 1.0 Universal license. We use the SPDX license list and SPDX IDs.