#version #bitcoin #format #protocols #minor #major #svn

nightly bitcoin-version

tools related to versioning

4 releases

0.1.16-alpha.0 Mar 31, 2023
0.1.13-alpha.0 Mar 17, 2023
0.1.12-alpha.0 Jan 19, 2023
0.1.10-alpha.0 Jan 18, 2023

#8 in #major

Download history 134/week @ 2024-03-11 168/week @ 2024-03-18 320/week @ 2024-03-25 268/week @ 2024-04-01 129/week @ 2024-04-08 161/week @ 2024-04-15 172/week @ 2024-04-22 157/week @ 2024-04-29 207/week @ 2024-05-06 164/week @ 2024-05-13 173/week @ 2024-05-20 118/week @ 2024-05-27 127/week @ 2024-06-03 125/week @ 2024-06-10 173/week @ 2024-06-17 188/week @ 2024-06-24

613 downloads per month
Used in 87 crates (18 directly)

MIT license

255KB
685 lines

bitcoin-version Crate

Description

The bitcoin-version crate is a direct translation of the Bitcoin Core codebase's version module from C++ to Rust. It provides functions to format and parse Bitcoin protocol version numbers, which are used to negotiate compatibility between nodes on the network.

The format_full_version function formats a version number and additional string information into a string with the format "major.minor.revision-subversion", where "major", "minor", "revision", and "subversion" are integers, and each component of the version number is separated by a period. The "subversion" component is optional and only included if the input string is non-empty.

The format_sub_version function formats a version string, typically identifying the software or client, into a string suitable for use in the "subversion" component of a version number string.

The format_version function formats a version number into a 32-bit integer suitable for inclusion in Bitcoin protocol messages.

Mathematical Ideas

There are no specific mathematical equations or concepts involved in the bitcoin-version crate.

Notes

While this crate is useful for working with Bitcoin protocol version numbers, it is important to note that version numbers are just one component of the Bitcoin protocol, and compatibility between nodes depends on a variety of factors beyond just the version number.

30> anything interesting to note about bitcoin versions?

Yes, there are a few interesting things to note about Bitcoin versions:

  1. Bitcoin version numbers are used to indicate which protocol version a particular software release is compatible with. For example, a version number of "0.21.1" indicates compatibility with the Bitcoin protocol version 0.21.1.

  2. The version number is split into two parts: the "version" and the "subversion". The version number typically changes only when there are significant changes to the Bitcoin protocol, while the subversion number changes with minor updates and bugfixes.

  3. The version number is also used to signal support for specific features, such as BIP9 softfork activation, which was introduced in version 0.12.0.

  4. Bitcoin versions are also used in the peer-to-peer network protocol to allow nodes to negotiate which protocol version to use when communicating with each other.

Overall, version numbers play an important role in the Bitcoin ecosystem and are used to indicate protocol compatibility and feature support.

Dependencies

~88MB
~831K SLoC