Commit Graph

1179 Commits

Author SHA1 Message Date
Devrandom 4826d0c6cc no_std support
Based on the original work by Justin Moon.

*MSRV unchanged from 1.29.0.*

When `std` is off, `no-std` must be on, and we use the [`alloc`](https://doc.rust-lang.org/alloc/) and core2 crates. The `alloc` crate requires the user define a global allocator.

* Import from `core` and `alloc` instead of `std`
* `alloc` only used if `no-std` is on
* Create `std` feature
* Create `no-std` feature which adds a core2 dependency to polyfill `std::io` features. This is an experimental feature and should be
used with caution.
* CI runs tests `no-std`
* MSRV for `no-std` is 1.51 or so
2021-07-15 09:04:49 +02:00
Andrew Poelstra abff973e83
Merge pull request #601 from LNP-BP/feat/bech32m-1
Bech32m adoption
2021-06-18 21:14:12 +00:00
Sebastian e334c9deea
Merge pull request #616 from sgeisler/2021-06-dust-value-amount
Use `Amount` type for dust value calculation
2021-06-16 20:51:23 +02:00
Dr Maxim Orlovsky aa5c36df12
Covering all BIP-173 and BIP-350 test vectors 2021-06-16 08:43:18 +02:00
Sebastian b0ae2a6842
Merge pull request #521 from RCasatta/errors_enum
Errors enum improvements
2021-06-15 14:01:56 +02:00
Matt Corallo e99177c4fb
Merge pull request #614 from devrandom/2021-06-nostd1
std -> core
2021-06-14 21:45:48 +00:00
Riccardo Casatta 88c186e436
nits on display implementation 2021-06-14 12:24:31 +02:00
Riccardo Casatta c26b3b9679
remove unused RngError, saving 24 bytes 2021-06-13 22:40:55 +02:00
Riccardo Casatta 9613181601
Split invalid version for address and extended key, saving also 16 bytes on the stack 2021-06-13 22:39:32 +02:00
Riccardo Casatta bace07d8f8
Remove base58::Error::Other variant in favor of specific variant 2021-06-13 22:33:54 +02:00
Riccardo Casatta 0eaf45ca81
Use boxed sliced instead of Vec in InvalidPreimageHashPair variant 2021-06-13 22:33:52 +02:00
Riccardo Casatta 781b0e014a
Box big Transaction type in psbt error 2021-06-13 22:33:48 +02:00
Sebastian Geisler 9981da2ec8 Use `Amount` type for dust value calculation 2021-06-12 21:15:13 +02:00
Devrandom 95aa3bf153 std -> core 2021-06-11 17:28:04 +02:00
Andrew Poelstra 9b2098517e
Merge pull request #611 from sgeisler/2021-06-fix-release
Fix release 0.26.2
2021-06-08 16:43:33 +00:00
Matt Corallo c82e75854a
Merge pull request #610 from afilini/fix/irc-link
Update IRC info to libera.chat
2021-06-08 15:02:32 +00:00
Sebastian Geisler 055d0fb087 Prepare release 0.26.2 2021-06-08 15:34:27 +02:00
Sebastian Geisler 091ac89440 Fix semver breaking Display change of ChildNumber
Fixes #608. In #567 the Display impl for ChildNumber was
consciously changed, assuming the semver break would not
affect any correctly implemented downstream projects. We
were wrong.
2021-06-08 15:33:02 +02:00
Alekos Filini f11f09d55b Fix release date in the changelog for `0.26.1` 2021-06-08 15:15:07 +02:00
Alekos Filini dc3d9eebaa
Update IRC info to libera.chat 2021-06-08 14:20:36 +02:00
Dr Maxim Orlovsky c1fae03686
Non-API breaking Bech32m adoption 2021-06-08 08:43:39 +02:00
Andrew Poelstra a685ce60bf
Merge pull request #607 from LNP-BP/ver/0.26.1
Bump version to 0.26.1
2021-06-07 22:19:42 +00:00
Dr. Maxim Orlovsky 73f1ed7d4c
Merge pull request #606 from romanz/fix-bip158-format
Fix bip158 example formatting
2021-06-06 20:11:22 +02:00
Dr Maxim Orlovsky d2ee8e81f3
Bump version to 0.26.1 2021-06-06 20:04:18 +02:00
Sebastian d7eb15c6f1
Merge pull request #584 from darosior/max_tx_weight_const
Introduce some policy constants from Bitcoin Core
2021-05-29 02:49:46 +02:00
Roman Zeyde 60e51ada36 Fix bip158 example formatting 2021-05-28 16:01:49 +03:00
Andrew Poelstra 052aaf1d80
Merge pull request #559 from LNP-BP/fix/error-derives-2
Fix/error derives 2
2021-05-19 15:02:10 +00:00
Antoine Poinsot 7345aa60d9 policy: add a function to get the virtual transaction size
It's very useful to Bitcoin applications, and especially "L2" ones, to
effectively compute feerates. Currently (and this is very unlikely to
change) bitcoind nodes compute the virtual size as a rounded-up division
of the size in witness units by 4, with a penalty for transactions that
are essentially >5% full of sigops.

Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
2021-05-18 14:53:45 +02:00
Antoine Poinsot 2e9d62a9c7 blockdata/script: use policy's constant in dust computation
Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
2021-05-18 14:52:58 +02:00
Antoine Poinsot 2b777485fa policy: introduce p2p constants from the reference implementation
This introduces some constants defined by Bitcoin Core which as a
consequence define some network rules in a new 'policy' module.

Only some were picked, which are very unlikely to change. Nonetheless a
Warning has been put in the module documentation.

Script-level constants are left into rust-miniscript where they are
already defined (src/miniscript/limits.rs).
2021-05-18 14:52:56 +02:00
Matt Corallo 05046b58d3
Merge pull request #602 from LNP-BP/fix/core
Fixing hashes core dependency and fuzz feature
2021-05-07 19:49:43 +00:00
Andrew Poelstra e5f37b817d
Merge pull request #581 from RCasatta/qr_string
Address to optimized QR string
2021-05-06 17:12:17 +00:00
Andrew Poelstra 4620c640a9
Merge pull request #579 from TheBlueMatt/master
Fix Script::dust_value()'s calculation for non-P2*PKH script_pubkeys
2021-05-06 16:01:36 +00:00
Andrew Poelstra d0fb626baf
Merge pull request #592 from LNP-BP/feat/ecdsa-key-creation
Constructors for compressed and uncompressed ECDSA keys
2021-05-06 15:50:06 +00:00
Andrew Poelstra 3fd88d317f
Merge pull request #598 from RCasatta/verify_flags
Add verify_with_flags to Script and Transaction
2021-05-05 22:33:47 +00:00
Matt Corallo fc6f23fb9b Drop not-very-useful output dust threshold constants
It doesn't really make sense to have a constant for every common
script type's dust limit, instead we should just use the
`Script::dust_value()` function to have users calculate it.
2021-05-05 14:53:26 +00:00
Dr Maxim Orlovsky c0b7defc86
More non-API breaking error derives depending on upstream PRs 2021-05-04 03:58:56 +02:00
Dr Maxim Orlovsky 5b962dc9a9
Updating dependency versions 2021-05-04 03:58:56 +02:00
Dr Maxim Orlovsky 122450b102
Fixing hashes core dependency and fuzz feature 2021-05-04 03:47:34 +02:00
Andrew Poelstra 902e0ec4f1
Merge pull request #600 from RCasatta/doc_fixes
Fixes documentation intra-links and enforce it
2021-05-03 22:07:05 +00:00
Riccardo Casatta c96f7ec71c
use markdown autolink syntax for urls with no text 2021-05-03 13:46:10 +02:00
Riccardo Casatta c58446f9c1
Deny broken doc intra-links and build docs in CI 2021-05-03 12:07:28 +02:00
Riccardo Casatta ef471ccca7
Fix documentation, in particular link to code elements 2021-05-03 11:43:11 +02:00
Matt Corallo 15981c945a Fix Script::dust_value()'s calculation for non-P2*PKH script_pubkeys
The dust calculations added were only valid for P2WPKH and P2PKH
outputs, and somehow this fact was missed in review, despite the
upstream Core code being linked to and looked at by two reviewers
and the author (me).

Someday I will grow eyeballs, but that day is not today.
2021-05-01 17:47:45 +00:00
Dr. Maxim Orlovsky 68096242d3
Merge pull request #594 from RCasatta/capped
Count bytes read in encoding
2021-05-01 16:28:57 +02:00
Dr Maxim Orlovsky 187eae8a13
Streamlining private key construction API in BIP32 2021-05-01 13:40:21 +02:00
Dr Maxim Orlovsky 18b6bd0d15
Adopting new ECDSA key constructors throughout the library 2021-05-01 13:34:31 +02:00
Dr Maxim Orlovsky ceacc7d85f
Constructors for compressed and uncompressed ECDSA keys 2021-05-01 13:34:04 +02:00
Riccardo Casatta 69117a1f63
Use Amount for verify_with_flags 2021-05-01 10:22:35 +02:00
Riccardo Casatta d1f4c0a5c8
Remove Copy for flags parameter 2021-05-01 10:19:54 +02:00