Skip to content

Commit

Permalink
First pass at cleaning out bch related code
Browse files Browse the repository at this point in the history
- reset version
- reset changelog
- remove CashAddr refs from Haddocks, README, etc.
- remove all references to Bitcoin Cash / BCH
- remove sighash forkid
- remove tests with forkid
- fourmolu for formatting
  • Loading branch information
ProofOfKeags authored and GambolingPangolin committed Sep 30, 2022
1 parent 41a92ea commit 543ee7c
Show file tree
Hide file tree
Showing 72 changed files with 2,527 additions and 3,123 deletions.
310 changes: 4 additions & 306 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,315 +1,13 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## 0.21.2
### Changed
- Serialisation test now works for both strict and lazy bytestrings.

## 0.21.1
### Changed
- Make Base58 faster.

## 0.21.0
### Added
- BCH Testnet4 support.

### Changed
- Use a newtype for Fingerprint, which uses an 8 digit hex string for various
instances. This fixes inconsistent (de)serialization across the package.

### Fixed
- Makes `finalScriptWitness` field encoding conform to bitcoin core.
- Fixes bug in `finalizeTransaction`

### Added
- Signing support for PSBTs
- Helper function for merging PSBTs
- More PSBT tests
- Partial support for taproot

## 0.20.5
### Added
- Support Bech32m address format for Taproot.

## 0.20.4
### Fixed
- Add missing case for witness version.

## 0.20.3
### Fixed
- Allow unknown inv types.

## 0.20.2
### Fixed
- Allow unknown messages of zero length.

## 0.20.1
### Fixed
- Correct case where binary search returned the wrong element.

## 0.20.0
### Chaged
- Use bytes instead of binary or cereal.

## 0.19.0
### Added
- Hashable instances for extended keys.

### Changed
- Mnemonic passphrases now `Text` instead of `ByteString`.

### Fixed
- Tests now pass for witness addresses.

## 0.18.0
### Added
- Support SegWit addresses with version other than 0.

## 0.17.6
### Added
- Serialize instances for `XPubKey` and `XPrvKey`.

## 0.17.5
### Fixed
- Handle special case in block header binary search function.

## 0.17.4
### Fixed
- Bounds check too restrictive in block header binary search function.

## 0.17.3
### Changed
- Reduce minimum version of text package dependency.

## 0.17.2
### Changed
- Update lists of seeds for all networks.

## 0.17.1
### Changed
- Use the C-preprocessor to handle versions of `base16-bytestring` including 1.0
(with a breaking API change)

## 0.17.0
### Added
- Support for Bitcoin Cash November 2020 hard fork.
- Functions to find block headers matching arbitrary sorted attributes.

### Removed
- GenesisNode constructor for BlockNode type.

## 0.15.0
### Added
- Add more test vectors

### Changed
- stringToAddr renamed to textToAddr
- Move ScriptOutput to Standard.hs
- Move WIF encoding/decoding to Keys.hs
- (breaking) rename `OP_NOP2` and `OP_NOP3` to `OP_CHECKLOCKTIMEVERIFY` and
`OP_CHECKSEQUENCEVERIFY` resp.
- Update to latest secp256k1 bindings.

## 0.14.1
### Fixed
- Correct some Bitcoin Cash Testnet3 seeds.
- Add helpers for writing Data.Serialize and Data.Aeson identity tests

## 0.14.0
### Changed
- Expose all modules for tests.
- Tests depend on library instead of having access to its source code.
- Use MIT license.
- Update seeds.
- Bump secp256k1-haskell dependency.

## 0.13.6
### Changed
- Expose the Arbitrary test instances under Haskoin.Util.Arbitrary

## 0.13.5
### Changed
- Provide meaningful JSON instances for most types.

## 0.13.4
### Added
- Support for Bitcoin Cash May 2020 hard fork.

## 0.13.3
### Changed
- Improve code and documentation organisation.

## 0.13.2
### Changed
- Move all packages from Network.Haskoin namespace to Haskoin namespace.
- Expose all top-level modules directly.

## 0.13.1
### Changed
- Faster JSON serialization.

## 0.13.0
### Changed
- Consolidate all modules in Haskoin module.

### Removed
- Deprecate Network.Haskoin namespace.
- Hide QuickCheck generators in test suite.

## 0.12.0
### Added
- Support for signing segwit transactions.

## 0.11.0
### Added
- High-level representation of segwit v0 data and auxilliary functions.

### Changed
- Adds handling of segwit signing parameters to transaction signing code.

## 0.10.1
### Added
- Lower bound versions for some dependencies.

## 0.10.0
### Added
- DeepSeq instances for all data types.

### Changed
- There is no `SockAddr` inside `NetworkAddress` anymore.

## 0.9.8
### Added
- Ord instance for `DerivPathI`

## 0.9.7
### Added
- JSON encoding/decoding for blocks.

### Fixed
- Fix lowercase HRP test for Bech32.

