2022-09-07 23:32:08 +00:00
|
|
|
[package]
|
|
|
|
name = "bitcoin"
|
2023-10-24 04:28:08 +00:00
|
|
|
version = "0.31.0"
|
2022-09-07 23:32:08 +00:00
|
|
|
authors = ["Andrew Poelstra <apoelstra@wpsoftware.net>"]
|
|
|
|
license = "CC0-1.0"
|
|
|
|
repository = "https://github.com/rust-bitcoin/rust-bitcoin/"
|
|
|
|
documentation = "https://docs.rs/bitcoin/"
|
2023-02-02 22:26:22 +00:00
|
|
|
description = "General purpose library for using and interoperating with Bitcoin."
|
|
|
|
categories = ["cryptography::cryptocurrencies"]
|
2022-09-07 23:32:08 +00:00
|
|
|
keywords = [ "crypto", "bitcoin" ]
|
2023-03-22 01:08:48 +00:00
|
|
|
readme = "../README.md"
|
2023-11-14 22:14:56 +00:00
|
|
|
edition = "2021"
|
2023-11-15 00:54:33 +00:00
|
|
|
rust-version = "1.56.1"
|
2023-02-02 22:26:22 +00:00
|
|
|
exclude = ["tests", "contrib"]
|
2022-09-07 23:32:08 +00:00
|
|
|
|
|
|
|
[features]
|
|
|
|
default = [ "std", "secp-recovery" ]
|
2023-10-04 06:09:26 +00:00
|
|
|
rand-std = ["secp256k1/rand-std", "std"]
|
2022-11-14 17:41:56 +00:00
|
|
|
rand = ["secp256k1/rand"]
|
2022-09-20 15:11:35 +00:00
|
|
|
serde = ["actual-serde", "hashes/serde", "secp256k1/serde", "internals/serde"]
|
2022-09-07 23:32:08 +00:00
|
|
|
secp-lowmemory = ["secp256k1/lowmemory"]
|
|
|
|
secp-recovery = ["secp256k1/recovery"]
|
2022-10-25 11:35:32 +00:00
|
|
|
bitcoinconsensus-std = ["bitcoinconsensus/std", "std"]
|
2022-09-07 23:32:08 +00:00
|
|
|
|
|
|
|
# At least one of std, no-std must be enabled.
|
|
|
|
#
|
|
|
|
# The no-std feature doesn't disable std - you need to turn off the std feature for that by disabling default.
|
|
|
|
# Instead no-std enables additional features required for this crate to be usable without std.
|
|
|
|
# As a result, both can be enabled without conflict.
|
Add a `bitcoin_io` crate
In order to support standard (de)serialization of structs, the
`rust-bitcoin` ecosystem uses the standard `std::io::{Read,Write}`
traits. This works great for environments with `std`, however sadly
the `std::io` module has not yet been added to the `core` crate.
Thus, in `no-std`, the `rust-bitcoin` ecosystem has historically
used the `core2` crate to provide copies of the `std::io` module
without any major dependencies. Sadly, its one dependency,
`memchr`, recently broke our MSRV.
Worse, because we didn't want to take on any excess dependencies
for `std` builds, `rust-bitcoin` has had to have
mutually-exclusive `std` and `no-std` builds. This breaks general
assumptions about how features work in Rust, causing substantial
pain for applications far downstream of `rust-bitcoin` crates.
Here, we add a new `bitcoin_io` crate, making it an unconditional
dependency and using its `io` module in the in-repository crates
in place of `std::io` and `core2::io`. As it is not substantial
additional code, the `hashes` io implementations are no longer
feature-gated.
This doesn't actually accomplish anything on its own, only adding
the new crate which still depends on `core2`.
2023-10-04 05:51:26 +00:00
|
|
|
std = ["secp256k1/std", "bitcoin-io/std", "hashes/std", "bech32/std", "internals/std", "hex/std"]
|
2023-11-06 19:22:43 +00:00
|
|
|
no-std = ["hashes/alloc", "hashes/io", "bitcoin-io/alloc", "bech32/alloc", "secp256k1/alloc", "hex/alloc"]
|
2022-09-07 23:32:08 +00:00
|
|
|
|
|
|
|
[package.metadata.docs.rs]
|
2023-02-02 22:24:48 +00:00
|
|
|
all-features = true
|
2022-09-07 23:32:08 +00:00
|
|
|
rustdoc-args = ["--cfg", "docsrs"]
|
|
|
|
|
|
|
|
[dependencies]
|
2023-06-27 22:57:25 +00:00
|
|
|
internals = { package = "bitcoin-internals", version = "0.2.0" }
|
2023-07-21 00:38:34 +00:00
|
|
|
hex = { package = "hex-conservative", version = "0.1.1", default-features = false }
|
2023-10-09 18:17:26 +00:00
|
|
|
bech32 = { version = "0.10.0-beta", default-features = false }
|
2023-07-14 04:45:33 +00:00
|
|
|
hashes = { package = "bitcoin_hashes", version = "0.13.0", default-features = false }
|
2023-10-02 01:48:50 +00:00
|
|
|
secp256k1 = { version = "0.28.0", default-features = false, features = ["hashes"] }
|
2023-02-20 21:33:51 +00:00
|
|
|
hex_lit = "0.1.1"
|
2022-09-07 23:32:08 +00:00
|
|
|
|
Add a `bitcoin_io` crate
In order to support standard (de)serialization of structs, the
`rust-bitcoin` ecosystem uses the standard `std::io::{Read,Write}`
traits. This works great for environments with `std`, however sadly
the `std::io` module has not yet been added to the `core` crate.
Thus, in `no-std`, the `rust-bitcoin` ecosystem has historically
used the `core2` crate to provide copies of the `std::io` module
without any major dependencies. Sadly, its one dependency,
`memchr`, recently broke our MSRV.
Worse, because we didn't want to take on any excess dependencies
for `std` builds, `rust-bitcoin` has had to have
mutually-exclusive `std` and `no-std` builds. This breaks general
assumptions about how features work in Rust, causing substantial
pain for applications far downstream of `rust-bitcoin` crates.
Here, we add a new `bitcoin_io` crate, making it an unconditional
dependency and using its `io` module in the in-repository crates
in place of `std::io` and `core2::io`. As it is not substantial
additional code, the `hashes` io implementations are no longer
feature-gated.
This doesn't actually accomplish anything on its own, only adding
the new crate which still depends on `core2`.
2023-10-04 05:51:26 +00:00
|
|
|
bitcoin-io = { version = "0.1", default-features = false }
|
|
|
|
|
2023-08-28 00:02:58 +00:00
|
|
|
base64 = { version = "0.21.3", optional = true }
|
2023-06-19 19:24:30 +00:00
|
|
|
# Only use this feature for no-std builds, otherwise use bitcoinconsensus-std.
|
2023-02-20 21:35:25 +00:00
|
|
|
bitcoinconsensus = { version = "0.20.2-0.5.0", default-features = false, optional = true }
|
2023-07-21 00:44:16 +00:00
|
|
|
|
2022-09-07 23:32:08 +00:00
|
|
|
# Do NOT use this as a feature! Use the `serde` feature instead.
|
2022-09-13 13:47:21 +00:00
|
|
|
actual-serde = { package = "serde", version = "1.0.103", default-features = false, features = [ "derive", "alloc" ], optional = true }
|
2022-09-07 23:32:08 +00:00
|
|
|
|
|
|
|
[dev-dependencies]
|
2022-09-13 13:47:21 +00:00
|
|
|
serde_json = "1.0.0"
|
|
|
|
serde_test = "1.0.19"
|
2022-09-07 23:32:08 +00:00
|
|
|
bincode = "1.3.1"
|
|
|
|
|
2022-12-20 05:19:32 +00:00
|
|
|
[target.'cfg(mutate)'.dev-dependencies]
|
|
|
|
mutagen = { git = "https://github.com/llogiq/mutagen" }
|
|
|
|
|
2022-09-07 23:32:08 +00:00
|
|
|
[[example]]
|
|
|
|
name = "bip32"
|
|
|
|
|
|
|
|
[[example]]
|
|
|
|
name = "handshake"
|
2022-11-16 21:16:01 +00:00
|
|
|
required-features = ["std", "rand-std"]
|
2022-09-07 23:32:08 +00:00
|
|
|
|
|
|
|
[[example]]
|
|
|
|
name = "ecdsa-psbt"
|
|
|
|
required-features = ["std", "bitcoinconsensus"]
|
2022-05-07 20:22:53 +00:00
|
|
|
|
|
|
|
[[example]]
|
|
|
|
name = "taproot-psbt"
|
2022-11-16 21:16:01 +00:00
|
|
|
required-features = ["std", "rand-std", "bitcoinconsensus"]
|