Commit Graph

1547 Commits

Author SHA1 Message Date
str4d 7176ff077c
Apply suggestions from code review
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2020-10-24 12:05:15 +01:00
Jack Grigg 450d68f073 Merge branch 'master' into zcash_client_sqlite-0.2.1 2020-10-24 00:44:37 +01:00
Jack Grigg 74bf85641c zcash_client_sqlite 0.2.1 2020-10-24 00:42:24 +01:00
Jack Grigg 524cc2e979 zcash_client_sqlite: Read rcm correctly from data DB after Canopy
ZIP 212 alters the note plaintext to store a seed from which rcm is
derived, rather than storing rcm directly. In the mobile SDKs we only
need rcm, so for post-ZIP 212 notes, we derive rcm from the seed and
store rcm in the data DB.

However, when selecting notes to spend, `create_to_address` was using the
transaction's target height to determine if Canopy is active, and parsing
the rcm value as the seed if so. This effectively applied a seed->rcm
derivation to all selected notes' rcms once Canopy activated on the
chain. As a result, the note commitments were incorrect, and thus the
anchors derived from the witness paths were also incorrect. This caused
two kinds of observed failures:

- If more than one note was selected, the builder would fail with
  "anchor mismatch", as the note commitments would be effectively
  randomised, causing the derived anchors to also randomise.
- If a single note was selected, the transaction would be built using
  the randomised anchor, and then rejected when sent to the network.

