diff --git a/backend-lib/Cargo.lock b/backend-lib/Cargo.lock index 0820a7d3..74a4fe5c 100644 --- a/backend-lib/Cargo.lock +++ b/backend-lib/Cargo.lock @@ -477,7 +477,7 @@ checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" [[package]] name = "equihash" version = "0.2.0" -source = "git+https://github.com/zcash/librustzcash.git?rev=961f902795133b34c17c61a8f540aba4bc097006#961f902795133b34c17c61a8f540aba4bc097006" +source = "git+https://github.com/zcash/librustzcash.git?rev=e387c6ce3f76ff32f023849f816f8b4214dc437f#e387c6ce3f76ff32f023849f816f8b4214dc437f" dependencies = [ "blake2b_simd", "byteorder", @@ -502,7 +502,7 @@ dependencies = [ [[package]] name = "f4jumble" version = "0.1.0" -source = "git+https://github.com/zcash/librustzcash.git?rev=961f902795133b34c17c61a8f540aba4bc097006#961f902795133b34c17c61a8f540aba4bc097006" +source = "git+https://github.com/zcash/librustzcash.git?rev=e387c6ce3f76ff32f023849f816f8b4214dc437f#e387c6ce3f76ff32f023849f816f8b4214dc437f" dependencies = [ "blake2b_simd", ] @@ -1052,8 +1052,9 @@ checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" [[package]] name = "orchard" -version = "0.6.0" -source = "git+https://github.com/zcash/orchard.git?rev=9a85034ce932ca398da16529482e5efecc474c50#9a85034ce932ca398da16529482e5efecc474c50" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92c801aeaccd19bb6916d71f25694b62d223061872900e8022221c1ad8dcad2d" dependencies = [ "aes", "bitvec", @@ -1075,6 +1076,8 @@ dependencies = [ "subtle", "tracing", "zcash_note_encryption", + "zcash_spec", + "zip32", ] [[package]] @@ -1469,8 +1472,9 @@ dependencies = [ [[package]] name = "sapling-crypto" -version = "0.0.1" -source = "git+https://github.com/zcash/sapling-crypto.git?rev=4ec6a48daab0af1fe6cb930f6a150030ce91d0e9#4ec6a48daab0af1fe6cb930f6a150030ce91d0e9" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f5de898a7cdb7f6d9c8fb888341b6ae6e2aeae88227b7f435f1dda49ecf9e62" dependencies = [ "aes", "bellman", @@ -2209,7 +2213,7 @@ dependencies = [ [[package]] name = "zcash_address" version = "0.3.1" -source = "git+https://github.com/zcash/librustzcash.git?rev=961f902795133b34c17c61a8f540aba4bc097006#961f902795133b34c17c61a8f540aba4bc097006" +source = "git+https://github.com/zcash/librustzcash.git?rev=e387c6ce3f76ff32f023849f816f8b4214dc437f#e387c6ce3f76ff32f023849f816f8b4214dc437f" dependencies = [ "bech32", "bs58", @@ -2220,7 +2224,7 @@ dependencies = [ [[package]] name = "zcash_client_backend" version = "0.10.0" -source = "git+https://github.com/zcash/librustzcash.git?rev=961f902795133b34c17c61a8f540aba4bc097006#961f902795133b34c17c61a8f540aba4bc097006" +source = "git+https://github.com/zcash/librustzcash.git?rev=e387c6ce3f76ff32f023849f816f8b4214dc437f#e387c6ce3f76ff32f023849f816f8b4214dc437f" dependencies = [ "base64", "bech32", @@ -2259,7 +2263,7 @@ dependencies = [ [[package]] name = "zcash_client_sqlite" version = "0.8.1" -source = "git+https://github.com/zcash/librustzcash.git?rev=961f902795133b34c17c61a8f540aba4bc097006#961f902795133b34c17c61a8f540aba4bc097006" +source = "git+https://github.com/zcash/librustzcash.git?rev=e387c6ce3f76ff32f023849f816f8b4214dc437f#e387c6ce3f76ff32f023849f816f8b4214dc437f" dependencies = [ "bs58", "byteorder", @@ -2283,13 +2287,14 @@ dependencies = [ "zcash_address", "zcash_client_backend", "zcash_encoding", + "zcash_keys", "zcash_primitives", ] [[package]] name = "zcash_encoding" version = "0.2.0" -source = "git+https://github.com/zcash/librustzcash.git?rev=961f902795133b34c17c61a8f540aba4bc097006#961f902795133b34c17c61a8f540aba4bc097006" +source = "git+https://github.com/zcash/librustzcash.git?rev=e387c6ce3f76ff32f023849f816f8b4214dc437f#e387c6ce3f76ff32f023849f816f8b4214dc437f" dependencies = [ "byteorder", "nonempty", @@ -2298,7 +2303,7 @@ dependencies = [ [[package]] name = "zcash_keys" version = "0.0.0" -source = "git+https://github.com/zcash/librustzcash.git?rev=961f902795133b34c17c61a8f540aba4bc097006#961f902795133b34c17c61a8f540aba4bc097006" +source = "git+https://github.com/zcash/librustzcash.git?rev=e387c6ce3f76ff32f023849f816f8b4214dc437f#e387c6ce3f76ff32f023849f816f8b4214dc437f" dependencies = [ "bech32", "bls12_381", @@ -2309,6 +2314,7 @@ dependencies = [ "hdwallet", "memuse", "nonempty", + "orchard", "rand_core", "sapling-crypto", "subtle", @@ -2335,7 +2341,7 @@ dependencies = [ [[package]] name = "zcash_primitives" version = "0.13.0" -source = "git+https://github.com/zcash/librustzcash.git?rev=961f902795133b34c17c61a8f540aba4bc097006#961f902795133b34c17c61a8f540aba4bc097006" +source = "git+https://github.com/zcash/librustzcash.git?rev=e387c6ce3f76ff32f023849f816f8b4214dc437f#e387c6ce3f76ff32f023849f816f8b4214dc437f" dependencies = [ "aes", "bip0039", @@ -2372,7 +2378,7 @@ dependencies = [ [[package]] name = "zcash_proofs" version = "0.13.0" -source = "git+https://github.com/zcash/librustzcash.git?rev=961f902795133b34c17c61a8f540aba4bc097006#961f902795133b34c17c61a8f540aba4bc097006" +source = "git+https://github.com/zcash/librustzcash.git?rev=e387c6ce3f76ff32f023849f816f8b4214dc437f#e387c6ce3f76ff32f023849f816f8b4214dc437f" dependencies = [ "bellman", "blake2b_simd", diff --git a/backend-lib/Cargo.toml b/backend-lib/Cargo.toml index 17219d7a..975e9cf2 100644 --- a/backend-lib/Cargo.toml +++ b/backend-lib/Cargo.toml @@ -18,7 +18,7 @@ hex = "0.4" jni = { version = "0.21", default-features = false } prost = "0.12" rusqlite = "0.29" -sapling = { package = "sapling-crypto", version = "0.0", default-features = false } +sapling = { package = "sapling-crypto", version = "0.1", default-features = false } schemer = "0.2" secp256k1 = "0.26" secrecy = "0.8" @@ -27,7 +27,7 @@ zcash_client_backend = { version = "0.10", features = ["transparent-inputs", "un zcash_client_sqlite = { version = "^0.8.1", features = ["transparent-inputs", "unstable"] } zcash_primitives = "0.13" zcash_proofs = "0.13" -orchard = { version = "0.6", default-features = false } +orchard = { version = "0.7", default-features = false } # Initialization rayon = "1.7" @@ -64,10 +64,9 @@ path = "src/main/rust/lib.rs" crate-type = ["staticlib", "cdylib"] [patch.crates-io] -orchard = { git = "https://github.com/zcash/orchard.git", rev = "9a85034ce932ca398da16529482e5efecc474c50" } -sapling = { package = "sapling-crypto", git = "https://github.com/zcash/sapling-crypto.git", rev = "4ec6a48daab0af1fe6cb930f6a150030ce91d0e9" } -zcash_address = { git = "https://github.com/zcash/librustzcash.git", rev = "961f902795133b34c17c61a8f540aba4bc097006" } -zcash_client_backend = { git = "https://github.com/zcash/librustzcash.git", rev = "961f902795133b34c17c61a8f540aba4bc097006" } -zcash_client_sqlite = { git = "https://github.com/zcash/librustzcash.git", rev = "961f902795133b34c17c61a8f540aba4bc097006" } -zcash_primitives = { git = "https://github.com/zcash/librustzcash.git", rev = "961f902795133b34c17c61a8f540aba4bc097006" } -zcash_proofs = { git = "https://github.com/zcash/librustzcash.git", rev = "961f902795133b34c17c61a8f540aba4bc097006" } +# Tag `ecc_sdk-20240129` +zcash_address = { git = "https://github.com/zcash/librustzcash.git", rev = "e387c6ce3f76ff32f023849f816f8b4214dc437f" } +zcash_client_backend = { git = "https://github.com/zcash/librustzcash.git", rev = "e387c6ce3f76ff32f023849f816f8b4214dc437f" } +zcash_client_sqlite = { git = "https://github.com/zcash/librustzcash.git", rev = "e387c6ce3f76ff32f023849f816f8b4214dc437f" } +zcash_primitives = { git = "https://github.com/zcash/librustzcash.git", rev = "e387c6ce3f76ff32f023849f816f8b4214dc437f" } +zcash_proofs = { git = "https://github.com/zcash/librustzcash.git", rev = "e387c6ce3f76ff32f023849f816f8b4214dc437f" } diff --git a/backend-lib/src/main/rust/lib.rs b/backend-lib/src/main/rust/lib.rs index 8b5fb4ce..a14cfdf1 100644 --- a/backend-lib/src/main/rust/lib.rs +++ b/backend-lib/src/main/rust/lib.rs @@ -69,6 +69,10 @@ mod utils; const ANCHOR_OFFSET_U32: u32 = 10; const ANCHOR_OFFSET: NonZeroU32 = unsafe { NonZeroU32::new_unchecked(ANCHOR_OFFSET_U32) }; +// Do not generate Orchard receivers until we support receiving Orchard funds. +const DEFAULT_ADDRESS_REQUEST: UnifiedAddressRequest = + UnifiedAddressRequest::unsafe_new(false, true, true); + #[cfg(debug_assertions)] fn print_debug_state() { debug!("WARNING! Debugging enabled! This will likely slow things down 10X!"); @@ -376,7 +380,7 @@ pub extern "C" fn Java_cash_z_ecc_android_sdk_internal_jni_RustDerivationTool_de .map(|usk| usk.to_unified_full_viewing_key())?; let (ua, _) = ufvk - .find_address(DiversifierIndex::new(), UnifiedAddressRequest::DEFAULT) + .find_address(DiversifierIndex::new(), DEFAULT_ADDRESS_REQUEST) .expect("At least one Unified Address should be derivable"); let address_str = ua.encode(&network); let output = env @@ -411,7 +415,7 @@ pub extern "C" fn Java_cash_z_ecc_android_sdk_internal_jni_RustDerivationTool_de // Derive the default Unified Address (containing the default Sapling payment // address that older SDKs used). - let (ua, _) = ufvk.default_address(); + let (ua, _) = ufvk.default_address(DEFAULT_ADDRESS_REQUEST); let address_str = ua.encode(&network); let output = env .new_string(address_str)