Commit Graph

246 Commits

Author SHA1 Message Date
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
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
80338c07e5 Auto merge of #3237 - str4d:std-array, r=str4d
Replace boost::array with std::array
2018-06-06 19:36:57 -07: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
Jack Grigg
a6bbb26e08 Replace boost::array with std::array 2018-05-26 00:12:57 +12:00
Sean Bowe
8f5429a13a Update merkle tree and pedersen hash tests to account for new encoding 2018-05-18 13:26:39 -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
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
Simon
67f3577239 Closes #3250. Memo getter should return by reference, not by value. 2018-05-09 21:52:33 -07:00
Jack Grigg
97b46f00cc Add valueBalance to value balances, and enforce its consensus rules 2018-05-09 11:34:41 +01: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
673a0a79b3 Adjust tests to handle Sapling anchor cache 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
7b62078782 Remove underscores from gtest test names. 2018-05-07 14:37:46 -06:00
Sean Bowe
18322f074c Introduce support for GetBestAnchor(SAPLING). 2018-05-07 13:46:06 -06:00
Sean Bowe
008f4ee8e7 Rename GetAnchorAt to GetSproutAnchorAt. 2018-05-07 13:46:06 -06:00
Sean Bowe
08f0728884 Rename hashAnchor to hashSproutAnchor. 2018-05-07 13:46:06 -06:00
Sean Bowe
d455828fdc Specifically describe anchors as Sprout anchors. 2018-05-07 13:46:06 -06:00
Sean Bowe
28d20bdb11 Rename NullifierType to ShieldedType. 2018-05-07 13:46:06 -06:00
Sean Bowe
2f23a656fb Add regression tests and test vectors for Sapling merkle tree 2018-05-07 13:46:06 -06:00
Homu
1d4235dce7 Auto merge of #3239 - str4d:sapling-default-tx-version, r=str4d
Update CreateNewContextualCMutableTransaction for Sapling

Part of #3063.
2018-05-07 12:27:47 -07:00
Jack Grigg
e1d41f21f3 Update tests for CreateNewContextualCMutableTransaction changes 2018-05-07 20:21:55 +01:00
Jack Grigg
e1dbec49b7 Add test of Sapling transaction size boundary 2018-05-04 11:17:30 +01:00
Jack Grigg
15ec5525e3 Raise 100kB transaction size limit from Sapling activation
Closes #2864.
2018-05-04 11:17:30 +01:00
Homu
d97bfb766b Auto merge of #3228 - str4d:3058-taddr-encoding-refactor, r=str4d
Refactor t-address encoding

Includes code cherry-picked from the following upstream PRs:

- bitcoin/bitcoin#11117
- bitcoin/bitcoin#11259
  - Only the second commit (first is for QT code)
- bitcoin/bitcoin#11167
  - Only the first commit (the rest are not part of the t-address encoding refactor).

Part of #3058. Precursor to #3202.
2018-05-03 18:12:22 -07:00
Jack Grigg
b6be3e88bb Use CBitcoinAddress wrappers in Zcash-specific code 2018-05-03 01:13:04 +01:00
Homu
9e5398686c Auto merge of #3206 - bitcartel:3194_polymorphic_note_class, r=str4d
Update note classes to be polymorphic

Closes #3194.  Lays foundation for introduction of Sapling notes through refactoring and creation of a class hierarchy for Sprout notes.  This PR updates some tests, but otherwise is a no-op.
2018-05-02 08:07:35 -07:00
Simon
debf6af9f8 Move memo member varible from SproutNotePlaintext to BaseNotePlaintext.
Add memo() accessor to BaseNotePlaintext.
2018-04-26 15:05:30 -07:00
Simon
d266f40393 Create class hierarchy for SproutNotePlaintext.
BaseNotePlaintext contains member variable for common attribute, value.
2018-04-26 15:05:30 -07:00
Simon
5020a93631 Refactoring: rename NotePlaintext --> SproutNotePlaintext
Also renames:
CNotePlaintextEntry --> CSproutNotePlaintextEntry
CUnspentNotePlaintextEntry --> CUnspentSproutNotePlaintextEntry
2018-04-26 15:05:30 -07:00
Simon
5f4fa1a954 Add virtual destructor to SproutNote and BaseNote
Also add test to make sure default copy constructors are okay.
2018-04-26 15:05:30 -07:00
Simon
5d99e3e92f Refactoring: SproutNote member variable value moved to BaseNote.
All notes have a value, so the member variable has been moved to the
base class, and direct member access has been replaced with a getter.
2018-04-26 15:05:19 -07:00
Simon
b230fe6836 Refactoring: Rename class libzcash::Note to libzcash::SproutNote. 2018-04-25 11:33:24 -07:00
Eirik Ogilvie-Wigley
9669920f75 Rename nullifier caches and maps to indicate sprout nullifiers 2018-04-25 11:26:38 -06:00
Eirik Ogilvie-Wigley
708c87f16d Add enum for nullifier type 2018-04-24 09:57:14 -06:00
Eirik Ogilvie-Wigley
685e936c31 Add sapling nullifier set 2018-04-24 09:57:14 -06:00
Jack Grigg
b1608eed82 Add a constant for Overwinter's transaction version 2018-04-23 20:39:04 +01:00
Homu
77889933e7 Auto merge of #3173 - str4d:2907-sapling-v4-tx-shell, r=str4d
Initial support for Sapling v4 transactions

Part of #2907.
2018-04-20 12:35:47 -07:00
Homu
5821bb0a4d Auto merge of #3185 - ebfull:sapling-testnet-params, r=str4d
Load Sapling testnet parameters into memory

This PR depends on https://github.com/zcash/librustzcash/pull/4.

The parameters are not loaded into memory if `zcashd` is configured as a mainnet node -- this is something we can change in the weeks before `2.0.0`.
2018-04-20 01:28:13 -07:00
Jack Grigg
987b8ee60e Adjust consensus rules to require v4 transactions from Sapling activation 2018-04-19 05:01:47 +01:00