Commit Graph

860 Commits

Author SHA1 Message Date
Kris Nuttycombe c6ff554d10 Add `IncomingViewingKey::prepare` convenience method. 2024-03-23 10:25:01 -06:00
Kris Nuttycombe 1b6c078942 Add `impl Distribution<MerkleHashOrchard> for Standard` for testing. 2024-03-18 08:54:10 -06:00
Kris Nuttycombe 1a8ded0038 Add a `Rho` type, to distinguish from revealed note nullifiers.
This change removes the ability to construct a `Rho` value directly from
the public API, except via deserialization from bytes (which is
necessary in order to be able to serialize a `Note`). Ordinarily, `Rho`
should be obtained either from an already-constructed `Note` or from an
`Action` or `CompactAction`.
2024-03-12 17:20:43 -06:00
Kris Nuttycombe 7ef1feaf16 Add a `MerkleHashOrchard::random` function under the `test-dependencies` feature. 2024-03-11 18:06:05 -06:00
str4d 2a312c0cf1
Merge pull request #419 from nuttycom/nullifier_ct_eq
Additions needed for Orchard batch scanning
2024-02-29 22:24:02 +00:00
Kris Nuttycombe 9729cd8d26 Add note_encryption::CompactAction::cmx 2024-02-26 10:03:16 -07:00
Kris Nuttycombe 8cc96b5420 Add `impl Clone for note_encryption::CompactAction` 2024-02-26 09:44:02 -07:00
Kris Nuttycombe ff7287e392 Add `impl subtle::ConstantTimeEq for note::Nullifier` 2024-02-23 22:06:10 -07:00
Daira-Emma Hopwood f90e52df92 Update the doc for `struct Action`. This was originally written when the
Orchard design had not yet been finalized.

Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
2024-02-06 21:39:47 +00:00
Daira Emma Hopwood ae1ba27d89 * Add a pointer to how the Z and U constants for fixed-base scalar
multiplication can be reproduced.
* Correct errors and omissions in the documentation of the fixed-base
  generators.

Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
2024-02-06 21:19:54 +00:00
Jack Grigg a55fbf1fda Use the `zip32::Scope` type 2024-01-26 03:05:42 +00:00
Jack Grigg 68290a1a58 Migrate to `zip32 0.1`
Closes zcash/orchard#410.
2024-01-10 22:45:11 +00:00
Jack Grigg 4b09ef6ab5 Migrate to `zcash_spec 0.1` 2024-01-10 22:44:19 +00:00
Kris Nuttycombe 3f7acee282
Apply suggestions from code review
Co-authored-by: str4d <thestr4d@gmail.com>
2024-01-09 15:14:12 -07:00
Kris Nuttycombe b60ef5c7ea Return bundle metadata from bundle building.
In order to be able to associate requested spends and outputs with the
indices of the actions that execute these operations, it is necessary to
track the randomization of inputs and outputs and return the mappings
that resulted from that shuffling.
2024-01-09 14:09:05 -07:00
Kris Nuttycombe 110ad5c642 Make the `MERKLE_DEPTH_ORCHARD` constant public. 2024-01-05 13:41:19 -07:00
Kris Nuttycombe 189257391a Expose `Anchor::empty_tree`. 2023-12-20 20:25:06 -07:00
Kris Nuttycombe 3845686a6e Modify `BundleType` to exclude the anchor & allow no bundle to be produced.
This adds a flag to `BundleType` that, when set, requires a dummy-only
bundle to be produced even if no spends or outputs are added to the
builder, and when unset results in standard padding.
2023-12-20 19:29:14 -07:00
Kris Nuttycombe 938b203de5 Apply suggestions from code review
Co-authored-by: str4d <thestr4d@gmail.com>
2023-12-19 12:45:43 -07:00
Kris Nuttycombe 2e2c161d52 Add a public bundle construction function & use it in the builder. 2023-12-18 21:56:42 -07:00
Kris Nuttycombe 0a257d6f68 Add explicit control of padding to the Builder API. 2023-12-15 15:08:22 -07:00
Kris Nuttycombe 06cb76168e Rename `Builder::add_recipient` to `add_output`.
The term `recipient` is commonly used to refer to the address to which a
note is sent; however, a bundle may include multiple outputs to the same
recipient. This change is intended to clarify this usage.

