Commit Graph

11457 Commits

Author SHA1 Message Date
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
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 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 531fcc88da Update to latest librustzcash 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
Sean Bowe fcbe7eef8d Update sapling-crypto and librustzcash 2018-05-07 18:56:55 -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
Sean Bowe c643ff0b51 Add support for PopAnchor(.., SPROUT/SAPLING) 2018-05-07 14:37:46 -06:00
Sean Bowe 27616b9a04 Add support for Sapling anchors in coins/txdb. 2018-05-07 14:37:46 -06:00
Sean Bowe e814be60fe Rename hashSproutAnchorEnd to hashFinalSproutRoot to be consistent. 2018-05-07 14:37:46 -06:00
Sean Bowe f2c6d214e5 Rename hashSaplingAnchorEnd to hashFinalSaplingRoot to match spec. 2018-05-07 14:37:46 -06:00
Sean Bowe 7b62078782 Remove underscores from gtest test names. 2018-05-07 14:37:46 -06:00
Sean Bowe 7703a673ea Generalize the PushAnchor implementation behavior. 2018-05-07 14:37:43 -06:00
Sean Bowe 9ea4e387b2 Generalize the PopAnchor implementation behavior. 2018-05-07 13:46:06 -06:00
Sean Bowe 18322f074c Introduce support for GetBestAnchor(SAPLING). 2018-05-07 13:46:06 -06:00
Sean Bowe 2bd59e1473 Rename PushAnchor to PushSproutAnchor. 2018-05-07 13:46:06 -06:00
Sean Bowe 008f4ee8e7 Rename GetAnchorAt to GetSproutAnchorAt. 2018-05-07 13:46:06 -06:00