Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
eab61fd
refactor: move `impl_bytes_newtype` to `internals`
kwvg Oct 15, 2026
e3a1441
refactor(crypto)!: re-export rust-bitcoin's ECDSA `Signature` types
kwvg Oct 11, 2026
383d042
refactor!: re-export rust-bitcoin's Taproot key types
kwvg Oct 15, 2026
ce0482b
build: bump base SDK packages to dashpay/base-sdk@d9e0d24, drop `codec`
kwvg Oct 13, 2026
9f47a84
refactor: serialize `impl_bytes_newtype!` types through `dash_types`
kwvg Oct 16, 2026
a53f8af
refactor(crypto): serialize `PublicKey` through `dash_types`
kwvg Oct 16, 2026
44159f3
test(crypto): pin the serde layout of the ECDSA signature
kwvg Sep 28, 2026
f934ebb
test(key-wallet): pin the serde layout of the root extended keys
kwvg Sep 28, 2026
3e68161
refactor!: serialize the pinned secp256k1 types through thin newtypes
kwvg Oct 11, 2026
6c19084
refactor!: isolate the backend ECDSA public key type behind its newtype
kwvg Oct 11, 2026
e6f4d02
refactor!: isolate the backend ECDSA secret key type behind its newtype
kwvg Sep 28, 2026
378906b
refactor!: isolate the backend ECDSA signature type behind its newtype
kwvg Sep 28, 2026
aee0a8b
refactor!: isolate the backend ECDSA recoverable signature in a newtype
kwvg Oct 11, 2026
55ec0e4
refactor(dash)!: replace `CompactSignature` with `EcdsaRecSignature`
kwvg Oct 15, 2026
e28c404
refactor(dash)!: replace `MessageSignature` with `EcdsaRecSignature`
kwvg Oct 15, 2026
4687dec
build!: drop `secp256k1` from `key-wallet{,-ffi}`, reap error variants
kwvg Oct 4, 2026
1e0571a
feat(crypto)!: switch ECDSA backend to `dash-pkc`
kwvg Oct 10, 2026
14e55b1
refactor(crypto)!: use `dash-pkc`'s `EcdsaError` directly
kwvg Oct 11, 2026
aff1059
refactor(crypto): forward the ECDSA newtype methods with `delegate`
kwvg Oct 11, 2026
95a03dd
build!: drop the `secp256k1` dependency from `dashcore{,-crypto}`
kwvg Oct 15, 2026
dfd7507
docs: update changelog
kwvg Oct 11, 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
46 changes: 44 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
### Added

- Make `PublicKey::with_serialized` public
- `EcdsaPublicKey`, `EcdsaSecretKey`, `EcdsaSignature`, `EcdsaRecSignature`,
`EcdsaError` and the `ECDSA_*_LEN` constants in `dashcore::ecdsa`
- `EcdsaSecretKey::generate` with the `rand` feature
- `TryFrom<&[u8]>` for `PublicKey`

### Changed

Expand Down Expand Up @@ -41,6 +45,29 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
- **Breaking:** the taproot types come from `bitcoin-crypto`. `Signature`
fields are renamed to `signature` and `sighash_type`, and `taproot::Error` is
`SigFromSliceError`, without a `Secp256k1` variant
- **Breaking:** `ecdsa::Signature` and `ecdsa::SerializedSignature` come from
`bitcoin-crypto`. `Signature` fields and human-readable serde keys are
renamed from `sig` and `hash_ty` to `signature` and `sighash_type`.
`signature` is a `secp256k1` signature.
`DecodeError` and `ParseSignatureError` replace `ecdsa::Error`. Formatting
flags apply to the whole encoding instead of being ignored
- **Breaking:** the `dashcore::ecdsa` newtypes replace the `secp256k1` keys and
signatures in `PublicKey`, `PrivateKey`, `ExtendedPrivKey`, `ExtendedPubKey`,
`RootExtendedPrivKey`, `RootExtendedPubKey`, `Wallet` key derivation,
`AssetLockCreditKeys` and `Signer`. `EcdsaPublicKey` converts into
`XOnlyPublicKey` and `EcdsaSecretKey` into `Keypair`
- **Breaking:** `key::XOnlyPublicKey`, `Keypair`, `Parity`, `TweakedPublicKey`
and `UntweakedPublicKey` come from `bitcoin-crypto`, whose `XOnlyPublicKey`
keeps its parity. `TweakedKeyPair` and `UntweakedKeyPair` are renamed to
`TweakedKeypair` and `UntweakedKeypair`
- **Breaking:** `TaprootError::InvalidInternalKey` and
`TaprootBuilderError::InvalidInternalKey` no longer hold a `secp256k1::Error`
- **Breaking:** `PrivateKey` is no longer `Copy`. `to_bytes` and `to_wif` take
`&self` instead of `self`
- **Breaking:** `Ecdsa(EcdsaError)` replaces `key::Error::Secp256k1` and
`bip32::Error::Secp256k1`. `MessageSignatureError::InvalidEncoding` holds an
`EcdsaError` instead of a `secp256k1::Error`. Failed verification reads
"signature verification failed" instead of "signature failed verification"
- **Breaking:** `dashcore::eddsa` uses the `dash-pkc` types, so `EddsaPkBytes`
and `EddsaSkBytes` no longer implement `BaseCodec` and `EddsaError` changes
shape. Use `EddsaPublicKey::try_from`, `EddsaPkHash::from` and
Expand All @@ -59,10 +86,14 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
- **Breaking:** `ExtendedPrivKey::new_master` rejects seeds outside 16 to 64
bytes with `bip32::Error::InvalidSeedLength`, which
`RootExtendedPrivKey::new_master` returns instead of `InvalidParameter`
- **Breaking:** `MessageSignature::from_slice` rejects headers above 34
- **Breaking:** `EcdsaRecSignature` rejects headers above 34 when read
- Relicense `dash-network`, `dash-network-seeds`, `dash-spv`, `dash-spv-ffi`,
`dash-spv-bench`, `git-state` and `masternode-seeds-fetcher` to CC0-1.0
- All workspace crates declare a MSRV of 1.89
- Human-readable serde of `PublicKey`, `ShortId` and `PlatformNodeId` also
accepts raw bytes, and their deserialization errors read differently
- `RootExtendedPubKey` now supports hybrid SEC1 public keys in human-readable
serde, and writes them back compressed

