Commit Graph

831 Commits

Author SHA1 Message Date
Kris Nuttycombe 1be97e9cef Address comments from code review. 2022-11-03 09:56:08 -06:00
Kris Nuttycombe 9496fc6118 Add fee calculator to the transaction builder.
This adds a fee calculation strategy abstraction that can be used to
dynamically compute fees so that the total fees required may be taken
taken into account during note selection, and also removes automatic
change creation from the transaction builder.

Change outputs must now be directly created by the caller by the caller.
This is a necessary prerequisite for permitting fees to adjust based
upon the contents of the transaction being constructed.

The initial implementation of the fee strategy simply uses the current
default fee.
2022-11-02 08:28:16 -06:00
Jack Grigg 3720b45feb Categorise dependencies in `Cargo.toml` files
This should make it easier to upgrade dependencies in future.
2022-11-01 09:02:54 +00:00
Jack Grigg a0016588ac Remove unused dependencies
Some were only used by tests, others weren't used at all.
2022-11-01 09:02:27 +00:00
Kris Nuttycombe 8cb16d878e Require a source transparent address to shield transparent funds.
Previously, `shield_transparent_funds` was only shielding funds
associated with the legacy default transparent address. This meant
that transparent funds sent to unified addresses could not reliably
be shielded, as a unified address will frequently be constructed
using a diversifier index greater than zero.

This modifies the `get_transparent_receivers` method to return address
metadata containing the account ID and diversifier index used to derive
each address along with the receiver.
2022-10-25 12:53:54 -06:00
Kris Nuttycombe 373e69907f
Improve reason for yanking of the 0.8.0 version of `zcash_primitives`.
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2022-10-19 17:53:50 -06:00
Sean Bowe f588d0dbeb
Bump zcash_primitives version to 0.8.1 and yank 0.8.0. 2022-10-19 16:59:53 -06:00
Sean Bowe bd7f9d7c3c
Bump zcash_encoding and zcash_address crate versions to 0.2. 2022-10-19 16:51:59 -06:00
Kris Nuttycombe 5bf36989e2 Fix beta clippy complaints. 2022-10-19 13:35:51 -06:00
Sean Bowe 176e21b015
Update zcash_primitives to orchard 0.3; release zcash_primitives and zcash_proofs 0.8. 2022-10-19 13:32:51 -06:00
Kris Nuttycombe c773ea3b3e Make the internals of `WalletTransparentOutput` private. 2022-10-14 12:38:55 -06:00
Jack Grigg 8f068b3b71 zcash_note_encryption 0.2.0 2022-10-13 21:35:39 +00:00
Jack Grigg 24f7d1c9bc zcash_primitives: Require `group 0.12.1` for `wnaf-memuse` feature flag 2022-10-13 06:19:34 +00:00
Kris Nuttycombe d6484da088 Minor documentation fixes.
Co-authored-by: ying tong <yingtong@z.cash>
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2022-10-05 13:02:21 -06:00
Kris Nuttycombe 60785a1d7a Fix Sapling key organization.
This change moves Sapling-specific key generation into a
submodule of `zip32`. Public reexports are used to keep the
existing API consistent.
2022-10-03 20:28:04 -06:00
Jack Grigg 913aa0a988 zcash_client_backend: Correctly track heap usage of batch items
As of zcash/librustzcash#633, `SaplingDomain::IncomingViewingKey` now
allocates memory internally, and this memory persists as long as the
`BatchRunner` is alive. Now that we have decoupled the measurement of
heap usage for batch tasks from their internals, we can add bounds to
all of the generic parameters of `Batch` to enable correctly measuring
their actual heap usage.