The fix is to "pretend" in `create_to_address` that all notes are
pre-ZIP 212 notes. This works fine because we never need to serialize
back to the note plaintext while spending a note.
2020-10-24 00:23:05 +01:00
Jack Grigg e6c2230afa equihash: Silence clippy mis-lint 2020-10-23 17:38:24 +01:00
Jack Grigg 14aba4f5d1 Update Actions CI with improved workflow 2020-10-23 17:26:03 +01:00
Kris Nuttycombe 7d47582bc4
Merge pull request #303 from adityapk00/bytes_params
Build prover with byte arrays of params
2020-10-20 13:17:26 -06:00
adityapk00 b8aa2d9169 Build prover with byte arrays of params 2020-10-20 11:49:42 -07:00
str4d 4c66a17b93
Merge pull request #306 from str4d/script-address-simplification
zcash_primitives: Small simplification to Script::address
2020-10-18 14:50:51 +01:00
Jack Grigg d657ff906e zcash_primitives: Small simplification to Script::address 2020-10-18 13:17:16 +01:00
Kris Nuttycombe b1c3f9d3f0
ZIP 321 Reference Implementation (#294)
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
Co-authored-by: Jack Grigg <jack@electriccoin.co>
2020-10-15 14:03:40 +01:00
Kris Nuttycombe 72b6de39eb
Merge pull request #286 from nuttycom/zip-tzes
Implementation for ZIP-222 Transparent Zcash Extensions
2020-10-13 14:56:44 -06:00
Kris Nuttycombe eeb0c2b08a
Update comment in zcash_primitives/src/transaction/builder.rs 2020-10-13 14:28:54 -06:00
Kris Nuttycombe 536c77bea7 Fix formatting. 2020-10-13 07:12:33 -06:00
Kris Nuttycombe cc121ede8e Document `TzeIn` serialization. 2020-10-09 16:37:00 -06:00
Kris Nuttycombe 39ab6e5b95
Apply suggestions from code review
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2020-10-09 16:19:44 -06:00
Kris Nuttycombe 9188a9d41c Add personalization to demo hashes. 2020-10-09 16:08:38 -06:00
Kris Nuttycombe 26aa23988c Replace domain separator with a 1-byte tag. 2020-09-30 10:22:51 -06:00
Kris Nuttycombe 6d0287c4c4 Merge remote-tracking branch 'upstream/master' into zip-tzes 2020-09-28 14:06:52 -06:00
Kris Nuttycombe d077872f9c
Merge pull request #297 from str4d/fix-benches
zcash_primitives: Fix note decryption benchmarks
2020-09-28 08:36:35 -06:00
Jack Grigg 05dd729c70 zcash_primitives: Fix note decryption benchmarks
zcash/librustzcash#290 added a benchmark that relied on an API that was
altered by zcash/librustzcash#261, but the PRs didn't cause merge
conflicts, so the issue was only noticed once both had been merged.
2020-09-26 20:48:39 +01:00
Kris Nuttycombe e4e159b117 Zcashd integration is based on branch id. 2020-09-24 17:29:38 -06:00
Kris Nuttycombe 03b4e56a44 Formatting fix. 2020-09-23 17:14:35 -06:00
Kris Nuttycombe b6cd096c10 Generate plausible scripts for transaction proptests.
Co-authored-by: str4d <thestr4d@gmail.com>
2020-09-23 14:48:10 -06:00
Kris Nuttycombe 9963fb9e57 Use CompactSize & Vector::write for tze sighash construction. 2020-09-23 14:37:48 -06:00
Kris Nuttycombe 995d063992 Documentation fixes from code review.
Co-authored-by: str4d <thestr4d@gmail.com>
2020-09-23 14:16:29 -06:00
Kris Nuttycombe 2e02803492 Use more idiomatic construction of fixed-length arrays from slices.
Co-authored-by: str4d <thestr4d@gmail.com>
2020-09-23 13:44:37 -06:00
Kris Nuttycombe 6a536aa88a Use more informative type names in Extension trait. 2020-09-23 13:35:14 -06:00
Kris Nuttycombe 36c28341b3 Additional future -> zfuture renaming. 2020-09-23 13:11:47 -06:00
Kris Nuttycombe 605e6d9b30 Avoid early returns in tze demo. 2020-09-23 13:09:25 -06:00
Kris Nuttycombe 99eb5b9336 Rename `Future -> ZFuture`
Proactively distinguish against future use of the
futures crate for source greppability.
2020-09-22 10:17:58 -06:00
Kris Nuttycombe a0a36eddfd Merge remote-tracking branch 'upstream/master' into zip-tzes
Fix benchmark build issues.
2020-09-21 16:43:33 -06:00
str4d 03ab89f7c7
Merge pull request #293 from narodnik/master
Make fixed generator functions publicly accessible
2020-09-22 09:47:35 +12:00
narodnik 6297087a5d Mark EDWARDS_D, MONTGOMERY_A, MONTGOMERY_SCALE and PEDERSEN_CIRCUIT_GENERATORS as public only within the crate. 2020-09-21 22:59:38 +02:00
Kris Nuttycombe ab2d5bf603 Merge remote-tracking branch 'upstream/master' into zip-tzes 2020-09-21 10:08:05 -06:00
str4d e0587e752b
Merge pull request #290 from str4d/273-remove-decryption-epk-subgroup-check
Take epk as a jubjub::ExtendedPoint for note decryption
2020-09-22 03:05:35 +12:00
narodnik 81e3ab1c91 make fixed generator functions publicly accessible 2020-09-20 21:01:39 +02:00
str4d 8f08723712
Merge pull request #261 from nuttycom/dyn_network_parameters
Remove static determination of network state.
2020-09-19 10:21:36 +12:00
Kris Nuttycombe b30de1da8d Add more documentation for the demo extension. 2020-09-18 12:22:14 -06:00
Kris Nuttycombe d4abd05512 Add comments to demo extension. 2020-09-18 11:50:50 -06:00
Kris Nuttycombe 924ee09bc4 Add documentation to primary `Extension` trait 2020-09-18 11:21:44 -06:00
Kris Nuttycombe c7c39964ec Use block.height() method instead of .into() 2020-09-18 10:55:29 -06:00
Kris Nuttycombe cfb6850d7c Rustfmt 2020-09-18 10:52:58 -06:00
Kris Nuttycombe 80e1d35ea6 Apply additional suggestions from code review. 2020-09-18 10:40:30 -06:00
Kris Nuttycombe 90d8980162
Apply suggestions from code review
Co-authored-by: str4d <thestr4d@gmail.com>
2020-09-18 10:39:37 -06:00
Kris Nuttycombe d232133216 Add constants to support static resolution of network parameters. 2020-09-17 12:58:23 -06:00
Kris Nuttycombe 1ad9294933 Remove static determination of network state.
In the interest of making the library usable for both
testnet and mainnet without recompilation, static resolution
of network parameters has been replaced with a parameter passed
to the relevant functions. This also moves addres prefix constants
into the network parameters.
2020-09-17 10:34:42 -06:00
Kris Nuttycombe efaba87681 Add newtype for block height. 2020-09-17 10:26:41 -06:00
Kris Nuttycombe 3601f077a1 Correct zcash_proofs dependency version. 2020-09-10 15:35:36 -06:00
Kris Nuttycombe c35c501734 Add comment on FUTURE_TX_VERSION/GROUP_ID` 2020-09-10 14:52:47 -06:00