Commit Graph

7941 Commits

Author SHA1 Message Date
Jack Grigg 66a519f55d
Alter SaplingNote::nullifier() to take a SaplingFullViewingKey
This means the API will work if you only have a SaplingExtendedSpendingKey,
as will be the case with ZIP 32.
2018-07-24 14:54:01 +02:00
Homu a7a62b724b Auto merge of #3391 - bitcartel:3061_sapling_note_encryption, r=ebfull
Sapling note plaintext (encryption and decryption)

Add encryption and decryption of SaplingNotePlaintext and SaplingOutgoingPlaintext classes.

This is part of #3061 to add Sapling note functionality.
2018-07-24 03:27:28 -07:00
Simon e739ca2ef2 Rename AttemptSaplingEncDecryptionUsingFullViewingKey and use function overloading. 2018-07-23 10:48:26 -07:00
Simon 7b913c3e5e Implement Sapling note decryption using full viewing key. 2018-07-20 16:31:48 -07:00
Wladimir J. van der Laan a9496b08b6
rpc: Register calls where they are defined
Split out methods to every module, apart from 'help' and 'stop' which
are implemented in rpcserver.cpp itself.

- This makes it easier to add or remove RPC commands - no longer everything that includes
    rpcserver.h has to be rebuilt when there's a change there.
- Cleans up `rpc/server.h` by getting rid of the huge cluttered list of function definitions.
- Removes most of the bitcoin-specific code from rpcserver.cpp and .h.

Continues #7307 for the non-wallet.
2018-07-18 11:07:18 -06:00
Daniel Cousens 4b184205e3
rpc: update inline comments to refer to new file paths 2018-07-18 11:07:17 -06:00
Daniel Cousens 4519a766b6
move rpc* to rpc/ 2018-07-18 11:07:16 -06:00
Jonas Schnelli 34aca1b03c
[RPC, Wallet] Move RPC dispatch table registration to wallet/ code
Allow extending the rpc dispatch table by appending commands when server is not running.
2018-07-18 11:07:15 -06:00
Homu aad4b86e95 Auto merge of #3376 - LarryRuane:2728-help-message-experimental, r=bitcartel
add extra help how to enable experimental features

Closes #2728. When the user attempts to execute a disabled experimental RPC, print some nice text explaining how to enable the RPC (either command-line or adding lines to zcash.conf).
2018-07-18 07:45:46 -07:00
Homu b9bd5ab42c Auto merge of #3354 - leto:absurd_fee_bug, r=bitcartel
Fix absurd fee bug reported in #3281, with tests

This was ported from the Hush `absurd_fee_bug` PR: https://github.com/MyHush/hush/pull/136

Tests executed with `./qa/pull-tester/rpc-tests.sh wallet` and pass on Ubuntu 16.04. Some tests were added for previously untested behavior as well.

Closes #3281.
2018-07-17 15:03:08 -07:00
Simon 687bd96cbd Minor update to address nits in review. 2018-07-17 14:26:38 -07:00
Homu 3835cbb57f Auto merge of #3263 - str4d:ibd-upstream-changes, r=bitcartel
InitialBlockDownload upstream changes

Cherry-picked from the following upstream PRs:

