Commit graph

29954 commits

Author SHA1 Message Date
Andrew Poelstra
a3d23c94de wallet: regression test for the previous bugfix 2021-09-06 20:06:48 +00:00
Andrew Poelstra
904054ffcb
Merge ElementsProject/elements#1032: script: cache transaction weight per-transaction
4aad8c1a14 script: cache transaction weight per-transaction (Andrew Poelstra)

Pull request description:

  This is an O(N) operation so we want to make sure that we're not recomputing
  it every time we hit the INSPECTTXWEIGHT opcode.

ACKs for top commit:
  sanket1729:
    Cr ACK 4aad8c1a14

Tree-SHA512: c6bf6db748ede3f29c1294363a9415b54252bec784cfe270d8db1e7d845dc680fc9af37ad3ceaa33f9439c1dcdfde683a15fa3086fe79f50fdc487bfbf602921
2021-09-05 18:35:12 +00:00
Andrew Poelstra
4aad8c1a14 script: cache transaction weight per-transaction
This is an O(N) operation so we want to make sure that we're not recomputing
it every time we hit the INSPECTTXWEIGHT opcode.
2021-09-03 19:37:20 +00:00
Andrew Poelstra
338ccc49e8
Merge ElementsProject/elements#1028: test: fix surjectionproof overflow functional test for new RPC changes
c0936ba2a3 test: fix surjectionproof overflow functional test for new RPC changes (Andrew Poelstra)

Pull request description:

  This fixes an undetected merge conflict between #1014 and #900.

ACKs for top commit:
  gwillen:
    utACK c0936ba
  psgreco:
    UTACK c0936ba2a3

Tree-SHA512: a39d98db91d92f7e0e739e06d7a1bb13814d2bc7751cb6105a759af04ed0d61d206d1650f5e4e087feaeafcf1c482587b05b66d9cc497bc594a45df6bf23c07a
2021-08-31 18:38:27 +00:00
Andrew Poelstra
c0936ba2a3 test: fix surjectionproof overflow functional test for new RPC changes
This fixes an undetected merge conflict between #1014 and #900.
2021-08-31 16:00:47 +00:00
Andrew Poelstra
d973e1105d
Merge ElementsProject/elements#1014: Fix crash when creating large inputs
f7e1fb6708 blind: add functional test that attempting to spend more than 256 inputs fails "gracefully" (Andrew Poelstra)
ba538cbe2a blind.cpp: refuse to create surjection proofs that would trigger an assertation failure (Andrew Poelstra)

Pull request description:

  There isn't really any reasonable way to recover from this situation but we can at least gracefully fail instead of triggering an assertation failure.

  Fixes #979

  Fixes #880

ACKs for top commit:
  gwillen:
    utACK f7e1fb6.

Tree-SHA512: 6f95732964503e5ac6fc85fd6b45958f1b1719b1f9ecf3d6295d571489112837cdb4429a02a389da82e8d5fcd55527241cba50bceff00bb4facd8be037c7dcab
2021-08-30 20:56:31 +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
84b3f7b004
Merge ElementsProject/elements#1019: Update spec for tapscript opcodes
31c232a39b clarify that secp scalars are unsigned big endian (sanket1729)
f11fe0ad9c Update spec for rolling sha256 opcodes (sanket1729)
3055e85042 Rename taptweak (sanket1729)
a651f7ed4b More updates to spec (sanket1729)
147b9b7f6a Remove binary operations for 64 bits (sanket1729)
95f82f5080 Update spec for inputoutpoint (sanket1729)
6c4971dfbd Confirm overflow behaviour of scalars (sanket1729)
1d778dd632 Remove shifts, update output spk introspection (sanket1729)
49978abf5a Renumber opcodes; minor fixups (sanket1729)
3be79d1257 Update LE32 to read only unsigned (sanket1729)
d3cff9eea4 Update overflow behavior (sanket1729)
50733b8826 Flatten out introspection opcodes (sanket1729)
4bce8af953 Remove MULTISCALAREXPVERIFY. Sigops budget calculation is mentioned in respective opcode sections (sanket1729)
5ae2945da7 [WIP] updated spec for tapscript opcodes (sanket1729)