Co-authored-by: Daira Emma Hopwood <daira@jacaranda.org>
2023-12-14 15:56:42 -07:00
str4d 4bb65b9330
Merge pull request #323 from defuse/nu5-consensus-labeled
Label Consensus Rules
2023-11-29 04:36:23 +00:00
Jack Grigg 7fa0edbd98 Bump MSRV to 1.65
`reddsa 0.5.1` has MSRV 1.65.
2023-09-08 17:52:14 +00:00
Kris Nuttycombe 2a4f27c937 Update `zcash_note_encryption` to remove unused arguments from parse_note_plaintext_without_memo_ovk. 2023-05-26 09:28:01 -06:00
Kris Nuttycombe 729def6c60
Merge pull request #394 from zcash/note-encryption-avoid-redundant-checks
Remove redundant checks during note encryption
2023-05-26 09:13:20 -06:00
Kris Nuttycombe 6cf6f15bf1 Update the `incrementalmerkletree` and `bridgetree` patch versions.
This also removes the `bridgetree` transitive dependency when building
using the `test-dependencies` feature flag, as the only use of it can be
satisfied just with `incrementalmerkletree`.
2023-05-24 15:36:25 -06:00
Jack Grigg 90e64cbac0 Remove redundant checks during note encryption
The consistency check between `esk` and `ephemeral_key` is checked
inside `zcash_note_encryption::try_output_recovery_with_ock`, and the
requirement to check it inside the `Domain` implementation is being
lifted in zcash/librustzcash#848.

Removing the check here improves performance, both because we avoid an
extra scalar multiplication from `esk.derive_public()`, and because we
avoid an unnecessary `spec::diversify_hash()` call which is expensive
for Orchard.
2023-05-19 16:43:17 +00:00
Kris Nuttycombe 8bc53ecbde Update to development versions of incrementalmerkletree/bridgetree
This modifies the tests where required to use bridgetree checkpoint
identifiers.
2023-04-11 10:33:25 -06:00
Jack Grigg a65018f93c Fix variable name in `spec::diversify_hash`
Closes zcash/orchard#368.
2023-04-11 00:23:33 +00:00
Kris Nuttycombe dca33119b4 Migrate to zcash_note_encryption 0.3.0 2023-03-21 10:48:47 -06:00
Kris Nuttycombe e9a2de7d97 Fix `cargo doc` complaints. 2023-03-10 14:26:07 -07:00
Kris Nuttycombe cf526f59e2 Fix clippy beta lints that are applicable given an MSRV of 1.60 2023-03-10 14:23:06 -07:00
Jack Grigg 3beea4adb7 Migrate to `ff 0.13`
Closes zcash/orchard#371.
2023-03-09 21:14:41 +00:00
Jack Grigg 0f123ca707 Bump MSRV to 1.60 2023-03-09 21:14:41 +00:00
Kris Nuttycombe e2bfd99454
Merge pull request #365 from zingolabs/add_spends_and_outputs_getters_to_builder
Add spends/outputs getter fns to builders for use in change calculation
2023-01-03 14:57:06 -07:00
Gygaxis Vainhardt b64d6ba01e
Update src/builder.rs
Co-authored-by: Kris Nuttycombe <kris@nutty.land>
2023-01-03 17:34:28 -04:00
Dimitris Apostolou 1f13327479
Fix typo 2022-12-31 13:19:43 +02:00
Gygaxis Vainhardt cd8a39bd0c
Format comments
Co-authored-by: Kris Nuttycombe <kris@nutty.land>
2022-12-09 13:38:06 -04:00
Hazel OHearn 13d0d5592c
Add spends/outputs getter fns to builders for use in change calculation 2022-12-09 13:37:26 -04:00
Hazel OHearn e466d7b523
Add Display and Error impls for error types 2022-12-08 16:58:30 -04:00
Gygaxis Vainhardt 4296860a86
Partially apply suggestions from code review
Co-authored-by: str4d <thestr4d@gmail.com>
2022-12-08 16:36:54 -04:00
Gygaxis Vainhardt 938b122814
Replace type alias with zero-size struct
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2022-12-08 16:35:49 -04:00
Hazel OHearn 6e8e2734e1
Error -> BuildError, add PartialEq, Eq to SpendError 2022-12-01 17:01:10 -04:00
Hazel OHearn 8c2326cdac
Error -> BuildError 2022-12-01 16:58:26 -04:00
Hazel OHearn 4f27b6bac3
Add concrete error types for add_spend and add_output 2022-12-01 16:51:04 -04:00
Kris Nuttycombe d05b6cee9d
Merge pull request #362 from zcash/batch-scanner-improvements
Batch scanner improvements
2022-10-20 09:30:49 -06:00
Daira Hopwood a3af4095ae Add more thorough documentation for `ValueCommitmentTrapdoor::from_bytes`.
Also add a CHANGELOG entry for orchard::value::{ValueCommitmentTrapdoor, ValueCommitment::derive}.

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2022-10-18 20:45:54 +01:00
Tomas Krnak d428aa3143 Add `ValueCommitTrapdoor::from_bytes` constructor 2022-10-18 20:36:55 +01:00
Daira Hopwood 591c4b89b9
Merge pull request #351 from jarys/pub-value-commit-derive
Publicize `ValueCommitment::derive` constructor
2022-10-18 20:19:19 +01:00