Commit Graph

715 Commits

Author SHA1 Message Date
Daira Hopwood e53439a236 Update chacha20poly1305 dependency in zcash_primitives to 0.10,
consistent with zcash_note_encryption.

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2022-09-23 21:52:40 +01:00
Kris Nuttycombe 03c3370de8 Fix problems identified by clippy's beta lints 2022-09-17 08:57:37 -06:00
Kris Nuttycombe 29220c716f Remove `zcash_primitives` as a zcash_note_encryption dev dependency.
This was only used to provide example code for Sapling usage of
the `NoteEncryption` struct; this example code has been moved
to `sapling::note_encryption`.
2022-09-16 12:52:00 -06:00
Daira Hopwood 20e869f501 zcash_primitives: Use prepared epk and ivk in Sapling note decryption
Co-authored-by: Jack Grigg <jack@electriccoin.co>
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2022-09-15 03:40:45 +01:00
Daira Hopwood d77ed9c6cf Change batch decryption benchmark to cover more cases of (nivks, noutputs).
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2022-09-15 03:20:14 +01:00
Jack Grigg 8f03208439 zcash_client_backend: Add tags to IVKs in the batch scanner
This removes the dependency on `SaplingIvk::to_repr()`, and enables us
to alter the type of `D::IncomingViewingKey` to improve the performance
of batch scanning.

For the welding rig, we already annotate the viewing keys with
`AccountId`, so we use `(AccountId, Scope)` as the tag.
2022-09-13 21:40:58 +00:00
Kris Nuttycombe a93c9d334e Apply suggestions from code review
Co-authored-by: str4d <thestr4d@gmail.com>
2022-09-10 17:02:43 -06:00
Kris Nuttycombe 7934e834d3 Add test for fee calculation in add_transaction_views migration. 2022-09-10 11:01:36 -06:00
Kris Nuttycombe 95610f7b4f Add fee to the transactions table & compute correct net_value in v_transactions. 2022-09-09 16:12:29 -06:00
Jack Grigg 7112ed9da5 zcash_client_backend: Add `WalletReadTransparent::get_transparent_receivers`
Co-authored-by: Kris Nuttycombe <kris@nutty.land>
2022-09-08 20:24:42 +00:00
Kris Nuttycombe 7b7288c750 (cleanup) Make the internals of `zip32::DiversifierKey` private 2022-09-08 11:17:14 -06:00
Kris Nuttycombe f15a6d8e80 Add `no_std` implementations of Sapling key encoding & decoding. 2022-09-08 11:05:59 -06:00
str4d 980f6b4e6c
Merge pull request #627 from nuttycom/edition_2021
Update to Rust 2021
2022-09-07 11:41:44 +01:00
Kris Nuttycombe d7e2e2f7c1 Remove use of `IntoIterator::into_iter` 2022-09-02 12:05:15 -06:00
Kris Nuttycombe a93f5945ab Remove redundant TryFrom/TryInto imports. 2022-09-02 12:05:15 -06:00
Kris Nuttycombe 16a0e43f2d Update to Rust 2021 and explicitly set MSRVs 2022-09-02 12:05:09 -06:00
Jack Grigg e5dad037e9 zcash_primitives: Make `NullifierDerivingKey` internals public
The `zcashd` Rust code relies on being able to construct the Sapling
types transparently. This part of the "public API" of the crate was
broken when the `NullifierDerivingKey` newtype was introduced. We do
want to migrate to all of these types having stronger type safety
guarantees (by only constructing them via constructors), but that should
be done consistently across the types. For now we maintain the existing
API by changing `NullifierDerivingKey` to be a transparent newtype.
2022-09-02 01:13:20 +00:00
Kris Nuttycombe f5a18b8fa5 Add conversions from u32 and u64 to DiversifierIndex 2022-08-31 17:15:47 -06:00
Kris Nuttycombe ba1bb65a5f Apply suggestions from code review
Co-authored-by: str4d <thestr4d@gmail.com>
2022-08-26 16:09:05 -06:00
Kris Nuttycombe c4da498cf4 Shield funds to the internal Sapling key for a specified account.
This updates `shield_transparent_funds` to look up the internal
(change) address for the account specified, and use that as the
destination for shielding transparent funds.

