Commit Graph

168 Commits

Author SHA1 Message Date
Simon
dae1c4204a Update CWallet::MarkAffectedTransactionsDirty() for Sapling. 2018-08-08 12:03:09 -07:00
Simon
3438e26cc3 Rename mapTxNullifiers to mapTxSproutNullifiers. 2018-08-08 11:37:38 -07:00
Simon
d5e490d9f2 Rename CWallet::AddToSpends methods for clarity. 2018-08-08 11:37:38 -07:00
Simon
f41bf503e1 Rename mapNullifiersToNotes to mapSproutNullifiersToNotes. 2018-08-08 11:37:38 -07:00
Simon
618206c7d5 Rename GetNoteNullifier to GetSproutNoteNullifier. 2018-08-08 11:37:38 -07:00
Simon
57faf44e61 Rename FindMyNotes to FindMySproutNotes. 2018-08-08 11:37:38 -07:00
Jack Grigg
25d5e80cbe Rename *SpendingKey -> *SproutSpendingKey
Also GetPaymentAddresses -> GetSproutPaymentAddresses
2018-08-03 10:10:26 +01:00
Jack Grigg
4c77517772 Rename *ViewingKey* -> *SproutViewingKey* 2018-08-03 02:23:38 +01:00
Jack Grigg
5175a7f07b Pass SaplingPaymentAddress to store through the CKeyStore 2018-08-03 01:01:45 +01:00
Jack Grigg
bc6344b350 Add CWallet::AddCryptedSaplingSpendingKey() hook
To be filled in when we implement Sapling persistence to disk.
2018-08-03 00:23:08 +01:00
Eirik Ogilvie-Wigley
8ea8ef9850 Rename Witnesses to include sprout or sapling 2018-08-01 10:41:36 -06:00
Eirik Ogilvie-Wigley
4fc309f0f5 Rename Merkle Trees to include sprout or sapling 2018-08-01 10:31:09 -06:00
Simon
2f0b2a256d Clean up for rebase: rename mapNoteData to mapSproutNoteData. 2018-07-25 20:47:41 -07:00
Simon
d9fe33b86f Only check for a valid Sapling anchor after Sapling activation.
Before Sapling activates, hashFinalSaplingRoot is 0x0, which is
not a valid anchor.  After Sapling activates, the empty root value
of 0x3e49... is a valid anchor.
2018-07-25 20:47:41 -07:00
Eirik Ogilvie-Wigley
e6b0a8b9ee Add getter and setter for sapling note data and update tests 2018-07-25 20:47:41 -07:00
Eirik Ogilvie-Wigley
29523dc778 Remove extra indentation 2018-07-25 20:47:41 -07:00
Eirik Ogilvie-Wigley
8e8279e728 Rename sprout specific methods 2018-07-25 20:47:41 -07:00
Eirik Ogilvie-Wigley
45de2eda07 Increment sapling note witnesses 2018-07-25 20:47:41 -07:00
Eirik Ogilvie-Wigley
f86ee1c252 Pass sapling merkle tree when incrementing witnesses 2018-07-25 20:47:41 -07:00
Eirik Ogilvie-Wigley
4a0bc6047e Extract method for incrementing witness heights 2018-07-25 20:47:40 -07:00
Eirik Ogilvie-Wigley
f6d0d5ec43 Extract methods for incrementing witnesses 2018-07-25 20:47:40 -07:00
Eirik Ogilvie-Wigley
b538024806 Extract method for copying previous witnesses 2018-07-25 20:47:40 -07:00
Eirik Ogilvie-Wigley
403b9b4e4d Clear sapling witness cache 2018-07-25 20:47:40 -07:00
Eirik Ogilvie-Wigley
9d804cc619 Decrement sapling note witnesses 2018-07-25 20:47:40 -07:00
Eirik Ogilvie-Wigley
3c868d2b03 Consolidate for loops 2018-07-25 20:47:40 -07:00
Eirik Ogilvie-Wigley
49695a97b5 Remove redundant curly braces 2018-07-25 20:47:40 -07:00
Eirik Ogilvie-Wigley
005f3ad1dd Rename note data to include sprout 2018-07-25 20:47:40 -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
Eirik Ogilvie-Wigley
0646f749f9 Add change indicator for notes 2018-07-16 14:49:29 -06: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
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
Jack Grigg
97b46f00cc Add valueBalance to value balances, and enforce its consensus rules 2018-05-09 11:34:41 +01:00
Pieter Wuille
3d31e09cbb Split key_io (address/key encodings) off from base58 2018-05-08 21:39:56 +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
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
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
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
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
25fee3509a Rename MAX_TX_SIZE to MAX_TX_SIZE_AFTER_SAPLING 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
fa70084c87 Expire Overwinter transactions before the Sapling activation height 2018-05-03 12:27:56 +01:00
Pieter Wuille
07444da1db Introduce wrappers around CBitcoinAddress
This patch removes the need for the intermediary Base58 type
CBitcoinAddress, by providing {Encode,Decode,IsValid}Destination
function that directly operate on the conversion between strings
and CTxDestination.
2018-05-03 01:12:57 +01:00