Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#1477] Allow Orchard-only UFVK be created from an Orchard FVK #1478

Merged
merged 1 commit into from
Aug 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion zcash_keys/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,12 @@ and this library adheres to Rust's notion of

## [Unreleased]
### Notable changes
- `zcash_keys` now supports TEX (transparent-source-only) addresses as specified
- `zcash_keys`:
- Now supports TEX (transparent-source-only) addresses as specified
in [ZIP 320](https://zips.z.cash/zip-0320).
- Has an `unstable-frost` feature for FROST implementors to use when
API changes are needed specifically for the FROST threshold signatures
use case.

### Added
- `zcash_keys::address::Address::try_from_zcash_address`
Expand Down
3 changes: 3 additions & 0 deletions zcash_keys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ test-dependencies = [

#! ### Experimental features

## Exposes unstable APIs that are compatible with FROST key management
unstable-frost = ["orchard"]

## Exposes unstable APIs. Their behaviour may change at any time.
unstable = ["dep:byteorder"]

Expand Down
16 changes: 16 additions & 0 deletions zcash_keys/src/keys.rs
Original file line number Diff line number Diff line change
Expand Up @@ -658,6 +658,22 @@ impl UnifiedFullViewingKey {
)
}

#[cfg(feature = "unstable-frost")]
pub fn from_orchard_fvk(
orchard: orchard::keys::FullViewingKey,
) -> Result<UnifiedFullViewingKey, DerivationError> {
Self::from_checked_parts(
#[cfg(feature = "transparent-inputs")]
None,
#[cfg(feature = "sapling")]
None,
#[cfg(feature = "orchard")]
Some(orchard),
// We don't currently allow constructing new UFVKs with unknown items, but we store
// this to allow parsing such UFVKs.
vec![],
)
}
/// Construct a UFVK from its constituent parts, after verifying that UIVK derivation can
/// succeed.
fn from_checked_parts(
Expand Down
Loading