Skip to main content

Crate zync_core

Crate zync_core 

Source
Expand description

ZYNC Core - Zero-knowledge sYNChronization for Zcash

Cross-platform wallet core using Crux architecture. This crate contains all business logic shared across platforms:

  • Desktop (egui)
  • Android (Jetpack Compose)
  • iOS (SwiftUI)
  • Web (WASM)

Key features:

  • WASM-compatible parallel note scanning
  • Ligerito-powered header chain verification
  • Epoch-based proof composition

Re-exports§

pub use app::ZafuCore;
pub use app::Event;
pub use app::Model;
pub use app::ViewModel;
pub use app::Effect;
pub use app::Contact;
pub use app::ChatMessage;
pub use error::ZyncError;
pub use error::Result;
pub use state::WalletState;
pub use state::WalletStateCommitment;
pub use scanner::Scanner;
pub use scanner::BatchScanner;
pub use scanner::ScanAction;
pub use scanner::DecryptedNote;
pub use client::ZidecarClient;
pub use client::LightwalletdClient;

Modules§

app
Crux App - cross-platform wallet core
client
gRPC clients for Zcash light wallet services
error
error types for zync
scanner
WASM-compatible parallel note scanner for Orchard
state
wallet state types and sparse merkle tree operations
trustless
Trustless state verification for secure light clients
verifier
ligerito proof verification

Structs§

IncomingViewingKey
A key that provides the capability to detect and decrypt incoming notes from the block chain, without being able to spend the notes or detect when they are spent.
OrchardFvk
A key that provides the capability to view incoming and outgoing transactions.
SpendingKey
A spending key, from which all key material is derived.
WalletId
wallet identifier (random 16 bytes)

Enums§

Scope
The scope of a viewing key or address.

Constants§

DOMAIN_EPOCH_PROOF
domain separator for epoch proof hash
DOMAIN_IVK_COMMIT
domain separator for ivk commitment
DOMAIN_WALLET_STATE
domain separator for wallet state commitment
EMPTY_SMT_ROOT
empty sparse merkle tree root
EPOCH_SIZE
blocks per epoch (~21 hours at 75s/block)
FIELDS_PER_ACTION
fields encoded per action in trace polynomial
GENESIS_EPOCH_HASH
genesis epoch hash (all zeros)
GIGAPROOF_TRACE_LOG_SIZE
polynomial size exponent for gigaproofs (2^26 config)
MAX_ACTIONS_PER_BLOCK
max orchard actions per block
ORCHARD_ACTIVATION_HEIGHT
orchard activation height (mainnet)
ORCHARD_ACTIVATION_HEIGHT_TESTNET
orchard activation height (testnet)
SECURITY_BITS
security parameter (bits)
TIP_TRACE_LOG_SIZE
polynomial size exponent for tip proofs (2^20 config, max ~32K headers)

Functions§

epoch_end
helper: get end height of epoch (inclusive)
epoch_for_height
helper: calculate epoch number from block height
epoch_start
helper: get start height of epoch
gigaproof_prover_config
ligerito prover config for gigaproofs (2^26, ~10s, multi-epoch)
gigaproof_verifier_config
ligerito verifier config for gigaproofs (2^28)
prover_config_for_size
select the appropriate prover config for a given trace size returns (config, required_trace_size) - trace must be padded to required_trace_size
tip_prover_config
ligerito prover config for tip proofs (2^20, ~0.1s, max ~32K blocks)
tip_verifier_config
ligerito verifier config for tip proofs (2^24)
verifier_config_for_log_size
select the appropriate verifier config for a given log size