Commit Graph

1354 Commits

Author SHA1 Message Date
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
Riccardo Casatta 3aaa5d6846
Add verify with flags 2021-04-30 18:56:35 +02:00
Andrew Poelstra 4db4e604cb
Merge pull request #589 from LNP-BP/taproot/key-1
Non-API breaking introduction of Schnorr keys
2021-04-29 20:30:54 +00:00
Riccardo Casatta f692c4a938
Limit bytes read with Take 2021-04-28 09:33:37 +02:00
Andrew Poelstra 8231e25292
Merge pull request #586 from sanket1729/warn
fix warnings for sighashtype
2021-04-21 15:52:44 +00:00
Andrew Poelstra da477f1041
Merge pull request #558 from LNP-BP/fix/error-derives-1
Non-API breaking derives for error & transaction types
2021-04-21 14:24:27 +00:00
Riccardo Casatta 0a91496570
rename to_qr_string into to_qr_uri returning also the schema 2021-04-15 10:40:57 +02:00
Dr Maxim Orlovsky 230813b578
Making old ECDSA key type paths depeicated 2021-04-12 14:18:15 +02:00
Dr Maxim Orlovsky 664b09cdfd
Re-export Scep256k1 Schnorr keys under `util::schnorr`
This is second step in introducing Schnorr key support as per #588
2021-04-12 14:18:00 +02:00
Dr Maxim Orlovsky b17d7fc31c
Moving keys under `util::ecdsa`, re-exporting them at `util::key`
This is the first step in introducing Schnorr key support as per #588
2021-04-12 14:17:42 +02:00
Riccardo Casatta 3158cedea0
document alternate formatting 2021-04-11 18:14:28 +02:00
Martin Habovstiak bc406bfdd6 Use &mut dyn fmt::Write instead of bool
This replaces manually-written dynamic dispatch with `&mut dyn
fmt::Write` which is hopefully more readable.
2021-04-09 17:58:35 +02:00
Riccardo Casatta 85ae82febb
use the char trick to avoid allocation 2021-04-07 16:56:54 +02:00
Riccardo Casatta 104836a042
implements alternate formatting for address 2021-04-07 15:49:58 +02:00
Elichai Turkel dc0e2b0a52
Merge pull request #582 from collinsmuriuki/collinsmuriuki-patch-1
doc: correct Transaction struct encode_signing_data_to doc comment
2021-04-07 14:27:02 +03:00
sanket1729 3545580bd9 fix warnings for sighashtype 2021-04-06 11:52:14 -07:00
Steven Roose fe9242ce8b
Merge pull request #583 from sgeisler/2021-04-fix-ci
Don't fail CI if base image's apt db is outdated
2021-04-06 15:14:30 +01:00
Dr Maxim Orlovsky 7fe3c4a605
Non-API breaking derives for error types 2021-04-06 14:44:50 +02:00
Sebastian Geisler 7f2a7011a4 Don't fail CI if base image's apt db is outdated 2021-04-04 10:46:15 +02:00
Collins Muriuki c4cfdbbd6a
doc: correct Transaction struct encode_signing_data_to doc comment 2021-04-03 23:52:09 +03:00
Sebastian 1326f7d2a8
Merge pull request #569 from stevenroose/static-asm
Make Script::fmt_asm a static method and add Script::str_asm
2021-03-31 23:45:03 +02:00
Riccardo Casatta cac3f460a2
improve to_qr_string doc 2021-03-23 09:42:58 +01:00
Riccardo Casatta d18554e756
Address to string conversion optimized for qr codes 2021-03-22 13:58:59 +01:00
Riccardo Casatta b9d5200448
Access Display and Formatter with fmt:: like in other places 2021-03-22 13:42:32 +01:00
Andrew Poelstra 20f1543f79
Merge pull request #552 from JeremyRubin/fix-amount-serde
Fix Optional Amount Serialization
2021-03-15 15:48:20 +00:00
Steven Roose 7df0d14f1a
Merge pull request #577 from RCasatta/proprietary_key
Include proprietary key in deserialized PSBT
2021-03-15 12:16:30 +00:00
Steven Roose 851a3a15c0
Make Script::fmt_asm a static method and add Script::str_asm
This makes it convenient to print/construct the script assembly on
byte slices withoout having to clone them to copy them to create a
Script struct.
2021-03-13 22:16:20 +00:00