Pull request description:

  This is an updating document for the latest specification of tapscript opcodes. This will be updated in parallel while the implementation is in progress

ACKs for top commit:
  apoelstra:
    ACK 31c232a39b

Tree-SHA512: 6862c9c09e340674d30d53cddc9a6adbcb67edcc00871c934a2b775f64537382ae4679a03b9a71e2a63aba0f66f181d1355051f452f7ef1a9017601fa9190127
2021-08-30 18:06:10 +00:00
Andrew Poelstra
feee029d29
Merge ElementsProject/elements#1020: Tapscript new opcodes
1577ed4e90 fuzz: add fuzz test for segwitv0 and tapscript script interpreters (Andrew Poelstra)
8a20fbe8a6 Add XOnlyPubKey::CreateTapTweak (Andrew Poelstra)
68961ca60e Make consensus checking of tweaks in pubkey.* Taproot-specific (Andrew Poelstra)
c3945cb39f Make XOnlyPubKey act like byte container (Pieter Wuille)
2c5c7eb87b Update tapscript leaf version (sanket1729)
937343c75c Add tests for crypto opcodes (sanket1729)
7193636d09 Add crypto opcodes (sanket1729)
3e7b8c6aed Test arithmetic opcodes (sanket1729)
4b9032209a Implement arithmetic opcodes (sanket1729)
6092d94c1d Add tests for introspection (sanket1729)
9346a8495e Implement transaction introspection opcodes (sanket1729)
97b53e0b89 Cache Input/Output ScriptPubkeys sha256 (sanket1729)
61b5152d44 Expose transaction data via BaseSignatureChecker (sanket1729)
007912eea4 Implement tests for sha256 streaming opcodes (sanket1729)
2df8e99813 Implement Streaming SHA256 opcodes (sanket1729)

Pull request description:

  Please refer to the new spec here. https://github.com/ElementsProject/elements/pull/1019

ACKs for top commit:
  apoelstra:
    ACK 1577ed4e90

Tree-SHA512: 297cfe8699982d9575a566eda2f5f4a253968552dbc9ff000440da4d6f5b175a1619d7a5074e1ddf6818e2c51f54a33142a89a63494f26ad946ca09e0cff94c5
2021-08-30 15:58:11 +00:00
Andrew Poelstra
1577ed4e90 fuzz: add fuzz test for segwitv0 and tapscript script interpreters 2021-08-27 19:31:34 +00:00
Andrew Poelstra
8a20fbe8a6 Add XOnlyPubKey::CreateTapTweak
https://github.com/bitcoin/bitcoin/pull/22051 (6/9)

Modified to use the old-style Optional rather than std::optional
2021-08-27 19:31:32 +00:00
Andrew Poelstra
68961ca60e Make consensus checking of tweaks in pubkey.* Taproot-specific
That results in a much safer interface (making the tweak commit
to the key implicitly using a fixed tag means it can't be used for
unrelated tweaking).

