Skip to content

Commit

Permalink
Merge rust-bitcoin#2503: base58: Re-name crate to base58ck
Browse files Browse the repository at this point in the history
6b09857 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 6b09857
  sanket1729:
    ACK 6b09857

Tree-SHA512: 86ee08105906a6f3403dc2602e827b0d46226798ecdedb420ad3ac4b657d6a00e25eabcdfbdb9f8e89bdc3a38e608189f1e073e65593f89a2ad853e8ff027f69
  • Loading branch information
apoelstra committed Mar 20, 2024
2 parents 4d90e0b + 6b09857 commit 6ff8505
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 15 deletions.
4 changes: 2 additions & 2 deletions Cargo-minimal.lock
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711"

[[package]]
name = "base58check"
name = "base58ck"
version = "0.1.0"
dependencies = [
"bitcoin-internals",
Expand Down Expand Up @@ -49,7 +49,7 @@ dependencies = [
name = "bitcoin"
version = "0.31.0"
dependencies = [
"base58check",
"base58ck",
"base64",
"bech32",
"bincode",
Expand Down
4 changes: 2 additions & 2 deletions Cargo-recent.lock
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711"

[[package]]
name = "base58check"
name = "base58ck"
version = "0.1.0"
dependencies = [
"bitcoin-internals",
Expand Down Expand Up @@ -48,7 +48,7 @@ dependencies = [
name = "bitcoin"
version = "0.31.0"
dependencies = [
"base58check",
"base58ck",
"base64",
"bech32",
"bincode",
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
members = ["bitcoin", "hashes", "internals", "fuzz", "io", "units", "base58"]
resolver = "2"

[patch.crates-io.base58check]
[patch.crates-io.base58ck]
path = "base58"

[patch.crates-io.bitcoin]
Expand Down
2 changes: 1 addition & 1 deletion base58/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "base58check"
name = "base58ck"
version = "0.1.0"
authors = ["Andrew Poelstra <apoelstra@wpsoftware.net>"]
license = "CC0-1.0"
Expand Down
20 changes: 13 additions & 7 deletions base58/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,22 @@ Bitcoin base58 encoding
This crate provides encoding and decoding of base58 strings as defined by the Bitcoin ecosystem
including the checksum.

There are two other crates on crates.io that implement base58 encoding and decoding. This
crate differs from them because:
There are a bunch of crates on crates.io that implement base58 encoding and decoding. The more
obviously named ones differ from this crate because:

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
implementation intended to be production-ready and to provide an Rust-idiomatic API.
Bitcoin Core as part of a large long-term transpilation project, whereas this crate is a pure
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
February 2024. It does not validate checksums and will therefore accept invalid Bitcoin
addresses. It may be appropriate in cases where performance is more important than safety.
2. [base58](https://crates.io/crates/base58) implements parsing but does not validate checksums (see
`base58check`). 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)
Expand Down
2 changes: 1 addition & 1 deletion bitcoin/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ all-features = true
rustdoc-args = ["--cfg", "docsrs"]

[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"] }
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"] }
Expand Down
2 changes: 1 addition & 1 deletion bitcoin/embedded/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ codegen-units = 1 # better optimizations
debug = true # symbols are nice and they don't increase the size on Flash
lto = true # better optimizations

[patch.crates-io.base58check]
[patch.crates-io.base58ck]
path = "../../base58"

[patch.crates-io.bitcoin_hashes]
Expand Down

0 comments on commit 6ff8505

Please sign in to comment.