Commit Graph

193 Commits

Author SHA1 Message Date
Jack Grigg 6898dbf094 Replace `unstable-nu6` and `zfuture` feature flags with cfg flags
Neither of these should have been feature flags, as they gate breaking
changes to the Zcash consensus rules (and in some ways are incompatible
with each other), while feature flags should be additive.
2024-03-10 18:42:39 +00:00
Kris Nuttycombe 5675a76f0d zcash_protocol: Use `BalanceError` instead of `()` for monetary range violations. 2024-03-05 13:59:26 -07:00
Kris Nuttycombe b8aa5132c2 Apply suggestions from code review
Co-authored-by: str4d <thestr4d@gmail.com>
Co-authored-by: Daira-Emma Hopwood <daira@jacaranda.org>
2024-03-05 13:36:15 -07:00
Kris Nuttycombe 04fdac7931 zcash_primitives: Move the `memo` module to the `zcash_protocol` crate. 2024-03-05 13:36:15 -07:00
Kris Nuttycombe 5e4d9abbce Move `Amount` and `NonNegativeAmount` types to the `zcash_protocol` crate. 2024-03-05 09:45:24 -07:00
Kris Nuttycombe bacfe3cb9d Move `zcash_primitives::{consensus, constants}` to the `zcash_protocol` crate 2024-03-05 09:45:24 -07:00
Jack Grigg 599aa45a56 zcash_primitives 0.14.0 2024-03-01 01:12:43 +00:00
Jack Grigg 92e54ddce2 Clean up zcash_primitives changelog 2024-02-22 23:38:15 +00:00
Jack Grigg e85c631dd3 Add missing entries to changelogs 2024-02-22 23:38:05 +00:00
Kris Nuttycombe 7a5852598e zcash_keys, zcash_client_backend: feature-flag off transparent-input WalletRead methods.
This also moves the `TransparentAddressMetadata` type behind the
`transparent-inputs` feature flag and performs associated cleanup.
2024-02-14 17:38:52 -07:00
Andrew Arnott 8f6afb2182
Update changelogs 2024-02-13 18:02:24 -07:00
Andrew Arnott 1733af8718
Declare `NonHardenedChildIndex` struct 2024-02-10 12:46:46 -07:00
Kris Nuttycombe 2360609f1a zcash_primitives: Rename `TransparentAddress` variants.
This resolves an old TODO.
2024-02-02 10:52:17 -07:00
Francisco Gindre 17f074d460
PR Suggestion by @nuttycom: remove the `FullNodeParameters` enum 2024-01-17 18:55:21 -03:00
Francisco Gindre 529fd3d562
Add Regtest variant of `Network` and Parameter
closes #1051

Also:
Adds encoding tests + cargo fmt
Adds tests on ZIP-321
Adds coverage on new code
Supports nu6 activation
`local-consensus` feature is disabled by default
2024-01-17 18:21:06 -03:00
Kris Nuttycombe cc39bf4429 zcash_primitives: Add Orchard bundle metadata to transaction builder. 2024-01-16 13:19:24 -07:00
Kris Nuttycombe 24ebe4c643 Address comments from code review.
Co-authored-by: Jack Grigg <jack@electriccoin.co>
2024-01-05 17:00:46 -07:00
Kris Nuttycombe 56f2ac573c zcash_client_backend: Add Orchard support to change strategies.
This modifies the `compute_balance` method to operate in a
bundle-oriented fashion, which simplifies the API and makes it easier to
elide Orchard functionality in the case that the `orchard` feature is
not enabled.
2024-01-05 16:59:54 -07:00
Jack Grigg b7bba9bbb2 zcash_primitives: Remove `keys` module 2024-01-03 17:29:59 +00:00
Kris Nuttycombe 704e8e1144 zcash_primitives: Updates to reflect `sapling-crypto` and `orchard` builder changes. 2024-01-02 13:00:11 -07:00
Jack Grigg 35ea2ff38b zcash_primitives: Remove `sapling-crypto` re-export and update changelog 2023-12-12 19:50:26 +00:00
Jack Grigg b6ee98ed46 zcash_primitives: Add `ProverProgress` trait to `sapling::builder`
This breaks the link between the concrete `Sender<Progress>` channel
used by the main builder in `zcash_primitives`, and the proof creation
APIs in what will become the `sapling-crypto` crate.