We also add `DynamicUsage` impls for a bunch of `zcash_primitives` types
that will be used with `BatchRunner` (or its equivalent implementation
in `zcashd`) by callers.
2022-09-24 21:01:19 +00:00
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
Jack Grigg ffa669a958 Migrate to orchard 0.1.0-beta.3 2022-04-06 21:00:25 +00:00
Jack Grigg 6e8c457e30 zcash_primitives: Show hex encoding of `BlockHash` in its `Debug` impl
The (byte-flipped) hex string is more useful than the raw bytes, because
we can look that up in RPC methods and block explorers.
2022-04-05 17:55:56 +00:00
Jack Grigg 7447a599f7 zcash_primitives: Show hex encoding of `TxId` in its `Debug` impl
The (byte-flipped) hex string is more useful than the raw bytes, because
we can look that up in RPC methods and block explorers.
2022-04-05 17:52:48 +00:00
Jack Grigg 9c1ed86c5a Update NU5 consensus branch ID and remove testnet activation height
Part of zcash/librustzcash#456.
2022-03-23 00:35:20 +00:00
Jack Grigg 5668804629 Migrate to beta releases of incrementalmerkletree and orchard 2022-03-23 00:04:32 +00:00
Jack Grigg 494092223b Merge branch 'master' into non-consensus-changes-on-branchid-37519621 2022-03-23 00:00:21 +00:00
Kris Nuttycombe 71657b4f18 Generalize vector and array writes & reads.
In a number of places, we transform other kinds of collections with
known length information into vectors simply to be able to use them with
`Vector::write` or `Vector::read`. We can avoid these extra allocations
by writing from iterators directly, and similarly by reading directly
into our desired collection types.
2022-03-11 16:48:28 -07:00
Kris Nuttycombe d602c01ef6 Standardize how we write and read usize values for incrementalmerkletree.
Also, make consistent use of helper functions for reading
and writing `Position` values.
2022-03-11 16:48:28 -07:00
Jack Grigg 91d9a42a08 Merge branch 'non-consensus-changes-on-branchid-37519621' into merge-non-consensus-changes-3 2022-02-28 23:22:40 +00:00
Jack Grigg 22ebe95de6 zcash_primitives: Replace custom `Debug` impl on `TransactionData` 2022-02-28 22:39:43 +00:00
Kris Nuttycombe b97d777361 Update the versions of incrementalmerkletree & orchard.
This removes unreleased incrementalmerkletree::BridgeTree serialization
that was zcashd-specific.
2022-02-24 13:54:31 -07:00
Kris Nuttycombe 600c06a408 Update MSRV to 1.56.1 2022-02-24 12:26:14 -07:00
Jack Grigg 12700b4c17 Migrate to `orchard` revision with the Orchard circuit changes 2022-02-15 23:37:52 +00:00
Jack Grigg f822d7aabc Bump MSRV to 1.54.0
This is the MSRV for the orchard crate version that contains the changes
to the Orchard circuit.

Closes zcash/librustzcash#513.
2022-02-15 16:39:29 +00:00
Jack Grigg dbfa673500 Merge branch 'non-consensus-changes-on-branchid-37519621' into merge-non-consensus-changes-again 2022-02-14 18:11:09 +00:00
Kris Nuttycombe a15f426ff3
Merge pull request #506 from rex4539/typos
Fix typos
2022-02-13 20:29:50 -07:00
Jack Grigg 54e3dded92 Add `TransactionData::map_bundles`
This is needed for FFI-crossing in `zcashd`.
2022-02-12 02:59:18 +00:00
Kris Nuttycombe f590134ee8 Add transaction::Transaction::into_data 2022-02-11 15:29:44 -07:00
Kris Nuttycombe af9edcea25 Define transaction::TransactionData::map_authorization 2022-02-11 15:29:44 -07:00
Kris Nuttycombe e20de50b84 Make AccountId internal representation private. 2022-02-10 11:30:02 -07:00
Kris Nuttycombe 970b6d6750 Add missing trait impls for AccountId 2022-02-10 09:12:18 -07:00
Kris Nuttycombe 2425a08690
Merge pull request #493 from zcash/485-zip244-coinbase-fix
zcash_primitives: Update ZIP 244 with coinbase fix
2022-02-08 08:16:19 -07:00
Dimitris Apostolou e600d7b917
Fix typos 2022-02-03 20:15:32 +02:00
str4d 9319dd4c3e Implement XNOR using `assert_eq!`
Because of course that is simpler than building it from XOR.

Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2022-02-03 00:12:55 +00:00
Kris Nuttycombe a304c3953b Fix Clippy beta linting complaints. 2022-02-02 16:02:45 -07:00
Kris Nuttycombe 60d9124453 Merge branch 'non-consensus-changes-on-branchid-37519621' into 'master' 2022-02-02 14:38:09 -07:00
Kris Nuttycombe 1507d1de0a Fix incorrect construction of transparent OVKs. 2022-02-02 10:33:44 -07:00
Kris Nuttycombe b4ff3f368e Add test vectors for transparent OVKs. 2022-02-02 10:33:44 -07:00
therealyingtong 0c80399fe1 zcash_primitives::zip32::tests: Use internal test vectors. 2022-02-02 10:33:44 -07:00
therealyingtong cf4c982483 zcash_primitives::zip32: Include test vectors for internal key components. 2022-02-02 10:33:44 -07:00
Kris Nuttycombe 9c2d485c80 Address comments from code review.
Co-authored-by: str4d <jack@electriccoin.co>
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2022-02-02 10:33:41 -07:00
Kris Nuttycombe 3d51c53d68 Address comments from code review.
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2022-02-02 10:32:33 -07:00
Kris Nuttycombe 8916a16f38 Replace ripemd160 dependency with ripemd 2022-02-02 10:30:43 -07:00
Jack Grigg d7fe28ac3f zcash_primitives: Update ZIP 244 with coinbase fix
This corresponds to the ZIP 244 changes in zcash/zips#587.

