diff --git a/circuits/transfer/Cargo.toml b/circuits/transfer/Cargo.toml index 928fdc1b3a..618b82898d 100644 --- a/circuits/transfer/Cargo.toml +++ b/circuits/transfer/Cargo.toml @@ -9,12 +9,13 @@ rand_core = "0.6" dusk-bytes = "0.1" dusk-bls12_381 = "0.11" dusk-jubjub = "0.12" -dusk-plonk = "0.13" -dusk-poseidon = "0.29.1-rc.0" -dusk-merkle = { version = "0.4.1-rc.0", features = ["poseidon", "zk"] } -dusk-pki ="0.11" -dusk-schnorr = "0.12" -phoenix-core = { version = "0.18", features = ["alloc"] } +dusk-plonk = "0.14" +dusk-poseidon = "0.30" +poseidon-merkle = { version = "0.2.1-rc.0", features = ["zk"] } +dusk-merkle = "0.5" +dusk-pki ="0.12" +dusk-schnorr = "0.13" +phoenix-core = { version = "0.20.0-rc.0", features = ["alloc"] } code-hasher = { version = "0.4", path = "../../macros/code-hasher" } rusk-profile = { version = "0.6", path = "../../rusk-profile", optional = true } diff --git a/circuits/transfer/src/execute.rs b/circuits/transfer/src/execute.rs index a91869e20d..9a3031da13 100644 --- a/circuits/transfer/src/execute.rs +++ b/circuits/transfer/src/execute.rs @@ -7,11 +7,11 @@ use crate::{error::Error, gadgets}; use dusk_jubjub::{GENERATOR_EXTENDED, GENERATOR_NUMS_EXTENDED}; -use dusk_merkle::poseidon::{Opening, Tree}; use dusk_merkle::Aggregate; use dusk_pki::{Ownable, SecretSpendKey, ViewKey}; use dusk_poseidon::sponge; use phoenix_core::{Crossover, Fee, Note}; +use poseidon_merkle::{Opening, Tree}; use rand_core::{CryptoRng, RngCore}; use dusk_plonk::error::Error as PlonkError; @@ -501,7 +501,7 @@ macro_rules! execute_circuit_variant { composer.assert_equal_constant( n, BlsScalar::zero(), - Some(-witness.nullifier), + Some(witness.nullifier), ); // 1.e commitment(ic,iv,ib,64) @@ -540,7 +540,7 @@ macro_rules! execute_circuit_variant { composer.assert_equal_constant( crossover.fee_value_witness, BlsScalar::zero(), - Some(-crossover.fee_value), + Some(crossover.fee_value), ); // 3. ∀(o,v) ∈ O × V | O → V diff --git a/circuits/transfer/src/execute/builder.rs b/circuits/transfer/src/execute/builder.rs index 27235636f4..1d52c7234c 100644 --- a/circuits/transfer/src/execute/builder.rs +++ b/circuits/transfer/src/execute/builder.rs @@ -12,8 +12,8 @@ use super::{ use crate::error::Error; use crate::execute::ExecuteCircuit; -use dusk_merkle::poseidon::{Item, Tree}; use dusk_merkle::Aggregate; +use poseidon_merkle::{Item, Tree}; use dusk_pki::{PublicSpendKey, SecretSpendKey}; use phoenix_core::Note; @@ -167,10 +167,7 @@ macro_rules! execute_circuit_variant { rng: &mut R, use_crossover: bool, tx_hash: BlsScalar, - ) -> Result< - (Self, Prover, Verifier, Proof, Vec), - Error, - > + ) -> Result<(Self, Prover, Verifier, Proof, Vec), Error> where T: Clone + Default + Aggregate, { @@ -184,8 +181,8 @@ macro_rules! execute_circuit_variant { let pk = keys.get_prover()?; let vd = keys.get_verifier()?; - let prover = Prover::::try_from_bytes(pk.as_slice())?; - let verifier = Verifier::::try_from_bytes(vd.as_slice())?; + let prover = Prover::try_from_bytes(pk.as_slice())?; + let verifier = Verifier::try_from_bytes(vd.as_slice())?; let (proof, pi) = prover.prove(rng, &circuit)?; diff --git a/circuits/transfer/src/execute/input.rs b/circuits/transfer/src/execute/input.rs index e40fbf43aa..00a1b80431 100644 --- a/circuits/transfer/src/execute/input.rs +++ b/circuits/transfer/src/execute/input.rs @@ -4,10 +4,9 @@ // // Copyright (c) DUSK NETWORK. All rights reserved. -use dusk_merkle::poseidon::Opening; use dusk_pki::Ownable; -use dusk_poseidon::cipher::PoseidonCipher; use phoenix_core::Note; +use poseidon_merkle::Opening; use dusk_plonk::prelude::*; @@ -92,23 +91,9 @@ impl CircuitInput { let value_commitment = note.value_commitment(); let value_commitment = composer.append_point(value_commitment); - let nonce = hash_inputs[3]; - let nonce = composer.append_witness(nonce); - - let r = note.stealth_address().R(); - let r = composer.append_point(r); - - let pos = hash_inputs[8]; + let pos = hash_inputs[5]; let pos = composer.append_witness(pos); - let mut cipher = [pos; PoseidonCipher::cipher_size()]; - cipher - .iter_mut() - .zip(hash_inputs[9..].iter()) - .for_each(|(c, i)| { - *c = composer.append_witness(*i); - }); - let value = composer.append_witness(self.value); let blinding_factor = composer.append_witness(self.blinding_factor); @@ -125,11 +110,7 @@ impl CircuitInput { note_type, value_commitment, - nonce, - r, pos, - cipher, - value, blinding_factor, diff --git a/circuits/transfer/src/execute/input/witness.rs b/circuits/transfer/src/execute/input/witness.rs index 1459811d0a..c16d8078dc 100644 --- a/circuits/transfer/src/execute/input/witness.rs +++ b/circuits/transfer/src/execute/input/witness.rs @@ -4,8 +4,6 @@ // // Copyright (c) DUSK NETWORK. All rights reserved. -use dusk_poseidon::cipher::PoseidonCipher; - use dusk_plonk::prelude::*; /// Coupled code @@ -31,30 +29,21 @@ pub struct WitnessInput { pub schnorr_u: Witness, pub schnorr_r: WitnessPoint, pub schnorr_r_p: WitnessPoint, - pub r: WitnessPoint, pub pos: Witness, - pub nonce: Witness, - pub cipher: [Witness; PoseidonCipher::cipher_size()], pub note_hash: Witness, pub nullifier: BlsScalar, } impl WitnessInput { #[allow(clippy::wrong_self_convention)] - pub fn to_hash_inputs(&self) -> [Witness; 12] { + pub fn to_hash_inputs(&self) -> [Witness; 6] { [ self.note_type, *self.value_commitment.x(), *self.value_commitment.y(), - self.nonce, *self.pk_r.x(), *self.pk_r.y(), - *self.r.x(), - *self.r.y(), self.pos, - self.cipher[0], - self.cipher[1], - self.cipher[2], ] } } diff --git a/circuits/transfer/src/gadgets.rs b/circuits/transfer/src/gadgets.rs index 2f3e6cb389..358329f816 100644 --- a/circuits/transfer/src/gadgets.rs +++ b/circuits/transfer/src/gadgets.rs @@ -9,8 +9,7 @@ use dusk_merkle::Aggregate; use dusk_plonk::prelude::*; use dusk_poseidon::cipher; use dusk_poseidon::sponge::truncated; - -use dusk_merkle::poseidon::Opening; +use poseidon_merkle::{zk::opening_gadget, Opening}; pub use dusk_schnorr::gadgets::double_key_verify as schnorr_double_key_verify; pub use dusk_schnorr::gadgets::single_key_verify as schnorr_single_key_verify; @@ -52,7 +51,7 @@ pub fn merkle_opening( C: Composer, { // The gadget asserts the leaf is the expected - let root = branch.gadget(composer, leaf); + let root = opening_gadget(composer, branch, leaf); composer.assert_equal(anchor, root); } diff --git a/circuits/transfer/src/send_to_contract_obfuscated.rs b/circuits/transfer/src/send_to_contract_obfuscated.rs index e14ddd71fb..00920421f9 100644 --- a/circuits/transfer/src/send_to_contract_obfuscated.rs +++ b/circuits/transfer/src/send_to_contract_obfuscated.rs @@ -205,7 +205,7 @@ impl SendToContractObfuscatedCircuit { } #[allow(clippy::option_map_unit_fn)] -#[code_hasher::hash(name = "CIRCUIT_ID", version = "0.1.0")] +#[code_hasher::hash(name = "CIRCUIT_ID", version = "0.2.0")] impl Circuit for SendToContractObfuscatedCircuit { fn circuit(&self, composer: &mut C) -> Result<(), PlonkError> { let zero = C::ZERO; diff --git a/circuits/transfer/src/send_to_contract_transparent.rs b/circuits/transfer/src/send_to_contract_transparent.rs index 0a6da9e612..c7ef665823 100644 --- a/circuits/transfer/src/send_to_contract_transparent.rs +++ b/circuits/transfer/src/send_to_contract_transparent.rs @@ -149,7 +149,7 @@ impl SendToContractTransparentCircuit { } #[allow(clippy::option_map_unit_fn)] -#[code_hasher::hash(name = "CIRCUIT_ID", version = "0.1.0")] +#[code_hasher::hash(name = "CIRCUIT_ID", version = "0.2.0")] impl Circuit for SendToContractTransparentCircuit { fn circuit(&self, composer: &mut C) -> Result<(), PlonkError> { // Witnesses diff --git a/circuits/transfer/src/withdraw_from_obfuscated.rs b/circuits/transfer/src/withdraw_from_obfuscated.rs index b4ef87ff51..4a30b6c73a 100644 --- a/circuits/transfer/src/withdraw_from_obfuscated.rs +++ b/circuits/transfer/src/withdraw_from_obfuscated.rs @@ -60,7 +60,7 @@ impl WithdrawFromObfuscatedCircuit { } } -#[code_hasher::hash(name = "CIRCUIT_ID", version = "0.1.0")] +#[code_hasher::hash(name = "CIRCUIT_ID", version = "0.2.0")] impl Circuit for WithdrawFromObfuscatedCircuit { fn circuit(&self, composer: &mut C) -> Result<(), PlonkError> { let zero = C::ZERO; diff --git a/circuits/transfer/src/withdraw_from_transparent.rs b/circuits/transfer/src/withdraw_from_transparent.rs index 2a66f33459..79ae15593b 100644 --- a/circuits/transfer/src/withdraw_from_transparent.rs +++ b/circuits/transfer/src/withdraw_from_transparent.rs @@ -37,7 +37,7 @@ impl WithdrawFromTransparentCircuit { } } -#[code_hasher::hash(name = "CIRCUIT_ID", version = "0.1.0")] +#[code_hasher::hash(name = "CIRCUIT_ID", version = "0.2.0")] impl Circuit for WithdrawFromTransparentCircuit { fn circuit(&self, composer: &mut C) -> Result<(), PlonkError> { // Witnesses diff --git a/circuits/transfer/tests/keys/mod.rs b/circuits/transfer/tests/keys/mod.rs index a335711deb..c26ae69256 100644 --- a/circuits/transfer/tests/keys/mod.rs +++ b/circuits/transfer/tests/keys/mod.rs @@ -8,12 +8,7 @@ use transfer_circuits::Error; use dusk_plonk::prelude::*; -pub fn circuit_keys( - id: &[u8; 32], -) -> Result<(Prover, Verifier), Error> -where - C: Circuit, -{ +pub fn circuit_keys(id: &[u8; 32]) -> Result<(Prover, Verifier), Error> { let keys = rusk_profile::keys_for(id)?; let pk = keys.get_prover()?; let vd = keys.get_verifier()?; diff --git a/consensus/Cargo.toml b/consensus/Cargo.toml index ea6a3fb934..4e1741dd0b 100644 --- a/consensus/Cargo.toml +++ b/consensus/Cargo.toml @@ -29,7 +29,7 @@ async-channel = "1.7.1" async-trait = "0.1" anyhow = "1.0" node-data = { version = "0.1", path = "../node-data" } -dusk-merkle = "0.4.1-rc.0" +dusk-merkle = "0.5" [dev-dependencies] hex-literal = { version = "0.3.4" } diff --git a/contracts/alice/Cargo.toml b/contracts/alice/Cargo.toml index 38ea9ef89e..14d73a9023 100644 --- a/contracts/alice/Cargo.toml +++ b/contracts/alice/Cargo.toml @@ -8,9 +8,9 @@ resolver = "2" crate-type = ["cdylib", "rlib"] [dependencies] -phoenix-core = { version = "0.18", default-features = false, features = ["rkyv-impl", "alloc"] } +phoenix-core = { version = "0.20.0-rc.0", default-features = false, features = ["rkyv-impl", "alloc"] } rusk-abi = { version = "0.8.0-alpha", path = "../../rusk-abi", features = ["dlmalloc"] } -dusk-pki = { version = "0.11", default-features = false, features = ["rkyv-impl"] } +dusk-pki = { version = "0.12", default-features = false, features = ["rkyv-impl"] } [dev-dependencies] piecrust = "0.5" diff --git a/contracts/governance/Cargo.toml b/contracts/governance/Cargo.toml index e40f508f54..168fe3e714 100644 --- a/contracts/governance/Cargo.toml +++ b/contracts/governance/Cargo.toml @@ -10,7 +10,7 @@ crate-type = ["cdylib", "rlib"] dusk-bls12_381 = { version = "0.11", default-features = false, features = ["rkyv-impl"] } dusk-bls12_381-sign = { version = "0.4", default-features = false, features = ["rkyv-impl"] } dusk-bytes = "0.1" -dusk-pki = { version = "0.11", default-features = false, features = ["rkyv-impl"] } +dusk-pki = { version = "0.12", default-features = false, features = ["rkyv-impl"] } rusk-abi = { version = "0.8.0-alpha", path = "../../rusk-abi", features = ["dlmalloc"] } rkyv = { version = "0.7", default-features = false } diff --git a/contracts/stake/Cargo.toml b/contracts/stake/Cargo.toml index 79eb112463..1e84efa900 100644 --- a/contracts/stake/Cargo.toml +++ b/contracts/stake/Cargo.toml @@ -11,10 +11,10 @@ dusk-bls12_381 = { version = "0.11", default-features = false, features = ["rkyv dusk-bls12_381-sign = { version = "0.4", default-features = false, features = ["rkyv-impl"] } dusk-bytes = "0.1" dusk-jubjub = { version = "0.12", default-features = false, features = ["rkyv-impl"] } -dusk-pki = { version = "0.11", default-features = false, features = ["rkyv-impl"] } -phoenix-core = { version = "0.18", default-features = false, features = ["rkyv-impl", "alloc"] } +dusk-pki = { version = "0.12", default-features = false, features = ["rkyv-impl"] } +phoenix-core = { version = "0.20.0-rc.0", default-features = false, features = ["rkyv-impl", "alloc"] } rusk-abi = { version = "0.8.0-alpha", path = "../../rusk-abi", features = ["dlmalloc"] } -dusk-plonk = { version = "0.13", default-features = false, features = ["rkyv-impl", "alloc"] } +dusk-plonk = { version = "0.14", default-features = false, features = ["rkyv-impl", "alloc"] } [dev-dependencies] piecrust = "0.5" @@ -24,4 +24,4 @@ transfer-circuits = { version = "0.5", path = "../../circuits/transfer", feature rkyv = { version = "0.7", default-features = false } hex = "0.4" rand = "0.8" -dusk-merkle = { version = "0.4.1-rc.0", features = ["poseidon", "rkyv-impl"] } +poseidon-merkle = { version = "0.2.1-rc.0", features = ["rkyv-impl"] } diff --git a/contracts/stake/tests/stake.rs b/contracts/stake/tests/stake.rs index 7a023cb6e5..bff9ddd70b 100644 --- a/contracts/stake/tests/stake.rs +++ b/contracts/stake/tests/stake.rs @@ -8,13 +8,13 @@ use dusk_bls12_381::BlsScalar; use dusk_bls12_381_sign::{PublicKey, SecretKey}; use dusk_bytes::Serializable; use dusk_jubjub::{JubJubScalar, GENERATOR_NUMS_EXTENDED}; -use dusk_merkle::poseidon::Opening as PoseidonOpening; use dusk_pki::{Ownable, PublicSpendKey, SecretSpendKey, ViewKey}; use dusk_plonk::prelude::*; use phoenix_core::transaction::*; use phoenix_core::{Fee, Note}; use piecrust::{ContractData, Error}; use piecrust::{Session, VM}; +use poseidon_merkle::Opening as PoseidonOpening; use rand::rngs::StdRng; use rand::{CryptoRng, RngCore, SeedableRng}; use rusk_abi::dusk::{dusk, LUX}; @@ -121,9 +121,7 @@ fn opening( session.call(TRANSFER_CONTRACT, "opening", &pos) } -fn prover_verifier( - circuit_id: &[u8; 32], -) -> (Prover, Verifier) { +fn prover_verifier(circuit_id: &[u8; 32]) -> (Prover, Verifier) { let (pk, vd) = prover_verifier_keys(circuit_id); let prover = Prover::try_from_bytes(pk).unwrap(); diff --git a/contracts/transfer/Cargo.toml b/contracts/transfer/Cargo.toml index 938b05b594..b2bda5ccb8 100644 --- a/contracts/transfer/Cargo.toml +++ b/contracts/transfer/Cargo.toml @@ -10,12 +10,12 @@ crate-type = ["cdylib", "rlib"] dusk-bls12_381 = { version = "0.11", default-features = false, features = ["rkyv-impl"] } dusk-bytes = "0.1" dusk-jubjub = { version = "0.12", default-features = false, features = ["rkyv-impl"] } -dusk-pki = { version = "0.11", default-features = false, features = ["rkyv-impl"] } -dusk-poseidon = { version = "0.29.1-rc.0", default-features = false, features = ["alloc"] } -dusk-merkle = { version = "0.4.1-rc.0", features = ["poseidon", "rkyv-impl"] } -phoenix-core = { version = "0.18", default-features = false, features = ["rkyv-impl", "alloc"] } +dusk-pki = { version = "0.12", default-features = false, features = ["rkyv-impl"] } +dusk-poseidon = { version = "0.30", default-features = false, features = ["alloc"] } +poseidon-merkle = { version = "0.2.1-rc.0", features = ["rkyv-impl"] } +phoenix-core = { version = "0.20.0-rc.0", default-features = false, features = ["rkyv-impl", "alloc"] } rusk-abi = { version = "0.8.0-alpha", path = "../../rusk-abi", features = ["dlmalloc"] } -dusk-plonk = { version = "0.13", default-features = false, features = ["rkyv-impl", "alloc"] } +dusk-plonk = { version = "0.14", default-features = false, features = ["rkyv-impl", "alloc"] } [dev-dependencies] piecrust = "0.5" diff --git a/contracts/transfer/src/circuits.rs b/contracts/transfer/src/circuits.rs index 2901a7d70a..6467d7d8a6 100644 --- a/contracts/transfer/src/circuits.rs +++ b/contracts/transfer/src/circuits.rs @@ -4,15 +4,39 @@ // // Copyright (c) DUSK NETWORK. All rights reserved. -const VD_STCT: &[u8] = include_bytes!(concat!(env!("RUSK_PROFILE_PATH"), "/.rusk/keys/9d267dfe1d1ede4f2ffa35c3609f8662cd84e4df1066b2185a0f3b5b17721c79.vd")); -const VD_STCO: &[u8] = include_bytes!(concat!(env!("RUSK_PROFILE_PATH"), "/.rusk/keys/c8c7d7fa2fe8eeabd5505056ae3c00b44c1aa13d9578eeff3a4fc7ddb3035da4.vd")); -const VD_WFCT: &[u8] = include_bytes!(concat!(env!("RUSK_PROFILE_PATH"), "/.rusk/keys/dcc4561c1bbd8a10cd14c9e826d51373567dd41bb2cfd498f92230abc602ed47.vd")); -const VD_WFCO: &[u8] = include_bytes!(concat!(env!("RUSK_PROFILE_PATH"), "/.rusk/keys/8f7301b53f3af3eb14563c7e474a539a6e12c1248e1e9bdb4b07eeb2ef1a8f2e.vd")); - -const VD_EXEC_1_2: &[u8] = include_bytes!(concat!(env!("RUSK_PROFILE_PATH"), "/.rusk/keys/4d5e60c2cdb7b3f273649487ad277eb0e380e44dd2f2effb0d2dcb3c1ff615d4.vd")); -const VD_EXEC_2_2: &[u8] = include_bytes!(concat!(env!("RUSK_PROFILE_PATH"), "/.rusk/keys/77d27ac80d397cfec7d621e61af4fa4b7fb4b9e503fa347082c5e1e187e08d48.vd")); -const VD_EXEC_3_2: &[u8] = include_bytes!(concat!(env!("RUSK_PROFILE_PATH"), "/.rusk/keys/4fb4e239548c5bdf9f5c6125cd07da64ce70edb99e79478f13140b53f136c441.vd")); -const VD_EXEC_4_2: &[u8] = include_bytes!(concat!(env!("RUSK_PROFILE_PATH"), "/.rusk/keys/05fb339e4fb471c745c8f90181a349ccf9226d8ee719073d45986fadcde466b4.vd")); +const VD_STCT: &[u8] = include_bytes!(concat!( + env!("RUSK_PROFILE_PATH"), + "/.rusk/keys/cfebfdcd309a070b44e1b407b7228ca9b900720e7cff283d653400357161899a.vd" +)); +const VD_STCO: &[u8] = include_bytes!(concat!( + env!("RUSK_PROFILE_PATH"), + "/.rusk/keys/d7fbe016d385b7d3b44c510225388a0f2a9889d07294ba3e3f9c037801d3148e.vd" +)); +const VD_WFCT: &[u8] = include_bytes!(concat!( + env!("RUSK_PROFILE_PATH"), + "/.rusk/keys/d0b52061b33cb2f2ef79448b53cd3d2dbca30819ca4a55e151c8af01e6c7efcd.vd" +)); +const VD_WFCO: &[u8] = include_bytes!(concat!( + env!("RUSK_PROFILE_PATH"), + "/.rusk/keys/7824ae42a6208eb0eca9f7c5e7ca964efa04a500fc3275e1c89541a26876808a.vd" +)); + +const VD_EXEC_1_2: &[u8] = include_bytes!(concat!( + env!("RUSK_PROFILE_PATH"), + "/.rusk/keys/1aed4ea248e24d6eb71ca40dbc8aca90e1972f0c08cce0666df248e14627d299.vd" +)); +const VD_EXEC_2_2: &[u8] = include_bytes!(concat!( + env!("RUSK_PROFILE_PATH"), + "/.rusk/keys/90369a00165fcf91b792bf6d64deaf39f5a16603588fe711838e1005e58458a6.vd" +)); +const VD_EXEC_3_2: &[u8] = include_bytes!(concat!( + env!("RUSK_PROFILE_PATH"), + "/.rusk/keys/942a788cf56d9ef93bda7385e86e8620b127bb47eac46829f81bc48e61bdf00e.vd" +)); +const VD_EXEC_4_2: &[u8] = include_bytes!(concat!( + env!("RUSK_PROFILE_PATH"), + "/.rusk/keys/076cdf6a1f160432941ac3cb14f8dece2c07da58559af4dfdda32b9be5cca884.vd" +)); /// Verifier data for the execute circuits. pub const fn verifier_data_execute(inputs: usize) -> Option<&'static [u8]> { diff --git a/contracts/transfer/src/state.rs b/contracts/transfer/src/state.rs index 56ddd75d6e..a5e0523df9 100644 --- a/contracts/transfer/src/state.rs +++ b/contracts/transfer/src/state.rs @@ -16,10 +16,10 @@ use core::ops::Range; use dusk_bls12_381::BlsScalar; use dusk_bytes::Serializable; use dusk_jubjub::{JubJubAffine, JubJubExtended}; -use dusk_merkle::poseidon::Opening as PoseidonOpening; use dusk_pki::{Ownable, PublicKey, StealthAddress}; use phoenix_core::transaction::*; use phoenix_core::{Crossover, Fee, Message, Note}; +use poseidon_merkle::Opening as PoseidonOpening; use rusk_abi::{ContractId, PaymentInfo, PublicInput, STAKE_CONTRACT}; /// Arity of the transfer tree. diff --git a/contracts/transfer/src/tree.rs b/contracts/transfer/src/tree.rs index 71a4aa3c49..a17668f959 100644 --- a/contracts/transfer/src/tree.rs +++ b/contracts/transfer/src/tree.rs @@ -12,7 +12,7 @@ use dusk_bls12_381::BlsScalar; use phoenix_core::transaction::*; use phoenix_core::Note; -use dusk_merkle::poseidon::{ +use poseidon_merkle::{ Item as PoseidonItem, Opening as PoseidonOpening, Tree as PoseidonTree, }; diff --git a/contracts/transfer/tests/circuits.rs b/contracts/transfer/tests/circuits.rs index 889559b1d9..11d7a52324 100644 --- a/contracts/transfer/tests/circuits.rs +++ b/contracts/transfer/tests/circuits.rs @@ -36,35 +36,35 @@ mod tests { test_circuit!( SendToContractTransparentCircuit, - "9d267dfe1d1ede4f2ffa35c3609f8662cd84e4df1066b2185a0f3b5b17721c79" + "cfebfdcd309a070b44e1b407b7228ca9b900720e7cff283d653400357161899a" ); test_circuit!( SendToContractObfuscatedCircuit, - "c8c7d7fa2fe8eeabd5505056ae3c00b44c1aa13d9578eeff3a4fc7ddb3035da4" + "d7fbe016d385b7d3b44c510225388a0f2a9889d07294ba3e3f9c037801d3148e" ); test_circuit!( WithdrawFromTransparentCircuit, - "dcc4561c1bbd8a10cd14c9e826d51373567dd41bb2cfd498f92230abc602ed47" + "d0b52061b33cb2f2ef79448b53cd3d2dbca30819ca4a55e151c8af01e6c7efcd" ); test_circuit!( WithdrawFromObfuscatedCircuit, - "8f7301b53f3af3eb14563c7e474a539a6e12c1248e1e9bdb4b07eeb2ef1a8f2e" + "7824ae42a6208eb0eca9f7c5e7ca964efa04a500fc3275e1c89541a26876808a" ); test_circuit!( ExecuteCircuitOneTwo<(), TRANSFER_TREE_DEPTH, A>, - "4d5e60c2cdb7b3f273649487ad277eb0e380e44dd2f2effb0d2dcb3c1ff615d4" + "1aed4ea248e24d6eb71ca40dbc8aca90e1972f0c08cce0666df248e14627d299" ); test_circuit!( ExecuteCircuitTwoTwo<(), TRANSFER_TREE_DEPTH, A>, - "77d27ac80d397cfec7d621e61af4fa4b7fb4b9e503fa347082c5e1e187e08d48" + "90369a00165fcf91b792bf6d64deaf39f5a16603588fe711838e1005e58458a6" ); test_circuit!( ExecuteCircuitThreeTwo<(), TRANSFER_TREE_DEPTH, A>, - "4fb4e239548c5bdf9f5c6125cd07da64ce70edb99e79478f13140b53f136c441" + "942a788cf56d9ef93bda7385e86e8620b127bb47eac46829f81bc48e61bdf00e" ); test_circuit!( ExecuteCircuitFourTwo<(), TRANSFER_TREE_DEPTH, A>, - "05fb339e4fb471c745c8f90181a349ccf9226d8ee719073d45986fadcde466b4" + "076cdf6a1f160432941ac3cb14f8dece2c07da58559af4dfdda32b9be5cca884" ); } } diff --git a/contracts/transfer/tests/transfer.rs b/contracts/transfer/tests/transfer.rs index 653cbb4a8f..9ae773c54c 100644 --- a/contracts/transfer/tests/transfer.rs +++ b/contracts/transfer/tests/transfer.rs @@ -7,13 +7,13 @@ use dusk_bls12_381::BlsScalar; use dusk_bytes::Serializable; use dusk_jubjub::{JubJubScalar, GENERATOR_NUMS_EXTENDED}; -use dusk_merkle::poseidon::Opening as PoseidonOpening; use dusk_pki::{Ownable, PublicKey, PublicSpendKey, SecretSpendKey, ViewKey}; use dusk_plonk::prelude::*; use phoenix_core::transaction::*; use phoenix_core::{Fee, Message, Note}; use piecrust::{ContractData, Error}; use piecrust::{Session, VM}; +use poseidon_merkle::Opening as PoseidonOpening; use rand::rngs::StdRng; use rand::{CryptoRng, RngCore, SeedableRng}; use rusk_abi::dusk::{dusk, LUX}; @@ -146,9 +146,7 @@ fn opening( session.call(TRANSFER_CONTRACT, "opening", &pos) } -fn prover_verifier( - circuit_id: &[u8; 32], -) -> (Prover, Verifier) { +fn prover_verifier(circuit_id: &[u8; 32]) -> (Prover, Verifier) { let (pk, vd) = prover_verifier_keys(circuit_id); let prover = Prover::try_from_bytes(pk).unwrap(); diff --git a/macros/code-hasher/Cargo.toml b/macros/code-hasher/Cargo.toml index d793720290..24823e3e8c 100644 --- a/macros/code-hasher/Cargo.toml +++ b/macros/code-hasher/Cargo.toml @@ -20,4 +20,4 @@ darling = "0.14" semver = "1.0" [dev-dependencies] -dusk-plonk = "0.13" +dusk-plonk = "0.14" diff --git a/rusk-abi/Cargo.toml b/rusk-abi/Cargo.toml index e2669cba93..9c2f7832c0 100644 --- a/rusk-abi/Cargo.toml +++ b/rusk-abi/Cargo.toml @@ -12,17 +12,17 @@ exclude = [".github/workflows/ci.yml", ".gitignore"] blake2b_simd = { version = "1", default-features = false } cfg-if = "1" -dusk-poseidon = { version = "0.29.1-rc.0", default-features = false } +dusk-poseidon = { version = "0.30", default-features = false } dusk-bls12_381 = { version = "0.11", default-features = false, features = ["rkyv-impl"] } dusk-bls12_381-sign = { version = "0.4", features = ["rkyv-impl"] } -dusk-schnorr = { version = "0.12", default-features = false, features = ["rkyv-impl"] } -dusk-pki = { version = "0.11", default-features = false, features = ["rkyv-impl"] } +dusk-schnorr = { version = "0.13", default-features = false, features = ["rkyv-impl"] } +dusk-pki = { version = "0.12", default-features = false, features = ["rkyv-impl"] } dusk-jubjub = { version = "0.12", default-features = false, features = ["rkyv-impl"] } dusk-bytes = "0.1" bytecheck = { version = "0.6", default-features = false } piecrust-uplink = { version = "0.5", default-features = false } piecrust = { version = "0.5", optional = true } -dusk-plonk = { version = "0.13", default-features = false, features = ["rkyv-impl", "alloc"] } +dusk-plonk = { version = "0.14", default-features = false, features = ["rkyv-impl", "alloc"] } # These are patches since these crates don't seem to like semver. rkyv = { version = "=0.7.39", default-features = false } diff --git a/rusk-abi/src/query/host.rs b/rusk-abi/src/query/host.rs index 3e04baa72c..2e271f26d7 100644 --- a/rusk-abi/src/query/host.rs +++ b/rusk-abi/src/query/host.rs @@ -17,7 +17,6 @@ use dusk_bls12_381_sign::{ }; use dusk_bytes::DeserializableSlice; use dusk_pki::PublicKey; -use dusk_plonk::error::Error as PlonkError; use dusk_plonk::prelude::*; use dusk_schnorr::Signature; use piecrust::{Error, Session, SessionData, VM}; @@ -133,7 +132,7 @@ pub fn verify_proof( proof: Vec, public_inputs: Vec, ) -> bool { - let verifier = Verifier::::try_from_bytes(verifier_data) + let verifier = Verifier::try_from_bytes(verifier_data) .expect("Verifier data coming from the contract should be valid"); let proof = Proof::from_slice(&proof).expect("Proof should be valid"); @@ -147,14 +146,12 @@ pub fn verify_proof( let mut pis = Vec::with_capacity(n_pi); - // FIXME: Plonk seems to be expecting `-pi`s, which is quite strange. Maybe - // some bug in Plonk? public_inputs.into_iter().for_each(|pi| match pi { - PublicInput::Point(p) => pis.extend([-p.get_x(), -p.get_y()]), - PublicInput::BlsScalar(s) => pis.push(-s), + PublicInput::Point(p) => pis.extend([p.get_x(), p.get_y()]), + PublicInput::BlsScalar(s) => pis.push(s), PublicInput::JubJubScalar(s) => { let s: BlsScalar = s.into(); - pis.push(-s) + pis.push(s) } }); @@ -171,17 +168,3 @@ pub fn verify_bls(msg: Vec, pk: BlsPublicKey, sig: BlsSignature) -> bool { let apk = APK::from(&pk); apk.verify(&sig, &msg).is_ok() } - -#[derive(Default)] -struct DummyCircuit; - -impl Circuit for DummyCircuit { - fn circuit(&self, _: &mut C) -> Result<(), PlonkError> - where - C: Composer, - { - unreachable!( - "This circuit should never be compiled or proven, only verified" - ) - } -} diff --git a/rusk-abi/tests/contracts/host_fn/Cargo.toml b/rusk-abi/tests/contracts/host_fn/Cargo.toml index 3f97055704..277ae5d1dd 100644 --- a/rusk-abi/tests/contracts/host_fn/Cargo.toml +++ b/rusk-abi/tests/contracts/host_fn/Cargo.toml @@ -10,8 +10,8 @@ crate-type = ["cdylib", "rlib"] dusk-bls12_381 = { version = "0.11", default-features = false, features = ["rkyv-impl"] } dusk-bls12_381-sign = { version = "0.4", default-features = false, features = ["rkyv-impl"] } dusk-jubjub = { version = "0.12", default-features = false, features = ["rkyv-impl"] } -dusk-schnorr = { version = "0.12", default-features = false, features = ["rkyv-impl"] } -dusk-pki = { version = "0.11", default-features = false, features = ["rkyv-impl"] } +dusk-schnorr = { version = "0.13", default-features = false, features = ["rkyv-impl"] } +dusk-pki = { version = "0.12", default-features = false, features = ["rkyv-impl"] } dusk-bytes = "0.1" -dusk-plonk = { version = "0.13", default-features = false, features = ["rkyv-impl", "alloc"] } +dusk-plonk = { version = "0.14", default-features = false, features = ["rkyv-impl", "alloc"] } rusk-abi = { version = "0.8.0-alpha", path = "../../..", features = ["dlmalloc"] } diff --git a/rusk-abi/tests/lib.rs b/rusk-abi/tests/lib.rs index 5af9e5b99b..b69dfae6a5 100644 --- a/rusk-abi/tests/lib.rs +++ b/rusk-abi/tests/lib.rs @@ -209,8 +209,12 @@ impl Circuit for TestCircuit { let a = composer.append_witness(self.a); let b = composer.append_witness(self.b); - let constraint = - Constraint::new().left(1).a(a).right(1).b(b).public(-self.c); + let constraint = Constraint::new() + .left(-BlsScalar::one()) + .a(a) + .right(-BlsScalar::one()) + .b(b) + .public(self.c); composer.append_gate(constraint); composer.append_dummy_gates(); @@ -230,27 +234,32 @@ fn plonk_proof() { let label = b"dusk-network"; - let (prover, verifier) = Compiler::compile(&pp, label) + let (prover, verifier) = Compiler::compile::(&pp, label) .expect("Circuit should compile successfully"); - let circuit = TestCircuit::new(1, 2); + let a = 1u64; + let b = 2u64; + let expected_pi = vec![BlsScalar::from(a) + BlsScalar::from(b)]; + let circuit = TestCircuit::new(a, b); - let (proof, public_inputs) = prover + let (proof, prover_pi) = prover .prove(&mut OsRng, &circuit) .expect("Proving circuit should succeed"); + // Check public inputs + assert_eq!( + expected_pi, prover_pi, + "Prover generates different pi than expected" + ); + // Integrity check verifier - .verify(&proof, &public_inputs) + .verify(&proof, &expected_pi) .expect("Proof should verify successfully"); let verifier = verifier.to_bytes(); - let public_inputs: Vec = public_inputs - .into_iter() - // FIXME: this should only be From::from, but due to the negative PI - // problem we invert them here - .map(|pi| From::from(-pi)) - .collect(); + let public_inputs: Vec = + expected_pi.into_iter().map(|pi| From::from(pi)).collect(); let proof = proof.to_bytes().to_vec(); diff --git a/rusk-recovery/Cargo.toml b/rusk-recovery/Cargo.toml index 2a64b57be4..62bf974bb4 100644 --- a/rusk-recovery/Cargo.toml +++ b/rusk-recovery/Cargo.toml @@ -26,12 +26,12 @@ rustc_tools_util = "=0.2.0" piecrust = "0.5" hex = "0.4" rustc_tools_util = "0.2" -dusk-plonk = { version = "0.13", features = ["rkyv-impl"] } -dusk-pki ="0.11" -phoenix-core = { version = "0.18", features = ["rkyv-impl", "alloc"] } +dusk-plonk = { version = "0.14", features = ["rkyv-impl"] } +dusk-pki ="0.12" +phoenix-core = { version = "0.20.0-rc.0", features = ["rkyv-impl", "alloc"] } rand = "0.8" transfer-circuits = { version = "0.5", path = "../circuits/transfer", features=["builder"] } -dusk-merkle = "0.4.1-rc.0" +dusk-merkle = "0.5" rusk-profile = { version = "0.6", path = "../rusk-profile" } rusk-abi = { version = "0.8.0-alpha", path = "../rusk-abi", features = ["host"] } once_cell = "1.13" diff --git a/rusk-schema/Cargo.toml b/rusk-schema/Cargo.toml index 7749f723df..58b09e7617 100644 --- a/rusk-schema/Cargo.toml +++ b/rusk-schema/Cargo.toml @@ -17,9 +17,9 @@ exclude = [".github/workflows/", ".gitignore"] tonic = "0.8" prost = "0.11" -dusk-pki = "0.11" +dusk-pki = "0.12" dusk-bytes = "0.1" -phoenix-core = { version = "0.18", features = ["alloc"] } +phoenix-core = { version = "0.20.0-rc.0", features = ["alloc"] } [build-dependencies] tonic-build = "0.8" diff --git a/rusk/Cargo.toml b/rusk/Cargo.toml index 96d9a9429f..95481c2590 100644 --- a/rusk/Cargo.toml +++ b/rusk/Cargo.toml @@ -37,17 +37,17 @@ bs58 = "0.4" hex = "0.4" tempfile = "3.2" -dusk-schnorr = "0.12" -dusk-poseidon = "0.29.1-rc.0" -dusk-merkle = { version = "0.4.1-rc.0", features = ["poseidon"] } -dusk-plonk = "0.13" +dusk-schnorr = "0.13" +dusk-poseidon = "0.30" +poseidon-merkle = { version = "0.2.1-rc.0", features = ["rkyv-impl", "size_32"] } +dusk-plonk = "0.14" dusk-bls12_381 = "0.11" dusk-bls12_381-sign = "0.4" dusk-jubjub = "0.12" -dusk-pki = "0.11" +dusk-pki = "0.12" dusk-bytes = "0.1" -dusk-wallet-core = "0.17.1-piecrust.0.5" -phoenix-core = "0.18" +dusk-wallet-core = "0.18.0-piecrust.0.5" +phoenix-core = "0.20.0-rc.0" piecrust = "0.5" kadcast = "0.5.0-rc" parking_lot = "0.12" diff --git a/rusk/src/lib/lib.rs b/rusk/src/lib/lib.rs index ebad108183..d2dfdb7a04 100644 --- a/rusk/src/lib/lib.rs +++ b/rusk/src/lib/lib.rs @@ -20,7 +20,6 @@ pub mod transaction; use bytecheck::CheckBytes; use dusk_bls12_381::BlsScalar; use dusk_bls12_381_sign::PublicKey as BlsPublicKey; -use dusk_merkle::poseidon::Opening as PoseidonOpening; use dusk_pki::PublicKey; use dusk_plonk::prelude::PublicParameters; use once_cell::sync::Lazy; @@ -28,6 +27,7 @@ use parking_lot::{Mutex, MutexGuard}; use phoenix_core::transaction::*; use phoenix_core::Message; use piecrust::{Error as PiecrustError, Session, VM}; +use poseidon_merkle::Opening as PoseidonOpening; use rkyv::validation::validators::DefaultValidator; use rkyv::{Archive, Deserialize, Infallible, Serialize}; use rusk_abi::dusk::{dusk, Dusk}; diff --git a/rusk/src/lib/services/prover/stco.rs b/rusk/src/lib/services/prover/stco.rs index bdeff71858..bf95343088 100644 --- a/rusk/src/lib/services/prover/stco.rs +++ b/rusk/src/lib/services/prover/stco.rs @@ -22,13 +22,12 @@ const STCO_INPUT_LEN: usize = u64::SIZE + BlsScalar::SIZE + Signature::SIZE; -pub static STCO_PROVER: Lazy> = - Lazy::new(|| { - let keys = keys_for(SendToContractObfuscatedCircuit::circuit_id()) - .expect("keys to be available"); - let pk = keys.get_prover().expect("prover to be available"); - Prover::try_from_bytes(pk).expect("prover key to be valid") - }); +pub static STCO_PROVER: Lazy = Lazy::new(|| { + let keys = keys_for(SendToContractObfuscatedCircuit::circuit_id()) + .expect("keys to be available"); + let pk = keys.get_prover().expect("prover to be available"); + Prover::try_from_bytes(pk).expect("prover key to be valid") +}); impl RuskProver { pub(crate) fn prove_stco( diff --git a/rusk/src/lib/services/prover/stct.rs b/rusk/src/lib/services/prover/stct.rs index 90eaba4460..0d534efb31 100644 --- a/rusk/src/lib/services/prover/stct.rs +++ b/rusk/src/lib/services/prover/stct.rs @@ -16,13 +16,12 @@ const STCT_INPUT_LEN: usize = Fee::SIZE + BlsScalar::SIZE + Signature::SIZE; -pub static STCT_PROVER: Lazy> = - Lazy::new(|| { - let keys = keys_for(SendToContractTransparentCircuit::circuit_id()) - .expect("keys to be available"); - let pk = keys.get_prover().expect("prover to be available"); - Prover::try_from_bytes(pk).expect("prover key to be valid") - }); +pub static STCT_PROVER: Lazy = Lazy::new(|| { + let keys = keys_for(SendToContractTransparentCircuit::circuit_id()) + .expect("keys to be available"); + let pk = keys.get_prover().expect("prover to be available"); + Prover::try_from_bytes(pk).expect("prover key to be valid") +}); impl RuskProver { pub(crate) fn prove_stct( diff --git a/rusk/src/lib/services/prover/wfco.rs b/rusk/src/lib/services/prover/wfco.rs index f9935cd29f..2df3018891 100644 --- a/rusk/src/lib/services/prover/wfco.rs +++ b/rusk/src/lib/services/prover/wfco.rs @@ -23,13 +23,12 @@ const WFCO_INPUT_LEN: usize = u64::SIZE + JubJubScalar::SIZE + JubJubAffine::SIZE; -pub static WFCO_PROVER: Lazy> = - Lazy::new(|| { - let keys = keys_for(WithdrawFromObfuscatedCircuit::circuit_id()) - .expect("keys to be available"); - let pk = keys.get_prover().expect("prover to be available"); - Prover::try_from_bytes(pk).expect("prover key to be valid") - }); +pub static WFCO_PROVER: Lazy = Lazy::new(|| { + let keys = keys_for(WithdrawFromObfuscatedCircuit::circuit_id()) + .expect("keys to be available"); + let pk = keys.get_prover().expect("prover to be available"); + Prover::try_from_bytes(pk).expect("prover key to be valid") +}); impl RuskProver { pub(crate) fn prove_wfco( diff --git a/rusk/src/lib/services/prover/wfct.rs b/rusk/src/lib/services/prover/wfct.rs index 639e0317a7..a730ac080f 100644 --- a/rusk/src/lib/services/prover/wfct.rs +++ b/rusk/src/lib/services/prover/wfct.rs @@ -12,13 +12,12 @@ use rand::rngs::OsRng; const WFCT_INPUT_LEN: usize = JubJubAffine::SIZE + u64::SIZE + JubJubScalar::SIZE; -pub static WFCT_PROVER: Lazy> = - Lazy::new(|| { - let keys = keys_for(WithdrawFromTransparentCircuit::circuit_id()) - .expect("keys to be available"); - let pk = keys.get_prover().expect("prover to be available"); - Prover::try_from_bytes(pk).expect("prover key to be valid") - }); +pub static WFCT_PROVER: Lazy = Lazy::new(|| { + let keys = keys_for(WithdrawFromTransparentCircuit::circuit_id()) + .expect("keys to be available"); + let pk = keys.get_prover().expect("prover to be available"); + Prover::try_from_bytes(pk).expect("prover key to be valid") +}); impl RuskProver { pub(crate) fn prove_wfct( diff --git a/rusk/tests/services/gas_behavior.rs b/rusk/tests/services/gas_behavior.rs index 501c0c89af..0f6e50a3fd 100644 --- a/rusk/tests/services/gas_behavior.rs +++ b/rusk/tests/services/gas_behavior.rs @@ -11,7 +11,6 @@ use dusk_bls12_381_sign::PublicKey; use dusk_bytes::Error::InvalidData; use dusk_bytes::{DeserializableSlice, Serializable}; use dusk_jubjub::{JubJubAffine, JubJubScalar}; -use dusk_merkle::poseidon::Opening as PoseidonOpening; use dusk_pki::ViewKey; use dusk_plonk::proof_system::Proof; use dusk_schnorr::Signature; @@ -20,6 +19,7 @@ use dusk_wallet_core::{ }; use futures::StreamExt; use phoenix_core::{Crossover, Fee, Note}; +use poseidon_merkle::Opening as PoseidonOpening; use rand::prelude::*; use rand::rngs::StdRng; use rusk::error::Error; diff --git a/rusk/tests/services/multi_transfer.rs b/rusk/tests/services/multi_transfer.rs index 06f2a5b8d6..2875097e7a 100644 --- a/rusk/tests/services/multi_transfer.rs +++ b/rusk/tests/services/multi_transfer.rs @@ -11,7 +11,6 @@ use dusk_bls12_381_sign::PublicKey; use dusk_bytes::Error::InvalidData; use dusk_bytes::{DeserializableSlice, Serializable}; use dusk_jubjub::{JubJubAffine, JubJubScalar}; -use dusk_merkle::poseidon::Opening as PoseidonOpening; use dusk_pki::{SecretSpendKey, ViewKey}; use dusk_plonk::proof_system::Proof; use dusk_schnorr::Signature; @@ -21,6 +20,7 @@ use dusk_wallet_core::{ use futures::StreamExt; use once_cell::sync::Lazy; use phoenix_core::{Crossover, Fee, Note}; +use poseidon_merkle::Opening as PoseidonOpening; use rand::prelude::*; use rand::rngs::StdRng; use rusk::error::Error; diff --git a/rusk/tests/services/prover_service.rs b/rusk/tests/services/prover_service.rs index b50ac970af..1d0b8d2769 100644 --- a/rusk/tests/services/prover_service.rs +++ b/rusk/tests/services/prover_service.rs @@ -8,7 +8,6 @@ use crate::common::*; use dusk_bls12_381::BlsScalar; use dusk_bls12_381_sign::PublicKey; use dusk_bytes::DeserializableSlice; -use dusk_merkle::poseidon::{Item, Opening as PoseidonOpening, Tree}; use dusk_pki::{PublicSpendKey, ViewKey}; use dusk_plonk::prelude::*; use dusk_schnorr::Signature; @@ -19,6 +18,7 @@ use dusk_wallet_core::{ use parking_lot::Mutex; use phoenix_core::{Crossover, Fee}; use phoenix_core::{Note, NoteType}; +use poseidon_merkle::{Item, Opening as PoseidonOpening, Tree}; use rand::{CryptoRng, RngCore}; use rusk::services::prover::{ProverServer, RuskProver}; use rusk_schema::prover_client::ProverClient; diff --git a/rusk/tests/services/stake.rs b/rusk/tests/services/stake.rs index 7959d9ab87..4a1df52740 100644 --- a/rusk/tests/services/stake.rs +++ b/rusk/tests/services/stake.rs @@ -11,7 +11,6 @@ use dusk_bls12_381_sign::{PublicKey, SecretKey}; use dusk_bytes::Error::InvalidData; use dusk_bytes::{DeserializableSlice, Serializable, Write}; use dusk_jubjub::{JubJubAffine, JubJubScalar}; -use dusk_merkle::poseidon::Opening as PoseidonOpening; use dusk_pki::{SecretSpendKey, ViewKey}; use dusk_plonk::proof_system::Proof; use dusk_schnorr::Signature; @@ -21,6 +20,7 @@ use dusk_wallet_core::{ use futures::StreamExt; use once_cell::sync::Lazy; use phoenix_core::{Crossover, Fee, Note}; +use poseidon_merkle::Opening as PoseidonOpening; use rand::prelude::*; use rand::rngs::StdRng; use rusk::error::Error; diff --git a/rusk/tests/services/transfer.rs b/rusk/tests/services/transfer.rs index 504a884ae2..636c8340a9 100644 --- a/rusk/tests/services/transfer.rs +++ b/rusk/tests/services/transfer.rs @@ -13,7 +13,6 @@ use dusk_bls12_381_sign::PublicKey; use dusk_bytes::Error::InvalidData; use dusk_bytes::{DeserializableSlice, Serializable}; use dusk_jubjub::{JubJubAffine, JubJubScalar}; -use dusk_merkle::poseidon::Opening as PoseidonOpening; use dusk_pki::{SecretSpendKey, ViewKey}; use dusk_plonk::proof_system::Proof; use dusk_schnorr::Signature; @@ -24,6 +23,7 @@ use futures::StreamExt; use once_cell::sync::Lazy; use parking_lot::Mutex; use phoenix_core::{Crossover, Fee, Note}; +use poseidon_merkle::Opening as PoseidonOpening; use rand::prelude::*; use rand::rngs::StdRng; use rusk::error::Error;