bitcoin 0.18.2

General purpose library for using and interoperating with Bitcoin and other cryptocurrencies.
Documentation

# 0.18.0 - 2019-03-21

* Update `bitcoin-bech32` version to 0.18
* add `to_bytes` method for `util::key` types
* add serde impls for `util::key` types
* contracthash: minor cleanups, use `util::key` types instead of `secp256k1` types

# 0.17.1 - 2019-03-04

* Add some trait impls to `PublicKey` for miniscript interoperability

# 0.17.0 - 2019-02-28 - ``The PSBT Release''

* **Update minimum rustc version to 1.22**.
* [Replace `rust-crypto` with `bitcoin_hashes`; refactor hash types]https://github.com/rust-bitcoin/rust-bitcoin/pull/215
* [Remove `Address::p2pk`]https://github.com/rust-bitcoin/rust-bitcoin/pull/222/
* Remove misleading blanket `MerkleRoot` implementation; [it is now only defined for `Block`]https://github.com/rust-bitcoin/rust-bitcoin/pull/218
* [Add BIP157]https://github.com/rust-bitcoin/rust-bitcoin/pull/215 (client-side block filtering messages)
* Allow network messages [to be deserialized even across multiple packets]https://github.com/rust-bitcoin/rust-bitcoin/pull/231
* [Replace all key types]https://github.com/rust-bitcoin/rust-bitcoin/pull/183 to better match abstractions needed for PSBT
* [Clean up BIP32]https://github.com/rust-bitcoin/rust-bitcoin/pull/233 in preparation for PSBT; [use new native key types rather than `secp256k1` ones]https://github.com/rust-bitcoin/rust-bitcoin/pull/238/
* Remove [apparently-used `Option` serialization]https://github.com/rust-bitcoin/rust-bitcoin/pull/236#event-2158116421 code
* Finally merge [PSBT]https://github.com/rust-bitcoin/rust-bitcoin/pull/103 after nearly nine months

# 0.16.0 - 2019-01-15

* Reorganize opcode types to eliminate unsafe code
* Un-expose some macros that were unintentionally exported
* Update rust-secp256k1 dependency to 0.12
* Remove `util::iter::Pair` type which does not belong in this library
* Minor bugfixes and optimizations

# 0.15.1 - 2018-11-08

* [Detect p2pk addresses with compressed keys]https://github.com/rust-bitcoin/rust-bitcoin/pull/189

# 0.15.0 - 2018-11-03

* [Significant API overhaul]https://github.com/rust-bitcoin/rust-bitcoin/pull/156:
    * Remove `nu_select` macro and low-level networking support
    * Move `network::consensus_params` to `consensus::params`
    * Move many other things into `consensus::params`
    * Move `BitcoinHash` from `network::serialize` to `util::hash`; remove impl for `Vec<u8>`
    * Rename/restructure error types
    * Rename `Consensus{De,En}coder` to `consensus::{De,En}coder`
    * Replace `Raw{De,En}coder` with blanket impls of `consensus::{De,En}coder` on `io::Read` and `io::Write`
    * make `serialize` and `serialize_hex` infallible
* Make 0-input transaction de/serialization [always use segwit]https://github.com/rust-bitcoin/rust-bitcoin/pull/153
* Implement `FromStr` and `Display` for many more types

# 0.14.2 - 2018-09-11

* Add serde support for `Address`

# 0.14.1 - 2018-08-28

* Reject non-compact `VarInt`s on various types
* Expose many types at the top level of the crate
* Add `Ord`, `PartialOrd` impls for `Script`

# 0.14.0 - 2018-08-22

* Add [regtest network]https://github.com/rust-bitcoin/rust-bitcoin/pull/84 to `Network` enum
* Add [`Script::is_op_return()`]https://github.com/rust-bitcoin/rust-bitcoin/pull/101/ which is more specific than
  `Script::is_provably_unspendable()`
* Update to bech32 0.8.0; [add Regtest bech32 address support]https://github.com/rust-bitcoin/rust-bitcoin/pull/110
* [Replace rustc-serialize dependency with hex]https://github.com/rust-bitcoin/rust-bitcoin/pull/107 as a stopgap
  toward eliminating any extra dependencies for this; clean up the many independent hex encoders and decoders
  throughout the codebase.
* [Add conversions between `ChildNumber` and `u32`]https://github.com/rust-bitcoin/rust-bitcoin/pull/126; make
  representation non-public; fix documentation
* [Add several derivation convenience]https://github.com/rust-bitcoin/rust-bitcoin/pull/129 to `bip32` extended keys
* Make `deserialize::deserialize()` [enforce no trailing bytes]https://github.com/rust-bitcoin/rust-bitcoin/pull/129
* Replace `TxOutRef` with `OutPoint`; use it in `TxIn` struct.
* Use modern `as_` `to_` `into_` conventions for array-wrapping types; impl `Display` rather than `ToString` for most types
* Change `script::Instructions` iterator [to allow rejecting non-minimal pushes]https://github.com/rust-bitcoin/rust-bitcoin/pull/136;
  fix bug where errors would iterate forever.
* Overhaul `util::Error`; introduce `serialize::Error` [and use it for `SimpleDecoder` and `SimpleDecoder` rather
  than parameterizing these over their error type](https://github.com/rust-bitcoin/rust-bitcoin/pull/137).
* Overhaul `UDecimal` and `Decimal` serialization and parsing [and fix many lingering parsing bugs]https://github.com/rust-bitcoin/rust-bitcoin/pull/142
* [Update to serde 1.0 and strason 0.4]https://github.com/rust-bitcoin/rust-bitcoin/pull/125
* Update to secp256k1 0.11.0
* Many, many documentation and test improvements.

# 0.13.1

* Add `Display` trait to uints, `FromStr` trait to `Network` enum
* Add witness inv types to inv enum, constants for Bitcoin regtest network, `is_coin_base` accessor for tx inputs
* Expose `merkleroot(Vec<Sha256dHash>)`

# 0.13

* Move witnesses inside the `TxIn` structure
* Add `Transaction::get_weight()`
* Update bip143 `sighash_all` API to be more ergonomic

# 0.12

* The in-memory blockchain was moved into a dedicated project rust-bitcoin-chain.
* Removed old script interpreter
* A new optional feature "bitcoinconsensus" lets this library use Bitcoin Core's native
script verifier, wrappend into Rust by the rust-bitcoinconsenus project.
See `Transaction::verify` and `Script::verify` methods.
* Replaced Base58 traits with `encode_slice`, `check_encode_slice`, from and `from_check` functions in the base58 module.
* Un-reversed the Debug output for Sha256dHash
* Add bech32 support
* Support segwit address types

### 0.11

* Remove `num` dependency at Matt's request; agree this is obnoxious to require all
downstream users to also have a `num` dependency just so they can use `Uint256::from_u64`.