Closes zcash/librustzcash#485.
2022-02-01 15:57:39 +00:00
Jack Grigg f28f0b7476 Merge branch 'non-consensus-changes-on-branchid-37519621' 2022-02-01 15:57:13 +00:00
Kris Nuttycombe b3fbf2410d Allow use of internal deprecated pubkey_to_address method. 2022-01-27 21:21:18 -07:00
Kris Nuttycombe 2f1d3da26d Update changelogs. 2022-01-27 16:25:01 -07:00
Kris Nuttycombe 4057b066bd ExtendedFullViewingKey::chain_code should not be public. 2022-01-27 16:18:26 -07:00
Kris Nuttycombe 6e11f2d11a Validate ZIP 321 request by roundtrip through the URI format.
Co-authored-by: str4d <jack@electriccoin.co>
2022-01-27 16:08:04 -07:00
Kris Nuttycombe a1e693d15f Remove the Wif type; it should not be used.
We should attempt to avoid passing spending keys back and forth
across the FFI entirely, but in any case this is no longer the
correct type to use at this boundary; we should use the encoding
of the transparent component of a unified spending key instead.
2022-01-27 16:08:04 -07:00
Kris Nuttycombe 3a20176092 Apply suggestions from code review
Co-authored-by: str4d <jack@electriccoin.co>
2022-01-27 15:00:37 -07:00
Kris Nuttycombe 132df78a31 Add serialization and deserialization for AccountPubKey 2022-01-27 08:52:12 -07:00
Kris Nuttycombe 6fcdfda69e Derive OVKs from transparent account-level key, not child keys.
This also renames a number of legacy key types to better reflect
their intended use.
2022-01-26 13:36:27 -07:00
Kris Nuttycombe 0b43535203 Move OutgoingViewingKey to zcash_primitives::keys 2022-01-25 08:53:51 -07:00
Kris Nuttycombe f58d191439 Move transparent account keys to zcash_primitives. 2022-01-25 08:53:51 -07:00
Kris Nuttycombe 72c2e54a7b Add explicit serialize and deserialize methods to ExternalPubKey
The serialization defined by HDWallet for the fields of ExtendedPubKey
is in the opposite field order from what is defined in ZIP 316.
2022-01-24 16:25:06 -07:00
therealyingtong 8b0c1c4ab2 transparent::ExternalPubKey: impl TryFrom for &[u8; 65]. 2022-01-24 14:41:40 +08:00
Kris Nuttycombe 4068075ffd Merge remote-tracking branch 'upstream/non-consensus-changes-on-branchid-37519621' into autoshield-poc-daa 2022-01-22 23:10:47 -07:00
Kris Nuttycombe 4dac37ffde Ensure that transparent input functionality is correctly feature-flagged. 2022-01-22 22:33:22 -07:00
therealyingtong a7ea5f0bc1 Implement TryFrom<&[u8] for ExternalPubKey. 2022-01-22 22:29:45 -07:00
therealyingtong 6f776aacc3 zcash_primitives::zip316::transparent: Parse Ufvk from zcash_address. 2022-01-22 22:29:45 -07:00
therealyingtong c9fe8402e2 Use transparent internal ovk in shield_transparent_funds(). 2022-01-22 22:29:45 -07:00
therealyingtong 5033d29d2f zip316::transparent: Implement ZIP 316 transparent internal ovk. 2022-01-22 22:29:45 -07:00
therealyingtong a4c9f53a3a Move ExternalPrivKey, ExternalPubKey to zcash_primitives. 2022-01-22 22:29:45 -07:00
therealyingtong 1f9b9fc147 zcash_primitives: Do not gate secp256k1 on transparent-inputs feature flag. 2022-01-22 22:04:32 -07:00
Kris Nuttycombe 54cca8081b Update zcash_primitives/CHANGELOG.md with change key derivation methods. 2022-01-22 19:35:01 -07:00
Kris Nuttycombe 7c03dbdc95 Add convenience method for amount sums. 2022-01-21 16:48:53 -07:00
therealyingtong eb80138cf9 Document new APIs for deriving internal keys. 2022-01-21 10:49:17 +08:00
Kris Nuttycombe 82c1d87dcd
Fix incorrect length of blake2b hashes for internal key derivation.
Co-authored-by: str4d <jack@electriccoin.co>
2022-01-20 18:08:01 -07:00
Kris Nuttycombe 37e6d3a2bc Apply suggestions from code review
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
Co-authored-by: ying tong <yingtong@z.cash>
2022-01-20 16:43:57 -07:00
Kris Nuttycombe 3dd1f310d9 Merge remote-tracking branch 'upstream/non-consensus-changes-on-branchid-37519621' into autoshield-poc-daa 2022-01-20 13:54:38 -07:00
Kris Nuttycombe da3833f906 Fix missing use of `dk` in derivation of sapling internal FVK.
Also, factor out sapling internal fvk derivation so that it only
requires (fvk, dk) since we may not have the full extfvk.
2022-01-20 13:50:12 -07:00
therealyingtong f6f5096ae4 Derive Sapling internal full viewing key.
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2022-01-20 13:50:12 -07:00
therealyingtong a98010a684 Derive Sapling internal spending key.
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2022-01-20 13:50:12 -07:00
Kris Nuttycombe eaa3ec56d0 Apply suggestions from code review
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2022-01-19 08:32:59 -07:00
Kris Nuttycombe 7b2f9e27ae Rename script_code to script_pubkey in zip244 test vectors. 2022-01-19 08:32:59 -07:00
Kris Nuttycombe fc82801d3d Update v5 transparent signature hashes to always commit to scriptPubKey 2022-01-19 08:32:59 -07:00
Kris Nuttycombe 3c6e19f4e4 Update test vectors. 2022-01-19 08:32:59 -07:00
Kris Nuttycombe 37fdf88462 Make hash_type a property of the SignableInput::Transparent 2022-01-19 08:32:59 -07:00
Kris Nuttycombe 145d1a57f7 Make transparent signatures commit to all input amounts & scripts.
Transparent UTXOs are referred as pair of previous txid and index. In
order to verify UTXO's amount in HWW (hardware wallet), whole previous
transaction containing this UTXO must be streamed into the device. This
increases complexity of signing process significantly.

