Merge rust-bitcoin/rust-bitcoin#2503: base58: Re-name crate to base58ck

6b09857f55 base58: Re-name crate to base58ck (Tobin C. Harding)

Pull request description:

  The current name `base58check` is taken, as is `base58`. Use `base58ck` instead.

  Add a brief section to the readme about the crate naming.

ACKs for top commit:
  apoelstra:
    ACK 6b09857f55
  sanket1729:
    ACK 6b09857f55

Tree-SHA512: 86ee08105906a6f3403dc2602e827b0d46226798ecdedb420ad3ac4b657d6a00e25eabcdfbdb9f8e89bdc3a38e608189f1e073e65593f89a2ad853e8ff027f69
This commit is contained in:
Andrew Poelstra 2024-03-20 16:38:25 +00:00
commit 6ff850539a
No known key found for this signature in database
GPG Key ID: C588D63CE41B97C1
7 changed files with 21 additions and 15 deletions

View File

@ -15,7 +15,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711"
[[package]] [[package]]
name = "base58check" name = "base58ck"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"bitcoin-internals", "bitcoin-internals",
@ -49,7 +49,7 @@ dependencies = [
name = "bitcoin" name = "bitcoin"
version = "0.31.0" version = "0.31.0"
dependencies = [ dependencies = [
"base58check", "base58ck",
"base64", "base64",
"bech32", "bech32",
"bincode", "bincode",

View File

@ -15,7 +15,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711"
[[package]] [[package]]
name = "base58check" name = "base58ck"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"bitcoin-internals", "bitcoin-internals",
@ -48,7 +48,7 @@ dependencies = [
name = "bitcoin" name = "bitcoin"
version = "0.31.0" version = "0.31.0"
dependencies = [ dependencies = [
"base58check", "base58ck",
"base64", "base64",
"bech32", "bech32",
"bincode", "bincode",

View File

@ -2,7 +2,7 @@
members = ["bitcoin", "hashes", "internals", "fuzz", "io", "units", "base58"] members = ["bitcoin", "hashes", "internals", "fuzz", "io", "units", "base58"]
resolver = "2" resolver = "2"
[patch.crates-io.base58check] [patch.crates-io.base58ck]
path = "base58" path = "base58"
[patch.crates-io.bitcoin] [patch.crates-io.bitcoin]

View File

@ -1,5 +1,5 @@
[package] [package]
name = "base58check" name = "base58ck"
version = "0.1.0" version = "0.1.0"
authors = ["Andrew Poelstra <apoelstra@wpsoftware.net>"] authors = ["Andrew Poelstra <apoelstra@wpsoftware.net>"]
license = "CC0-1.0" license = "CC0-1.0"

View File

@ -4,16 +4,22 @@ Bitcoin base58 encoding
This crate provides encoding and decoding of base58 strings as defined by the Bitcoin ecosystem This crate provides encoding and decoding of base58 strings as defined by the Bitcoin ecosystem
including the checksum. including the checksum.
There are two other crates on crates.io that implement base58 encoding and decoding. This There are a bunch of crates on crates.io that implement base58 encoding and decoding. The more
crate differs from them because: obviously named ones differ from this crate because:
1. [bitcoin-base58](https://crates.io/crates/bitcoin-base58) is transpiled from the C++ code in 1. [bitcoin-base58](https://crates.io/crates/bitcoin-base58) is transpiled from the C++ code in
Bitcoin Core as part of a large long-term transpilation project; this crate is a pure Rust Bitcoin Core as part of a large long-term transpilation project, whereas this crate is a pure
implementation intended to be production-ready and to provide an Rust-idiomatic API. Rust implementation intended to be production-ready and to provide an Rust-idiomatic API.
2. [base58](https://crates.io/crates/base58) is incomplete and appears unmaintained as of 2. [base58](https://crates.io/crates/base58) implements parsing but does not validate checksums (see
February 2024. It does not validate checksums and will therefore accept invalid Bitcoin `base58check`). It may be appropriate in cases where performance is more important than safety.
addresses. It may be appropriate in cases where performance is more important than safety. Appears unmaintained.
3. [base58check](https://crates.io/crates/base58check) Adds checksum to the `base58` crate and
depends on [sha2](https://crates.io/crates/sha2/0.8.2) for hashing. Appears unmaintained.
This crate uses [bitcoin_hashes](https://crates.io/crates/bitcoin_hashes) when hashing to calculate
the checksum.
## Minimum Supported Rust Version (MSRV) ## Minimum Supported Rust Version (MSRV)

View File

@ -28,7 +28,7 @@ all-features = true
rustdoc-args = ["--cfg", "docsrs"] rustdoc-args = ["--cfg", "docsrs"]
[dependencies] [dependencies]
base58 = { package = "base58check", version = "0.1.0", default-features = false } base58 = { package = "base58ck", version = "0.1.0", default-features = false }
bech32 = { version = "0.11.0", default-features = false, features = ["alloc"] } bech32 = { version = "0.11.0", default-features = false, features = ["alloc"] }
hashes = { package = "bitcoin_hashes", version = "0.13.0", default-features = false, features = ["alloc", "io"] } hashes = { package = "bitcoin_hashes", version = "0.13.0", default-features = false, features = ["alloc", "io"] }
hex = { package = "hex-conservative", version = "0.2.0", default-features = false, features = ["alloc"] } hex = { package = "hex-conservative", version = "0.2.0", default-features = false, features = ["alloc"] }

View File

@ -27,7 +27,7 @@ codegen-units = 1 # better optimizations
debug = true # symbols are nice and they don't increase the size on Flash debug = true # symbols are nice and they don't increase the size on Flash
lto = true # better optimizations lto = true # better optimizations
[patch.crates-io.base58check] [patch.crates-io.base58ck]
path = "../../base58" path = "../../base58"
[patch.crates-io.bitcoin_hashes] [patch.crates-io.bitcoin_hashes]