Part of zcash/librustzcash#1044.
2023-12-11 16:37:53 +00:00
str4d ecd5402266
Merge pull request #1061 from zcash/1044-sapling-prf-expand
zcash_primitives: Introduce type-safe `PRF^expand`
2023-12-07 18:03:37 +00:00
Jack Grigg ce7b7df0cc zcash_primitives: Switch to type-safe `PRF^expand`
Part of zcash/librustzcash#1044.
2023-12-07 17:09:44 +00:00
Kris Nuttycombe 4eaa41affa zcash_primitives: Remove and relocate `InputView` traits. 2023-12-06 20:17:43 -07:00
Kris Nuttycombe 8c1480304e zcash_client_backend: Wrap entire Sapling note in `SaplingReceivedNote` 2023-12-05 10:49:35 -07:00
Jack Grigg 8acc03783e zcash_primitives: Refactor `sapling::tree::Node` around `jubjub::Base` 2023-12-04 20:24:24 +00:00
Jack Grigg 5ccba3e1af zcash_primitives: Introduce newtypes for `ask` and `ak`
The Sapling key components specification places more constraints on the
values of `ask` and `ak` than general RedJubjub signing and verification
keys.
2023-12-01 11:19:31 +00:00
Jack Grigg de1ed21051 zcash_primitives: Replace `sapling::redjubjub` with `redjubjub` crate
As a side-effect, we remove the ability to verify individual
transactions with pre-ZIP 216 rules (which we already removed from
`zcashd` consensus nodes in zcash/zcash#6000 and zcash/zcash#6399, as
all pre-ZIP 216 transactions on mainnet are also valid under ZIP 216).
2023-11-30 17:52:31 +00:00
Kris Nuttycombe 7f3d057a1b zcash_primitives: Avoid passing duplicate diversifier information to Sapling builder.
The note provided to `add_sapling_spend` contains the recipient address,
and we can extract the diversifier from this address, so we should not
pass it separately.
2023-11-28 10:54:06 -07:00
Jack Grigg 106f5a353a Remove `MemoBytes` usage from `zcash_primitives::sapling` 2023-11-28 03:25:14 +00:00
Jack Grigg 7badba29ea zcash_primitives: Move `zip32::sapling` to `sapling::zip32` 2023-11-28 01:38:53 +00:00
Jack Grigg 45ef8b1604 zcash_primitives: Add constructor and getter to `zip32::ChainCode` 2023-11-28 01:38:53 +00:00
Jack Grigg 61bb18d97f zcash_primitives: Refactor `zip32::ChildIndex` to be an opaque struct 2023-11-28 01:38:53 +00:00
Jack Grigg a9310e3969 zcash_primitives: Remove non-hardened Sapling ZIP 32 derivation 2023-11-28 01:34:31 +00:00
Jack Grigg cdd20e8583 zcash_primitives: Make `value_balance` generic in `sapling::Bundle`
This removes the dependency on `Amount`, and matches how we handle this
in the `orchard` crate.

Part of zcash/librustzcash#1044.
2023-11-23 07:08:13 +00:00
Jack Grigg eb0b5a1b24 zcash_primitives: Remove `consensus::Parameters` from `sapling` module
Part of zcash/librustzcash#1044.
2023-11-22 04:29:36 +00:00
Kris Nuttycombe 33169719ce zcash_client_backend: Add serialization & parsing for protobuf Proposal representation. 2023-11-09 20:07:16 -07:00
Jack Grigg c6dd9ad858 zcash_primitives: Expose Sapling bundle component parsers needed by zcashd
These can be removed after future zcashd refactors.
2023-11-10 02:09:22 +00:00
Jack Grigg e1a5539094 zcash_primitives: Rework Sapling parsers to be plain functions
Once `zcash_primitives::sapling` is extracted to `sapling-crypto`, these
would have become orphan impls.
2023-11-10 01:06:18 +00:00
Jack Grigg 54eb03e34e zcash_primitives: Move Sapling bundle types into `sapling` module 2023-11-09 04:04:07 +00:00
Jack Grigg f5595122f9 zcash_primitives: Move `builder` module to `zcash_primitives::sapling` 2023-11-09 04:02:19 +00:00
Jack Grigg 82535112c2 zcash_primitives: Add Sapling verification key newtypes 2023-11-07 03:11:15 +00:00
Jack Grigg 1b9f26c984 Move `{Spend,Output}Parameters` from `zcash_proofs` to `zcash_primitives` 2023-11-07 03:09:25 +00:00
Jack Grigg 8bb9c4e7ba Move Sapling proof verifiers from `zcash_proofs` to `zcash_primitives` 2023-11-07 03:08:43 +00:00
Jack Grigg b20641ae58 zcash_primitives: Remove `sapling::prover::TxProver`
Removed
-------
- `zcash_primitives::sapling`:
  - `prover::TxProver` (use `SpendProver` and `OutputProver` instead).
  - `prover::mock::MockTxProver` (use `MockSpendProver` and `MockOutputProver`
    instead).
2023-11-03 21:08:37 +00:00
Jack Grigg a77b6c631c Add missing unreleased changelog entries 2023-11-03 00:56:56 +00:00
Jack Grigg bed5bc6cf6 Clean up unreleased changelog entries 2023-11-03 00:56:26 +00:00
Kris Nuttycombe 570ea48588 Apply suggestions from code review
Co-authored-by: Daira Emma Hopwood <daira@jacaranda.org>
2023-10-26 15:24:45 -06:00
Kris Nuttycombe cc0cc2de84 zcash_primitives: add StandardFeeRule
`StandardFeeRule` is an enumeration of the standard fees that have
existed in the history of Zcash zips. It is provided to simplify
transition to new fee strategies; legacy elements of this enumeration
are introduced already-deprecated.
2023-10-25 08:08:49 -06:00