39 KiB
unreleased
- Bump MSRV to Rust 1.56.1
0.31.1 - 2023-10-18
-
Bump MSRV to Rust 1.48.0 #1729
-
Add new example code for signature verification #1776
-
Manually implement
DebugonWitness#1913 -
Upgrade to
secp256k1 v0.28.0#2098 -
Upgrade to
base64 v0.21.3#2032 -
API Improvements:
- Add kilo weight unit conversion #1735
- Add
ChainHash::from_genesis_block_hash#1753 - Add implementation of
PartialEqtrait forAddress<NetworkUnchecked>#1757 - Add unsafe address type conversions #1765
- Add
Inventory::network_hash()method #515 - Implement
serde::SerializeforAddress#1785 - Expose valid (min, max) difficulty transition thresholds #1820
- Add functionality to generate
PrivateKey#1837 - Allow parsing sub-sat denominations with decimal points #1768
- Fix associated constants of
InputWeightPrediction#1835 - Add
FeeRate::checked_mul_by_weight#1864 - Use
Amounttype for theTxOutvalue field #1811 - Add support for alloc-free parse errors #1297
- Add
Amount::from_int_btc#1870 - Make
ckd_privfunction private and implAsRefforChildNumber#1882 - Use
hex_lit::hexin benches (also backported to v0.30.1) #1941 - Add a verify function to
PublicKey#1911 - Add method
Script::count_sigops#1890 - Implement
From<PublicKey> for XOnlyPublicKey#1901 - Implement
From<secp256k1::PublicKey> for bitcoin::PublicKey#1949 - Add
DerivationPath::to_u32_vec#1946 - Use
Targetas type forpow_limit#2107 - Add
Witness::p2wpkhconstructor #2084 - Make
Instructionbe able to read the script number #2081 - Add
Script::is_mulitsig#2078 - Count sigops for
Transaction#2073 - Add
Psbtfee checks #2064 - Add version bytes consts #2020
- Add
transaction::Versiondata type #2006
-
Moves, Removes, and renames:
- Move witness types to the script module #1846
- Remove reexport of
psbt::Prevouts#1872 - Rename
Transaction::is_coin_basetois_coinbase#1796 - Rename
TaprootSpendInfo::as_script_maptoscript_map#1897 - Rename
Script::emptytoScript::new#1925 - Rename
PartiallySignedTransactiontoPsbt#1938 - Rename
XpubIdenifiertoXKeyIdentifier#2021 - Rename
ExtendedPubKeytoXpub#2019 - Rename
ExtendedPrivKeytoXpriv#2019 - Remove
_v0from various function names (eg,new_v0_p2wpkh) #1994 - Remove
SighashCache::segwit_signature_hash(addp2wpkh_signiture_hashandp2wsh_signature_hash) #1995 - Reexport all the hash types from the crate root #1998
- Rename
opcodes::AlltoOpcode#1995 - Removed
TxOut::default(), the same logic now exists asTxOut::NULL#1811 and #1838
-
Error handling improvements:
0.30.1 - 2023-07-16
- Fix compilation when
RUSTFLAGS=--cfg=benchis set
0.30 - 2023-03-21 "The First Crate-Smashing Release"
We now have a website for crates that live under the rust-bitcoin GitHub organization: https://rust-bitcoin.org/
This release is big, to help users upgrade we wrote a blog post, please see https://rust-bitcoin.org/blog/release-0.30.0/
-
Import
bitcoin_hashesinto this repository. -
Update dependencies we control
- Depend on the new private crate
bitcoin-private - Depend on the new
bitcoin_hashesv0.12 - Depend on the new
secp256k1v0.27
- Depend on the new private crate
-
We moved a lot of modules around, specifically we move basically everything out of
util. -
API improvements:
- Use marker type to enforce validation of
Address's network - New
Witnessfeatures WitnessAPI improvements- Renamed
ScripttoScriptBufand added a new unsized typeScript - Add
tapscript_leaf_hash()toScript - Unify
TapLeafHashandTapBranchHashintoTapNodeHashwhile tree construction - Add
Script::builderconvenience function - Implement
PartiallySignedTransaction::fee - Implement
Script::p2pk_public_key(&self) -> Option<PublicKey> - Add
log2toWork - Add weight utilities to
TxInandTxOut - Add conversions for
TweakedKeyPair->TweakedPublicKey - Add
From<Address>forScriptBuf - Rename
from_slicemethods todecode - Add methods for pushing locktimes to scripts
- Create Address::matches_script_pubkey method
- Add API method
absolute::LockTime::is_satisfied_by_lock - Add
FromHexStrfor parsing strings with and without0xprefix - Add CentiBitcoin to denominations
- Add
difficulty_floatmethod forblock::Header
- Use marker type to enforce validation of
-
Various sighash code moves, and type improvements:
-
New types:
-
Removed types/traits:
- Remove
ToHex - Remove code deprecated in v0.28
- Remove
PackedLockTime, replace with richerLockTimeeverywhere Be aware thatLockTimedoes not have anOrdimplementation, so users who need a total ordering on locktimes will be forced to wrap this type. InTransaction, which contains aLockTimebut isOrd, we have manually sorted the locktimes based on their consensus encoding. This ordering is somewhat arbitrary -- there is no total ordering on locktimes since they may be measured in either blocks or seconds. - Removed
FromHeximplementation from all types exceptVecand arrays, replace where appropriate withFromStr.
- Remove
-
Performance improvements:
- Remove needless allocation from BIP-158 encoding
- Implement fast hex encoding (usage added in a later PR)
-
Testing improvements:
0.29 - 2022-07-20 "Edition 2018 Release"
As promised, this is our quick release to bring on edition 2018 by increasing our MSRV to Rust 1.41.1 #983
This work saw a bunch of new language features become available to us. At the
same time we were able to start using rustfmt. We also started linting as part
of CI.
Breaking changes
There are numerous breaking changes in this release related to the new language features but also
other improvements such as more newtypes added. Note that not all changes cause compilation failure!
For example, Witness serialization was changed
to support human-readable formats.
Detailed list of breaking changes
Highlights
- Added support for BIP 152 #1088
- Edition 2018 improvements
- Implement
TryFrom#1007 - Add
non_exhaustiveto all error enums #1026 - Various other improvements, see tracking issue for more information.
- Implement
- Enable
clippyon CI #1061 - Taproot improvements #950 #936
- serde improvements/changes #1006 #905 #1071 []
- Performance improvements #1033 #996 #1053 #1023
- PSBT improvements #853 [#951] (https://github.com/rust-bitcoin/rust-bitcoin/pull/951) #940
- Script improvements #1021 #954
- New types that may be of interest
- Improve pubkey sorting: #1084
- Introduce
rustfmt#1040 - Dependencies
- Take
Writer/Readerby&mutin consensus en/decoding #1035 - Consume
selfin conversion methods namedto_*instead of borrowing #1161
0.28.2 - 2022-11-01
Backported a set of changes from 0.29 which may cause some specific transactions and/or blocks to fail to deserialize. No known such transactions exist on any public blockchain.
0.28 - 2022-04-20 "The Taproot Release"
At nearly nine months, this is our longest release cycle ever, and thanks to a huge increase in the number of active contributors this year and last, it is also by far our largest release ever, at 148 PRs merged from 23 different contributors. Our primary goal in this release was to introduce support for Taproot and its associated data structures: addresses, taptrees, sighashes, PSBT fields, and more. As it turned out, these changes required (or at least, incentivized) changing a lot of our APIs, causing a significant increase in scope.
We have more big changes coming down the pike. 2022 is going to be a big
year for rust-bitcoin, which we know is exciting for us but disruptive to
downstream users who ultimately want the library to just work. Our hope is
that by 2023 we will have eliminated large amounts of technical debt,
modernized our APIs to meet current Rust conventions, and clarified the scope
of the individual crates in this ecosystem while still providing the essential
functionality needed by our downstream users, especially wallet projects.
We will also develop a plan to make our releases more predictable and manageable, likely by having scheduled releases with limited scope. We would like to reach a point where we no longer have frequent breaking releases, but right now we are nowhere close.
Upcoming changes will include
- A quick new release which updates our MRSV from 1.29 to 1.41 and does little else
- Updating our codebase to take advantage of the new MSRV, especially regarding nostd and wasm support
- A comprehensive rethinking and flattening of our public-facing APIs
- Richer support for PSBT, Script, and BIP-0340/Schnorr signatures
With so many changes since 0.27, we cannot list every PR. Here are the highlights:
- Remove dangerous
fuzztargetcargo feature #634 - Improve serde serialization for
Script#596 - Documentation improvements #623 #633 #663 #689 #704 #744 #852 #869 #865 #864 #858 #806 #877 #912 #923
- Introduce
WitnessVersiontype #617 - Improve error types and API #625
- Implement
Block.get_strippedsize()andTransaction.get_vsize()#626 - Add Bloom filter network messages #580
- Taproot: add signature hash support #628 #702 #722 #835 #903 #796
- Taproot: add new Script opcodes #644 #721 #868 #920
- Taproot: add bech32m support, addresses and new key types #563 #691 #697 #728 #696 #757
- Taproot: add taptree data structures #677 #703 #701 #718 #845 #901 #910 #909 #914
- no-std improvements #637
- PSBT improvements, including Taproot #654 #681 #669 #774 #779 #752 #776 #790 #836 #847 #842
- serde improvements #672
- Update rust-secp256k1 dependency #694 #755 #875
- Change BIP32 to use rust-secp256k1 keys rather than rust-bitcoin ones (no compressedness flag) #590 #591
- Rename inner key field in
PrivateKeyandPublicKey#762 - Address and denomination related changes #768 #784
- Don't allow hybrid EC keys #829
- Change erroneous behavior for
SIGHASH_SINGLEbug #860 #897 - Delete the deprecated
contracthashmodule #871; this functionality will migrate to ElementsProject/rust-elements - Remove compilation-breaking feature-gating of enum variants" #881
Additionally we made several minor API changes (renaming methods, etc.) to improve compliance with modern Rust conventions. Where possible we left the existing methods in place, marked as deprecated.
0.27 - 2021-07-21
- Bigendian fixes and CI test
- no_std support, keeping MSRV
- Bech32m adoption
- Use Amount type for dust value calculation
- Errors enum improvements
- std -> core
0.26.2 - 2021-06-08
The previous release changed the behavior of Display for ChildNumber, assuming that any correct usage would not be
affected. Issue 608 goes into the details of why this isn't
the case and how we broke both rust-miniscript and BDK.
0.26.1 - 2021-06-06 (yanked, see explanation above)
- Change Amount Debug impl to BTC with 8 decimals
- Make uint types (un)serializable
- Add more derives for key::Error
- Fix optional amount serialization
- Add PSBT base64 (de)serialization with Display & FromStr
- Add non-API breaking derives for error & transaction types
- Fix error derives
- Add function to check RBF-ness of transactions
- Add Script:dust_value() to get minimum output value for a spk
- Improving bip32 ChildNumber display implementation
- Make Script::fmt_asm a static method and add Script::str_asm
- Return BlockHash from BlockHeader::validate_pow
- Add a method to error on non-standard hashtypes
- Include proprietary key in deserialized PSBT
- Fix Script::dust_value()'s calculation for non-P2*PKH script_pubkeys
- Add Address to optimized QR string conversion
- Correct Transaction struct encode_signing_data_to doc comment
- Fixing CI if base image's apt db is outdated
- Introduce some policy constants from Bitcoin Core
- Fix warnings for sighashtype
- Introduction of Schnorr keys
- Adding constructors for compressed and uncompressed ECDSA keys
- Count bytes read in encoding
- Add verify_with_flags to Script and Transaction
- Fixes documentation intra-links and enforce it
- Fixing hashes core dependency and fuzz feature
0.26.0 - 2020-12-21
- Add signet support
- Add wtxidrelay message and
WTxinv type for BIP 339 - Add addrv2 support
- Distinguish
FilterHeaderandFilterHash - Add hash preimage fields to PSBT
- Detect write errors for
PublicKey::write_into - impl
OrdandPartialOrdforInventory - Add binary encoding for BIP32 xkeys
- Add Taproot Tagged Hashes
- Add
message::MAX_INV_SIZEconstant - impl
ToSocketAddrsfor network addresses - Add new global fields to PSBT
- Serde serialization of PSBT data
- Make
InventoryandNetworkMessageenums exhaustive - Add PSBT proprietary keys
- Add
PublicKey::read_frommethod symmetric withwrite_to - Bump rust-secp to 0.20, turn off
recoveryfeature by default - Change return value of
consensus_encodetoio::Error
0.25.1 - 2020-10-26
- Remove an incorrect
debug_assertthat can cause a panic when running using the dev profile.
0.25.1 - 2020-10-07
- Expose methods on
Scriptto generate various scriptpubkeys - Expose all cargo features of secp256k1
- Allow directly creating various hash newtypes
- Add methods to
Blockto get the coinbase tx and BIP34 height commitment - Add
extendmethod to bip32::DerivationPath - Alias
(Fingerprint, DerivationPath)asKeySource - Add serde implementation for PSBT data structs
- Add FromStr/Display implementation for SigHashType
- Expose the raw sighash message from sighash computations
- Add support for signmessage/verifymessage style message signatures
0.25.0 - 2020-09-10
- Bump MSRV to 1.29.0
0.24.0 - 2020-09-10
- Remove the
BitcoinHashtrait - Introduce
SigHashCachestructure to replaceSighashComponentsand support all sighash modes - Add
Transaction::get_sizemethod - Export
util::amount::Denomination - Add
Block::get_sizeandBlock::get_weightmethods - Add
MerkleBlock::from_header_txids - Add
BlockHeader::u256_from_compact_target - Add
feefilternetwork message - Cleanup/replace
Script::Instructionsiterator API - Disallow uncompressed pubkeys in witness address generation
- Deprecate
util::contracthashmodule - Add modulo division operation for
Uint128andUint256 - Add
slice_to_u64_beendian conversion method
0.23.0 - 2020-01-07
- Update
secp256k1dependency to0.17.1. - Update
bitcoinconsensusdependency to0.19.0-1. - Update
bech32dependency to0.7.2.
0.22.0 - 2020-01-07
- Add
ServiceFlagstype. - Add
NetworkMessage::command. - Add
key::Error. - Add newtypes for specific hashes:
TxidWtxidBlockHashSigHashPubkeyHashScriptHashWPubkeyHashWScriptHashTxMerkleNodeWitnessMerkleNodeWitnessCommitmentXpubIdentifierFilterHash
- Refactor
CommandString. - Refactor
Rejectmessage. - Rename
RejectReasonenum variants. - Refactor
encode::Error. - Implement
DefaultforTxIn. - Implement
std::hash::HashforInventory. - Implement
CopyforInvTypeenum. - Use
psbt::ErrorinPartiallySignedTransaction::from_unsigned_tx. - Drop message decode max length to 4_000_000.
- Drop
hexandbyteorderdependencies.
0.21.0 - 2019-10-02
- Add serde to
BlockHeaderandBlock - Clean up
StreamReaderAPI (breaking change) - Add reject message to p2p messages
0.20.0 - 2019-08-23
- Update
secp256k10.15 andbitcoinconsensus0.17
0.19.0 - 2019-08-16
- Add
AmountandSignedAmounttypes. - Add BIP-158 support with
BlockFilterand related types. - Add
util::misc::signed_msg_hash()for signing messages. - Add
MerkleBlockandPartialMerkleTreetypes. - bip32: Support serde serializaton for types and add some utility methods:
ChildNumber::incrementDerivationPath::children_fromDerivationPath::normal_childrenDerivationPath::hardened_children
- Add
blockdata::script::Builder::push_verifyto verify-ify an opcode. - Add
sendheadersnetwork message. - Add
OutPoint::new()method and JSON-serialize as<txid>:<vout>. - Refactor
Addresstype:- Now supports segwit addresses with version >0.
- Add
Address::from_scriptconstructor. - Add
Address::address_typeinspector. - Parsing now returns an
address::Errorinstead ofencode::Error. - Removed
bitcoin_bech32dependency for bech32 payloads.
- bip143: Rename
witness_scripttoscript_code - Rename
BlockHeader::spv_validatetovalidate_pow - Rename
OP_NOP2andOP_NOP3toOP_CLTVandOP_CSV - psbt: Use
BTreeMapinstead ofHashMapto ensure serialization roundtrips. - Drop
Decimaltype. - Drop
LoneHeaderstype. - Replace
strasondependency with (optional)serde_json. - Export the
bitcoin_hashesandsecp256k1dependent crates. - Updated
bitcoin_hashesdependency to v0.7. - Removed
randandserde_testdependencies. - Internal improvements to consensus encoding logic.
0.18.0 - 2019-03-21
- Update
bitcoin-bech32version to 0.9 - add
to_bytesmethod forutil::keytypes - add serde impls for
util::keytypes - contracthash: minor cleanups, use
util::keytypes instead ofsecp256k1types
0.17.1 - 2019-03-04
- Add some trait impls to
PublicKeyfor miniscript interoperability
0.17.0 - 2019-02-28 - ``The PSBT Release''
- Update minimum rustc version to 1.22.
- Replace
rust-cryptowithbitcoin_hashes; refactor hash types - Remove
Address::p2pk - Remove misleading blanket
MerkleRootimplementation; it is now only defined forBlock - Add BIP157 (client-side block filtering messages)
- Allow network messages to be deserialized even across multiple packets
- Replace all key types to better match abstractions needed for PSBT
- Clean up BIP32 in preparation for PSBT; use new native key types rather than
secp256k1ones - Remove apparently-used
Optionserialization code - Finally merge PSBT 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::Pairtype which does not belong in this library - Minor bugfixes and optimizations
0.15.1 - 2018-11-08
0.15.0 - 2018-11-03
- Significant API overhaul:
- Remove
nu_selectmacro and low-level networking support - Move
network::consensus_paramstoconsensus::params - Move many other things into
consensus::params - Move
BitcoinHashfromnetwork::serializetoutil::hash; remove impl forVec<u8> - Rename/restructure error types
- Rename
Consensus{De,En}codertoconsensus::{De,En}coder - Replace
Raw{De,En}coderwith blanket impls ofconsensus::{De,En}coderonio::Readandio::Write - make
serializeandserialize_hexinfallible
- Remove
- Make 0-input transaction de/serialization always use segwit
- Implement
FromStrandDisplayfor many more types
0.14.2 - 2018-09-11
- Add serde support for
Address
0.14.1 - 2018-08-28
- Reject non-compact
VarInts on various types - Expose many types at the top level of the crate
- Add
Ord,PartialOrdimpls forScript
0.14.0 - 2018-08-22
- Add regtest network to
Networkenum - Add
Script::is_op_return()which is more specific thanScript::is_provably_unspendable() - Update to bech32 0.8.0; add Regtest bech32 address support
- Replace rustc-serialize dependency with hex 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
ChildNumberandu32; make representation non-public; fix documentation - Add several derivation convenience to
bip32extended keys - Make
deserialize::deserialize()enforce no trailing bytes - Replace
TxOutRefwithOutPoint; use it inTxInstruct. - Use modern
as_to_into_conventions for array-wrapping types; implDisplayrather thanToStringfor most types - Change
script::Instructionsiterator to allow rejecting non-minimal pushes; fix bug where errors would iterate forever. - Overhaul
util::Error; introduceserialize::Errorand use it forSimpleDecoderandSimpleDecoderrather than parameterizing these over their error type. - Overhaul
UDecimalandDecimalserialization and parsing and fix many lingering parsing bugs - Update to serde 1.0 and strason 0.4
- Update to secp256k1 0.11.0
- Many, many documentation and test improvements.
0.13.1
- Add
Displaytrait to uints,FromStrtrait toNetworkenum - Add witness inv types to inv enum, constants for Bitcoin regtest network,
is_coin_baseaccessor for tx inputs - Expose
merkleroot(Vec<Sha256dHash>)
0.13
- Move witnesses inside the
TxInstructure - Add
Transaction::get_weight() - Update bip143
sighash_allAPI 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::verifyandScript::verifymethods. - Replaced Base58 traits with
encode_slice,check_encode_slice, from andfrom_checkfunctions in the base58 module. - Un-reversed the Debug output for Sha256dHash
- Add bech32 support
- Support segwit address types
0.11
- Remove
numdependency at Matt's request; agree this is obnoxious to require all downstream users to also have anumdependency just so they can useUint256::from_u64.