Commit Graph

122 Commits

Author SHA1 Message Date
Vivek Arte f38d6b9e4c
Rename `sk_iss` to `isk`, the `IssuanceKey` struct to `IssuanceAuthorizingKey`, and move to a two key structure (#92)
This performs a consistent renaming of the issuance authorizing key to make it consistent with the ZIP.
It also reworks the `IssuanceAuthorizingKey` struct in place of the `IssuanceKey` and `IssuanceAuthorizingKey` structs, as part of using a two key structure for issuance, as specified in ZIP 227.
2023-11-07 17:06:30 +05:30
Dmitry Demin 7b943e197e
Adopt Orchard ZSA for Zebra (introduce zcash_note_encryption_zsa alias, minor enhancements) (#89)
This Pull Request introduces the `zcash_note_encryption_zsa` alias,
ensuring compatibility with the Zebra project. This alias is used to
prevent conflicts with the original `zcash_note_encryption` crate, which
is also used in Zebra through the original `orchard` crate that is used
in parallel with our `orchard` (Orchard ZSA) crate.
Additionally, this PR includes minor enhancements to ensure
compatibility with the Zebra project.

---------

Co-authored-by: Dmitry Demin <dmitry@qed-it.com>
2023-11-01 10:37:43 +01:00
Constance Beguier aa1d89561c
Fix issuance key derivation (#74)
Updated constants for master (extended) issuance key according to ZIP
227. Previously, we used the same personalization for the master
extended spending key and the master extended issuance key, as well as
the same purpose constant for the spending master key and the issuance
master key.

Now, the following updates have been made:
- Personalization for the master extended issuance key: ZIP32ZSAIssue_V1
- Purpose constant for the issuance master key: 227"
2023-06-20 20:35:57 +02:00
Vivek Arte f0b794896d
Making changes to the asset base derivation from the asset identifier (#49)
This PR updates the test-vectors from the updates to the zcash-test-vectors repository (see here).

The keys test is also updated to now use the asset base from the test vectors instead of just using the native asset.
2023-04-19 01:00:37 +05:30
Paul 43d5e77d38
AssetBase spec update (#44)
- Renamed AssetId to AssetBase
- Changed the  AssetBase implementation to support the zip update.
- Updated visibility for various members of issuance.rs
2023-03-02 14:26:19 +02:00
Alexey 4e4767789e
Minimal API changes for Issuance in Client (#43)
Make IVK::from_bytes public
2023-02-09 12:44:25 +01:00
Paul 355b5691ea Review fixes2 (#24)
* rename 2 note_type -> asset as per  https://github.com/zcash/orchard/pull/356#discussion_r967636009

* added a dedicated type for "IssuanceAuth"

* disabled codecov github action due to bad behavior. 

* extracted "is_asset_desc_of_valid_size()" into asset_id.rs
2022-12-06 15:47:30 +02:00
Paul f3ebe7a1ab Review fixes (#23)
* fixes and suggestions

* changed "issuer" to "issuance" as per https://github.com/zcash/orchard/pull/356#discussion_r967668241

* terminology fixes

* updated naming
2022-12-06 15:39:59 +02:00
Paul 0b2988acc7 Issuance (#12)
- added IssueBundle and IssueAction
- added a builder for IssueBundle
- added verify_issue_bundle() for consensus verification.
- unit tests.
2022-12-06 15:39:59 +02:00
Paul e6b776295a Added NoteType to Notes (#2)
* Added NoteType to Notes
* Added NoteType to value commitment derivation
2022-12-06 15:15:19 +02:00
Daniel Benarroch 1328c622ab issuer keys implementation (#5)
Implements the issuer keys as

    IssuerAuthorizingKey -> isk
    IssuerVerifyingKey -> ik

Test vectors generated with zcash_test_vectors repo
2022-12-06 15:02:45 +02:00
Daira Hopwood 786d285987 Fix a clippy lint.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2022-10-18 19:17:15 +01:00
Daira Hopwood b988d4c275
Fix comment that incorrectly referred to Sapling when Orchard was meant 2022-10-18 02:45:24 +01:00
Jack Grigg 050b2f231e Add `memuse::DynamicUsage` impls for types used for batch scanning 2022-10-15 23:29:06 +00:00
Jack Grigg 0b4d7bc9c6 Migrate note encryption to use prepared w-NAF APIs 2022-10-15 23:27:57 +00:00
Hazel OHearn 0800d23fe7
Publicize diversifier method of Address, fix comments, etc 2022-09-15 14:40:21 -03:00
Hazel OHearn 45bcc16f80
Publicize necessary functionality for reading diversifiers and notes from data 2022-07-05 14:55:44 -03:00
Jack Grigg 6d6832f3f1 Fix clippy lints 2022-05-06 19:33:10 +00:00
Jack Grigg 30f9452743 Replace unnecessary usage of `std::io` 2022-04-28 20:45:05 +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
Daira Hopwood 3b52b2abec Minor cleanup found while performing review for zcash/zcash#5024
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2022-04-14 08:29:00 -06:00
therealyingtong eaa0cfdbf6 Check that the internal IVK can be derived from a spending key
Co-authored-by: Jack Grigg <jack@electriccoin.co>
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2022-03-30 20:49:38 +08:00
therealyingtong e550c3d536 Check IVK derivations during FullViewingKey::from_bytes.
Closes zcash/orchard#303

Co-authored-by: Jack Grigg <jack@electriccoin.co>
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2022-03-30 20:49:38 +08: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 72b6febf7b Move zero-handling from inside CommitIVK to outside it
This more closely matches the change to the protocol spec.
2022-03-17 18:51:33 +00: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 65f3e6ec32 Add `FullViewingKey::derive_internal`
This is identical to the changes introduced in zcash/orchard#270, except
that the output is non-optional (since the derivation is non-fallible).
2022-02-21 14:41:47 +00: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
Kris Nuttycombe 5d5e289197 Remove default_diversifier and default_address methods. 2022-02-15 14:39:32 -07:00
Kris Nuttycombe 4c7ab377fb Make the DiversifierKey type crate-private 2022-02-14 17:04:38 -07:00
Kris Nuttycombe ae3cc78a56 Add decryption of the diversifier index for an address to the IVK.
Also correct a spelling error.
2022-02-14 17:04:38 -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
Kris Nuttycombe b7f66b48e6
Merge pull request #280 from nuttycom/decrypt_diversifier
Add diversifier index decryption to DiversifierKey
2022-02-11 14:51:54 -07:00
Kris Nuttycombe 8c96640826 Add diversifier index decryption to DiversifierKey. 2022-02-11 14:09:07 -07:00
Jack Grigg c1447d6af2 Fix broken main branch
This was a non-code merge conflict between zcash/halo2#217 and main,
that caused CI to break after the PR merged.
2022-02-08 15:19:56 +00:00
str4d 40491385c6
Merge pull request #217 from zcash/update-halo2-gadgets
Delete gadgets and introduce halo2_gadgets dependency.
2022-02-03 21:23:42 +00:00
therealyingtong 91e22e4f92 Use internal keys test vectors. 2022-02-01 18:55:21 +08:00
therealyingtong 9cf4e10d4f Remove InternalSpendingKey, introduce FullViewingKey::rivk_internal. 2022-02-01 18:55:21 +08:00
therealyingtong 99119f04fa Derive internal full viewing key. 2022-02-01 18:55:21 +08:00
therealyingtong 2412e83400 Derive internal spending key. 2022-02-01 18:55:21 +08:00
Jack Grigg f300cea2c8 Fix clippy lints
These became stable lints between 1.51 and 1.54.
2022-01-28 23:00:00 +08:00
Jack Grigg 0e1220acc9 Merge branch 'main' into orchard-mainnet-circuit 2021-12-20 15:20:33 +00:00
Jack Grigg 369b99ee3f Add `doc_cfg` annotations 2021-12-17 22:08:58 +00:00
Jack Grigg 044844c0a0 Reject the identity in `SpendValidatingKey::from_bytes`
`ak_P` is not allowed to be the identity in the Orchard protocol. We
were enforcing this by construction in most places, except for the
parsing of an Orchard full viewing key.

Closes zcash/orchard#261.
2021-12-15 13:48:59 +00:00
Jack Grigg 0378898289 Replace `FieldExt::{from, to}_bytes` with `PrimeField::{from, to}_repr` 2021-12-09 15:39:37 +00:00
Jack Grigg 37f1bba998 Remove `PartialEq, PartialOrd` impls from `{Extended}SpendingKey` 2021-11-30 23:25:35 +00:00
Jack Grigg 674ceb54c8 `impl ConstantTimeEq for {Extended}SpendingKey` 2021-11-30 23:24:50 +00:00
Kris Nuttycombe 14c4b40dfc Add construction of DiversifierIndex directly from bytes. 2021-11-24 18:09:25 -07:00