- bitcoin/bitcoin#7208
- bitcoin/bitcoin#8007
- bitcoin/bitcoin#9053
  - Excluding second commit (requires bitcoin/bitcoin#8865)
- bitcoin/bitcoin#10388
2018-07-17 13:17:27 -07:00
Simon 0b6eeac330 Update and fix per review comments, the test for absurd fee. 2018-07-17 13:00:42 -07:00
Homu 13b41a6760 Auto merge of #3156 - Eirik0:2935-change-indicator, r=bitcartel
Add change indicator

This adds to the json returned when calling z_listreceivedbyaddress and z_listuspent an additional field entitiled 'change' which will be either true or false depending on whether or not the note was change from another transaction.
2018-07-17 11:41:03 -07:00
Larry Ruane 66dfcc1369 add extra help how to enable experimental features 2018-07-16 21:31:55 -06:00
Sean Bowe f23e783600 Decryption and tests of note/outgoing encryption. 2018-07-16 18:34:14 -06:00
Homu ea0bd9d3b8 Auto merge of #3345 - str4d:sapling-z_validateaddress, r=bitcartel
Add Sapling support to z_validateaddress

Part of #3217.
2018-07-16 15:04:54 -07:00
Eirik Ogilvie-Wigley 0646f749f9 Add change indicator for notes 2018-07-16 14:49:29 -06:00
Homu b7d058cef3 Auto merge of #3334 - arielgabizon:add_groth_tests, r=bitcartel
Extend JoinSplit tests to Groth

As we now have both PGHR and Groth proofs for Sprout - make the joinsplit tests check the Groth proofs as well.
See https://github.com/zcash/zcash/issues/3266
2018-07-16 12:11:12 -07:00
Duke Leto 4b8c52c65c Improve error message 2018-07-14 05:16:28 +00:00
Duke Leto 75bb5f94f4 Update comment as per @arielgabizon 2018-07-13 19:19:16 +00:00
Ariel Gabizon 589479fd33 Extend Joinsplit tests to Groth 2018-07-13 13:01:34 +02:00
Homu eea0e2c924 Auto merge of #3390 - arcalinea:3319_discard_sk_if_invalid_ivk, r=str4d
Discard sk if ivk == 0

Addresses #3319
2018-07-13 03:16:21 -07:00
Jay Graber db9f669c15 Discard sk if ivk == 0 2018-07-12 15:05:19 -07:00
Homu f55bcd1c10 Auto merge of #3374 - rex4539:fix-typos, r=str4d
Fix typos
2018-07-12 14:25:15 -07:00
Simon 34bf166e5f Add encryption of SaplingNotePlaintext and SaplingOutgoingPlaintext classes.
This is part of #3061 to add Sapling note functionality.
2018-07-11 22:03:04 -07:00
Homu d86f60f382 Auto merge of #3324 - ebfull:sapling-note-encryption, r=ebfull
Sapling note encryption implementation

Closes #3055

Implemented along with @gtank and @Eirik0

DH key exchange was implemented in https://github.com/zcash/librustzcash/pull/18
2018-07-11 14:51:57 -07:00
Sean Bowe 7478876271 Minor edits 2018-07-11 15:48:41 -06:00
Jack Grigg bea879157c
Add Sapling support to z_validateaddress 2018-07-09 15:38:07 +01:00
Homu 579ad3b13e Auto merge of #3273 - arcalinea:sapling_keys, r=str4d
Sapling keys in keystore, wallet

-  Add/Have/Get SaplingSpendingKey
- Add/Remove/Have/Get SaplingFullViewingKey
- Have/Get SaplingIncomingViewingKey

- SaplingSpendingKeyMap, SaplingFullViewingKeyMap, SaplingIncomingViewingKeyMap

- GenerateNewSaplingZKey()

Not included: note decryptors, crypted keystore
2018-07-06 15:18:39 -07:00
Dimitris Apostolou ccf9106501
Fix typos 2018-07-06 14:33:24 +03:00
Jay Graber 2173767365 Add crypted keystore sapling add key 2018-07-05 15:00:00 -07:00
Jay Graber 8e91ebf76c Change default_address to return SaplingPaymentAddr and not boost::optional 2018-07-05 14:52:51 -07:00
Jay Graber f82a864dc1 Add StoreAndRetrieveSaplingSpendingKey test 2018-07-05 14:52:51 -07:00
Jay Graber f4207d0c0e Add SaplingIncomingViewingKeys map, SaplingFullViewingKey methods 2018-07-05 14:52:46 -07:00
Jay Graber efb7662d4a Add Sapling Add/Have/Get to keystore 2018-07-05 14:37:33 -07:00
Larry Ruane c872c1d2df Disable libsnark debug logging in Boost tests 2018-07-05 10:16:13 -06:00
Simon 8fc73722e8 make-release.py: Versioning changes for 1.1.2. 2018-07-01 20:07:24 -07:00
Simon 5cbbb7e375 make-release.py: Versioning changes for 1.1.2-rc1. 2018-06-22 16:55:20 -07:00
Homu d5dcfa2b01 Auto merge of #3346 - bitcartel:3328_alert_non_overwinter_nodes, r=str4d
Closes #3328. Send alert to put non-Overwinter nodes into safe mode.

The alert targets nodes running protocol version <= 170004.
Overwinter compatible nodes run protocol version >= 170005.
2018-06-22 09:40:01 -07:00
Simon e56117f894 Closes #3328. Send alert to put non-Overwinter nodes into safe mode.
The alert targets nodes running protocol version <= 170004.
Overwinter compatible nodes run protocol version >= 170005.
2018-06-22 09:07:12 -07:00
Homu f587e61bda Auto merge of #3259 - leto:signmessage, r=str4d
Clarify help that signmessage only works on taddrs
2018-06-22 02:19:12 -07:00
Duke Leto e5aa9f617b Fix absurd fee bug reported in #3281, with tests 2018-06-22 05:20:45 +00:00
Homu f24d1ff546 Auto merge of #3337 - str4d:getblock-finalsaplingroot, r=bitcartel
Add hashFinalSaplingRoot to getblockheader and getblock output
2018-06-19 16:19:13 -07:00
Homu 9acfa0067f Auto merge of #3258 - Eirik0:3056-anchor-test-cases, r=str4d
Add tests for sapling anchors

Closes #3253
2018-06-19 09:28:20 -07:00
Eirik Ogilvie-Wigley 762ee0e896 Rename typename 2018-06-19 10:07:00 -06:00
Eirik Ogilvie-Wigley 115b26cb27 Add BOOST_TEST_CONTEXT to distinguish sprout v. sapling 2018-06-19 10:06:21 -06:00
Homu 2ebde5860e Auto merge of #3326 - str4d:3058-sapling-addresses, r=str4d
Sapling address encodings

This PR enables Sapling keys and addresses to be passed in anywhere Sprout keys
and addresses are used. Doing so will cause crashes until those places are updated
with Sapling support.

Includes code cherry-picked from the following upstream PRs:

- bitcoin/bitcoin#11167
  - Only the `ConvertBits()` function.
- bitcoin/bitcoin#11630

Closes #3058.
2018-06-19 05:12:50 -07:00
Homu 4e3ff06507 Auto merge of #3320 - str4d:macos-tests, r=bitcartel
Fix MacOS tests

Includes code cherry-picked from upstream PR bitcoin/bitcoin#8270.
2018-06-18 19:00:56 -07:00
Sean Bowe 4e1f2daa0d Add get_esk() function to Sapling note encryption. 2018-06-18 13:14:43 -06:00
Jack Grigg 3af4633b4b
Add hashFinalSaplingRoot to getblockheader and getblock output 2018-06-15 13:59:28 +12:00
Sean Bowe c03e22612d Prevent nonce reuse in Sapling note encryption API. 2018-06-14 12:21:28 -06:00
Sean Bowe 90073aeca5 Swap types in OutputDescription to use new NoteEncryption interfaces. 2018-06-14 12:08:37 -06:00
Sean Bowe 9e1c2c4049 Implementation of Sapling in-band secret distribution. 2018-06-14 11:58:45 -06:00
Jay Graber 052d640cb0 Add json test vectors for Sapling key components. 2018-06-13 10:38:32 -07:00
Homu 4f18c693c3 Auto merge of #3272 - bitcartel:3061_sapling_add_notes, r=bitcartel
Add SaplingNote class

Part of #3061, adding SaplingNote class.
2018-06-12 16:58:38 -07:00
Simon 268e5dfa50 Return optional for Sapling commitments and nullifiers.
Unlike Sprout, they are not always computable in Sapling.
2018-06-12 14:40:17 -07:00
Simon d17f8d1cc7 Refactor and replace factory method random() with constructor. 2018-06-12 14:37:15 -07:00
Simon 36e2e7cc32 Add SaplingNote class and test_sapling_note unit test. 2018-06-12 14:37:05 -07:00
Homu 524171de1f Auto merge of #3137 - str4d:2943-remove-auto-senescence-option, r=ebfull
Remove config option -disabledeprecation

Closes #2943.
2018-06-12 08:51:13 -07:00
Jack Grigg 69aa0d8f28
Use CChainParams::Bech32HRP() in zs_address_test 2018-06-12 18:38:36 +12:00
Jack Grigg f59093935c
Add examples of ConvertBits transformation 2018-06-12 16:51:59 +12:00
Jack Grigg dd7417c8d0
Add comment about size calculations for converted serialized keys 2018-06-12 15:47:56 +12:00
Jack Grigg c74ab3356a Remove config option -disabledeprecation
Closes #2943.
2018-06-11 10:38:12 -07:00
Ariel Gabizon e1a3461cc2 Improve/Fix variable names
ZCProof was too general. pubKeyHash was actually the JoinSplit pubkey
itself.
2018-06-09 20:27:35 -07:00
Homu de1bc2d389 Auto merge of #3321 - bitcartel:remove_librustcash_xor, r=str4d
Remove now redundant Rust call to librustzcash_xor.

Related to https://github.com/zcash/librustzcash/pull/17 which removes librustzcash_xor from library.
2018-06-07 20:37:07 -07:00
Simon 10a7d55a03 Remove now redundant Rust call to librustzcash_xor. 2018-06-06 23:24:21 -07:00
Jack Grigg 2802e321c1
Fix cached_witnesses_empty_chain test failure on MacOS
Assertion error format is different, so match only on the assertion.
2018-06-07 17:49:05 +12:00
Jack Grigg bec3e62bc1
Implement encoding and decoding of Sapling keys and addresses 2018-06-07 17:28:50 +12:00
Jack Grigg c8511dfc07
Fix bech32::Encode() error handling
Previously, an input with invalid characters would result in out-of-bounds
reads, potentially exposing up to 224 bytes of memory following the location of
the CHARSET constant. This commit fixes the function to return an empty string,
which is what was originally documented as happening.
2018-06-07 17:19:44 +12:00
Pieter Wuille 6a2cc8ddc0
Simplify Base32 and Base64 conversions 2018-06-07 17:19:43 +12:00
Pieter Wuille ac70f76c5d
Generalize ConvertBits 2018-06-07 17:19:34 +12:00
Jack Grigg 6b759fb092
ConvertBits() - convert from one power-of-2 number base to another.
Function extracted from upstream:
  PR bitcoin/bitcoin#11167
  Commit c091b99379b97cb314c9fa123beabdbc324cf7a4
2018-06-07 16:42:01 +12:00
Jack Grigg 7e45636707
chainparams: Add Sapling Bech32 HRPs 2018-06-07 16:41:59 +12:00
Homu 80338c07e5 Auto merge of #3237 - str4d:std-array, r=str4d
Replace boost::array with std::array
2018-06-06 19:36:57 -07:00
Jack Grigg 4fb3d05ce9
Whitespace cleanup 2018-06-07 14:35:56 +12:00
Homu ffba08b0e0 Auto merge of #3318 - Eirik0:3298-fix-getnetworksolps-params, r=bitcartel
Fix parsing parameters in getnetworksolps

This fixes https://github.com/zcash/zcash/issues/3298. The parameters were not correctly being converted.
2018-06-06 10:00:21 -07:00
Homu d18212b1d6 Auto merge of #3299 - Eirik0:3248-update-getblocktemplate, r=str4d
Add hashFinalSaplingRoot to getblocktemplate

Closes #3248
2018-06-06 05:00:58 -07:00
Matthew King d28d3d20de
Use portable #! in python scripts (/usr/bin/env) 2018-06-05 21:56:13 +12:00
Eirik Ogilvie-Wigley c61ed9acfb Fix parsing parameters in getnetworksolps 2018-06-04 16:45:12 -06:00
Jay Graber 87c9994cb2 Make diversifier functions return option 2018-06-04 07:47:46 -07:00
Jay Graber 0da9aac63e s/SaplingInViewingKey/SaplingIncomingViewingKey 2018-06-04 04:59:07 -07:00
Eirik Ogilvie-Wigley 25c13ef702 Add hashFinalSaplingRoot to getblocktemplate 2018-06-01 15:47:30 -06:00
Jay Graber dd099401a3 Fix default_address() 2018-06-01 04:03:27 -07:00
Jay Graber 521a6f1fc0 Minimal sapling key test 2018-06-01 02:32:17 -07:00
Jay Graber 52d81ff794 Update librustzcash dependency, address comments 2018-06-01 01:48:28 -07:00
Jay Graber 84e3a2212f Change librustzcash dependency hash to work for new Sapling classes 2018-06-01 00:04:13 -07:00
Jay Graber 11acfe6e9f Add Sapling key classes to wallet, with new librustzcash APIs 2018-06-01 00:04:13 -07:00
Homu 73fea25404 Auto merge of #3300 - bitcartel:3277_add_comment_deprecated_txdb_prefixes, r=str4d
Part of #3277. Add comment about deprecated txdb prefixes.
2018-05-25 18:42:05 -07:00
Jack Grigg a6bbb26e08
Replace boost::array with std::array 2018-05-26 00:12:57 +12:00
Simon c290f8f263 Update release height to block 332000. 2018-05-24 23:09:02 -07:00
Jack Grigg d670db7164
Sapling testnet activation height 2018-05-25 16:05:25 +12:00
Jack Grigg 40c33db2f4
make-release.py: Versioning changes for 1.1.1. 2018-05-25 15:38:43 +12:00
Simon 47db75426f Closes #3301. Non-void function should not have empty definition. 2018-05-23 21:04:51 -07:00
Simon f9840089db Part of #3277. Add comment about deprecated txdb prefixes. 2018-05-23 20:37:34 -07:00
Simon d3ff27c0a6 make-release.py: Versioning changes for 1.1.1-rc2. 2018-05-23 09:27:59 -07:00
Jack Grigg 8bf890abac make-release.py: Versioning changes for 1.1.1-rc1. 2018-05-19 09:50:15 +12:00
Sean Bowe 3577de83aa Change txdb prefixes for sapling and avoid writing unnecessary information. 2018-05-18 13:26:39 -06:00
Sean Bowe 8f5429a13a Update merkle tree and pedersen hash tests to account for new encoding 2018-05-18 13:26:39 -06:00
Homu f62fff80d5 Auto merge of #3255 - str4d:sapling-value-pool, r=ebfull
Track net value entering and exiting the Sapling circuit
2018-05-16 10:46:32 -07:00
Eirik Ogilvie-Wigley 3182b4abc3 Add tests for sapling anchors 2018-05-16 10:31:53 -06:00
Alex Morcos bbff8631f5
Output line to debug.log when IsInitialBlockDownload latches to false 2018-05-15 22:18:11 +12:00
Gregory Maxwell f04a90afb2
IsInitialBlockDownload no longer uses header-only timestamps.
This avoids a corner case (mostly visible on testnet) where bogus
 headers can keep nodes in IsInitialBlockDownload.
2018-05-15 22:18:04 +12:00
Gregory Maxwell e41632c9fb
IBD check uses minimumchain work instead of checkpoints.
This introduces a 'minimum chain work' chainparam which is intended
 to be the known amount of work in the chain for the network at the
 time of software release.  If you don't have this much work, you're
 not yet caught up.

This is used instead of the count of blocks test from checkpoints.

This criteria is trivial to keep updated as there is no element of
subjectivity, trust, or position dependence to it. It is also a more
reliable metric of sync status than a block count.
2018-05-15 21:25:19 +12:00
Kaz Wesley 02eedeeb69
IsInitialBlockDownload: usually avoid locking
Optimistically test the latch bool before taking the lock.
For all IsInitialBlockDownload calls after the first to return false,
this avoids the need to lock cs_main.
2018-05-15 21:25:19 +12:00
Wladimir J. van der Laan 29aaf13b0a
Make max tip age an option instead of chainparam
After discussion in #7164 I think this is better.

Max tip age was introduced in #5987 to make it possible to run
testnet-in-a-box. But associating this behavior with the testnet chain
is wrong conceptually, as it is not needed in normal usage.
Should aim to make testnet test the software as-is.

Replace it with a (debug) option `-maxtipage`, which can be
specified only in the specific case.
2018-05-15 21:24:58 +12:00
Jack Grigg f55029e7d1 Correctly serialize Groth16 JSDescription for verifyjoinsplit benchmark 2018-05-14 16:29:02 -06:00
Sean Bowe 34f6ea95dc Adjust tests and benchmarks 2018-05-14 16:29:02 -06:00
Sean Bowe b7a6c32178 Integrate Groth16 verification and proving. 2018-05-14 16:26:23 -06:00
Jack Grigg e5eab182b5
Use boost::variant to represent shielded addresses and keys
libzcash::PaymentAddress has been renamed to libzcash::SproutPaymentAddress,
and a new typedef boost::variant is now libzcash::PaymentAddress. Similarly
for ViewingKey and SpendingKey.

A new class InvalidEncoding is introduced as the default boost::variant
option for each address and key type; it is used during decoding instead
of boost::optional.

All address and key storage functions in the wallet have been modified to
refer specifically to the Sprout types, as they are used very precisely.
In most other cases, the more general type is leveraged as much as possible,
and we convert to the Sprout type when necessary. This will be subsequently
wrapped in, or replaced with, context-specific functions once Sapling
types are implemented.
2018-05-11 17:14:49 -04:00
Homu 1942f7a42b Auto merge of #3242 - str4d:3058-key-encoding-refactor, r=str4d
Key encoding refactor

Includes code cherry-picked from the following upstream PRs:

- bitcoin/bitcoin#11372
  - Only the first three commits (the fourth commit depends on #2390)

Part of #3058.
2018-05-11 12:21:29 -07:00
Jonathan "Duke" Leto 30bf78ca23 Clarify help that signmessage only works on taddrs 2018-05-10 17:25:13 -07:00
Homu ae6c2587d3 Auto merge of #3232 - ebfull:3207-sapling-validation, r=str4d
Sapling validation

**Also review https://github.com/zcash/librustzcash/pull/7**

This is an attempt to tackle much of https://github.com/zcash/zcash/issues/3065
2018-05-10 10:21:15 -07:00
Homu 73f5cb1213 Auto merge of #3257 - bitcartel:3250_fix_segfault_memo, r=ebfull
Closes #3250. Memo getter should return by reference, not by value.
2018-05-10 08:47:06 -07:00
Homu 677b5b3b8b Auto merge of #3247 - str4d:3207-valuebalance, r=str4d
Add valueBalance to value balances

Part of #3065 and #3207.
2018-05-10 07:12:00 -07:00
Jack Grigg 0fe0ca7948
Add contextual comment for GetValueOut() and GetShieldedValueIn() 2018-05-10 09:34:19 -04:00
Simon 67f3577239 Closes #3250. Memo getter should return by reference, not by value. 2018-05-09 21:52:33 -07:00
Homu 08f74ed026 Auto merge of #3240 - str4d:remove-obsolete-binaries, r=str4d
Remove obsolete CreateJoinSplit and GenerateParams binaries
2018-05-09 13:50:25 -07:00
Jack Grigg ae97177c86
Track net value entering and exiting the Sapling circuit 2018-05-09 16:02:23 -04:00
Jack Grigg 97b46f00cc
Add valueBalance to value balances, and enforce its consensus rules 2018-05-09 11:34:41 +01:00
Homu f0daf3915f Auto merge of #3233 - str4d:3164-sapling-sighash, r=str4d
ZIP 243: Sapling SignatureHash

Closes #3164.
2018-05-08 16:59:33 -07:00
Jack Grigg 93bd00a0d5
Add key_io includes to Zcash-specific code 2018-05-08 21:39:56 +01:00
Pieter Wuille 3d31e09cbb
Split key_io (address/key encodings) off from base58 2018-05-08 21:39:56 +01:00
Pieter Wuille 3e60c9fabd
Stop using CBase58Data for ext keys 2018-05-08 21:39:55 +01:00
Jack Grigg aa333ee8f2
Implement {Encode,Decode}PaymentAddress etc. without CZCEncoding 2018-05-08 21:39:55 +01:00
Jack Grigg 8bf3a3d700
Introduce wrappers around CZCViewingKey 2018-05-08 21:39:55 +01:00
Jack Grigg 472f75bc2d
Introduce wrappers around CZCSpendingKey 2018-05-08 21:39:55 +01:00
Jack Grigg 80ed13d545
Introduce wrappers around CZCPaymentAddress
This patch removes the need for the intermediary Base58 type
CZCPaymentAddress, by providing {Encode,Decode}PaymentAddress
functions that directly operate on the conversion between strings
and libzcash::PaymentAddress.
2018-05-08 21:39:55 +01:00
Pieter Wuille f146029b0a
Replace CBitcoinSecret with {Encode,Decode}Secret 2018-05-08 21:39:54 +01:00
Sean Bowe b4db32f53c Check Sapling Spend/Output proofs and signatures. 2018-05-08 14:30:26 -06:00
Sean Bowe 55fabd8272 Refactor so that dataToBeSigned can be used later in the function for other purposes. 2018-05-08 14:28:01 -06:00
Sean Bowe 6eea48bf96 Remove unnecessary IsCoinbase() check. Coinbases are guaranteed to have empty vjoinsplit. 2018-05-08 14:23:09 -06:00
Homu b1d2a69908 Auto merge of #3202 - str4d:3058-sapling-bech32, r=str4d
Bech32 encoding support

Cherry-picked from the following upstream PRs:

- bitcoin/bitcoin#8578
- bitcoin/bitcoin#11167
  - Only the second and third commits (first is in #3228, fourth depends on #2390, later ones are SegWit-specific).
- bitcoin/bitcoin#12757
  - Only the change to `src/bech32.h`

Part of #3058.
2018-05-08 09:08:37 -07:00
Homu 0c1adf8281 Auto merge of #3201 - Eirik0:3190-dumpprivkey-help-text, r=str4d
Clarify help text of dumpprivkey

Closes #3190
2018-05-08 06:02:17 -07:00
Jack Grigg 50284985e9
Update sighash tests 2018-05-08 11:45:41 +01:00
Jack Grigg b391b70736
Implement Sapling signature hash (ZIP 243) 2018-05-08 11:45:38 +01:00
Homu 0a98b97524 Auto merge of #3236 - str4d:3192-jsoutpoint-constructor, r=str4d
Change JSOutPoint constructor to have js argument be uint64_t

Closes #3192.
2018-05-08 02:50:04 -07:00
Homu 333b9a0d0b Auto merge of #3170 - ebfull:sapling-merkle-tree, r=ebfull
Sapling merkle tree implementation

Closes #3056.

Please also review https://github.com/zcash/librustzcash/pull/8

This PR:

1. Introduces ZCSaplingIncrementalMerkleTree using Pedersen hashes.
2. Adds support for Sapling anchors into consensus rules. (Adds commitments, checks anchors are correct, handles block (dis)connects, etc.)
3. Handles mempool eviction for obsolete anchors.
4. Enforces correctness of block's Sapling root field
5. Changes miner to correctly apply the Sapling root to the block header
6. Handles mempool consistency checks for anchors
2018-05-07 20:37:46 -07:00
Sean Bowe 40bfb9e5b9 Swap bit endianness of test vectors 2018-05-07 18:57:04 -06:00
Jack Grigg e935beb810
wallet: Make some arguments const that can be 2018-05-07 22:13:26 +01:00
Jack Grigg b87e271a9a
wallet: Change IsLockedNote to take a JSOutPoint
This removes the uint64_t -> size_t -> uint64_t round trip, as well as the
JSOutPoint -> parts -> JSOutPoint round trip.
2018-05-07 21:56:57 +01:00
Sean Bowe f6f97dfb1c Fix miner tests 2018-05-07 14:37:46 -06:00
Sean Bowe 8c57bbac15 Fix broken error messages. 2018-05-07 14:37:46 -06:00
Sean Bowe e390a475c1 Fix outdated comment 2018-05-07 14:37:46 -06:00
Sean Bowe 98d2f090ca Evict transactions with obsolete anchors from the mempool 2018-05-07 14:37:46 -06:00
Sean Bowe 673a0a79b3 Adjust tests to handle Sapling anchor cache 2018-05-07 14:37:46 -06:00
Sean Bowe 31a04d2875 Calculate the correct hashFinalSaplingRoot in the miner. 2018-05-07 14:37:46 -06:00
Sean Bowe b4ff707605 Add support for Sapling anchor checks in mempool consistency checks. 2018-05-07 14:37:46 -06:00
Sean Bowe 1f8be05b63 Add consensus support for Sapling merkle trees. 2018-05-07 14:37:46 -06:00
Sean Bowe 85b39f57bb Add `PushSaplingAnchor` 2018-05-07 14:37:46 -06:00