Commit graph

29909 commits

Author SHA1 Message Date
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
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
Glenn Willen
d0095727d3
Merge pull request #1024 from apoelstra/2021-07--secp-update
Update libsecp-zkp to 90580edcc98350c9df9bebee58d2f9616d801849
2021-08-16 12:26:12 -07:00
Andrew Poelstra
f1bf3712da ci: backport bitcoin #20413 changes to nowallet bionic test
Cirrus quietly dropped the compiler that we were using.
2021-07-30 16:58:43 +00:00
Andrew Poelstra
4a7eaa9260 Merge commit '196c993d1f' into 2021-07--secp-update 2021-07-28 23:11:33 +00:00
Andrew Poelstra
196c993d1f Squashed 'src/secp256k1/' changes from 0129b77767e..90580edcc98
90580edcc98 Merge pull request #140 from apoelstra/2021-07--resync
6ad66de6802 rangeproof: add an (unnecessary) variable initialization to shut up CI
2979e4d9d46 Merge commits '8ae56e33 75ce488c 4866178d 446d28d9 253f90cd ec3aaa50 0440945f 7688a4f1 be8d9c26 ' into temp-merge-965
5d2df054196 Merge elementsproject/secp256k1-zkp#120: Add MuSig Key Aggregation spec
fc26ca8ddef musig: remove unnecessary constant time normalize in combine
48f63efe683 musig: remove unnecessary branch in pubkey_tweak_add
5860b5e0fe7 musig: do not also require schnorrsig module config flag
f27fd1d5e75 musig: improve test coverage of pubkey_combine
56014e8ca01 musig: change pubkey_combine arg to array of pointers to pks
08fa02d5791 musig: add key aggregation spec draft
4a9b059b16d musig: rename Musig coefficient to KeyAgg coefficient
4bc46d836e7 musig: optimize key aggregation using const 1 for 2nd key
2310849f50f musig: compute musig coefficient by hashing key instead of index
9683c8a7eb6 musig: add static test vectors for key aggregation
9b3d7bf5361 extrakeys: add xonly_sort function
f31affd8a61 extrakeys: add hsort, in-place, iterative heapsort
be8d9c262f4 Merge bitcoin-core/secp256k1#965: gen_context: Don't use any ASM
d9560e0af78 Merge elementsproject/secp256k1-zkp#136: Eliminate a wrong -Wmaybe-uninitialized warning in GCC
aeece445997 gen_context: Don't use any ASM
6db00f5b2e0 Merge elementsproject/secp256k1-zkp#132: Upstream PRs 831, 907, 903, 889, 918, 906, 928, 922, 933, Merge bitcoin-core/secp256k1#936: Fix gen_context/ASM build on ARM, 925, 937, 926, Merge bitcoin-core/secp256k1#940: contrib: Explain explicit header guards, 850, 930, 941, 846, 947, 662, 950
cc0b279568d Eliminate a wrong -Wmaybe-uninitialized warning in GCC
f09497ea3e0 CI: tweak cirrus.yml to prevent OOM and timeout w sanitizer/valgrind
7226cf215aa ecdsa_adaptor: fix too small buffer in tests
b053e853d4f ecdsa_adaptor: fix test case with invalid signature
91b64770c3b Merge elementsproject/secp256k1-zkp#135: sync-upstream: fix "end" parameter for specifying range
907633e2e9a sync-upstream: fix "end" parameter for specifying range
394f49fd1a6 sync-upstream: quote variables
1bb5db3d602 Merge elementsproject/secp256k1-zkp#134: sync-upstream: parse merge commits w/ and w/o repo identifier
9321d42f751 sync-upstream: parse merge commits w/ and w/o repo identifier
7688a4f13a3 Merge bitcoin-core/secp256k1#963: "Schnorrsig API overhaul" fixups
90e83449b2c ci: Add C++ test
f698caaff6a Use unsigned char consistently for byte arrays
b5b8e7b7190 Don't declare constants twice
769528f3071 Don't use string literals for char arrays without NUL termination
2cc3cfa5838 Fix -Wmissing-braces warning in clang
0440945fb5c Merge #844: schnorrsig API overhaul
ec3aaa5014f Merge #960: tests_exhaustive: check the result of secp256k1_ecdsa_sign
a1ee83c6546 tests_exhaustive: check the result of secp256k1_ecdsa_sign
253f90cdeb1 Merge bitcoin-core/secp256k1#951: configure: replace AC_PATH_PROG to AC_CHECK_PROG
446d28d9de3 Merge bitcoin-core/secp256k1#944: Various improvements related to CFLAGS
0302138f750 ci: Make compiler warning into errors on CI
b924e1e605d build: Ensure that configure's compile checks default to -O2
7939cd571c7 build: List *CPPFLAGS before *CFLAGS like on the compiler command line
595e8a35d80 build: Enable -Wcast-align=strict warning
07256267ffa build: Use own variable SECP_CFLAGS instead of touching user CFLAGS
4866178dfc9 Merge bitcoin-core/secp256k1#955: Add random field multiply/square tests
75ce488c2a6 Merge bitcoin-core/secp256k1#959: tests: really test the non-var scalar inverse
41ed13942bd tests: really test the non-var scalar inverse
5f6ceafcfa4 schnorrsig: allow setting MSGLEN != 32 in benchmark
fdd06b79671 schnorrsig: add tests for sign_custom and varlen msg verification
d8d806aaf38 schnorrsig: add extra parameter struct for sign_custom
a0c3fc177f7 schnorrsig: allow signing and verification of variable length msgs
5a8e4991ad4 Add secp256k1_tagged_sha256 as defined in BIP-340
b6c0b72fb06 schnorrsig: remove noncefp args from sign; add sign_custom function
bdf19f105c6 Add random field multiply/square tests
8ae56e33e74 Merge #879: Avoid passing out-of-bound pointers to 0-size memcpy
a4642fa15ee configure: replace AC_PATH_PROG to AC_CHECK_PROG
d27e4598610 Revert "Remove unused Jacobi symbol support"
edcacc2b2ec Merge commits '26de4dfe 6e898534 c083cc6e 1e5d50fa cc2c09e3 efad3506 7012a188 34388af6 98e0358d d0bd2693 185a6af2 6c52ae87 69394879 1e78c18d 202a030f bf0ac460 399722a6 3dc8c072 50f33677 7973576f 1758a92f ' into temp-merge-950
1758a92ffd8 Merge #950: ci: Add ppc64le build
c58c4ea4707 ci: Add ppc64le build
7973576f6e3 Merge #662: Add ecmult_gen, ecmult_const and ecmult to benchmark
8f879c2887e Fix array size in bench_ecmult
2fe1b50df16 Add ecmult_gen, ecmult_const and ecmult to benchmark
593e6bad9c5 Clean up ecmult_bench to make space for more benchmarks
50f33677122 Merge #947: ci: Run PRs on merge result even for i686
a35fdd3478f ci: Run PRs on merge result even for i686
442cee5bafb schnorrsig: add algolen argument to nonce_function_hardened
df3bfa12c3b schnorrsig: clarify result of calling nonce_function_bip340 without data
99e8614812b README: mention schnorrsig module
3dc8c072b6d Merge #846: ci: Run ASan/LSan and reorganize sanitizer and Valgrind jobs
02dcea1ad94 ci: Make test iterations configurable and tweak for sanitizer builds
489ff5c20a1 tests: Treat empty SECP2561_TEST_ITERS as if it was unset
fcfcb97e74b ci: Simplify to use generic wrapper for QEMU, Valgrind, etc
de4157f13ac ci: Run ASan/LSan and reorganize sanitizer and Valgrind jobs
399722a63ad Merge #941: Clean up git tree
09b3bb8648f Clean up git tree
bf0ac460661 Merge #930: Add ARM32/ARM64 CI
202a030f7d1 Merge #850: add `secp256k1_ec_pubkey_cmp` method
1e78c18d5b8 Merge bitcoin-core/secp256k1#940: contrib: Explain explicit header guards
69394879b64 Merge #926: secp256k1.h: clarify that by default arguments must be != NULL
6eceec6d566 add `secp256k1_xonly_pubkey_cmp` method
0d9561ae879 add `secp256k1_ec_pubkey_cmp` method
22a9ea154a2 contrib: Explain explicit header guards
6c52ae87247 Merge #937: Have ge_set_gej_var, gej_double_var and ge_set_all_gej_var initialize all fields of their outputs.
185a6af2279 Merge #925: changed include statements without prefix 'include/'
14c9739a1fb tests: Improve secp256k1_ge_set_all_gej_var for some infinity inputs
4a19668c37b tests: Test secp256k1_ge_set_all_gej_var for all infinity inputs
3c90bdda95a change local lib headers to be relative for those pointing at "include/" dir
45b6468d7e3 Have secp256k1_ge_set_all_gej_var initialize all fields. Previous behaviour would not initialize r->y values in the case where infinity is passed in. Furthermore, the previous behaviour wouldn't initialize anything in the case where all inputs were infinity.
31c0f6de413 Have secp256k1_gej_double_var initialize all fields. Previous behaviour would not initialize r->x and r->y values in the case where infinity is passed in.
dd6c3de3227 Have secp256k1_ge_set_gej_var initialize all fields. Previous behaviour would not initialize r->x and r->y values in the case where infinity is passed in.
d0bd2693e30 Merge bitcoin-core/secp256k1#936: Fix gen_context/ASM build on ARM
8bbad7a18e5 Add asm build to ARM32 CI
7d65ed52142 Add ARM32/ARM64 CI
c8483520c90 Makefile.am: Don't pass a variable twice
2161f31785e Makefile.am: Honor config when building gen_context
99f47c20ec4 gen_context: Don't use external ASM because it complicates the build
98e0358d297 Merge #933: Avoids a missing brace warning in schnorrsig/tests_impl.h on old compilers
99e2d5be0db Avoids a missing brace warning in schnorrsig/tests_impl.h on old compilers.
34388af6b6a Merge #922: Add mingw32-w64/wine CI build
7012a188e6e Merge #928: Define SECP256K1_BUILD in secp256k1.c directly.
ed5a199bed6 tests: fopen /dev/urandom in binary mode
ae9e648526c Define SECP256K1_BUILD in secp256k1.c directly.
4dc37bf81b5 Add mingw32-w64/wine CI build
0881633dfd0 secp256k1.h: clarify that by default arguments must be != NULL
efad3506a89 Merge #906: Use modified divsteps with initial delta=1/2 for constant-time
cc2c09e3a78 Merge #918: Clean up configuration in gen_context
07067967ee9 add ECMULT_GEN_PREC_BITS to basic_config.h
a3aa2628c7b gen_context: Don't include basic-config.h
be0609fd54a Add unit tests for edge cases with delta=1/2 variant of divsteps
cd393ce2283 Optimization: only do 59 hddivsteps per iteration instead of 62
277b224b6ab Use modified divsteps with initial delta=1/2 for constant-time
376ca366db0 Fix typo in explanation
1e5d50fa93d Merge #889: fix uninitialized read in tests
f3708a1ecb4 Merge #117: Add ECDSA adaptor signatures module
5710ebacb9e Merge #128: Make function argument name consistent with doc
b0ffa923199 ecdsa_adaptor: add tests
6955af5ca89 ecdsa_adaptor: add ECDSA adaptor signature APIs
c083cc6e52a Merge #903: Make argument of fe_normalizes_to_zero{_var} const
6e898534ff4 Merge #907: changed import to use brackets <> for openssl
cc82ad5ab74 Make function argument name consistent with doc
4504472269d changed import to use brackets <> for openssl as they are not local to the project
26de4dfeb1f Merge #831: Safegcd inverses, drop Jacobi symbols, remove libgmp
b508e5dd9b1 ecdsa_adaptor: add support for proof of discrete logarithm equality
d8f336564fe ecdsa_adaptor: add nonce function and tags
654cd633f50 ecdsa_adaptor: initialize project
23c3fb629b9 Make argument of fe_normalizes_to_zero{_var} const
24ad04fc064 Make scalar_inverse{,_var} benchmark scale with SECP256K1_BENCH_ITERS
ebc1af700f9 Optimization: track f,g limb count and pass to new variable-time update_fg_var
b306935ac12 Optimization: use formulas instead of lookup tables for cancelling g bits
9164a1b6582 Optimization: special-case zero modulus limbs in modinv64
1f233b3fa05 Remove num/gmp support
fac477f822a Merge #126: Upstream PRs  #854 #852 #857 #858 #860 #845 #862 #875 #878 #874 #877 #880 #864 #882 #894 #891 #901
20448b8d09a Remove unused Jacobi symbol support
5437e7bdfbf Remove unused scalar_sqr
aa9cc521800 Improve field/scalar inverse tests
1e0e885c8ac Make field/scalar code use the new modinv modules for inverses
436281afdcb Move secp256k1_fe_inverse{_var} to per-impl files
aa404d53bef Move secp256k1_scalar_{inverse{_var},is_even} to per-impl files
08d54964e51 Improve bounds checks in modinv modules
6a7861f646f Merge #127: sync-upstream: Create proper links to upstream PRs
4091e619248 cirrus: increase timeout for macOS tasks
136ed8f84d9 sync-upstream: Fix output of command to reproduce
38f1e777d49 sync-upstream: Create proper links to upstream PRs
79d4c3ac681 whitelist: add SECP_INCLUDES to bench_whitelist CPPFLAGS
649bf201d85 musig: fix tests for 32-bit
151aac00d31 Add tests for modinv modules
d8a92fcc4c6 Add extensive comments on the safegcd algorithm and implementation
8e415acba25 Add safegcd based modular inverse modules
de0a643c3dc Add secp256k1_ctz{32,64}_var functions
d4ca81f48e9 Merge commits 'dc6e5c3a 2d9e7175 b61f9da5 98dac878 8c727b90 328aaef2 f2d9aeae b732701f db726782 5671e5f3 a4abaab7 659d0d47 f8c0b57e 24d1656c 3a8b47bc ebdba03c 4c3ba88c ' into temp-merge-901
4c3ba88c3a8 Merge #901: ci: Switch all Linux builds to Debian and more improvements
9361f360bb0 ci: Select number of parallel make jobs depending on CI environment
28eccdf8064 ci: Split output of logs into multiple sections
c7f754fe4d5 ci: Run PRs on merge result instead of on the source branch
b994a8be3cf ci: Print information about binaries using "file"
f24e122d13d ci: Switch all Linux builds to Debian
ebdba03cb56 Merge #891: build: Add workaround for automake 1.13 and older
3a8b47bc6d1 Merge #894: ctime_test: move context randomization test to the end
6da00ec6245 Merge pull request #124 from apoelstra/2021-02--rename-klepto
e354c5751d6 ecdsa_s2c: rename anti-klepto to anti-exfil
7d3497cdc4c ctime_test: move context randomization test to the end
99a1cfec174 print warnings for conditional-uninitialized
3d2cf6c5bd3 initialize variable in tests
f329bba2442 build: Add workaround for automake 1.13 and older
24d1656c328 Merge #882: Use bit ops instead of int mult for constant-time logic in gej_add_ge
e491d06b98c Use bit ops instead of int mult for constant-time logic in gej_add_ge
f8c0b57e6ba Merge #864: Add support for Cirrus CI
cc2a5451dc8 ci: Refactor Nix shell files
2480e55c8f3 ci: Remove support for Travis CI
2b359f1c1d8 ci: Enable simple cache for brewing valgrind on macOS
8c02e465c5a ci: Add support for Cirrus CI
659d0d47989 Merge #880: Add parens around ROUND_TO_ALIGN's parameter.
b6f649889ae Add parens around ROUND_TO_ALIGN's parameter. This makes the macro robust against a hypothetical ROUND_TO_ALIGN(foo ? sizeA : size B) invocation.
a4abaab7931 Merge #877: Add missing secp256k1_ge_set_gej_var decl.
5671e5f3fd0 Merge #874: Remove underscores from header defs.
db726782fa2 Merge #878: Remove unused secp256k1_fe_inv_all_var
b732701faa7 Merge #875: Avoid casting (void**) values.
9570f674cc7 Avoid passing out-of-bound pointers to 0-size memcpy
75d2ae149ef Remove unused secp256k1_fe_inv_all_var
482e4a9cfce Add missing secp256k1_ge_set_gej_var decl.
27306186045 Avoid casting (void**) values. Replaced with an expression that only casts (void*) values.
fb390c5299e Remove underscores from header defs. This makes them consistent with other files and avoids reserved identifiers.
ed69ea79b42 Merge #98: Add contrib/sync-upstream.sh script to automate syncing PRs
7eeacd7725f Add contrib/sync-upstream.sh script to automate merging upstream PRs
f2d9aeae6d5 Merge #862: Autoconf improvements
328aaef22a4 Merge #845: Extract the secret key from a keypair
3c15130709d Improve CC_FOR_BUILD detection
47802a47624 Restructure and tidy configure.ac
252c19dfc65 Ask brew for valgrind include path
8c727b9087a Merge #860: fixed trivial typo
cfac088e1b2 Merge #119: Remove repeated schnorr flag from travis config
96c83a83dcf Remove repeated schnorr flag from travis config
d2b6740688f Merge pull request #118 from jonasnick/clarify-rangeproof-rewind
41d6963bc1c rangeproof: clarify rewind outlen argument
673e551f4d1 Merge #111: Add ECDSA sign-to-contract module
b7bc3a4aaa5 fixed typo
47efb5e39a1 ecdsa-s2c: add ctime tests
396b558273c ecdsa-s2c: add anti-klepto protocol
290dee566e1 ecdsa-s2c: add actual sign-to-contract functionality
8e46cac5b31 ecdsa-s2c: block in module
826bd04b43f add eccommit functionality
33cb3c2b1fc Add secret key extraction from keypair to constant time tests
36d9dc1e8e6 Add seckey extraction from keypair to the extrakeys tests
fc96aa73f5c Add a function to extract the secretkey from a keypair
98dac878398 Merge #858: Fix insecure links
07aa4c70ffb Fix insecure links
b61f9da54ef Merge #857: docs: fix simple typo, dependecy -> dependency
18aadf9d288 docs: fix simple typo, dependecy -> dependency
2d9e7175c6e Merge #852: Add sage script for generating scalar_split_lambda constants
dc6e5c3a5c4 Merge #854: Rename msg32 to msghash32 in ecdsa_sign/verify and add explanation
6e85d675aaf Rename tweak to tweak32 in public API
f587f04e357 Rename msg32 to msghash32 in ecdsa_sign/verify and add explanation
329a2e0a3f2 sage: Add script for generating scalar_split_lambda constants
f554dfc7088 sage: Reorganize files