### Fixed

Expand Down Expand Up @@ -102,8 +133,19 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
`Witness::push_bitcoin_signature`
- **Breaking:** remove `key::Error::NotSupported`,
`bip32::Error::NotSupported` and `dashcore_rpc::Error::Secp256k1`
- **Breaking:** remove `signer::CompactSignature`. Use `MessageSignature`
- **Breaking:** remove `signer::CompactSignature`. Use `EcdsaRecSignature`
instead
- **Breaking:** remove `bip32::PublicKey`, `bip32::PrivateKey`,
`key_wallet::Error::Secp256k1` and `Index<RangeFull>` for `PrivateKey`
- **Breaking:** remove the `secp256k1` re-exports from `dashcore` and
`dashcore-crypto`, `key::Secp256k1`, `key::Verification` and
`TaprootError::InvalidParity`
- **Breaking:** remove the `secp-recovery` and `secp-lowmemory` features.
Message signature recovery is always available
- **Breaking:** remove `MessageSignature`. Signed messages are
`EcdsaRecSignature`s, which carry the key compression, and the
`sign_message` functions `from_slice`, `from_base64`, `to_base64`,
`recover_pubkey` and `is_signed_by_address` replace its methods

### Fixed

Expand Down
7 changes: 3 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,13 @@ bincode = { package = "grovedb-bincode", version = "=2.1.0" }
bincode_derive = { package = "grovedb-bincode-derive", version = "=2.1.0" }
futures = "0.3"
rayon = "1.11"
secp256k1 = "0.33.1" # must match with version used in `bitcoin-crypto` and `dash-pkc`
serde = { version = "1.0.219", default-features = false }
zeroize = { version = "1.8", features = ["derive"] }

# Packages from `dashpay/base-sdk`, MUST share same version ACROSS crates
dash-num = { git = "https://github.com/dashpay/base-sdk", rev = "33fcc59e1868c803f9608e0e78ee8bddf3abcee7", default-features = false }
dash-pkc = { git = "https://github.com/dashpay/base-sdk", rev = "33fcc59e1868c803f9608e0e78ee8bddf3abcee7", default-features = false }
dash-types = { git = "https://github.com/dashpay/base-sdk", rev = "33fcc59e1868c803f9608e0e78ee8bddf3abcee7", default-features = false }
dash-num = { git = "https://github.com/dashpay/base-sdk", rev = "d9e0d241e2e06edff455f88c9cb3b9ce0d8a8ac5", default-features = false }
dash-pkc = { git = "https://github.com/dashpay/base-sdk", rev = "d9e0d241e2e06edff455f88c9cb3b9ce0d8a8ac5", default-features = false }
dash-types = { git = "https://github.com/dashpay/base-sdk", rev = "d9e0d241e2e06edff455f88c9cb3b9ce0d8a8ac5", default-features = false }

# Packages from `rust-bitcoin/rust-bitcoin`, `bitcoin-crypto` uses revision due to `secp256k1`
base58ck = { version = "0.5.0" }
Expand Down
13 changes: 8 additions & 5 deletions crypto/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,28 +14,31 @@ version.workspace = true
default = []

bincode = ["dep:bincode", "dep:bincode_derive", "dashcore_hashes/bincode", "dash-network/bincode"]
bls = ["dash-pkc/bls", "dep:tracing"]
bls = ["dash-pkc/bls", "dash-pkc/portable", "dep:tracing"]
eddsa = ["dash-pkc/eddsa"]
serde = ["dep:serde", "bitcoin-crypto/serde", "dash-types/serde", "dashcore_hashes/serde", "dash-network/serde", "dash-pkc/serde", "secp256k1/serde"]
rand = ["bitcoin-crypto/rand"]
serde = ["dep:serde", "bitcoin-crypto/serde", "dash-types/serde", "dashcore_hashes/serde", "dash-network/serde", "dash-pkc/serde"]

[dependencies]
base58ck = { workspace = true }
bitcoin-crypto = { workspace = true, features = ["std", "hex"] }
bincode = { workspace = true, optional = true }
bincode_derive = { workspace = true, optional = true }
dash-network = { path = "../dash-network" }
dash-pkc = { workspace = true, features = ["std"] }
dash-types = { workspace = true, features = ["codec"] }
dash-pkc = { workspace = true, features = ["ecdsa", "std"] }
dash-types = { workspace = true }
delegate = "0.13"
dashcore_hashes = { path = "../hashes" }
hex-conservative = { workspace = true }
internals = { path = "../internals", package = "dashcore-private" }
secp256k1 = { workspace = true }
serde = { workspace = true, features = ["derive", "alloc"], optional = true }
thiserror = "2"
tracing = { version = "0.1", optional = true }
zeroize = { workspace = true }

[lints.rust]
unexpected_cfgs = { level = "deny", check-cfg = ['cfg(bench)', 'cfg(fuzzing)', 'cfg(kani)'] }

[dev-dependencies]
bincode = { workspace = true, features = ["serde"] }
serde_json = { version = "1.0" }
Loading
Loading