Skip to content

Commit f106e7b

Browse files
quantumclaude
authored andcommitted
feat: migrate from bls-signatures to blsful library
- Replace bls-signatures with blsful (dashpay/agora-blsful) for BLS operations - Add support for legacy BLS format in quorum validation - Update verify_aggregated_commitment_signature to use blsful API - Remove all bls-signatures dependencies and error types - Add comprehensive tests for BLS format compatibility The migration uses dashpay/agora-blsful with main branch to maintain compatibility with both legacy and modern BLS key formats. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 7b9c20a commit f106e7b

File tree

6 files changed

+315
-54
lines changed

6 files changed

+315
-54
lines changed

Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,8 @@ version = "0.39.6"
88
[patch.crates-io.dashcore_hashes]
99
path = "hashes"
1010

11+
[patch.crates-io]
12+
blsful = { git = "https://github.com/dashpay/agora-blsful", rev = "5f017aa1a0452ebc73e47f219f50c906522df4ea" }
13+
1114

1215

dash/Cargo.toml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ signer = ["secp-recovery", "rand", "base64"]
3030
core-block-hash-use-x11 = ["dashcore_hashes/x11"]
3131
bls = ["blsful"]
3232
eddsa = ["ed25519-dalek"]
33-
quorum_validation = ["bls", "bls-signatures"]
33+
quorum_validation = ["bls"]
3434
message_verification = ["bls"]
3535
bincode = [ "dep:bincode", "dep:bincode_derive", "dashcore_hashes/bincode", "dash-network/bincode" ]
3636

@@ -66,12 +66,11 @@ hex = { version= "0.4" }
6666
bincode = { version= "=2.0.0-rc.3", optional = true }
6767
bincode_derive = { version= "=2.0.0-rc.3", optional = true }
6868
bitflags = "2.9.0"
69-
blsful = { version = "3.0.0-pre8", optional = true }
69+
blsful = { git = "https://github.com/dashpay/agora-blsful", rev = "5f017aa1a0452ebc73e47f219f50c906522df4ea", optional = true }
7070
ed25519-dalek = { version = "2.1", features = ["rand_core"], optional = true }
7171
blake3 = "1.8.1"
7272
thiserror = "2"
73-
# version 1.3.5 is 0bb5c5b03249c463debb5cef5f7e52ee66f3aaab
74-
bls-signatures = { git = "https://github.com/dashpay/bls-signatures", rev = "0bb5c5b03249c463debb5cef5f7e52ee66f3aaab", optional = true }
73+
# bls-signatures removed during migration to agora-blsful
7574

7675
[dev-dependencies]
7776
serde_json = "1.0.140"

dash/src/base58.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,6 @@ pub enum Error {
5252
// TODO: Remove this as part of crate-smashing, there should not be any key related errors in this module
5353
Hex(hex::Error),
5454

55-
/// bls signatures related error
56-
#[cfg(feature = "bls-signatures")]
57-
BLSError(String),
5855
/// edwards 25519 related error
5956
#[cfg(feature = "ed25519-dalek")]
6057
Ed25519Dalek(String),
@@ -80,8 +77,6 @@ impl fmt::Display for Error {
8077
Error::TooShort(_) => write!(f, "base58ck data not even long enough for a checksum"),
8178
Error::Secp256k1(ref e) => fmt::Display::fmt(&e, f),
8279
Error::Hex(ref e) => write!(f, "Hexadecimal decoding error: {}", e),
83-
#[cfg(feature = "bls-signatures")]
84-
Error::BLSError(ref e) => write!(f, "BLS error: {}", e),
8580
#[cfg(feature = "ed25519-dalek")]
8681
Error::Ed25519Dalek(ref e) => write!(f, "Ed25519-Dalek error: {}", e),
8782
Error::NotSupported(ref e) => write!(f, "Not supported: {}", e),

dash/src/crypto/key.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,6 @@ pub enum Error {
4343
Base58(base58::Error),
4444
/// secp256k1-related error
4545
Secp256k1(secp256k1::Error),
46-
/// bls signatures related error
47-
#[cfg(feature = "bls-signatures")]
48-
BLSError(String),
4946
/// edwards 25519 related error
5047
#[cfg(feature = "ed25519-dalek")]
5148
Ed25519Dalek(String),
@@ -72,8 +69,6 @@ impl fmt::Display for Error {
7269
Error::NotSupported(string) => {
7370
write!(f, "{}", string.as_str())
7471
}
75-
#[cfg(feature = "bls-signatures")]
76-
Error::BLSError(string) => write!(f, "{}", string.as_str()),
7772
#[cfg(feature = "ed25519-dalek")]
7873
Error::Ed25519Dalek(string) => write!(f, "{}", string.as_str()),
7974
}
@@ -91,8 +86,6 @@ impl std::error::Error for Error {
9186
Hex(e) => Some(e),
9287
InvalidKeyPrefix(_) | InvalidHexLength(_) => None,
9388
NotSupported(_) => None,
94-
#[cfg(feature = "bls-signatures")]
95-
BLSError(_) => None,
9689
#[cfg(feature = "ed25519-dalek")]
9790
Ed25519Dalek(_) => None,
9891
}

dash/src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,6 @@ pub extern crate bitcoinconsensus;
7676
pub extern crate dashcore_hashes as hashes;
7777
pub extern crate secp256k1;
7878

79-
#[cfg(feature = "bls-signatures")]
80-
pub use bls_signatures;
8179
#[cfg(feature = "blsful")]
8280
pub use blsful;
8381
#[cfg(feature = "ed25519-dalek")]

0 commit comments

Comments
 (0)