git-subtree-dir: src/secp256k1
git-subtree-split: 90580edcc98350c9df9bebee58d2f9616d801849
2021-07-28 22:05:08 +00:00
Steven Roose
0bc24d95a8
Merge ElementsProject/elements#1018: ci: a bunch more backports to get MacOS job working
1e63e577db ci: disable Werror on MacOS build (not a backport) (Andrew Poelstra)
1852f83a5d ci: Bump macOS image to big-sur-xcode-12.5 (MarcoFalke)
4f33ba757d ci: Fix macOS brew install command (Hennadii Stepanov)
026508542c ci: Bump macOS VM image to the latest version (Hennadii Stepanov)
0740ceeb13 ci: Adjust cirrus ci task names (Andrew Poelstra)
d08e5845a0 ci: Fix doc typos in .cirrus.yml (Andrew Poelstra)
953cbe2599 ci: Run nowallet ci config on cirrus (MarcoFalke)
60a5632f77 build: set minimum supported macOS to 10.14 (fanquake)

Pull request description:

  Backport of https://github.com/bitcoin/bitcoin/pull/20419 then https://github.com/bitcoin/bitcoin/pull/19179 (except 2nd commit "Run i686 centos ci config on cirrus" which requires some more supporting PRs) then https://github.com/bitcoin/bitcoin/pull/20545 then https://github.com/bitcoin/bitcoin/pull/21542 then
  https://github.com/bitcoin/bitcoin/pull/21663 then https://github.com/bitcoin/bitcoin/pull/22122

  We are getting 403 errors in our MacOS job on Cirrus, presumably because bintray.com has shut down (see discussion on upstream PR 21663). Backport this PR and several supporting ones. These PRs will be merged as part of the 22.0 rebase. In the interest of keeping CI running let's backport them early.

