Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
153 changes: 27 additions & 126 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,20 @@ key-wallet-ffi = { git = "https://github.com/dashpay/rust-dashcore", rev = "aca0
key-wallet-manager = { git = "https://github.com/dashpay/rust-dashcore", rev = "aca020263990a86a15cc1d97ae2cbf965d488db5" }
dash-network = { git = "https://github.com/dashpay/rust-dashcore", rev = "aca020263990a86a15cc1d97ae2cbf965d488db5" }
dashcore-rpc = { git = "https://github.com/dashpay/rust-dashcore", rev = "aca020263990a86a15cc1d97ae2cbf965d488db5" }
dashcore-crypto = { git = "https://github.com/dashpay/rust-dashcore", rev = "aca020263990a86a15cc1d97ae2cbf965d488db5" }
tokio-metrics = "0.5"

# rust-dashcore's bitcoin-crypto takes these crates from this rust-bitcoin rev,
# while other dependencies take the same versions from crates.io. Cargo cannot
# vendor one name and version from two sources, so use the git copies for both.
# Keep the rev equal to bitcoin-crypto's rev in rust-dashcore. A bump past
# dashpay/rust-dashcore#1224 needs only bitcoin-internals; see #5648.
[patch.crates-io]
base58ck = { git = "https://github.com/rust-bitcoin/rust-bitcoin", rev = "7ba35c7c1dd63892bfb9c9395bbd80e2ab5df516" }
bitcoin_hashes = { git = "https://github.com/rust-bitcoin/rust-bitcoin", rev = "7ba35c7c1dd63892bfb9c9395bbd80e2ab5df516" }
bitcoin-internals = { git = "https://github.com/rust-bitcoin/rust-bitcoin", rev = "7ba35c7c1dd63892bfb9c9395bbd80e2ab5df516" }
bitcoin-units = { git = "https://github.com/rust-bitcoin/rust-bitcoin", rev = "7ba35c7c1dd63892bfb9c9395bbd80e2ab5df516" }
Comment thread
PastaPastaPasta marked this conversation as resolved.
Resolved
Comment thread
PastaPastaPasta marked this conversation as resolved.
Resolved

# Size-tuned profile for the iOS `rs-unified-sdk-ffi` staticlib, which
# otherwise ships huge. Inherits `release` and is ONLY used by the iOS
# build (`build_ios.sh --profile release`)
Expand Down
6 changes: 4 additions & 2 deletions packages/rs-dpp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ authors = [

[dependencies]
secp256k1 = { workspace = true }
dash-pkc = { git = "https://github.com/dashpay/base-sdk", rev = "33fcc59e1868c803f9608e0e78ee8bddf3abcee7", default-features = false, features = ["bls"], optional = true }
# Reach dash-pkc through rust-dashcore so its base-sdk rev is the only one in the
# lockfile; a second rev would duplicate dash-pkc and break `cargo vendor`.
dashcore-crypto = { workspace = true, optional = true }
# Keep downstream lockfiles from retaining blst versions without WASM aggregate verification.
# TODO: Remove this constraint once the pinned rust-dashcore dependency graph enforces a compatible blst minimum.
blst = { version = "0.3.17", default-features = false, optional = true }
Expand Down Expand Up @@ -127,7 +129,7 @@ core_key_wallet_manager = ["dep:key-wallet-manager"]
core_key_wallet_serde = ["dep:key-wallet", "key-wallet/serde"]
core_spv = ["dep:dash-spv"]
core_rpc_client = ["dep:dashcore-rpc"]
bls-signatures = ["dashcore/bls", "dep:dash-pkc", "dep:blst", "dep:zeroize"]
bls-signatures = ["dashcore/bls", "dashcore-crypto/bls", "dep:blst", "dep:zeroize"]
ed25519-dalek = ["dashcore/eddsa", "dep:ed25519-dalek"]
all_features = [
"json-conversion",
Expand Down
4 changes: 3 additions & 1 deletion packages/rs-dpp/src/bls/bls_signatures.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
//! Platform BLS keys and Basic signatures backed by rust-dashcore's dash-pkc primitives.

use dash_pkc::bls::{BlsPublicKey, BlsScChia, BlsScIetf, BlsSecretKey, BlsSignature, Fr};
use dashcore_crypto::dash_pkc::bls::{
BlsPublicKey, BlsScChia, BlsScIetf, BlsSecretKey, BlsSignature, Fr,
};
use rand::{CryptoRng, Rng, RngCore};
use std::fmt;
use zeroize::Zeroizing;
Expand Down
6 changes: 4 additions & 2 deletions packages/rs-dpp/tests/bls_compatibility.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
use dash_pkc::bls::{BlsPublicKey, BlsScChia, BlsScIetf, BlsSecretKey, BlsSignature};
use dashcore_crypto::dash_pkc::bls::{
BlsPublicKey, BlsScChia, BlsScIetf, BlsSecretKey, BlsSignature,
};
use dpp::bls::{PublicKey, SecretKey, Signature};
use dpp::core_types::validator::v0::ValidatorV0;
use dpp::core_types::validator_set::v0::ValidatorSetV0;
Expand Down Expand Up @@ -226,7 +228,7 @@ fn should_preserve_historical_scalar_reduction() {
hex::encode(NativeBlsModule.sign(b"scalar boundary", &input).unwrap()),
v.signature.unwrap()
);
let reduced = dash_pkc::bls::Fr::from_bendian_reduce(&input).unwrap();
let reduced = dashcore_crypto::dash_pkc::bls::Fr::from_bendian_reduce(&input).unwrap();
let candidate = BlsSecretKey::<BlsScIetf>::try_from(reduced).unwrap();
assert_eq!(*candidate.to_bytes(), bytes::<32>(&normalized));
} else {
Expand Down
2 changes: 1 addition & 1 deletion packages/rs-sdk/src/platform/dashpay/invitation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1372,7 +1372,7 @@ mod tests {
assert_eq!(decoded.network, network, "network preserved");
assert_eq!(*decoded.inner.to_bytes(), voucher().to_secret_bytes());
// Network byte matches bitcoinj/legacy (0xCC mainnet, 0xEF testnet).
let raw = dpp::dashcore::base58::decode(&wif).unwrap();
let raw = dpp::dashcore::base58::decode_check(&wif).unwrap();
assert_eq!(raw[0], first_byte);
}
}
Expand Down
Loading