From 7e43c134f0e10f07df8ce1b6ee5b042aa13d3ea4 Mon Sep 17 00:00:00 2001 From: Kittywhiskers Van Gogh <63189531+kwvg@users.noreply.github.com> Date: Thu, 17 Sep 2026 22:38:43 +0530 Subject: [PATCH 1/3] pkc%refac(test): replace `tests` with common module against public API --- pkgs/pkc/Cargo.toml | 5 +-- pkgs/pkc/bench/bls.rs | 3 +- pkgs/pkc/bench/ecdsa.rs | 3 +- pkgs/pkc/bench/eddsa.rs | 3 +- pkgs/pkc/bench/main.rs | 5 +++ pkgs/pkc/src/bls/mod.rs | 6 +-- pkgs/pkc/src/bls/tests.rs | 37 +---------------- pkgs/pkc/src/ecdsa/mod.rs | 5 +-- pkgs/pkc/src/ecdsa/tests.rs | 10 +---- pkgs/pkc/src/eddsa/mod.rs | 5 +-- pkgs/pkc/src/eddsa/tests.rs | 8 +--- pkgs/pkc/src/lib.rs | 3 ++ pkgs/pkc/src/tests.rs | 80 +++++++++++++++++++++++++++++++++++++ 13 files changed, 104 insertions(+), 69 deletions(-) create mode 100644 pkgs/pkc/src/tests.rs diff --git a/pkgs/pkc/Cargo.toml b/pkgs/pkc/Cargo.toml index a128de4f..832a8b7a 100644 --- a/pkgs/pkc/Cargo.toml +++ b/pkgs/pkc/Cargo.toml @@ -35,7 +35,6 @@ secp256k1 = { version = "0.33.1", default-features = false, features = [ "recovery", ], optional = true } rand_core = { workspace = true, optional = true } -rstest = { version = "0.25", optional = true } serde = { version = "1", default-features = false, features = [ "alloc", "derive", @@ -73,8 +72,7 @@ codec = [ ecdsa = ["dep:rand_core", "dep:secp256k1"] eddsa = ["dep:ed25519-dalek", "dep:rand_core"] serde = ["codec", "dep:serde", "dash-num/serde", "dash-types/serde"] -full = ["bls", "codec", "ecdsa", "eddsa", "serde", "std", "tests"] -tests = ["std", "dep:rstest"] +full = ["bls", "codec", "ecdsa", "eddsa", "serde", "std"] [lints] workspace = true @@ -83,4 +81,3 @@ workspace = true name = "pkc" path = "bench/main.rs" harness = false -required-features = ["tests"] diff --git a/pkgs/pkc/bench/bls.rs b/pkgs/pkc/bench/bls.rs index bc4295c8..60899061 100644 --- a/pkgs/pkc/bench/bls.rs +++ b/pkgs/pkc/bench/bls.rs @@ -6,7 +6,8 @@ //! Benchmarks for BLS schemes. -use dash_pkc::bls::tests::{sequential_ids, test_ikm, test_msg}; +use crate::common::bls::{sequential_ids, test_ikm, test_msg}; + use dash_pkc::bls::{BlsPublicKey, BlsScChia, BlsScIetf, BlsScheme, BlsSecretKey, BlsSigShare, BlsSignature}; use divan::{counter::ItemsCount, Bencher}; use getrandom::SysRng; diff --git a/pkgs/pkc/bench/ecdsa.rs b/pkgs/pkc/bench/ecdsa.rs index a3a0134c..e1cdb6d1 100644 --- a/pkgs/pkc/bench/ecdsa.rs +++ b/pkgs/pkc/bench/ecdsa.rs @@ -6,7 +6,8 @@ //! Benchmarks for the ecdsa (secp256k1) feature -use dash_pkc::ecdsa::tests::{message_hash, ALICE_SK}; +use crate::common::ecdsa::{message_hash, ALICE_SK}; + use dash_pkc::ecdsa::{Compression, EcdsaPublicKey, EcdsaSecretKey}; fn test_key() -> EcdsaSecretKey { diff --git a/pkgs/pkc/bench/eddsa.rs b/pkgs/pkc/bench/eddsa.rs index 6557f7c1..0c9a3045 100644 --- a/pkgs/pkc/bench/eddsa.rs +++ b/pkgs/pkc/bench/eddsa.rs @@ -6,7 +6,8 @@ //! Benchmarks for the `eddsa` (ed25519) feature -use dash_pkc::eddsa::tests::{ALICE_PK, ALICE_SK, MSG}; +use crate::common::eddsa::{ALICE_PK, ALICE_SK, MSG}; + use dash_pkc::eddsa::{EddsaPkBytes, EddsaPublicKey, EddsaSecretKey}; use dash_types::Hashable; diff --git a/pkgs/pkc/bench/main.rs b/pkgs/pkc/bench/main.rs index 2c4bdd96..b256f20d 100644 --- a/pkgs/pkc/bench/main.rs +++ b/pkgs/pkc/bench/main.rs @@ -9,8 +9,13 @@ expect(clippy::unwrap_used, reason = "benchmarks rely on trusted test vectors") )] +extern crate alloc; + #[cfg(feature = "bls")] mod bls; +#[cfg(any(feature = "bls", feature = "ecdsa", feature = "eddsa"))] +#[path = "../src/tests.rs"] +mod common; #[cfg(feature = "ecdsa")] mod ecdsa; #[cfg(feature = "eddsa")] diff --git a/pkgs/pkc/src/bls/mod.rs b/pkgs/pkc/src/bls/mod.rs index ede00e8e..adb8aab3 100644 --- a/pkgs/pkc/src/bls/mod.rs +++ b/pkgs/pkc/src/bls/mod.rs @@ -48,10 +48,8 @@ cfg_if::cfg_if! { pub(crate) mod group; pub(crate) mod scalar; pub(crate) mod scheme_ops; - - #[cfg(any(test, feature = "tests"))] - #[doc(hidden)] - pub mod tests; + #[cfg(test)] + pub(crate) mod tests; pub use ies_ops::{BlsIesBlob, BlsIesMulti}; pub use public_ops::BlsPublicKey; diff --git a/pkgs/pkc/src/bls/tests.rs b/pkgs/pkc/src/bls/tests.rs index 7c53d073..23517cee 100644 --- a/pkgs/pkc/src/bls/tests.rs +++ b/pkgs/pkc/src/bls/tests.rs @@ -6,11 +6,10 @@ //! Shared test fixtures and constants. -use crate::bls::BlsShareId; use crate::prelude::*; +pub(crate) use crate::tests::bls::{make_id, sequential_ids, test_ikm, test_msg}; use cfg_if::cfg_if; -use dash_types::Numeric; use hex_conservative::hex; /// BLS12-381 scalar field order r, big-endian. @@ -69,40 +68,6 @@ pub const fn ietf_g1_encoding(mut chia: [u8; 48]) -> [u8; 48] { chia } -/// Build a participant id whose field element is `i`. -pub fn make_id(i: u32) -> BlsShareId { - let mut bytes = [0u8; 32]; - bytes[28..32].copy_from_slice(&i.to_be_bytes()); - BlsShareId::from_lendian(bytes) -} - -/// Build `n` sequential participant ids `1..=n`. -pub fn sequential_ids(n: usize) -> Vec { - (1..=n).map(|i| make_id(i as u32)).collect() -} - -/// Build a distinct 32-byte IKM from an index, for multi-signer tests. -/// -/// The index is carried in full, so a run of more than 256 signers gets that -/// many distinct keys instead of wrapping at 256. -pub fn test_ikm(i: usize) -> [u8; 32] { - let mut ikm = [0u8; 32]; - ikm[..8].copy_from_slice(&(i as u64).to_be_bytes()); - ikm[24..].copy_from_slice(&(i as u64).wrapping_add(1).to_be_bytes()); - ikm -} - -/// Build a distinct 32-byte message from an index, for multi-signer tests. -/// -/// As with [`test_ikm`], the index is carried in full to keep messages -/// distinct past 256. -pub fn test_msg(i: usize) -> [u8; 32] { - let mut m = [0u8; 32]; - m[..8].copy_from_slice(&(i as u64).to_be_bytes()); - m[8..16].copy_from_slice(&(i as u64).wrapping_mul(7).to_be_bytes()); - m -} - cfg_if! { if #[cfg(test)] { use dash_dev::Corpus; diff --git a/pkgs/pkc/src/ecdsa/mod.rs b/pkgs/pkc/src/ecdsa/mod.rs index fcdc1f50..477ffe7d 100644 --- a/pkgs/pkc/src/ecdsa/mod.rs +++ b/pkgs/pkc/src/ecdsa/mod.rs @@ -59,11 +59,10 @@ cfg_if::cfg_if! { mod secret_ops; mod sig_ops; mod sig_rec_ops; - - #[cfg(any(test, feature = "tests"))] + #[cfg(test)] #[expect(clippy::unwrap_used, reason = "test code")] #[allow(dead_code, reason = "usage dependent on build flags")] - pub mod tests; + pub(crate) mod tests; pub use public_ops::EcdsaPublicKey; pub use secret_ops::EcdsaSecretKey; diff --git a/pkgs/pkc/src/ecdsa/tests.rs b/pkgs/pkc/src/ecdsa/tests.rs index 8a7501fc..1d65d781 100644 --- a/pkgs/pkc/src/ecdsa/tests.rs +++ b/pkgs/pkc/src/ecdsa/tests.rs @@ -8,11 +8,11 @@ use super::curve_consts::ORDER; use crate::ecdsa::{Compression, EcdsaPublicKey, EcdsaRecSignature, EcdsaSecretKey, EcdsaSignature}; +pub(crate) use crate::tests::ecdsa::{message_hash, ALICE_SK}; use hex_conservative::hex; use rstest::fixture; -pub const ALICE_SK: [u8; 32] = hex!("0123456789abcdef0123456789abcdeffedcba9876543210fedcba9876543210"); pub const BOB_SK: [u8; 32] = hex!("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"); pub const MSG: [u8; 32] = hex!("deadbeefdeadbeefdeadbeefdeadbeefcafebabecafebabecafebabecafebabe"); @@ -30,14 +30,6 @@ pub(crate) fn negate_scalar(s: &[u8]) -> [u8; 32] { out } -/// Derive a distinct 32-byte message digest from an index. -pub fn message_hash(i: u16) -> [u8; 32] { - let mut h = [0u8; 32]; - h[0] = i as u8; - h[31] = (i >> 8) as u8; - h -} - #[fixture] pub fn alice_pk() -> EcdsaPublicKey { alice_sk().public_key() diff --git a/pkgs/pkc/src/eddsa/mod.rs b/pkgs/pkc/src/eddsa/mod.rs index 95831011..0eb65141 100644 --- a/pkgs/pkc/src/eddsa/mod.rs +++ b/pkgs/pkc/src/eddsa/mod.rs @@ -23,11 +23,10 @@ cfg_if::cfg_if! { mod public_ops; mod secret_ops; mod sig_ops; - - #[cfg(any(test, feature = "tests"))] + #[cfg(test)] #[expect(clippy::unwrap_used, reason = "test code")] #[allow(dead_code, reason = "usage dependent on build flags")] - pub mod tests; + pub(crate) mod tests; pub use public_ops::EddsaPublicKey; pub use secret_ops::EddsaSecretKey; diff --git a/pkgs/pkc/src/eddsa/tests.rs b/pkgs/pkc/src/eddsa/tests.rs index cb2ed10c..9dc0da12 100644 --- a/pkgs/pkc/src/eddsa/tests.rs +++ b/pkgs/pkc/src/eddsa/tests.rs @@ -7,17 +7,11 @@ //! Common test definitions. use crate::eddsa::{EddsaPublicKey, EddsaSecretKey, EddsaSignature}; +pub(crate) use crate::tests::eddsa::{ALICE_PK, ALICE_SK, MSG}; use hex_conservative::hex; use rstest::fixture; -/// The message the signature fixtures cover. -pub const MSG: &[u8] = b"dash platform node"; - -/// The platform account secret at DIP-9 `m/9'/5'/3'/4'` for the -/// "abandon ... about" mnemonic. -pub const ALICE_SK: [u8; 32] = hex!("80035d9c2f89971a9c9fad826bba8be9328f1686ae555e912949c2c32800c379"); -pub const ALICE_PK: [u8; 32] = hex!("c352476b459846a552263aef12d35ce05d03ae9c6cfa380747d3700cdbb5c75f"); pub const ALICE_PK_HASH: &str = "834b7cd3bba35f514f36704b5a553423c39a8df8"; /// An unrelated secret, for tests that need two distinct keys. diff --git a/pkgs/pkc/src/lib.rs b/pkgs/pkc/src/lib.rs index 3d4929fc..066a3b73 100644 --- a/pkgs/pkc/src/lib.rs +++ b/pkgs/pkc/src/lib.rs @@ -9,6 +9,7 @@ #![no_std] extern crate alloc; +extern crate self as dash_pkc; #[cfg(feature = "std")] extern crate std; @@ -16,6 +17,8 @@ extern crate std; mod aes_cbc; #[allow(unused_imports, reason = "ergonomic shim, exports may be unused")] mod prelude; +#[cfg(test)] +mod tests; pub mod bls; pub mod ecdsa; diff --git a/pkgs/pkc/src/tests.rs b/pkgs/pkc/src/tests.rs new file mode 100644 index 00000000..a26c3384 --- /dev/null +++ b/pkgs/pkc/src/tests.rs @@ -0,0 +1,80 @@ +// +// Copyright (c) 2026-present, The Dash Core developers +// SPDX-License-Identifier: MIT +// See the accompanying file LICENSE or https://opensource.org/license/MIT +// + +//! Common test definitions. + +#[cfg(feature = "bls")] +pub mod bls { + use dash_pkc::bls::BlsShareId; + use dash_types::Numeric; + + use alloc::vec::Vec; // nosemgrep: prelude-no-use-alloc + + /// Build a participant id whose field element is `i`. + pub fn make_id(i: u32) -> BlsShareId { + let mut bytes = [0u8; 32]; + bytes[28..32].copy_from_slice(&i.to_be_bytes()); + BlsShareId::from_lendian(bytes) + } + + /// Build `n` sequential participant ids `1..=n`. + pub fn sequential_ids(n: usize) -> Vec { + (1..=n).map(|i| make_id(i as u32)).collect() + } + + /// Build a distinct 32-byte IKM from an index, for multi-signer runs. + /// + /// The index is carried in full, so a run of more than 256 signers gets that + /// many distinct keys instead of wrapping at 256. + pub fn test_ikm(i: usize) -> [u8; 32] { + let mut ikm = [0u8; 32]; + ikm[..8].copy_from_slice(&(i as u64).to_be_bytes()); + ikm[24..].copy_from_slice(&(i as u64).wrapping_add(1).to_be_bytes()); + ikm + } + + /// Build a distinct 32-byte message from an index, for multi-signer runs. + /// + /// As with [`test_ikm`], the index is carried in full to keep messages + /// distinct past 256. + pub fn test_msg(i: usize) -> [u8; 32] { + let mut m = [0u8; 32]; + m[..8].copy_from_slice(&(i as u64).to_be_bytes()); + m[8..16].copy_from_slice(&(i as u64).wrapping_mul(7).to_be_bytes()); + m + } +} + +#[cfg(feature = "ecdsa")] +pub mod ecdsa { + use hex_conservative::hex; + + /// Fixed secret key scalar the signing benchmarks run against. + pub const ALICE_SK: [u8; 32] = hex!("0123456789abcdef0123456789abcdeffedcba9876543210fedcba9876543210"); + + /// Derive a distinct 32-byte message digest from an index. + pub fn message_hash(i: u16) -> [u8; 32] { + let mut h = [0u8; 32]; + h[0] = i as u8; + h[31] = (i >> 8) as u8; + h + } +} + +#[cfg(feature = "eddsa")] +pub mod eddsa { + use hex_conservative::hex; + + /// The message the signing benchmarks cover. + pub const MSG: &[u8] = b"dash platform node"; + + /// The platform account secret at DIP-9 `m/9'/5'/3'/4'` for the + /// "abandon ... about" mnemonic. + pub const ALICE_SK: [u8; 32] = hex!("80035d9c2f89971a9c9fad826bba8be9328f1686ae555e912949c2c32800c379"); + + /// The public key [`ALICE_SK`] derives to. + pub const ALICE_PK: [u8; 32] = hex!("c352476b459846a552263aef12d35ce05d03ae9c6cfa380747d3700cdbb5c75f"); +} From 05e1a7a89245c103aab45eb57c52cd437e6f2448 Mon Sep 17 00:00:00 2001 From: Kittywhiskers Van Gogh <63189531+kwvg@users.noreply.github.com> Date: Thu, 17 Sep 2026 21:48:50 +0530 Subject: [PATCH 2/3] pkc%doc: flesh out basic README, link to Zensical, clarify feat policy --- docs/pkc/README.md | 9 ++++++ docs/pkc/changelog.md | 9 ++++++ docs/zensical.toml | 4 +++ pkgs/pkc/Cargo.toml | 43 +++++++++++++++++++++------- pkgs/pkc/README.md | 66 +++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 121 insertions(+), 10 deletions(-) create mode 100644 docs/pkc/README.md create mode 100644 docs/pkc/changelog.md diff --git a/docs/pkc/README.md b/docs/pkc/README.md new file mode 100644 index 00000000..f5797aca --- /dev/null +++ b/docs/pkc/README.md @@ -0,0 +1,9 @@ + + +> [!NOTE] +> This is a spliced page meant for publication on Zensical. See [`pkgs/pkc`](../../pkgs/pkc/) for available +> documentation. + + + + diff --git a/docs/pkc/changelog.md b/docs/pkc/changelog.md new file mode 100644 index 00000000..cb5234f9 --- /dev/null +++ b/docs/pkc/changelog.md @@ -0,0 +1,9 @@ + + +> [!NOTE] +> This is a spliced page meant for publication on Zensical. See [`pkgs/pkc`](../../pkgs/pkc/) for available +> documentation. + + + + diff --git a/docs/zensical.toml b/docs/zensical.toml index 95baa935..11297b4a 100644 --- a/docs/zensical.toml +++ b/docs/zensical.toml @@ -32,6 +32,10 @@ nav = [ { "Overview" = "num/README.md" }, { "Changelog" = "num/changelog.md" }, ] }, + { "dash-pkc" = [ + { "Overview" = "pkc/README.md" }, + { "Changelog" = "pkc/changelog.md" }, + ] }, { "Samples" = [ { "Genesis Solver" = "samples/solver/README.md" }, { "Object Parser" = "samples/parser/README.md" }, diff --git a/pkgs/pkc/Cargo.toml b/pkgs/pkc/Cargo.toml index 832a8b7a..2974e501 100644 --- a/pkgs/pkc/Cargo.toml +++ b/pkgs/pkc/Cargo.toml @@ -16,8 +16,6 @@ aes = { version = "0.8", default-features = false, features = [ base58ck = { workspace = true, optional = true, features = ["alloc"] } bitcoin_hashes = { workspace = true, features = ["alloc"] } blst = { version = "0.3", default-features = false, optional = true } -ff = { version = "0.14", default-features = false, optional = true } -group = { version = "0.14", default-features = false, optional = true } cfg-if = "1" dash-num = { version = "0.1.0-beta", path = "../num", default-features = false } dash-types = { version = "0.1.0-beta", path = "../types", default-features = false } @@ -27,14 +25,16 @@ ed25519-dalek = { version = "3", default-features = false, features = [ "signature", "zeroize", ], optional = true } +ff = { version = "0.14", default-features = false, optional = true } +group = { version = "0.14", default-features = false, optional = true } hex-conservative = { workspace = true, features = [ "alloc", ] } +rand_core = { workspace = true, optional = true } secp256k1 = { version = "0.33.1", default-features = false, features = [ "alloc", "recovery", ], optional = true } -rand_core = { workspace = true, optional = true } serde = { version = "1", default-features = false, features = [ "alloc", "derive", @@ -54,8 +54,13 @@ rstest = "0.25" serde = { version = "1", features = ["derive"] } [features] -default = [] -std = ["base58ck?/std", "bitcoin_hashes/std", "dash-types/std"] +default = ["codec"] +std = [ + "base58ck?/std", + "bitcoin_hashes/std", + "dash-types/std", +] + bls = [ "dep:aes", "dep:blst", @@ -65,14 +70,32 @@ bls = [ "dep:sha2", ] codec = [ - "dep:base58ck", "dash-num/codec", "dash-types/codec", + "dep:base58ck", +] +ecdsa = [ + "dep:rand_core", + "dep:secp256k1", +] +eddsa = [ + "dep:ed25519-dalek", + "dep:rand_core", +] +full = [ + "bls", + "codec", + "ecdsa", + "eddsa", + "serde", + "std", +] +serde = [ + "codec", + "dash-num/serde", + "dash-types/serde", + "dep:serde", ] -ecdsa = ["dep:rand_core", "dep:secp256k1"] -eddsa = ["dep:ed25519-dalek", "dep:rand_core"] -serde = ["codec", "dep:serde", "dash-num/serde", "dash-types/serde"] -full = ["bls", "codec", "ecdsa", "eddsa", "serde", "std"] [lints] workspace = true diff --git a/pkgs/pkc/README.md b/pkgs/pkc/README.md index de163a73..80e69c52 100644 --- a/pkgs/pkc/README.md +++ b/pkgs/pkc/README.md @@ -1,4 +1,70 @@ [![dash-pkc](https://img.shields.io/github/actions/workflow/status/dashpay/base-sdk/pkg_pkc.yml?style=flat&logo=github&logoColor=white&label=pkc)](https://github.com/dashpay/base-sdk/actions/workflows/pkg_pkc.yml) [![dash-pkc](https://img.shields.io/codecov/c/github/dashpay/base-sdk/develop?flag=dash-pkc&style=flat&logo=codecov&logoColor=white&label=pkc)](https://app.codecov.io/github/dashpay/base-sdk/tree/develop/pkgs%2Fpkc) +> [!WARNING] +> +> It is heavily advised **against** using this library for new consensus implementations and to use established +> spec-conformant libraries like [supranational/blst](https://github.com/supranational/blst) as this library codifies +> primitives predating the final IETF spec and includes a non-standard (now legacy) scheme. +> +> **This library has not undergone a formal security review.** + # dash-pkc + +This crate supplies the curve primitives for signing, verifying and encrypting used by the Dash Base SDK for +consensus-stable types, including + +* Distinct byte bag and operative types to allow parsing _without_ pulling in crypto dependencies with native + zeroization and constant-time comparison. +* A bug-compatible implementation of the sunset BLS12-381 scheme used by the reference implementation (also known as + "legacy" or Chia scheme) and the current active (i.e. "basic") scheme. +* Shared DH secret derivation and encryption using BLS12-381's integrated encryption scheme. +* A consensus-compatible wrapper around secp256k1 with support for DER (en/de)coding, recoverable signatures and + Bitcoin-derived compression semantics. +* Scalar and point tweaks for BLS12-381 and secp256k1 + +## Usage + +To import `dash-pkc` to your project, add the following to the `[dependencies]` section in `Cargo.toml` + +```toml +dash-pkc = "0.1.0-beta" +``` + +To use an unpublished revision of this crate, identify the commit hash to pin against and use the following replacing +the value of `rev`. + +```toml +dash-pkc = { git = "https://github.com/dashpay/base-sdk", rev = "a1b2c3d4e5f67890abcdef1234567890abcdef" } +``` + +To build this crate on a clone of the repository, at the repository root, run the following + +```bash +cargo build --package dash-pkc --all-features +``` + +## Features + +This crate is `#![no_std]` + `alloc` by default. + +| Feature | Default | Description | +| ------- | ------- | ----------- | +| `bls` | | Enables support for BLS12-381 operations backed by [`blst`](https://docs.rs/blst). Byte types are available without enabling this feature. | +| `codec` | :white_check_mark: | Enables support for encoding and decoding types using [`bitcoin-consensus-encoding`](https://docs.rs/bitcoin-consensus-encoding) | +| `ecdsa` | | Enables secp256k1 operations backed by [`rust-secp256k1`](https://docs.rs/secp256k1). Byte types are available without enabling this feature. | +| `eddsa` | | Enables ed25519 operations backed by [`ed25519-dalek`](https://docs.rs/ed25519-dalek). Byte types are available without enabling this feature. | +| `full` | | Enables all features and `std` support. | +| `serde` | | Enables support for encoding and decoding `codec`-backed types using [`serde`](https://github.com/serde-rs/serde). _Implies `codec`._ | + +## Documentation + + +Documentation for the most recent release of `dash-pkc` is available at https://dashpay.github.io/base-sdk/pkc and +changes between versions are recorded in the [changelog](https://dashpay.github.io/base-sdk/pkc/changelog). + +## License + + +`dash-pkc` is released under the terms of the MIT license. Copyright © 2026-present, The Dash Core developers. +To read a copy of the license terms, visit https://opensource.org/license/MIT. From 78745b9af9c88c77ebe8f2adf6e3e02ad865b3d0 Mon Sep 17 00:00:00 2001 From: Kittywhiskers Van Gogh <63189531+kwvg@users.noreply.github.com> Date: Tue, 15 Sep 2026 18:22:32 +0530 Subject: [PATCH 3/3] pkc%chore: prepare crate for initial release, update changelog --- Cargo.lock | 2 +- docs/samples/Cargo.lock | 2 +- pkgs/p2p_core/Cargo.toml | 2 +- pkgs/pkc/CHANGELOG.md | 2 ++ pkgs/pkc/Cargo.toml | 20 ++++++++++++++++++-- pkgs/pkc/LICENSE | 21 +++++++++++++++++++++ pkgs/primitives/Cargo.toml | 2 +- pkgs/script/Cargo.toml | 2 +- 8 files changed, 46 insertions(+), 7 deletions(-) create mode 100644 pkgs/pkc/LICENSE diff --git a/Cargo.lock b/Cargo.lock index d03c25ae..6670a7a1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -513,7 +513,7 @@ dependencies = [ [[package]] name = "dash-pkc" -version = "0.0.0" +version = "0.1.0-beta" dependencies = [ "aes", "base58ck", diff --git a/docs/samples/Cargo.lock b/docs/samples/Cargo.lock index ae12d31e..8f007eee 100644 --- a/docs/samples/Cargo.lock +++ b/docs/samples/Cargo.lock @@ -128,7 +128,7 @@ dependencies = [ [[package]] name = "dash-pkc" -version = "0.0.0" +version = "0.1.0-beta" dependencies = [ "base58ck", "bitcoin_hashes 1.2.0", diff --git a/pkgs/p2p_core/Cargo.toml b/pkgs/p2p_core/Cargo.toml index cbf71742..bdf69975 100644 --- a/pkgs/p2p_core/Cargo.toml +++ b/pkgs/p2p_core/Cargo.toml @@ -32,7 +32,7 @@ bitcoin-consensus-encoding = { workspace = true, features = ["alloc"] } bitcoin-internals = { workspace = true } cfg-if = "1" dash-num = { version = "0.1.0-beta", path = "../num", features = ["codec"] } -dash-pkc = { version = "0.0.0", path = "../pkc", features = ["codec"] } +dash-pkc = { version = "0.1.0-beta", path = "../pkc", features = ["codec"] } dash-script = { version = "0.0.0", path = "../script" } dash-params = { version = "0.0.0", path = "../params" } dash-primitives = { version = "0.0.0", path = "../primitives" } diff --git a/pkgs/pkc/CHANGELOG.md b/pkgs/pkc/CHANGELOG.md index d9acb68c..044a6b8b 100644 --- a/pkgs/pkc/CHANGELOG.md +++ b/pkgs/pkc/CHANGELOG.md @@ -7,4 +7,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), ## [Unreleased] +## [0.1.0-beta] - 2026-09-15 + - Initial release. diff --git a/pkgs/pkc/Cargo.toml b/pkgs/pkc/Cargo.toml index 2974e501..71d8bad8 100644 --- a/pkgs/pkc/Cargo.toml +++ b/pkgs/pkc/Cargo.toml @@ -1,6 +1,19 @@ [package] name = "dash-pkc" -version = "0.0.0" +version = "0.1.0-beta" +description = "Cryptographic primitives for the Dash Base SDK" +keywords = ["base-sdk", "dash", "dashcore", "dashpay"] +categories = [ + "cryptography", + "cryptography::cryptocurrencies", + "no-std", + "wasm", +] +exclude = [ + "bench", + "corpus", + "tests", +] readme = "README.md" authors.workspace = true edition.workspace = true @@ -45,7 +58,7 @@ zeroize = { workspace = true, features = ["alloc", "derive"] } [dev-dependencies] bitcoin-consensus-encoding = { workspace = true, features = ["alloc"] } -dash-dev = { version = "0.0.0", path = "../dev", features = ["full"] } +dash-dev = { path = "../dev", features = ["full"] } divan = "0.1" getrandom = { version = "0.4", features = ["sys_rng"] } hex-conservative = { workspace = true, features = ["std"] } @@ -104,3 +117,6 @@ workspace = true name = "pkc" path = "bench/main.rs" harness = false + +[package.metadata.docs.rs] +all-features = true diff --git a/pkgs/pkc/LICENSE b/pkgs/pkc/LICENSE new file mode 100644 index 00000000..a2b849b2 --- /dev/null +++ b/pkgs/pkc/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2026-present, The Dash Core developers + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/pkgs/primitives/Cargo.toml b/pkgs/primitives/Cargo.toml index de07db68..5a8960fa 100644 --- a/pkgs/primitives/Cargo.toml +++ b/pkgs/primitives/Cargo.toml @@ -41,7 +41,7 @@ bitcoin-primitives = { workspace = true, features = ["alloc"] } bitcoin_hashes = { workspace = true, features = ["alloc"] } bitcoin-units = { workspace = true, features = ["alloc"] } dash-num = { version = "0.1.0-beta", path = "../num", features = ["codec"] } -dash-pkc = { version = "0.0.0", path = "../pkc", default-features = false, features = [ +dash-pkc = { version = "0.1.0-beta", path = "../pkc", default-features = false, features = [ "codec", ] } dash-pow = { version = "0.0.0", path = "../pow" } diff --git a/pkgs/script/Cargo.toml b/pkgs/script/Cargo.toml index f6d0a716..5b0d41e7 100644 --- a/pkgs/script/Cargo.toml +++ b/pkgs/script/Cargo.toml @@ -24,7 +24,7 @@ serde = ["dep:serde", "dash-pkc/serde", "dash-types/serde"] base58ck = { workspace = true, features = ["alloc"] } bitcoin-consensus-encoding = { workspace = true, features = ["alloc"] } dash-num = { version = "0.1.0-beta", path = "../num", default-features = false } -dash-pkc = { version = "0.0.0", path = "../pkc", default-features = false, features = [ +dash-pkc = { version = "0.1.0-beta", path = "../pkc", default-features = false, features = [ "codec", ] } dash-types = { version = "0.1.0-beta", path = "../types", default-features = false, features = [