Commit Graph

989 Commits

Author SHA1 Message Date
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
Eirik Ogilvie-Wigley
c61ed9acfb Fix parsing parameters in getnetworksolps 2018-06-04 16:45:12 -06: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
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
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
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
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
Jack Grigg
50284985e9 Update sighash tests 2018-05-08 11:45:41 +01:00
Sean Bowe
40bfb9e5b9 Swap bit endianness of test vectors 2018-05-07 18:57:04 -06: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
673a0a79b3 Adjust tests to handle Sapling anchor cache 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
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
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
Pieter Wuille
488d43dd8f Convert base58_tests from type/payload to scriptPubKey comparison 2018-05-04 10:27:11 +01:00
Pieter Wuille
10e5357e8b Import Bech32 C++ reference code & tests
This includes a reformatted version of the Bech32 reference code
(see https://github.com/sipa/bech32/tree/master/ref/c%2B%2B), with
extra documentation.
2018-05-04 10:27:11 +01:00
MarcoFalke
57be66d30e [test] Remove unused code
Zcash: left createArgs() as we still have rpc_wallet_tests which uses it.
2018-05-04 10:27:11 +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
Homu
c7f5d5ce1c Auto merge of #3227 - str4d:3191-nullifier-macos-fix, r=str4d
Fix -Wstring-plus-int warning on clang
2018-05-03 14:36:39 -07:00
Jack Grigg
b6be3e88bb Use CBitcoinAddress wrappers in Zcash-specific code 2018-05-03 01:13:04 +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
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
Homu
53fa6f1315 Auto merge of #3179 - bitcartel:backport_transaction_details_in_getblock_v2bitcartel, r=str4d
Add improvements to getblock RPC output

Includes and supercedes #3095. Includes code cherry-picked from bitcoin/bitcoin#8704.
2018-05-01 10:19:10 -07:00
Homu
0a8d0c25e8 Auto merge of #3220 - Eirik0:3209-fix-CheckTransaction, r=str4d
Implement consensus rules about the number of Spend and Output Descriptions in a transaction

Closes #3209.
Part of #3065.
2018-05-01 07:09:52 -07:00
Jack Grigg
1f9dfbb9f0 Fix -Wstring-plus-int warning on clang 2018-05-01 14:55:47 +01:00
Simon
9bd8f092c6 Closes #3178 by adding verbosity level improvements to getblock RPC.
This is a follow-up commit for d0a1d833520d120bb5a2ac4cf4192047af6afe24
found in PR #3095 in order to fix nits and add a test.
2018-04-30 11:51:59 -07:00
Marshall Gaucher
b300118002 Merge pull request #2813 from str4d/2074-uacomment
Implement uacomment config parameter
2018-04-30 09:12:38 -06:00
Eirik Ogilvie-Wigley
812098256f Coinbase transactions can not have shielded spend or output 2018-04-26 15:53:26 -06:00
Eirik Ogilvie-Wigley
4b4662b06d Make sure transactions have non-empty outputs 2018-04-26 15:24:59 -06:00
Sean Bowe
6679855147 Check that duplicate Sapling nullifiers don't exist within a transaction. 2018-04-25 17:10:34 -06: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
cab341e1a8 Add sapling nullifiers to db and mempool 2018-04-24 17:16:43 -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