diff --git a/Cargo.toml b/Cargo.toml index cc03ebd..1baaf92 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,7 +8,7 @@ crate-type = ["cdylib", "rlib"] [features] default = [] -parallel = ["sp-client/parallel"] +parallel = ["spdk-core/parallel"] blindbit-backend = ["backend-blindbit-native"] blindbit-wasm = ["backend-blindbit-wasm", "dep:js-sys", "dep:serde-wasm-bindgen", "dep:futures"] @@ -23,9 +23,9 @@ serde_json = { version = "1.0.108" } rs_merkle = "1.4.2" zstd = "0.13.3" getrandom = { version = "0.2", features = ["js"] } -sp-client = { git = "https://github.com/Sosthene00/sp-client.git", branch = "dev", default-features = false } -backend-blindbit-native = { git = "https://github.com/Sosthene00/sp-client.git", branch = "dev", optional = true } -backend-blindbit-wasm = { git = "https://github.com/Sosthene00/sp-client.git", branch = "dev", optional = true } +spdk-core = { git = "https://github.com/cygnet3/spdk", branch = "add_blindbit_wasm" } +backend-blindbit-native = { git = "https://github.com/cygnet3/spdk", branch = "add_blindbit_wasm", optional = true } +backend-blindbit-wasm = { git = "https://github.com/cygnet3/spdk", branch = "add_blindbit_wasm", optional = true } tsify = { git = "https://github.com/Sosthene00/tsify", branch = "next" } wasm-bindgen = "0.2.91" diff --git a/src/crypto.rs b/src/crypto.rs index 972c658..5947425 100644 --- a/src/crypto.rs +++ b/src/crypto.rs @@ -1,6 +1,6 @@ use anyhow::Result; use rs_merkle::{algorithms::Sha256, MerkleProof}; -use sp_client::silentpayments::{ +use spdk_core::silentpayments::{ bitcoin_hashes::{sha256t_hash_newtype, Hash, HashEngine}, secp256k1::PublicKey, }; diff --git a/src/device.rs b/src/device.rs index b7fab75..1056a4b 100644 --- a/src/device.rs +++ b/src/device.rs @@ -4,7 +4,7 @@ use serde::{Deserialize, Serialize}; use tsify::Tsify; use wasm_bindgen::prelude::*; -use sp_client::{ +use spdk_core::{ bitcoin::{ absolute::Height, hashes::Hash, secp256k1::PublicKey, Amount, OutPoint, Transaction, XOnlyPublicKey, diff --git a/src/hash.rs b/src/hash.rs index 266059b..fb8f84d 100644 --- a/src/hash.rs +++ b/src/hash.rs @@ -1,4 +1,4 @@ -use sp_client::bitcoin::{ +use spdk_core::bitcoin::{ consensus::{serialize, Encodable}, hashes::{sha256t_hash_newtype, Hash, HashEngine}, OutPoint, diff --git a/src/lib.rs b/src/lib.rs index 67a64ed..e0aed35 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -8,7 +8,7 @@ pub use log; pub use rand; pub use serde; pub use serde_json; -pub use sp_client; +pub use spdk_core; pub use tsify; pub use wasm_bindgen; pub use zstd; diff --git a/src/network.rs b/src/network.rs index 5664f6d..fba31df 100644 --- a/src/network.rs +++ b/src/network.rs @@ -1,8 +1,8 @@ use anyhow::Result; use rand::{thread_rng, RngCore}; use serde::{Deserialize, Serialize}; -use sp_client::bitcoin::hex::DisplayHex; -use sp_client::bitcoin::OutPoint; +use spdk_core::bitcoin::hex::DisplayHex; +use spdk_core::bitcoin::OutPoint; use tsify::Tsify; use crate::error::AnkError; diff --git a/src/pcd.rs b/src/pcd.rs index 9945731..51b9cab 100644 --- a/src/pcd.rs +++ b/src/pcd.rs @@ -9,7 +9,7 @@ use std::io::Write; use serde::{Deserialize, Serialize}; use serde_json::Value; -use sp_client::{ +use spdk_core::{ bitcoin::{hashes::Hash, secp256k1::PublicKey, OutPoint}, silentpayments::SilentPaymentAddress, }; @@ -663,7 +663,7 @@ impl Roles { #[cfg(test)] mod tests { use serde_json::json; - use sp_client::{ + use spdk_core::{ bitcoin::{secp256k1::SecretKey, Network}, SpClient, SpendKey, }; diff --git a/src/prd.rs b/src/prd.rs index e696873..5b975f2 100644 --- a/src/prd.rs +++ b/src/prd.rs @@ -4,11 +4,11 @@ use anyhow::Result; use serde::{Deserialize, Serialize}; use serde_json::{Map, Value}; -use sp_client::bitcoin::hashes::{sha256t_hash_newtype, Hash, HashEngine}; -use sp_client::bitcoin::secp256k1::{PublicKey, SecretKey}; -use sp_client::bitcoin::OutPoint; -use sp_client::silentpayments::SilentPaymentAddress; -use sp_client::SpClient; +use spdk_core::bitcoin::hashes::{sha256t_hash_newtype, Hash, HashEngine}; +use spdk_core::bitcoin::secp256k1::{PublicKey, SecretKey}; +use spdk_core::bitcoin::OutPoint; +use spdk_core::silentpayments::SilentPaymentAddress; +use spdk_core::SpClient; use tsify::Tsify; use crate::pcd::{Pcd, PcdCommitments, Roles}; diff --git a/src/process.rs b/src/process.rs index 6b31070..2739acf 100644 --- a/src/process.rs +++ b/src/process.rs @@ -3,7 +3,7 @@ use std::collections::{BTreeMap, HashMap, HashSet}; use std::sync::{Mutex, MutexGuard, OnceLock}; use serde::{Deserialize, Serialize}; -use sp_client::{ +use spdk_core::{ bitcoin::{OutPoint, Transaction}, silentpayments::SilentPaymentAddress, }; @@ -703,7 +703,7 @@ mod tests { use std::str::FromStr; use serde_json::{json, Value}; - use sp_client::{ + use spdk_core::{ bitcoin::{secp256k1::SecretKey, Network, Txid}, silentpayments::SilentPaymentAddress, SpClient, SpendKey, diff --git a/src/secrets.rs b/src/secrets.rs index 277a1d6..01093bf 100644 --- a/src/secrets.rs +++ b/src/secrets.rs @@ -1,8 +1,8 @@ use crate::aes_gcm::aead::{Aead, Payload}; use crate::aes_gcm::Nonce; use crate::crypto::{Aes256Gcm, AnkSharedSecretHash, KeyInit, AAD}; -use crate::sp_client::bitcoin::hashes::Hash; -use crate::sp_client::silentpayments::SilentPaymentAddress; +use crate::spdk_core::bitcoin::hashes::Hash; +use crate::spdk_core::silentpayments::SilentPaymentAddress; use anyhow::{Error, Result}; use serde::ser::SerializeStruct; use serde::{Deserialize, Deserializer, Serialize, Serializer}; diff --git a/src/serialization.rs b/src/serialization.rs index bd3fe9b..9a46988 100644 --- a/src/serialization.rs +++ b/src/serialization.rs @@ -1,8 +1,8 @@ use crate::{pcd::Member, process::Process}; use serde::de::Error; use serde::{Deserialize, Deserializer, Serialize, Serializer}; -use sp_client::bitcoin::hex::{DisplayHex, FromHex}; -use sp_client::bitcoin::OutPoint; +use spdk_core::bitcoin::hex::{DisplayHex, FromHex}; +use spdk_core::bitcoin::OutPoint; use std::collections::{BTreeMap, HashMap}; use tsify::Tsify; diff --git a/src/signature.rs b/src/signature.rs index c739863..1029e6f 100644 --- a/src/signature.rs +++ b/src/signature.rs @@ -1,10 +1,10 @@ use anyhow::Result; use rand::{thread_rng, RngCore}; use serde::{Deserialize, Serialize}; -use sp_client::bitcoin::hashes::{sha256t_hash_newtype, Hash, HashEngine}; -use sp_client::bitcoin::key::Secp256k1; -use sp_client::bitcoin::secp256k1::schnorr::Signature; -use sp_client::bitcoin::secp256k1::{Keypair, Message, PublicKey, SecretKey}; +use spdk_core::bitcoin::hashes::{sha256t_hash_newtype, Hash, HashEngine}; +use spdk_core::bitcoin::key::Secp256k1; +use spdk_core::bitcoin::secp256k1::schnorr::Signature; +use spdk_core::bitcoin::secp256k1::{Keypair, Message, PublicKey, SecretKey}; sha256t_hash_newtype! { pub struct AnkMessageTag = hash_str("4nk/Message"); diff --git a/src/silentpayments.rs b/src/silentpayments.rs index f1d4ade..3b4e309 100644 --- a/src/silentpayments.rs +++ b/src/silentpayments.rs @@ -2,15 +2,15 @@ use std::collections::HashMap; use anyhow::{Error, Result}; use serde::{Deserialize, Serialize}; -use sp_client::bitcoin::absolute::Height; -use sp_client::bitcoin::hashes::Hash; -use sp_client::bitcoin::secp256k1::{PublicKey, SecretKey}; +use spdk_core::bitcoin::absolute::Height; +use spdk_core::bitcoin::hashes::Hash; +use spdk_core::bitcoin::secp256k1::{PublicKey, SecretKey}; use tsify::Tsify; use rand::{thread_rng, Rng}; -use sp_client::bitcoin::{Amount, BlockHash, OutPoint, Transaction, TxOut, Txid, XOnlyPublicKey}; -use sp_client::silentpayments::utils::receiving::calculate_ecdh_shared_secret; -use sp_client::{ +use spdk_core::bitcoin::{Amount, BlockHash, OutPoint, Transaction, TxOut, Txid, XOnlyPublicKey}; +use spdk_core::silentpayments::utils::receiving::calculate_ecdh_shared_secret; +use spdk_core::{ FeeRate, OutputSpendStatus, OwnedOutput, Recipient, SilentPaymentUnsignedTransaction, SpClient, }; @@ -209,7 +209,7 @@ pub fn create_transaction( } recipients.push(Recipient { - address: sp_client::RecipientAddress::Data(commitment.to_vec()), + address: spdk_core::RecipientAddress::Data(commitment.to_vec()), amount: Amount::ZERO, }); diff --git a/src/updates.rs b/src/updates.rs index c77d250..6e4bacf 100644 --- a/src/updates.rs +++ b/src/updates.rs @@ -1,7 +1,7 @@ use anyhow::Result; use serde::{Deserialize, Serialize}; use std::mem; -use sp_client::{ +use spdk_core::{ bitcoin::{absolute::Height, BlockHash, OutPoint}, OwnedOutput, Updater, };