Fixed #614
2022-08-26 16:03:25 -06:00
Kris Nuttycombe 6156215d4c Add parallelized batched trial decryption to wallet scanning.
Co-authored-by: str4d <jack@electriccoin.co>
2022-08-18 16:48:22 -06:00
Kris Nuttycombe cdfaa57496 Add migrations to support using UFVKs instead of Sapling extfvks.
Fixes #594
2022-08-18 10:15:58 -06:00
Kris Nuttycombe f1c2da7b1d Add sapling::NullifierDerivingKey newtype.
Nullifier computation only requires the nullifier deriving key,
not the entire Sapling viewing key. This separation of concerns
will be needed for batch decryption when wallet-internal keys
will need to be considered.
2022-07-28 15:23:21 -06:00
Kris Nuttycombe 5873950648 Restructure batch decryption to avoid cartesian product of results.
While it is necessary in the worst case to perform `m * n` decryptions,
where `m` is the number of outputs being decrypted and `n` is the number
of IVKs, it is possible to stop performing trial decryptions when the
first successful decryption is performed. Also, it's inconvenient and
unnecessary to return the full cartesian product of these results, as
only one IVK will decrypt a given output. This commit modifies batch
trial decryption to stop on the first successful decryption, and instead
of returning the cartesian product of results we return the index of the
input IVK along with the output it decrypted. Note that this means that
trial decryption is not constant-time with respect to the number and/or
order of IVKs.
2022-07-28 15:23:21 -06:00
Kris Nuttycombe 94c8d8e7ef Return the network type for encoding addresses as part of the network parameters. 2022-06-30 12:09:32 -06:00
Daira Hopwood dae2e008e9
Merge pull request #577 from daira/bosl-notice
Projects that rely on BOSL exceptions should say that they do
2022-06-29 12:59:07 +01:00
Kris Nuttycombe 0142a3db1b
Merge pull request #570 from zcash/387-migrate-from-extfvk-to-ufvk
`zcash_client_*`: Migrate from `ExtendedFullViewingKey` to `UnifiedFullViewingKey`
2022-06-28 10:49:37 -06:00
Daira Hopwood a9aa2929d2 Address feedback about the use of "permissive".
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2022-06-28 16:46:13 +01:00
Daira Hopwood 75ca854005 Projects that rely on BOSL exceptions should say that they do.
fixes #576

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2022-06-28 12:29:16 +01:00
Jack Grigg e952ff637e zcash_primitives 0.7.0 2022-06-24 17:00:39 +00:00
Jack Grigg a3cae5d36a equihash 0.2.0 2022-06-24 17:00:26 +00:00
Jack Grigg 59b20c6e31 pprof 0.9 2022-06-24 16:27:06 +00:00
Jack Grigg 18fb1f0b07 orchard 0.2 2022-06-24 16:25:51 +00:00
Jack Grigg 3a3c3863cd zcash_primitives: Update changelog 2022-06-24 16:01:24 +00:00
Jack Grigg 76d015ed11 zcash_client_backend: Fix `UnifiedFullViewingKey` Sapling item type
Per ZIP 316, the Sapling FVK Encoding only includes `(ak, nk, ovk, dk)`
which is a subset of the Sapling `ExtendedFullViewingKey`. We therefore
need to use `DiversifiableFullViewingKey` inside `UnifiedFullViewingKey`
in order to make it parseable from the UFVK string encoding.

`zcash_client_sqlite::wallet::get_extended_full_viewing_keys` has been
removed as a consequence of this change: we can no longer reconstruct
the correct `ExtendedFullViewingKey` from the `UnifiedFullViewingKey`.
2022-06-17 10:03:17 +00:00
Jack Grigg df1105b996 zcash_primitives: Add `DiversifiableFullViewingKey` 2022-06-14 02:18:25 +00:00
Kris Nuttycombe 7bce52f235 Update NU5 mainnet activation height. 2022-05-11 12:22:20 -06:00
Jack Grigg 3ecfd26d79 zcash_primitives 0.6.0 2022-05-10 23:33:05 +00:00
Jack Grigg 6976d3fe85 zcash_encoding 0.1.0 2022-05-10 23:33:05 +00:00
Jack Grigg 9ebbd42401 orchard 0.1 2022-05-10 23:06:31 +00:00
Jack Grigg c17af47d8f pprof 0.8 2022-05-10 23:04:48 +00:00
Jack Grigg a565c7e113 hdwallet 0.3.1
This release bumped secp256k1 to 0.21.
2022-05-10 23:00:43 +00:00
ebfull 71e2f395d4
Merge pull request #547 from nuttycom/fix_merkle_tree_complete
Allow CommitmentTree completeness & auth paths to be computed at arbitrary depths.
2022-05-06 17:42:01 -06:00
Jack Grigg 144512b547 Migrate to `ff 0.12` 2022-05-06 20:03:49 +00:00
Kris Nuttycombe a63a37aab2 Allow CommitmentTree completeness & auth paths to be computed at arbitrary depths.
Fixes #546
2022-05-06 11:45:06 -06:00
Kris Nuttycombe 4969d81ad3 Add a test for merkle_tree::CommitmentTree::is_complete 2022-05-06 11:44:04 -06:00
Kris Nuttycombe 8bb1962153 Update incrementalmerkletree version and add SER_V2 serialization constant. 2022-05-04 09:25:07 -06:00
Kris Nuttycombe d14e7a707c Set NU5 testnet reactivation height. 2022-04-13 16:47:33 -06:00
Kris Nuttycombe 4d5b3831d1 Add conversion from incrementalmerkletree::bridgetree::Frontier -> CommitmentTree
Also, add roundtrip property tests to ensure the correctness of the
conversion.
2022-04-08 13:08:48 -06:00
Kris Nuttycombe 9416ab3a3e Update to secp256k1 v0.21 2022-04-06 16:09:45 -06:00