Skip to content

Commit

Permalink
Merge pull request #1478 from pacu/ufvk-from-orchard-fvk
Browse files Browse the repository at this point in the history
[#1477] Allow Orchard-only UFVK be created from an Orchard FVK
  • Loading branch information
nuttycom authored Aug 14, 2024
2 parents d829d3c + 22dd30f commit 3b74284
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
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

0 comments on commit 3b74284

Please sign in to comment.