Commit Graph

82 Commits

Author SHA1 Message Date
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
Kris Nuttycombe dca33119b4 Migrate to zcash_note_encryption 0.3.0 2023-03-21 10:48:47 -06: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 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 33bce9b567
Merge pull request #359 from daira/add-value-balance-to-builder-docfix
Correct the doc comment and add a test for `Builder::value_balance`
2022-10-10 13:36:35 -06:00
Tomas Krnak 5fbbded49e Add `SpendInfo::new` and `Circuit::from_action_context`
Author: Tomas Krnak <tomas@krnak.cz>
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2022-09-20 18:52:07 +01:00
Daira Hopwood 6458e27185 Add minimal test that `Builder::value_balance` works.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2022-09-19 14:05:46 +01:00
Daira Hopwood fbfc8f9ed8 Correct the doc comment for the `Builder::value_balance` method added in #352.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2022-09-19 14:05:46 +01:00
Hazel OHearn 8011e0d57a
add value_balance to builder 2022-09-15 16:47:54 -03:00
Jack Grigg e76a91adff Document how to obtain inputs for `Builder::add_spend`
Closes zcash/orchard#244.
2022-06-23 22:51:05 +00:00
Jack Grigg be69324b9c Migrate to `halo2_proofs 0.2.0` 2022-06-23 19:24:57 +00:00
Jack Grigg 6d6832f3f1 Fix clippy lints 2022-05-06 19:33:10 +00:00
Tomas Krnak e47abb8018 Support externally computed signatures
Co-authored-by: str4d <thestr4d@gmail.com>
2022-05-05 18:12:27 +02:00
Jack Grigg 3ca8c662a4 Merge branch 'main' into str4d/circuit-review 2022-05-04 17:09:15 +00:00
Jack Grigg 3ccf27e519 Update `Builder::build` docs
Closes zcash/orchard#279.
2022-05-04 14:57:08 +00:00
Kris Nuttycombe 4e3e469780 Update incrementalmerkletree dependency version. 2022-05-04 08:01:02 -06:00
Jack Grigg 70b6eb3623 Simplify witness synthesis for `v_net`
`NoteValue - NoteValue` is always guaranteed to produce a valid
`ValueSum`, so we make that infallible and introduce a new helper method
`ValueSum::magnitude_sign` that we use for circuit synthesis.
2022-04-29 20:03:17 +00:00
Jack Grigg ae6a50611a Pass `g_d_new` and `pk_d_new` directly to `Circuit`
The initial Action circuit specification indicated that only the byte
encodings of `g_d_new` and `pk_d_new` would be witnessed, but we ended
up witnessing the points directly instead. This commit removes the
leftover (and now redundant) encoding-decoding round trip.
2022-04-29 18:04:01 +00:00
Jack Grigg 200c366ea4 Rename `Bundle::{try_}authorize` to `Bundle::{try_}map_authorization`
Closes zcash/orchard#71.
2022-04-29 00:16:16 +00:00
Jack Grigg 5c5c999439 Move `orchard::bundle::Action` to its own module
The `Bundle` struct is variable in size and requires allocations, but
`Action` is not. This split will make it cleaner to disable the bundle
logic for no-std support.
2022-04-28 22:59:07 +00:00
Jack Grigg b1ce38405a Use `core` instead of `std` where possible 2022-04-28 20:20:23 +00:00
Jack Grigg 4574d4793a Migrate to 2021 edition 2022-04-28 17:23:30 +00:00
Jack Grigg 06995064d7 incrementalmerkletree 0.3.0-beta.2 2022-04-06 18:19:39 +00:00
therealyingtong a0424984c6 Add explicit scoping for viewing keys and addresses
Co-authored-by: Jack Grigg <jack@electriccoin.co>
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2022-03-30 20:49:37 +08:00
Jack Grigg eb7a9668aa Merge branch 'non-consensus-changes-on-branchid-c4cd541e' into merge-non-consensus-changes-2 2022-02-28 20:46:55 +00:00
Jack Grigg def4d4d9ae Add missing `Debug` trait bounds for `Builder` components
All relevant types have `Debug` impls, but some of the trait and method
impls were lacking `Debug` bounds on their generic types. This prevented
`Debug` impls being used on the overall partially-constructed `Bundle`
types.
2022-02-28 20:09:30 +00:00
Kris Nuttycombe 273662c00b
Apply suggestions from code review
Co-authored-by: str4d <thestr4d@gmail.com>
2022-02-24 09:16:39 -07:00
Kris Nuttycombe 1cf828fe7b Update the incremental merkle tree version and the Rust toolchain.
Use derived equality and ordering (which delegate to constant-time
versions) for note::nullifier::Nullifier and tree::MerkleHashOrchard
so that these types can be used as map keys in wallets.
2022-02-23 20:43:02 -07:00
Jack Grigg 17ad25ee35 Merge branch 'non-consensus-changes-on-branchid-c4cd541e' into merge-non-consensus-changes 2022-02-15 22:46:47 +00:00
Daira Hopwood e92d1167af The address used to derive g_d_old and pk_d_old is the recipient address of the note being spent. 2022-02-15 14:39:32 -07:00
Kris Nuttycombe 5d5e289197 Remove default_diversifier and default_address methods. 2022-02-15 14:39:32 -07:00
str4d 4ae32ef98a
Merge pull request #282 from zcash/clone-unauthorized-bundle
Add `Clone` impls to various structs
2022-02-12 03:23:11 +00:00
Jack Grigg c4cd541e6c Add `Clone` impls to various structs
This enables `InProgress<Unproven, Unauthorized>: Clone`, which allows
the bundle returned by `Builder::build` to be cloned. In pure-Rust
wallets this should not be necessary, but it is required for `zcashd`
due to FFI-crossing.
2022-02-12 02:04:52 +00:00
Jack Grigg ce301a6aa3 Shuffle spends and recipients before pairing them into Actions
Callers cannot assume that any specific output corresponds to a specific
Orchard recipient, and must trial-decrypt all outputs to find the ones
belonging to them. This is consistent with higher-layer semantics like
having Unified Addresses as recipients (where the mapping from recipient
to a specific output would become much more complex).

Closes zcash/orchard#203.

Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2022-02-07 22:37:37 +00:00
therealyingtong f74cb9e4d3 Delete gadgets and their primitives; add `halo2_gadgets` dependency. 2022-01-29 01:57:01 +08:00
therealyingtong 5b26c7d67a Pass rng to create_proof API.
As of halo2#444, all APIs now take `R: RngCore` arguments instead of
internally depending on `rand::rngs::OsRng`.
2022-01-05 21:30:45 +08:00
Jack Grigg 369b99ee3f Add `doc_cfg` annotations 2021-12-17 22:08:58 +00:00
therealyingtong 1f2132a8c0 Use correct MERKLE_DEPTH_ORCHARD in proptests.
Co-authored-by: Jack Grigg <jack@electriccoin.co>
2021-09-16 21:37:59 +02:00
therealyingtong d47c157ae0 Replace arb_tree proptest with incrementalmerkletree impl. 2021-09-16 20:50:27 +02:00