zcash/zips#574 identifies this problem and suggests a modification
to ZIP-244 to resolve this issue, by adding three new fields to
section S.2 of the signature hash.
2022-01-19 08:32:59 -07:00
Squirrel c910ffdb41
Remove unused dependencies (#479)
Remove unused dependencies

Co-authored-by: Kris Nuttycombe <kris.nuttycombe@gmail.com>
Co-authored-by: str4d <thestr4d@gmail.com>
2022-01-18 12:04:14 -07:00
Kris Nuttycombe e3c67ffee6 Pin pprof version 2022-01-04 11:48:59 -07:00
Jack Grigg fe05d2dc11 pprof 0.6 2021-12-17 23:47:00 +00:00
Jack Grigg 07a95d70c9 incrementalmerkletree 0.2 2021-12-17 23:46:00 +00:00
Jack Grigg d5a375919d blake2{b,s}_simd 1 2021-12-17 23:44:06 +00:00
Jack Grigg 36db7634a0 orchard 0.1.0-beta.1 2021-12-17 22:22:25 +00:00
Jack Grigg 142a38e792 zcash_note_encryption 0.1.0 2021-12-17 20:00:46 +00:00
Jack Grigg e148ca84ba Migrate to latest `zcash_note_encryption` API 2021-12-17 05:34:45 +00:00
Jack Grigg 01c768dbeb zcash_note_encryption: Place pre-ZIP 212 APIs behind a feature flag 2021-12-17 04:30:57 +00:00
Kris Nuttycombe c72ddb1251
Improve documentation of DiversifierKey#diversifier_index
Co-authored-by: str4d <jack@electriccoin.co>
2021-12-13 13:37:11 -07:00
Kris Nuttycombe 8e934682bb Add decryption of Sapling diversifiers.
Given a diversifier key, decrypts a diversifier to obtain
the diversifier index from which the diversifier was originally
produced.

Co-authored-by: str4d <jack@electriccoin.co>
2021-12-13 13:08:58 -07:00
Kris Nuttycombe 06bea7f936 Factors out sapling address generation from SaplingExtendedFullViewingKey.
Sapling address generation depends only on an FVK and
a diversifier key. For the purpose of unified full viewing
keys, we need to break the dependence upon Sapling extended
full viewing keys, so this makes the address generation
methods of SaplingExtendedFullViewingKey usable without
coupling them to the ability to derive child full viewing keys.
2021-11-30 20:00:36 -07:00
Kris Nuttycombe 0b9d7e4303 Merge remote-tracking branch 'upstream/master' into autoshield-poc-daa 2021-11-24 15:48:02 -07:00
Jack Grigg 5055033c31 zcash_primitives: Migrate to `zcash_note_encryption::BatchDomain` 2021-11-17 12:17:10 +00:00