Top commit has no ACKs.

Tree-SHA512: cdfe96789adedbfb617cdafb534175323a8fd46606e67adf7053f97cc32712dd3ece850906b522b6b0bed137f52c1372319f52f4a7b303aec479ea54d213271c
2021-07-12 18:39:15 +01:00
Steven Roose
aad04d0b9e
Merge ElementsProject/elements#1017: test: update createrawtransaction call in feature_taphash_pegins_issuances.py
1c883db83e test: update `createrawtransaction` call in feature_taphash_pegins_issuances.py (Andrew Poelstra)

Pull request description:

  Should describe the outputs as an array rather than as an object. (The old behavior has long been deprecated but was eliminated entirely in #900.)

  Fixes functional tests which were broken in master by simultaneous merge of #1002 and #900.

ACKs for top commit:
  stevenroose:
    utACK 1c883db83e

Tree-SHA512: f7963c34e7006a25ac5515e30966ef46777fa22d6125d219345731aef603e5f3179fc316134d59694af8e753f7cb48c825ad3434f2bceda0a10b8d5a52c32cd3
2021-07-12 18:38:03 +01:00
Andrew Poelstra
1e63e577db ci: disable Werror on MacOS build (not a backport) 2021-07-11 20:02:10 +00:00
MarcoFalke
1852f83a5d ci: Bump macOS image to big-sur-xcode-12.5
This also removes the "brew update" added in commit
b7381552cd.

https://github.com/bitcoin/bitcoin/pull/22122 (1/1)
2021-07-11 20:02:02 +00:00
Hennadii Stepanov
4f33ba757d ci: Fix macOS brew install command
Details: https://github.com/Homebrew/discussions/discussions/691

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

Conflicts: .cirrus.yml; had to remove libnatpnp which was added upstream
 in https://github.com/bitcoin/bitcoin/pull/18077 which is a much larger
 PR that we are NOT backporting.
2021-07-11 20:02:02 +00:00
Hennadii Stepanov
026508542c ci: Bump macOS VM image to the latest version
https://github.com/bitcoin/bitcoin/pull/21542 (1/1)
2021-07-11 20:02:02 +00:00
Andrew Poelstra
0740ceeb13 ci: Adjust cirrus ci task names
https://github.com/bitcoin/bitcoin/pull/20545 (1/1)
2021-07-11 20:02:00 +00:00
Andrew Poelstra
d08e5845a0 ci: Fix doc typos in .cirrus.yml
https://github.com/bitcoin/bitcoin/pull/19179 (3/3)
2021-07-11 20:01:19 +00:00
MarcoFalke
953cbe2599 ci: Run nowallet ci config on cirrus
https://github.com/bitcoin/bitcoin/pull/19179 (1/3)
2021-07-11 18:58:08 +00:00
fanquake
60a5632f77 build: set minimum supported macOS to 10.14 2021-07-11 18:43:54 +00:00
Andrew Poelstra
1c883db83e test: update createrawtransaction call in feature_taphash_pegins_issuances.py
Should describe the outputs as an array rather than as an object. (The old
behavior has long been deprecated but was eliminated entirely in #900.)
2021-07-09 20:31:24 +00:00
Andrew Poelstra
1ba24fe9b3
Merge ElementsProject/elements#1002: Implement Taproot Sighash
14f93579a5 Add pegins and issuance test (sanket1729)
edf8455fe4 Fix bug in CAssetIssuance decoding (sanket1729)
cdd75d4251 Update OP_SUCCESS for elements with allowed opcodes (sanket1729)
4618097ab4 Implement taphash for elements (sanket1729)
6c985308d7 Implement Taphash in test framework (sanket1729)
a26f6fead6 Expose only blockchain hash twice in header (sanket1729)
afb9e7b727 taproot: feed genesis hash and parent pegged asset to sighash function (Andrew Poelstra)

Pull request description:

ACKs for top commit:
  apoelstra:
    ACK 14f93579a5

Tree-SHA512: f0a3f6ef9f8958bc948cc42375600767f39aadc0dac096fe8e7823dc69ddc4204360e504af7801d05bb19ae4e6ace6a271842531c192e330167381cf2690c856
2021-07-07 20:58:41 +00:00
Andrew Poelstra
e0532f60c7
Merge ElementsProject/elements#933: doc: add document describing Taproot sighashes
cca82245f8 doc: fix `SigMsg` length in taproot sighash (Andrew Poelstra)
7ca7983c2a doc/taproot-sighash: encode issuance rangeproofs in sighash; clean up padding etc (Andrew Poelstra)
04cb40010f doc/taproot-sighash: clarify text about pegin input data (Andrew Poelstra)
a88e4c5b1d doc/taproot-sighash: remove "padded" CTxOut format from doc (Andrew Poelstra)
41de29493f taproot-sighash.mediawiki: address formatting/typo comments from Russell (Andrew Poelstra)
dc5b3185b4 taproot-sighash.mediawiki: remove input `nNonce` field (Andrew Poelstra)
f62c8d19d3 taproot-sighash.mediawiki: fix ambiguity in text (Andrew Poelstra)
a552fbf470 update taphash doc (sanket1729)
88d41e5ba2 doc: add missing nNonce field for ACP taproot sighashes (Andrew Poelstra)
639f6f3a98 doc: expand all confidential fields in taproot-sighash to fixed 33 bytes (Andrew Poelstra)
d19dd01ce6 doc: add document describing Taproot sighashes (Andrew Poelstra)

Pull request description:

  Thanks to @roconnor-blockstream for writing the first draft of this document.

ACKs for top commit:
  sanket1729:
    ACK cca82245f8

Tree-SHA512: a534a0be313b5ba3c74ad4f2cdb1e009f1c240f5f85aeb06195325ff87348a1c1457252c9b347de4400446d0fc98def8c4df55176d4481c44449f5bc4e2917b1
2021-07-07 17:06:45 +00:00
Andrew Poelstra
9a154599fe
Merge ElementsProject/elements#900: Redesign PSET
f8553c571b Disable joinpsbts (Andrew Chow)
864f625fcf Fix display of outputs in PSBT ops dialog (Andrew Chow)
5425da4278 Enable converttopsbt for PSET (Andrew Chow)
4940ceeea6 Use a constant for maximum surjection targets (Andrew Chow)
4a44ff2c2e Check elements blinding field constraints during deser (Andrew Chow)
9fe6401d59 Allow specifying SIGHASH_RANGEPROOF (Andrew Chow)
7533503b3c Initialize optionals with nullopt (Andrew Chow)
64b30bfc3d Enable analyzepsbt (Andrew Chow)
b65a00f095 Add PSBTOutput::GetTxOut() (Andrew Chow)
80ff739c7a Default to adding bip32 derivs (Andrew Chow)
1889554e2c Remove unnecessary psbt blinding test (Andrew Chow)
afd795010b Update rpc_psbt.py for PSET (Andrew Chow)
46ccf611c4 Only allow psbt_version 2 (Andrew Chow)
b1ebc813ea Remove walletsignpsbt, blindpsbt, walletblindpsbt, and walletfillpsbtdata (Andrew Chow)
d8fa5c1458 Use createtx array outputs (Andrew Chow)
0e2f1ff441 Make m_peg_in_witness during SignPSBTInput (Andrew Chow)
bd97836767 Update FinalizeAndExtract for PSEt (Andrew Chow)
c0cb623acc Allow value commitments instead of explicit value (Andrew Chow)
2c0cee5a20 Update GetUnsignedTx for PSET (Andrew Chow)
25df8aa12b Fixes to FillPSBT (Andrew Chow)
e9bfff25db Allow empty scriptPubKeys (Andrew Chow)
eeb6cf76e4 Mark PSET as being implemented (Andrew Chow)
3db2622e70 Only sign blinded PSBTs in walletprocesspsbt (Andrew Chow)
a8a6f4c999 Add IsBlinded and IsFullyBlinded helpers for PSBT (Andrew Chow)
124efa2668 Return better errors for BlindingStatus (Andrew Chow)
f686e0fa54 Remove walletfillpsbtdata RPC (Andrew Chow)
5391095205 Output PSBTOutputs with aux info from ConstructTransaction (Andrew Chow)
ea2c3dfb20 Remove output_assets and have asset field in outputs (Andrew Chow)
e6cc0fd693 Have walletprocesspsbt blind before signing (Andrew Chow)
bad1876e03 Re-enable and fix PSBT signing (Andrew Chow)
9a450ecc19 Set blinder_index to self in walletcreatefundedpsbt (Andrew Chow)
3f6c8bfda1 Add walletblindpsbt rpc (Andrew Chow)
e7dd046b03 Implement BlindPSBT (Andrew Chow)
1dbc3b270c Implement updatepsbtpegin RPC (Andrew Chow)
bdfcb436b7 Add calculateasset RPC (Andrew Chow)
79c4a9901b pset: add issuance things (Andrew Chow)
6890461bfe Implement blinded combiner stuff (Andrew Chow)
2220d844ef Return peg-in UTXO with GetUTXO (Andrew Chow)
33c694f822 Helper functions to determine whether a PSBTOutput is blinded (Andrew Chow)
ee28be3018 Extract elements fields for tx into psbt (Andrew Chow)
f84a927a71 Add DecomposePeginWitness (Andrew Chow)
e37439775a Implement and enable decodepsbt for PSET (Andrew Chow)
b372430f70 Implement PSET fields and their de/ser (Andrew Chow)
ecaf5ea1cf Use GetUnsignedTx when serializing in PSBTv0 (Andrew Chow)
e860cd0f42 Add a PSBT constructor for providing the version (Andrew Chow)
0ca0b7e040 Update rpc_psbt.py to test PSBTv0 explicitly in some places (Andrew Chow)
f4bca18784 Restrict joinpsbts to PSBTv0 only (Andrew Chow)
ebc49e3111 Allow createpsbt and walletcreatefundedpsbt to take psbt version (Andrew Chow)
2c1fe5841f Allow and create PSBTv2 in RPCs (Andrew Chow)
e467ec68ad Update PSBT::UpdatePSBTOutput to use GetUnsignedTx (Andrew Chow)
a34474e25a Allow specifying PSBT version in constructor (Andrew Chow)
bedc1e0fec Implement PSBTv2 in decodepsbt (Andrew Chow)
139ac3613e Implement PSBTv2 AddInput and AddOutput (Andrew Chow)
16395c15e9 Update wallet for PSBTv2 (Andrew Chow)
9c8330024a Update RPCs for PSBTv2 (Andrew Chow)
c9c23cad6b Update PSBT Operations Dialog for v2 (Andrew Chow)
500554acbe Update AnalyzePSBT for PSBTv2 (Andrew Chow)
f269d1170c Update FinalizeAndExtract for v2 (Andrew Chow)
23f644206b Update SignPSBTInput for PSBTv2 (Andrew Chow)
d8dba3333b Add PSBTInput::GetOutPoint (Andrew Chow)
4ff2593280 Implement PSBTv2 field merging (Andrew Chow)
cd5515a266 Change PSBT::AddOutput to take just PSBTOutput (Andrew Chow)
90cd7ec5d5 Change PSBT::AddInput to take just PSBTInput (Andrew Chow)
bd1a57bd80 Add PSBT::GetUniqueID (Andrew Chow)
32bdf2d97e Add PSBT::GetUnsignedTx (Andrew Chow)
10bf24726b Add PSBT::ComputeLockTime() (Andrew Chow)
3c647b7a54 Replace PSBT::GetInputUTXO with PSBTInput::GetUTXO (Andrew Chow)
4b805fd4b5 Convert PSBTv0 unsigned tx to PSBTv2 fields (Andrew Chow)
32234dfa68 Call CacheUnsignedTxPieces in PSBT constructor (Andrew Chow)
c32950e02b Add PSBT::CacheUnsignedTxPieces (Andrew Chow)
457b6bd44b Enforce PSBT version constraints (Andrew Chow)
2042765520 Have PSBTInput and PSBTOutput know the PSBT's version (Andrew Chow)
8c624438ca Change PSBT unknown fields test to use higher numbers (Andrew Chow)
dd792cea62 Implement PSBTv2 fields de/ser (Andrew Chow)
ec03f83d5f Define psbtv2 field numbers (Andrew Chow)
20e8dff880 Merge global xpubs in joinpsbts and combinepsbts (Andrew Chow)
bc2651d200 Add global xpub test vectors from BIP (Andrew Chow)
7fd50b2795 Add global_xpubs to decodepsbt (Andrew Chow)
2c54175f0f Implement serializations for PSBT_GLOBAL_XPUB (Andrew Chow)
5b5c5efbbb Implement operator< for KeyOriginInfo and CExtPubKey (Andrew Chow)
4eabba9be7 Separate individual HD Keypath serialization into separate functions (Andrew Chow)
cb9c553429 Store version bytes and be able to serialize them in CExtPubKey (Andrew Chow)
fad29bafd3 moveonly: Move (Un)Serialize(To/From)Vector, (De)SerializeHDKeypaths to psbt module (Andrew Chow)
31a7e0a744 Test for proprietary field (Andrew Chow)
5bb930e0b4 Output proprietary type info in decodepsbt (Andrew Chow)
575fec01b2 Implement PSBT proprietary type (Andrew Chow)
25c13ad3b8 Output psbt version in decodepsbt (Andrew Chow)
ad2b2d7c58 Add GetVersion helper to PSBT (Andrew Chow)
50c281fc12 Implement PSBT versions (Andrew Chow)
e882a3a32d Types are compact size uints (Andrew Chow)
fdf71def4c Remove PSET and disable PSBT/PSET things for now (Andrew Chow)

Pull request description:

  The original PSET had some issues with leaking private information and there were issues with the design of the various roles. This PR replaces it with a new PSET design that should be able to provide all of the things that people expect PSETs to do while preserving privacy.

  Additionally, an actual specification for this new design has been written up. It describes all of the new fields, their serialization, and how roles should handle the PSET data.

  This is still a work in progress as not everything with the blinder role has been worked out yet.

Top commit has no ACKs.

Tree-SHA512: 69f6f74dd252e4fba14e201f8f1d9b017b3b62ddf375e6536e71a3f327435e7c1ef8a12b2914cbed3e46f70bcbc8caadc07342ee323ece45a47dd1d77d81b3e8
2021-07-06 19:55:59 +00:00
Andrew Poelstra
0355e30db3
Merge ElementsProject/elements#949: [Doc] New Opcodes for tapscript
84339ba5e5 Address Andrew's suggestions (sanket1729)
7b187d6b26 Add doc for tapscript opcode upgradres (sanket1729)

Pull request description:

  This PR adds a doc describing suggested new opcodes for better script programming with elements. The purpose of these opcodes to aid easier writing of complex scripts like covenants in elements.

  This introduces 1) Opcodes for Streaming hashes, 2) Transaction introspection opcodes 3) 64 byte athematic opcodes 4) Some utility conversion opcodes 5) Crypto opcodes for low-level operations and tweaking 6) A cleaner way to write For loops and 7) Changes to existing opcodes.

  The doc also describes a brief rationale for choice. Feedback welcome :)

