Commit graph

3979 commits

Author SHA1 Message Date
Andrew Poelstra
ba8273ac94 lint: fix non-pylint linter errors
Includes fixing all the spelling mistakes that are our fault,
but not those present upstream in Core.
2021-10-15 00:20:20 +00:00
Andrew Poelstra
dc31deacff Merge bc0494cc39 into merged_master (Elements PR ElementsProject/elements#1040) 2021-09-18 14:58:14 +00:00
Andrew Poelstra
6c38123ae4 Merge 787ee1e91f into merged_master (Elements PR ElementsProject/elements#1043) 2021-09-18 13:43:13 +00:00
Andrew Poelstra
bc0494cc39
Merge ElementsProject/elements#1040: regtest: change network magic away from liquid v1
e57b4c51ad regtest: change network magic away from liquid v1 (Andrew Poelstra)

Pull request description:

  We don't want connectivity issues between Liquid and custom test networks.

ACKs for top commit:
  stevenroose:
    ACK e57b4c51ad

Tree-SHA512: 3ddd626496d7877551c41b089932784bcb752962089fd3e6baa5e9ea6acac44b1b4c5c915b061892b712849d12455fae00347885cecb0e0a3b59a134d91d4014
2021-09-15 22:36:31 +00:00
Andrew Poelstra
bcd7de55a4 fuzz: update psbt fuzztest for PSBT2 changes
The `psbt.tx` Optional is no longer safe to dereference just
because decoding succeeded.
2021-09-14 19:39:06 +00:00
Andrew Poelstra
e57b4c51ad regtest: change network magic away from liquid v1
We don't want connectivity issues between Liquid and custom test networks.
2021-09-10 17:20:20 +00:00
Andrew Poelstra
ba3d786a61 Merge 64194498cf into merged_master (Elements PR ElementsProject/elements#1025)
Another annoying one to deal with because it includes partial
backports. In future let's really try to stay up to date with
Core.
2021-09-05 15:42:08 +00:00
Andrew Poelstra
6387aaf765 Merge feee029d29 into merged_master (Elements PR ElementsProject/elements#1020)
Messy merge conflicts because this PR backported some ad-hoc stuff from
upstream while keeping a few things that upstream deleted. Hopefully
reviewing is easier than doing this in the first place, since ultimately
all I did was delete code from one side or another of the conflicts.
(Ok, I also changed some boost optional stuff to std::optional, and had
to patch up a test file for test framework changes.)

When reviewing the detailed crypto, bear in mind that taptweaks, like all
hashes are the kind of crypto that cannot be subtly wrong -- it will either
fail very hard or be correct. And we have independent implementations in
C++ and Python that cross-check each other, si it's unlikely to be the former.
2021-09-05 13:42:34 +00:00
Andrew Poelstra
7d1c77f0a1 Merge 1ba24fe9b3 into merged_master (Elements PR ElementsProject/elements#1002)
This forward-ports the new Taproot sighash but does not fix a couple
22-blocked TODOs related to the MissingDataBehavior enum. Should be fixed
in a followup commit.

One nontrivial change I had to make was feeding the genesis hash to SignTransaction
(the "global" one in script/sign.cpp) so that it could correctly compute
the sighash at signing time.
2021-09-04 22:14:42 +00:00
Andrew Poelstra
36e5e2a7f1 Merge 9a154599fe into merged_master (Elements PR ElementsProject/elements#900)
Surprisingly easy to do. Almost all of the diff resolution was mechanically
  * replacing boost::variant with std::variant
  * replacing Optional with std::optional
     * then replacing `nullopt` with `std::nullopt`
  * updating the RPC functions for the new RPCArg::Default type
  * update the tests/ directory to make new (since 22) tests use arrays for
    createrawtransaction outputs
  * other ad-hoc changes to function parameters etc (not too many of these)

I had to "really" change the code in PrecomputePSBTData, which was introduced
in 22.0 and affected by PSET, but this function was like 8 lines long so it
was easy.

Reviewing the diff may be a bit difficult because of the mix of mechanical
changes and ad-hoc things. Probably the most straightforward thing to do
is to redo the merge, `sed -i` to fix the boost::variant and Optional stuff,
then diff the remaining conflicts against this commit.

TODO: grep for `blindpsbt` and you will see that this RPC is still referenced
in documentation and help text even though it was deleted. Need to fix this
in 0.21 in a separate PR.
2021-09-04 19:34:14 +00:00
Andrew Poelstra
64194498cf
Merge ElementsProject/elements#1025: Introduce blech32m format for v1+ witness programs
c72c949d29 blech32: copy ubsan suppression for bech32 to blech32 (Andrew Poelstra)
d13fb4994b blech32: add test vectors for blech32 and blech32m (Andrew Poelstra)
15a826ea27 blech32: add functional tests for blech32m (Andrew Poelstra)
c01e09e8c3 blech32: add blech32m format and use it to decode witness v1+ addresses (Andrew Poelstra)
18fcec8714 naming nits (Fabian Jahr)
8515f40fed Add signet support to gen_key_io_test_vectors.py (Pieter Wuille)
b3df66f82e Use Bech32m encoding for v1+ segwit addresses (Pieter Wuille)
42f43a1bcb Add Bech32m test vectors (Pieter Wuille)
b1d1d94e01 Implement Bech32m encoding/decoding (Pieter Wuille)
c607835bad Better error messages for invalid addresses (Bezdrighin)

Pull request description:

  Includes backports of https://github.com/bitcoin/bitcoin/pull/20832 (1 commit) and https://github.com/bitcoin/bitcoin/pull/20861 (5 commits)

ACKs for top commit:
  gwillen:
    utACK c72c949.

Tree-SHA512: af96a6ef31b1cab72b0350197dcb34761e9ffb2ec43685084408b5fafcda0adee1945045003194600372652f7cca65d721bda3ed9b6be7e9543d3199e2cbe145
2021-08-30 18:59:25 +00:00
Andrew Poelstra
1577ed4e90 fuzz: add fuzz test for segwitv0 and tapscript script interpreters 2021-08-27 19:31:34 +00:00
sanket1729
2df8e99813 Implement Streaming SHA256 opcodes
Co-authored-by: roconnor-blockstream  <roconnor@blockstream.com>
2021-08-26 20:28:01 +00:00
Andrew Poelstra
d13fb4994b blech32: add test vectors for blech32 and blech32m
Converted the bech32 valid test vectors. Did not convert the invalid test
vectors because it was not obvious how.
2021-08-18 15:54:23 +00:00
Andrew Poelstra
c01e09e8c3 blech32: add blech32m format and use it to decode witness v1+ addresses 2021-08-18 15:54:20 +00:00
Pieter Wuille
8515f40fed Add signet support to gen_key_io_test_vectors.py 2021-08-17 22:32:47 +00:00
Pieter Wuille
b3df66f82e Use Bech32m encoding for v1+ segwit addresses
This also includes updates to the Python test framework implementation,
test vectors, and release notes.

https://github.com/bitcoin/bitcoin/pull/20861 (3/5)
2021-08-17 22:32:47 +00:00
Pieter Wuille
42f43a1bcb Add Bech32m test vectors
https://github.com/bitcoin/bitcoin/pull/20861 (2/5)
2021-08-17 22:32:47 +00:00
Pieter Wuille
b1d1d94e01 Implement Bech32m encoding/decoding
https://github.com/bitcoin/bitcoin/pull/20861 (1/5)
2021-08-17 22:32:47 +00:00
Andrew Poelstra
6484dc0d67 Merge d542603c5a into merged_master (Bitcoin PR bitcoin/bitcoin#22502) 2021-08-03 03:23:17 +00:00
Andrew Poelstra
049058f5ae Merge 624a193330 into merged_master (Bitcoin PR bitcoin/bitcoin#22497) 2021-08-03 02:46:40 +00:00
Andrew Poelstra
bc829ae9d6 Merge 0eea1dfe80 into merged_master (Bitcoin PR bitcoin/bitcoin#22445) 2021-08-03 00:18:09 +00:00
Andrew Poelstra
84b41b323a Merge 21998bc028 into merged_master (Bitcoin PR bitcoin/bitcoin#22284) 2021-08-02 17:17:41 +00:00
Andrew Poelstra
40d1f3ffc5 Merge c0224bc962 into merged_master (Bitcoin PR bitcoin/bitcoin#22415) 2021-08-02 16:39:39 +00:00
Andrew Poelstra
78c3a94eb8 Merge d8f1e1327f into merged_master (Bitcoin PR bitcoin/bitcoin#22112) 2021-07-31 21:46:05 +00:00
Andrew Poelstra
5b9fec6ef0 Merge efff9c3494 into merged_master (Bitcoin PR bitcoin/bitcoin#22176) 2021-07-31 14:23:36 +00:00
Andrew Poelstra
304587c1e2 Merge d968616422 into merged_master (Bitcoin PR bitcoin/bitcoin#22179) 2021-07-31 02:56:44 +00:00
Andrew Poelstra
e4746d6297 Merge 914c0cad97 into merged_master (Bitcoin PR bitcoin/bitcoin#22399)
This PR adds a fuzz test ensuring that all the different destination types
round-trip to strings (an important test given that Satoshi managed to mess
this up, having two different address types encode the same way..)

Anyway we fail this test, since both CNoDestination and NullData encode as
empty strings, and then this "decodes" as CNoDestination (and returns an
error, but the fuzztest doesn't check that). To make the fuzzer pass, I
changed NullData to encode and decode as "null".

I think this actually adds some functionality, letting you use "null" as
an "address" for sendtoaddress and createrawtransaction, thus burning the
coins and fixing #1011...but this was not my intent and we probably want
to think a bit more carefully before deliberately supporting this.
2021-07-31 00:58:01 +00:00
Andrew Poelstra
47164a1e9c Merge ddc6979b8b into merged_master (Bitcoin PR bitcoin/bitcoin#19438) 2021-07-30 16:16:50 +00:00
Andrew Poelstra
eb214706d4 Merge 2749613020 into merged_master (Bitcoin PR bitcoin/bitcoin#22348) 2021-07-30 04:25:59 +00:00
Andrew Poelstra
8a158e3e93 Merge 722776c0fd into merged_master (Bitcoin PR bitcoin/bitcoin#21329) 2021-07-29 22:11:13 +00:00
Andrew Poelstra
cac878cf89 Merge 8071ec179d into merged_master (Bitcoin PR bitcoin/bitcoin#21789) 2021-07-29 12:55:13 +00:00
Andrew Poelstra
9a6ea2c704 Merge 246daf1f53 into merged_master (Bitcoin PR bitcoin/bitcoin#22322) 2021-07-29 04:06:09 +00:00
Andrew Poelstra
3c48d95401 Merge 7317e14a44 into merged_master (Bitcoin PR bitcoin/bitcoin#22263) 2021-07-28 16:09:13 +00:00
Andrew Poelstra
e8b84fa091 Merge d6e0d78c31 into merged_master (Bitcoin PR bitcoin/bitcoin#20966) 2021-07-28 14:05:54 +00:00
Andrew Poelstra
374930ee5a Merge 965e937434 into merged_master (Bitcoin PR bitcoin/bitcoin#22279)
Hey look, it's one of mine, from this rebase :)
2021-07-27 23:14:41 +00:00
Andrew Poelstra
0afcb6d978 Merge 5c2e2afe99 into merged_master (Bitcoin PR bitcoin/bitcoin#21365)
This introduces Taproot wallet support. I fixed all the merge conflicts
and ensured that the tests pass, but this is still using the old sighash
(before Russell/Sanket/I redid it) so is not actually production ready.
Will be fixed when we bring Elements #1002 in.
2021-08-03 20:43:53 +00:00
Andrew Poelstra
94bc5cb7f5 Merge 8cb43077b3 into merged_master (Bitcoin PR bitcoin/bitcoin#22271) 2021-07-27 05:16:01 +00:00
Andrew Poelstra
3bef51bb0d Merge 7b45c5e875 into merged_master (Bitcoin PR bitcoin/bitcoin#20516) 2021-07-27 04:38:45 +00:00
Andrew Poelstra
eb5d43150e Merge 922abe8ca3 into merged_master (Bitcoin PR bitcoin/bitcoin#22268) 2021-07-27 04:01:05 +00:00
Andrew Poelstra
7efecc9d8b Merge 6eafa81b32 into merged_master (Bitcoin PR bitcoin/bitcoin#22267) 2021-07-27 03:23:12 +00:00
Andrew Poelstra
6b9494054a Merge 3a2c84a6b5 into merged_master (Bitcoin PR bitcoin/bitcoin#19238) 2021-07-25 18:35:42 +00:00
Andrew Poelstra
dc6f568584 Merge 5c4f0c4d46 into merged_master (Bitcoin PR bitcoin/bitcoin#21261) 2021-07-25 17:57:58 +00:00
Andrew Poelstra
8923cd37e5 Merge d75a1df617 into merged_master (Bitcoin PR bitcoin/bitcoin#21941) 2021-07-25 16:03:27 +00:00
Andrew Poelstra
34da23bd1a Merge a55904a80c into merged_master (Bitcoin PR bitcoin/bitcoin#21866)
Paying the piper for some lazy use of globals, including ones I added
in 8e770d3f21

Had to add another couple methods to interfaces::Chain
2021-07-29 13:18:11 +00:00
Andrew Poelstra
25981aeceb Merge f66eceaecf into merged_master (Bitcoin PR bitcoin/bitcoin#22216) 2021-07-24 20:31:41 +00:00
Andrew Poelstra
e39e6e320d Merge 551933f9ec into merged_master (Bitcoin PR bitcoin/bitcoin#22203) 2021-07-24 02:58:54 +00:00
Andrew Poelstra
b413362d11 Merge ef8f2966ac into merged_master (Bitcoin PR bitcoin/bitcoin#22084) 2021-07-24 01:43:31 +00:00
Andrew Poelstra
aad3d400b8 Merge 76d4018aa5 into merged_master (Bitcoin PR bitcoin/bitcoin#22180) 2021-07-23 03:59:56 +00:00
Andrew Poelstra
7fe97f20c6 Merge 912cb59490 into merged_master (Bitcoin PR bitcoin/bitcoin#21795) 2021-07-22 23:48:52 +00:00