## 0.9.6
### Added
- `bloomRelevantUpdate` implementation for Bloom filters (thanks to @IlyasRidhuan).

### Fixed
- Fix for Bech32 encoding (thanks to @pavel-main).

## 0.9.5
### Added
- Expose functions added in 0.9.4.

## 0.9.4
### Added
- Support for (P2SH-)P2WPKH addresses derived from extended keys.

### Changed
- Change names of backwards-compatible P2SH-P2WPKH functions from 0.9.3.

## 0.9.3
### Added
- Some support for P2WPKH-over-P2SH addresses.

## 0.9.2
### Removed
- Disable unnecessary `-O2` optimisation added in previous version.

### Added
- Allow decoding unknown P2P messages.

## 0.9.1
### Added
- Add a function to produce a structured signature over a transaction.
- Enable `-O2` optimisations.

## 0.9.0
### Changed
- Address conversion to string now defined for all inputs.

## 0.8.4
### Added
- Add reward computation to block functions.
- Add PSBT [BIP-174](https://github.com/bitcoin/bips/blob/master/bip-0174.mediawiki) types and functions

## 0.8.3
### Added
- Add reward halving interval parameter to network constants.

## 0.8.2
### Added
- Recognize `OP_CHECKDATASIG` and `OP_CHECKDATASIGVERIFY` opcodes.

## 0.8.1
### Added
- Add instances of `Hashable` and `Generic` where possible.

## 0.8.0
### Removed
- Remove `deepseq` dependency.
- Remove network constant reference from address and extended keys.

## 0.7.0
### Added
- Add `Serialize` instance for network constants.
- Add `Serialize` instance for addresses that includes network constants.

### Changed
- Move functions related to addresses from `Script` to `Address` module.

## 0.6.1
### Added
- Compatibility with latest GHC and base.

### Changed
- Update minimum base to 4.9.

## 0.6.0
### Changed
- Force initialization of addresses through smart constructor.
- Assume addresses are always valid when instantiated in code.
- Allow to provide unwrapped private keys to transaction signing functions.

## 0.5.2
### Changed
- Make dependencies more specific.

## 0.5.1
### Changed
- Remove some unneeded dependencies from `stack.yaml`.
- Change `secp256k1` dependency to `secp256k1-haskell`.

## 0.5.0
### Added
- Support for Bitcoin Cash network block sychronization.
- Support for Bitcoin Cash signatures.
- Initial work on SegWit support.
- New version of `secp256k1` bindings.
- Block header validation.
- Support for RegTest networks on Bitcoin and Bitcoin Cash.
- Support for Bitcoin Cash Testnet3 Network.
- Support for new Haskoin Wallet.
- Minikey decoding for Casascius coins.
- New tests for various networks and new features.
- Added `CHANGELOG.md` file.
- Support for SegWit addresses.
- Support for CashAddr addresses.
## 0.1.0

### Changed
- Use of hpack `package.yaml` file to auto-generate Cabal file.
- Removal of dependency version limits, relying on `stack.yaml` instead.
- Tests moved to `hspec`.
- New documentation.
- Updated `.gitignore`.
- Renamed network constants to use same style for BTC and BCH.
- Network constants must be passed explicitly.
- Target LTS Haskell 12.9.

### Removed
- Removed `.stylish-haskell.yaml` files.
- Removed old `haskoin-node` and `haskoin-wallet` packages from main repository.
- Removed support for non-strict signatures and related tests.
- Removed script evaluator and related tests.
- Forked from `haskoin-core` 0.21.1
- Removed Bitcoin Cash support
21 changes: 7 additions & 14 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,19 +1,12 @@
Copyright 2020 Haskoin Developers
Copyright 2022 Haskell-Bitcoin Developers

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
# Haskoin Core

Haskoin Core is a library of Bitcoin and Bitcoin Cash functions written in Haskell featuring:
Haskoin Core is a library of Bitcoin functions written in Haskell featuring:

- Hashing functions (SHA-256, RIPEMD-160)
- Base58 support
- CashAddr support
- Bech32 suport
- BIP32 extended key derivation and parsing (m/1'/2/3)
- BIP39 mnemonic keys
- ECDSA secp256k1 cryptographic primitives
- Script parsing
- Building and signing of standard transactions (regular, multisig, p2sh, segwit)
- Parsing and manipulation of all Bitcoin and Bitcoin Cash protocol messages
- Parsing and manipulation of all Bitcoin protocol messages
- Bloom filters and partial merkle trees (used in SPV wallets)
- Comprehensive test suite

## Contributing

Please use `ormolu` (or `fourmolu`) to format code prior to submission. See `scripts/pre-commit.sh` for an example pre-commit hook.
Please use `fourmolu` to format code prior to submission.
2 changes: 2 additions & 0 deletions Setup.hs
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
import Distribution.Simple


main = defaultMain
Loading

0 comments on commit 543ee7c

Please sign in to comment.