Top commit has no ACKs.

Tree-SHA512: 0a6da8ab3c8498c7378d21cb26fc0b120c669efe5bf2dc97f935bd8c9b463b51cba9dd368593c33b714f206c14992fca1e5ff23f674bfd921759f0c80ce0087b
2021-07-06 18:50:59 +00:00
Andrew Poelstra
cca82245f8 doc: fix SigMsg length in taproot sighash 2021-07-01 22:20:37 +00:00
sanket1729
14f93579a5 Add pegins and issuance test 2021-07-01 17:56:44 +00:00
sanket1729
edf8455fe4 Fix bug in CAssetIssuance decoding 2021-07-01 17:56:44 +00:00
sanket1729
cdd75d4251 Update OP_SUCCESS for elements with allowed opcodes 2021-07-01 17:56:44 +00:00
sanket1729
4618097ab4 Implement taphash for elements 2021-07-01 17:56:44 +00:00
sanket1729
6c985308d7 Implement Taphash in test framework 2021-07-01 17:56:44 +00:00
sanket1729
a26f6fead6 Expose only blockchain hash twice in header 2021-07-01 17:56:44 +00:00
Andrew Poelstra
afb9e7b727 taproot: feed genesis hash and parent pegged asset to sighash function 2021-07-01 17:56:44 +00:00
Andrew Poelstra
7ca7983c2a doc/taproot-sighash: encode issuance rangeproofs in sighash; clean up padding etc 2021-07-01 16:59:52 +00:00
Andrew Poelstra
04cb40010f doc/taproot-sighash: clarify text about pegin input data 2021-07-01 16:59:52 +00:00
Andrew Poelstra
a88e4c5b1d doc/taproot-sighash: remove "padded" CTxOut format from doc 2021-07-01 16:59:52 +00:00
Andrew Poelstra
41de29493f taproot-sighash.mediawiki: address formatting/typo comments from Russell 2021-07-01 16:59:52 +00:00
Andrew Poelstra
dc5b3185b4 taproot-sighash.mediawiki: remove input nNonce field 2021-07-01 16:59:52 +00:00
Andrew Poelstra
f62c8d19d3 taproot-sighash.mediawiki: fix ambiguity in text 2021-07-01 16:59:52 +00:00
sanket1729
a552fbf470 update taphash doc 2021-07-01 16:59:52 +00:00
Andrew Poelstra
88d41e5ba2 doc: add missing nNonce field for ACP taproot sighashes 2021-07-01 16:59:52 +00:00
Andrew Poelstra
639f6f3a98 doc: expand all confidential fields in taproot-sighash to fixed 33 bytes 2021-07-01 16:59:52 +00:00
Andrew Poelstra
d19dd01ce6 doc: add document describing Taproot sighashes 2021-07-01 16:59:52 +00:00
Steven Roose
bd2e2d5c64
Merge ElementsProject/elements#1012: fuzz: backport fixes to fuzzer errors
0896d0a278 util: Properly handle -noincludeconf on command line (MarcoFalke)
5f18d337d4 Cleanup -includeconf error message (MarcoFalke)
99b86594df Fix crash when parsing command line with -noincludeconf=0 (MarcoFalke)
c98902bd1b fuzz: add missing ECCVerifyHandle to base_encode_decode (Andrew Poelstra)

Pull request description:

  Backport of https://github.com/bitcoin/bitcoin/pull/22279 and https://github.com/bitcoin/bitcoin/pull/22002 and https://github.com/bitcoin/bitcoin/pull/22137

ACKs for top commit:
  jonasnick:
    utACK 0896d0a278

Tree-SHA512: 7a9c4a20fc51ac3e66fd0b8d6f28200b9342774fcb003c561e277fab4a68c3ebd2cab4c3081170199a51aabf3956e0f7248fa6c853c8aa971645fb9039adc688
2021-07-01 16:58:21 +01:00
sanket1729
84339ba5e5 Address Andrew's suggestions 2021-06-28 13:43:39 -07:00
sanket1729
7b187d6b26 Add doc for tapscript opcode upgradres 2021-06-23 14:30:27 -07:00
Andrew Chow
f8553c571b Disable joinpsbts
It doesn't work, disable for now.
2021-06-22 14:42:38 -04:00
Andrew Chow
864f625fcf Fix display of outputs in PSBT ops dialog 2021-06-22 14:42:38 -04:00
Andrew Chow
5425da4278 Enable converttopsbt for PSET 2021-06-22 14:42:38 -04:00