Skip to content
Open
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
49ad468
chore(platform)!: bump rust-dashcore to 719de34b (secp256k1 0.33)
PastaPastaPasta Sep 23, 2026
7b63fc6
ci: bootstrap trusted publisher before feature runner adoption
infraclaw-dash Sep 29, 2026
e2fd47d
Merge pull request #5175: bootstrap trusted CI image publisher
ktechmidas Sep 29, 2026
536a004
Merge branch 'v5.0-dev' into chore/bump-rust-dashcore-secp-033
PastaPastaPasta Oct 5, 2026
bf382b1
fix(sdk)!: require Node.js 20 for the WASM packages
PastaPastaPasta Oct 5, 2026
1b82309
fix(sdk): move v5.0-dev's encrypted-for and moderation-charter code t…
PastaPastaPasta Oct 5, 2026
ad2b8c2
chore: port rust-dashcore migration to v5.1
lklimek Oct 6, 2026
d3861e4
chore: merge v5.1-dev into rust-dashcore migration
lklimek Oct 6, 2026
efa487d
fix(sdk)!: require Node 20 for legacy WASM-DPP consumers
lklimek Oct 6, 2026
3271536
chore: move Node runtime requirements to a separate PR
lklimek Oct 6, 2026
d9149f1
chore(platform): pin rust-dashcore to merged dev
lklimek Oct 6, 2026
c0b4b97
chore!: require Node.js >=22 for JS packages and >=24 for dashmate (#…
lklimek Oct 6, 2026
938b60f
Merge branch 'v5.1-dev' into chore/rust-dashcore-1112-v5.1
lklimek Oct 7, 2026
7c73e98
fix(platform-wallet): retain SPV client and track shutdown through ca…
lklimek Oct 7, 2026
4045c13
refactor: share rust-dashcore BLS backend through dpp::bls (#5320)
lklimek Oct 7, 2026
8377b64
fix(platform-wallet)!: tell a retryable SPV stop from one that needs …
Claudius-Maginificent Oct 8, 2026
9af2033
chore(deps)!: pin rust-dashcore to BLS compatibility fix
lklimek Oct 8, 2026
41e9453
chore(deps): pin rust-dashcore to legacy serde restoration
lklimek Oct 9, 2026
1dbcaaf
fix(drive-abci): preserve quorum key storage independently of serde
lklimek Oct 9, 2026
d8b911d
fix(wallet-ffi): adapt platform node ID hashing to rust-dashcore
lklimek Oct 9, 2026
c1c7b09
fix(test-suite): wait for rotated quorum publication before retrying …
lklimek Oct 9, 2026
069a5ca
fix(dpp): require WASM-compatible blst for external consumers
lklimek Oct 9, 2026
cbb694d
test(platform): freeze historical storage and signing vectors
lklimek Oct 9, 2026
f475f72
chore(deps): pin rust-dashcore to PR 1149
lklimek Oct 9, 2026
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
587 changes: 458 additions & 129 deletions Cargo.lock

Large diffs are not rendered by default.

20 changes: 12 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,20 @@ grovedb-storage = { git = "https://github.com/dashpay/grovedb", rev = "dce8252f8
grovedb-version = { git = "https://github.com/dashpay/grovedb", rev = "dce8252f8665bf06c7bd788e739efba354141690" }
grovedb-epoch-based-storage-flags = { git = "https://github.com/dashpay/grovedb", rev = "dce8252f8665bf06c7bd788e739efba354141690" }
grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "dce8252f8665bf06c7bd788e739efba354141690" }
dashcore = { git = "https://github.com/dashpay/rust-dashcore", rev = "e4208c90786a6854bd498315bcb571ef24182c15" }
dash-network-seeds = { git = "https://github.com/dashpay/rust-dashcore", rev = "e4208c90786a6854bd498315bcb571ef24182c15" }
dash-spv = { git = "https://github.com/dashpay/rust-dashcore", rev = "e4208c90786a6854bd498315bcb571ef24182c15" }
key-wallet = { git = "https://github.com/dashpay/rust-dashcore", rev = "e4208c90786a6854bd498315bcb571ef24182c15" }
key-wallet-ffi = { git = "https://github.com/dashpay/rust-dashcore", rev = "e4208c90786a6854bd498315bcb571ef24182c15" }
key-wallet-manager = { git = "https://github.com/dashpay/rust-dashcore", rev = "e4208c90786a6854bd498315bcb571ef24182c15" }
dash-network = { git = "https://github.com/dashpay/rust-dashcore", rev = "e4208c90786a6854bd498315bcb571ef24182c15" }
dashcore-rpc = { git = "https://github.com/dashpay/rust-dashcore", rev = "e4208c90786a6854bd498315bcb571ef24182c15" }
dashcore = { git = "https://github.com/dashpay/rust-dashcore", rev = "870af146f7656b98e746d1a84f08c725c5af68da" }
dash-network-seeds = { git = "https://github.com/dashpay/rust-dashcore", rev = "870af146f7656b98e746d1a84f08c725c5af68da" }
dash-spv = { git = "https://github.com/dashpay/rust-dashcore", rev = "870af146f7656b98e746d1a84f08c725c5af68da" }
Comment thread
lklimek marked this conversation as resolved.
Outdated
key-wallet = { git = "https://github.com/dashpay/rust-dashcore", rev = "870af146f7656b98e746d1a84f08c725c5af68da" }
key-wallet-ffi = { git = "https://github.com/dashpay/rust-dashcore", rev = "870af146f7656b98e746d1a84f08c725c5af68da" }
key-wallet-manager = { git = "https://github.com/dashpay/rust-dashcore", rev = "870af146f7656b98e746d1a84f08c725c5af68da" }
dash-network = { git = "https://github.com/dashpay/rust-dashcore", rev = "870af146f7656b98e746d1a84f08c725c5af68da" }
dashcore-rpc = { git = "https://github.com/dashpay/rust-dashcore", rev = "870af146f7656b98e746d1a84f08c725c5af68da" }
tokio-metrics = "0.5"

[patch.crates-io]
# Supply no_std aggregate verification while retaining blstrs_plus's exact 0.3.12 pin.
blst = { git = "https://github.com/supranational/blst", rev = "71a00877c75a482e7d44c4e6370c1a7fb82444be" }
Comment thread
lklimek marked this conversation as resolved.
Outdated

# 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
2 changes: 1 addition & 1 deletion packages/js-evo-sdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Evo SDK provides a high-level, strongly-typed interface for interacting with [Da
npm install @dashevo/evo-sdk
```

The package is ESM-only (`"type": "module"`). In CommonJS projects, use dynamic `import()`. Requires Node.js >= 18.18.
The package is ESM-only (`"type": "module"`). In CommonJS projects, use dynamic `import()`. Requires Node.js >= 20 (the bundled WASM draws entropy from the global WebCrypto `crypto` object, which Node.js exposes by default from v19).

## Usage

Expand Down
2 changes: 1 addition & 1 deletion packages/js-evo-sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
},
"sideEffects": false,
"engines": {
"node": ">=18.18"
"node": ">=20"
},
"files": [
"dist/**",
Expand Down
19 changes: 17 additions & 2 deletions packages/rs-dpp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ authors = [
]

[dependencies]
blsful = { git = "https://github.com/dashpay/agora-blsful", rev = "0c34a7a488a0bd1c9a9a2196e793b303ad35c900", optional = true }
ed25519-dalek = { version = "=2.2.0", features = ["rand_core"], optional = true }
anyhow = { version = "1.0.81" }
async-trait = { version = "0.1.79" }
base64 = "0.22.1"
Expand Down Expand Up @@ -90,6 +92,19 @@ once_cell = "1.7"
env_logger = { version = "0.11.8" }
log = { version = "0.4.27" }

# secp256k1 0.33 pulls getrandom 0.3 (via rand 0.9) and key-wallet pulls
# getrandom 0.4; on wasm32-unknown-unknown both refuse to build without their
# `wasm_js` feature, so enable it here where every wasm crate picks it up.
# Unlike getrandom 0.2's `js` (which falls back to Node's `require("crypto")`),
# `wasm_js` only reads `globalThis.crypto.getRandomValues`, which Node.js
# exposes by default from v19; the JS packages therefore require Node >= 20.
[target.'cfg(all(target_arch = "wasm32", target_os = "unknown"))'.dependencies]
getrandom_03 = { package = "getrandom", version = "0.3", features = ["wasm_js"] }
getrandom_04 = { package = "getrandom", version = "0.4", features = ["wasm_js"] }
Comment thread
lklimek marked this conversation as resolved.

[package.metadata.cargo-machete]
ignored = ["getrandom_03", "getrandom_04"]

[features]
default = ["state-transitions"]
core_bincode = ["dashcore/bincode"]
Expand All @@ -102,8 +117,8 @@ 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"]
ed25519-dalek = ["dashcore/eddsa"]
bls-signatures = ["dashcore/bls", "dep:blsful"]
ed25519-dalek = ["dashcore/eddsa", "dep:ed25519-dalek"]
all_features = [
"json-conversion",
"all-system_contracts",
Expand Down
19 changes: 6 additions & 13 deletions packages/rs-dpp/src/address_funds/platform_address.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ use bincode::{Decode, DecodeUntrusted, Encode};
use dashcore::address::Payload;
use dashcore::blockdata::script::ScriptBuf;
use dashcore::hashes::{sha256d, Hash};
use dashcore::key::Secp256k1;
use dashcore::secp256k1::ecdsa::RecoverableSignature;
use dashcore::secp256k1::Message;
use dashcore::signer::CompactSignature;
Expand Down Expand Up @@ -247,8 +246,7 @@ impl From<&PrivateKey> for PlatformAddress {
/// The address is derived as: P2PKH(Hash160(compressed_public_key))
/// where Hash160 = RIPEMD160(SHA256(x)), which is the standard Bitcoin P2PKH derivation.
fn from(private_key: &PrivateKey) -> Self {
let secp = Secp256k1::new();
let pubkey_hash = private_key.public_key(&secp).pubkey_hash();
let pubkey_hash = private_key.public_key().pubkey_hash();
PlatformAddress::P2pkh(*pubkey_hash.as_byte_array())
}
}
Expand Down Expand Up @@ -555,7 +553,6 @@ impl PlatformAddress {

let signable_bytes_hash = sha256d::Hash::hash(signable_bytes).to_byte_array();
let msg = Message::from_digest(signable_bytes_hash);
let secp = Secp256k1::new();

while sig_idx < valid_signatures.len() && pubkey_idx < pubkeys.len() {
signature_verifications += 1;
Expand All @@ -574,10 +571,7 @@ impl PlatformAddress {
ProtocolError::AddressWitnessError(format!("Invalid public key: {}", e))
})?;

if secp
.verify_ecdsa(&msg, &sig.to_standard(), &pub_key.inner)
.is_ok()
{
if sig.to_standard().verify(msg, &pub_key.inner).is_ok() {
matched += 1;
sig_idx += 1;
}
Expand Down Expand Up @@ -798,7 +792,7 @@ mod tests {
use super::*;
use dashcore::blockdata::opcodes::all::*;
use dashcore::hashes::Hash;
use dashcore::secp256k1::{PublicKey as RawPublicKey, Secp256k1, SecretKey as RawSecretKey};
use dashcore::secp256k1::{PublicKey as RawPublicKey, SecretKey as RawSecretKey};
use dashcore::PublicKey;
use platform_value::BinaryData;

Expand All @@ -822,16 +816,15 @@ mod tests {

/// Helper to create a keypair from a 32-byte seed
fn create_keypair(seed: [u8; 32]) -> (RawSecretKey, PublicKey) {
let secp = Secp256k1::new();
let secret_key = RawSecretKey::from_byte_array(&seed).expect("valid secret key");
let raw_public_key = RawPublicKey::from_secret_key(&secp, &secret_key);
let secret_key = RawSecretKey::from_secret_bytes(seed).expect("valid secret key");
let raw_public_key = RawPublicKey::from_secret_key(&secret_key);
let public_key = PublicKey::new(raw_public_key);
(secret_key, public_key)
}

/// Helper to sign data with a secret key
fn sign_data(data: &[u8], secret_key: &RawSecretKey) -> Vec<u8> {
dashcore::signer::sign(data, secret_key.as_ref())
dashcore::signer::sign(data, secret_key.as_secret_bytes())
.expect("signing should succeed")
.to_vec()
}
Expand Down
2 changes: 1 addition & 1 deletion packages/rs-dpp/src/core_types/validator/v0/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -274,8 +274,8 @@ impl ValidatorV0Setters for ValidatorV0 {
#[cfg(test)]
mod tests {
use super::*;
use crate::bls_signatures::SecretKey;
use bincode::config;
use dashcore::blsful::SecretKey;
use rand::prelude::StdRng;
use rand::SeedableRng;

Expand Down
2 changes: 1 addition & 1 deletion packages/rs-dpp/src/core_types/validator_set/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,9 @@ impl ValidatorSetV0Setters for ValidatorSet {
))]
mod json_convertible_tests {
use super::*;
use crate::bls_signatures::{Bls12381G2Impl, SecretKey};
use crate::core_types::validator::v0::ValidatorV0;
use crate::core_types::validator_set::v0::ValidatorSetV0;
use dashcore::blsful::{Bls12381G2Impl, SecretKey};
use dashcore::hashes::Hash;
use dashcore::{ProTxHash, PubkeyHash, QuorumHash};
use platform_value::{platform_value, Value};
Expand Down
4 changes: 2 additions & 2 deletions packages/rs-dpp/src/core_types/validator_set/v0/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use crate::bls_signatures::Bls12381G2Impl;
use crate::bls_signatures::PublicKey as BlsPublicKey;
use crate::core_types::validator::v0::ValidatorV0;
#[cfg(feature = "core-types-serialization")]
Expand All @@ -8,7 +9,6 @@ use bincode::enc::Encoder;
use bincode::error::EncodeError;
#[cfg(feature = "core-types-serialization")]
use bincode::{BorrowDecode, Decode, Encode};
use dashcore::blsful::Bls12381G2Impl;
#[cfg(feature = "core-types-serialization")]
use dashcore::hashes::Hash;
use dashcore::{ProTxHash, QuorumHash};
Expand Down Expand Up @@ -309,8 +309,8 @@ impl ValidatorSetV0Setters for ValidatorSetV0 {
#[cfg(test)]
mod tests {
use super::*;
use crate::bls_signatures::SecretKey;
use bincode::config;
use dashcore::blsful::SecretKey;
use dashcore::PubkeyHash;
use rand::rngs::StdRng;
use rand::SeedableRng;
Expand Down
2 changes: 1 addition & 1 deletion packages/rs-dpp/src/errors/protocol_error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ pub enum ProtocolError {
/// BLS signature error
#[cfg(feature = "bls-signatures")]
#[error(transparent)]
BlsError(#[from] dashcore::blsful::BlsError),
BlsError(#[from] crate::bls_signatures::BlsError),

#[error("Private key wrong size: expected 32, got {got}")]
PrivateKeySizeError { got: u32 },
Expand Down
58 changes: 30 additions & 28 deletions packages/rs-dpp/src/identity/identity_public_key/key_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ use ciborium::value::Value as CborValue;
use dashcore::secp256k1::rand::rngs::StdRng as EcdsaRng;
#[cfg(feature = "random-public-keys")]
use dashcore::secp256k1::rand::SeedableRng;
use dashcore::secp256k1::Secp256k1;
use dashcore::Network;
use itertools::Itertools;
use lazy_static::lazy_static;
Expand Down Expand Up @@ -161,11 +160,12 @@ impl KeyType {
fn random_public_key_data_v0(&self, rng: &mut StdRng) -> Vec<u8> {
match self {
KeyType::ECDSA_SECP256K1 => {
let secp = Secp256k1::new();
let mut rng = EcdsaRng::from_rng(rng).unwrap();
let mut seed = [0u8; 32];
rng.fill(&mut seed);
let mut rng = EcdsaRng::from_seed(seed);
let secret_key = dashcore::secp256k1::SecretKey::new(&mut rng);
let private_key = dashcore::PrivateKey::new(secret_key, Network::Mainnet);
private_key.public_key(&secp).to_bytes()
private_key.public_key().to_bytes()
}
KeyType::BLS12_381 => {
let private_key = bls_signatures::SecretKey::<Bls12381G2Impl>::random(rng);
Expand Down Expand Up @@ -207,12 +207,12 @@ impl KeyType {
) -> Result<Vec<u8>, ProtocolError> {
match self {
KeyType::ECDSA_SECP256K1 => {
let secp = Secp256k1::new();
let secret_key = dashcore::secp256k1::SecretKey::from_byte_array(private_key_bytes)
.map_err(|e| ProtocolError::Generic(e.to_string()))?;
let secret_key =
dashcore::secp256k1::SecretKey::from_secret_bytes(*private_key_bytes)
.map_err(|e| ProtocolError::Generic(e.to_string()))?;
let private_key = dashcore::PrivateKey::new(secret_key, network);

Ok(private_key.public_key(&secp).to_bytes())
Ok(private_key.public_key().to_bytes())
}
KeyType::BLS12_381 => {
#[cfg(feature = "bls-signatures")]
Expand All @@ -237,18 +237,17 @@ impl KeyType {
));
}
KeyType::ECDSA_HASH160 => {
let secp = Secp256k1::new();
let secret_key = dashcore::secp256k1::SecretKey::from_byte_array(private_key_bytes)
.map_err(|e| ProtocolError::Generic(e.to_string()))?;
let secret_key =
dashcore::secp256k1::SecretKey::from_secret_bytes(*private_key_bytes)
.map_err(|e| ProtocolError::Generic(e.to_string()))?;
let private_key = dashcore::PrivateKey::new(secret_key, network);

Ok(ripemd160_sha256(private_key.public_key(&secp).to_bytes().as_slice()).to_vec())
Ok(ripemd160_sha256(private_key.public_key().to_bytes().as_slice()).to_vec())
}
KeyType::EDDSA_25519_HASH160 => {
#[cfg(feature = "ed25519-dalek")]
{
let key_pair =
dashcore::ed25519_dalek::SigningKey::from_bytes(private_key_bytes);
let key_pair = crate::ed25519_dalek::SigningKey::from_bytes(private_key_bytes);
Ok(ripemd160_sha256(key_pair.verifying_key().to_bytes().as_slice()).to_vec())
}
#[cfg(not(feature = "ed25519-dalek"))]
Expand All @@ -267,46 +266,49 @@ impl KeyType {
pub fn random_public_and_private_key_data_v0(&self, rng: &mut StdRng) -> (Vec<u8>, [u8; 32]) {
match self {
KeyType::ECDSA_SECP256K1 => {
let secp = Secp256k1::new();
let mut rng = EcdsaRng::from_rng(rng).unwrap();
let mut seed = [0u8; 32];
rng.fill(&mut seed);
let mut rng = EcdsaRng::from_seed(seed);
let secret_key = dashcore::secp256k1::SecretKey::new(&mut rng);
let private_key = dashcore::PrivateKey::new(secret_key, Network::Mainnet);
(
private_key.public_key(&secp).to_bytes(),
private_key.inner.secret_bytes(),
private_key.public_key().to_bytes(),
private_key.inner.to_secret_bytes(),
)
}
KeyType::BLS12_381 => {
let private_key = dashcore::blsful::SecretKey::<Bls12381G2Impl>::random(rng);
let private_key = crate::bls_signatures::SecretKey::<Bls12381G2Impl>::random(rng);
let public_key_bytes = private_key.public_key().0.to_compressed().to_vec();
(public_key_bytes, private_key.0.to_be_bytes())
}
KeyType::ECDSA_HASH160 => {
let secp = Secp256k1::new();
let mut rng = EcdsaRng::from_rng(rng).unwrap();
let mut seed = [0u8; 32];
rng.fill(&mut seed);
let mut rng = EcdsaRng::from_seed(seed);
let secret_key = dashcore::secp256k1::SecretKey::new(&mut rng);
let private_key = dashcore::PrivateKey::new(secret_key, Network::Mainnet);
(
ripemd160_sha256(private_key.public_key(&secp).to_bytes().as_slice()).to_vec(),
private_key.inner.secret_bytes(),
ripemd160_sha256(private_key.public_key().to_bytes().as_slice()).to_vec(),
private_key.inner.to_secret_bytes(),
)
}
KeyType::EDDSA_25519_HASH160 => {
let key_pair = dashcore::ed25519_dalek::SigningKey::generate(rng);
let key_pair = crate::ed25519_dalek::SigningKey::generate(rng);
(
ripemd160_sha256(key_pair.verifying_key().to_bytes().as_slice()).to_vec(),
key_pair.to_bytes(),
)
}
KeyType::BIP13_SCRIPT_HASH => {
//todo (using ECDSA_HASH160 for now)
let secp = Secp256k1::new();
let mut rng = EcdsaRng::from_rng(rng).unwrap();
let mut seed = [0u8; 32];
rng.fill(&mut seed);
let mut rng = EcdsaRng::from_seed(seed);
let secret_key = dashcore::secp256k1::SecretKey::new(&mut rng);
let private_key = dashcore::PrivateKey::new(secret_key, Network::Mainnet);
(
ripemd160_sha256(private_key.public_key(&secp).to_bytes().as_slice()).to_vec(),
private_key.inner.secret_bytes(),
ripemd160_sha256(private_key.public_key().to_bytes().as_slice()).to_vec(),
private_key.inner.to_secret_bytes(),
)
}
}
Expand Down
Loading
Loading