https://github.com/bitcoin/bitcoin/pull/22051 (5/9)
We actually preserve the "unrelated tweaking" method so we can
use it in OP_TWEAKVERIFY
2021-08-27 19:24:07 +00:00
Pieter Wuille
c3945cb39f Make XOnlyPubKey act like byte container
https://github.com/bitcoin/bitcoin/pull/22051 (1/9)
2021-08-27 19:24:07 +00:00
sanket1729
2c5c7eb87b Update tapscript leaf version 2021-08-27 19:24:07 +00:00
sanket1729
937343c75c Add tests for crypto opcodes 2021-08-27 19:24:07 +00:00
sanket1729
7193636d09 Add crypto opcodes 2021-08-27 19:24:06 +00:00
sanket1729
3e7b8c6aed Test arithmetic opcodes 2021-08-26 20:28:01 +00:00
sanket1729
4b9032209a Implement arithmetic opcodes 2021-08-26 20:28:01 +00:00
sanket1729
6092d94c1d Add tests for introspection 2021-08-26 20:28:01 +00:00
sanket1729
9346a8495e Implement transaction introspection opcodes 2021-08-26 20:28:01 +00:00
sanket1729
97b53e0b89 Cache Input/Output ScriptPubkeys sha256 2021-08-26 20:28:01 +00:00
sanket1729
61b5152d44 Expose transaction data via BaseSignatureChecker 2021-08-26 20:28:01 +00:00
sanket1729
007912eea4 Implement tests for sha256 streaming opcodes 2021-08-26 20:28:01 +00:00
sanket1729
2df8e99813 Implement Streaming SHA256 opcodes
Co-authored-by: roconnor-blockstream  <roconnor@blockstream.com>
2021-08-26 20:28:01 +00:00
sanket1729
31c232a39b clarify that secp scalars are unsigned big endian 2021-08-24 10:46:33 -07:00
sanket1729
f11fe0ad9c Update spec for rolling sha256 opcodes 2021-08-23 16:39:22 -07:00
sanket1729
3055e85042 Rename taptweak 2021-08-19 09:49:10 -07:00
Andrew Poelstra
c72c949d29 blech32: copy ubsan suppression for bech32 to blech32 2021-08-18 15:54:23 +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
15a826ea27 blech32: add functional tests for blech32m 2021-08-18 15:54:22 +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
Fabian Jahr
18fcec8714 naming nits 2021-08-17 22:32:47 +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
Bezdrighin
c607835bad Better error messages for invalid addresses
This commit addresses #20809.

We add an additional 'error' property in the result of 'validateaddress' in case the address is not valid that gives a short description of why the address in invalid. We also change the error message returned by 'getaddressinfo' in case the address is invalid.

https://github.com/bitcoin/bitcoin/pull/20832 (1/1)

ELEMENTS: Merge conflicts resolved based on d6c85c5620 (from 22.0 rebase)
2021-08-17 22:32:47 +00:00
sanket1729
a651f7ed4b More updates to spec 2021-08-17 15:20:35 -07:00
sanket1729
147b9b7f6a Remove binary operations for 64 bits 2021-08-17 15:20:35 -07:00
sanket1729
95f82f5080 Update spec for inputoutpoint 2021-08-17 15:20:35 -07:00
sanket1729
6c4971dfbd Confirm overflow behaviour of scalars 2021-08-17 15:20:35 -07:00
sanket1729
1d778dd632 Remove shifts, update output spk introspection 2021-08-17 15:20:35 -07:00
sanket1729
49978abf5a Renumber opcodes; minor fixups 2021-08-17 15:20:35 -07:00
sanket1729
3be79d1257 Update LE32 to read only unsigned 2021-08-17 15:20:35 -07:00
sanket1729
d3cff9eea4 Update overflow behavior 2021-08-17 15:20:35 -07:00
sanket1729
50733b8826 Flatten out introspection opcodes 2021-08-17 15:20:35 -07:00
sanket1729
4bce8af953 Remove MULTISCALAREXPVERIFY. Sigops budget calculation is mentioned in respective opcode sections 2021-08-17 15:20:35 -07:00
sanket1729
5ae2945da7 [WIP] updated spec for tapscript opcodes
Update op_success
2021-08-17 15:20:35 -07:00
Andrew Poelstra
0b8174b1fe
Merge ElementsProject/elements#1023: Address post merge feedback for Taphash
2612017031 Address post merge feedback for Taphash (sanket1729)

Pull request description:

  Addressing the review by @roconnor-blockstream on #1002 .

ACKs for top commit:
  apoelstra:
    ACK 2612017031

Tree-SHA512: 62121ba33cf1fccda75cd2402c22799ccee437ba64575e6f5561b0aa1c571b6d94f3981fb4c1260a8c2848a26e1790d770364ade2af3edb5a98be29c23d6e0a2
2021-08-17 20:05:14 +00:00
sanket1729
2612017031 Address post merge feedback for Taphash 2021-08-17 16:25:00 +00:00