Skip to content

pkc%feat(eddsa): add rudimentary Ed25519 support backed by ed25519-dalek - #46

Open
kwvg wants to merge 6 commits into
dashpay:developfrom
kwvg:eddsa_prep
Open

kwvg wants to merge 6 commits into
dashpay:developfrom
kwvg:eddsa_prep

Conversation

@kwvg

@kwvg kwvg commented Sep 15, 2026

Copy link
Copy Markdown
Collaborator

Additional Information

  • Due to inherent properties of the Ed25519 , tweaking is unavailable in the API. See SLIP-0010 for more information (source).

Breaking Changes

  • dash_primitives::payload::proregtx::PlatformNodeId has been superseded by dash_primitives::payload::PlatformNodeId

  • PlatformNodeId no longer implements dash_types::codec::Hashable

How Has This Been Tested?

./contrib/git_filter.py --fast-fail develop eddsa_prep -- bash -c 'cargo clippy --all-targets --no-default-features -- -D warnings && cargo clippy --all-targets --features full -- -D warnings && cargo test --all-targets --features full && nix develop ./contrib/nix#dev --command python3 maint/lint_all.py'

Checklist

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional tests
  • I have made corresponding changes to the documentation
  • I have assigned this pull request to a milestone (for repository code-owners and collaborators only)

@kwvg kwvg added this to the 0.1 milestone Sep 15, 2026
@kwvg kwvg self-assigned this Sep 15, 2026
@coderabbitai

coderabbitai Bot commented Sep 15, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 21c08dc2-06b7-44e4-8123-ae26c721051d

📥 Commits

Reviewing files that changed from the base of the PR and between 751f147 and d95cd6c.

⛔ Files ignored due to path filters (4)
  • Cargo.lock is excluded by !**/*.lock, !**/*.lock
  • pkgs/pkc/corpus/eddsa_keygen.json5 is excluded by !**/*.json5
  • pkgs/pkc/corpus/eddsa_node_id.json5 is excluded by !**/*.json5
  • pkgs/pkc/corpus/eddsa_sign.json5 is excluded by !**/*.json5
📒 Files selected for processing (21)
  • maint/codeql/rust/lib/imports.qll
  • maint/codeql/rust/lib/pkc.qll
  • maint/codeql/rust/pkc.model.yml
  • maint/codeql/rust/pkc.ql
  • pkgs/pkc/Cargo.toml
  • pkgs/pkc/bench/eddsa.rs
  • pkgs/pkc/bench/main.rs
  • pkgs/pkc/src/eddsa/error.rs
  • pkgs/pkc/src/eddsa/mod.rs
  • pkgs/pkc/src/eddsa/public_bytes.rs
  • pkgs/pkc/src/eddsa/public_hash.rs
  • pkgs/pkc/src/eddsa/public_ops.rs
  • pkgs/pkc/src/eddsa/secret_bytes.rs
  • pkgs/pkc/src/eddsa/secret_ops.rs
  • pkgs/pkc/src/eddsa/sig_bytes.rs
  • pkgs/pkc/src/eddsa/sig_ops.rs
  • pkgs/pkc/src/eddsa/tests.rs
  • pkgs/pkc/src/lib.rs
  • pkgs/primitives/src/payload/mod.rs
  • pkgs/primitives/src/payload/proregtx.rs
  • pkgs/primitives/src/payload/proupservtx.rs

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The change adds feature-gated Ed25519 support to dash-pkc, including key, signature, hash, validation, tests, and benchmarks. It reuses EddsaPkHash for PlatformNodeId and updates Rust CodeQL models for EdDSA-specific API differences.

Changes

EdDSA support and integration

Layer / File(s) Summary
EdDSA module foundation
pkgs/pkc/Cargo.toml, pkgs/pkc/src/lib.rs, pkgs/pkc/src/eddsa/*
Adds the eddsa feature, Ed25519 dependency, public byte and hash types, error types, module exports, and shared fixtures.
EdDSA key and signature operations
pkgs/pkc/src/eddsa/public_ops.rs, pkgs/pkc/src/eddsa/secret_ops.rs, pkgs/pkc/src/eddsa/sig_ops.rs
Adds Ed25519 public-key parsing, strict verification, secret-key generation, signing, zeroization, conversions, and tests for valid and invalid inputs.
EdDSA benchmark wiring
pkgs/pkc/bench/*
Adds benchmarks for signing, verification, key derivation, deserialization, and public-key hashing.
PlatformNodeId type integration
pkgs/primitives/src/payload/*
Re-exports EddsaPkHash as PlatformNodeId and updates payload modules to use that shared type.
CodeQL EdDSA modeling
maint/codeql/rust/*
Adds armLacks modeling for Ed25519 APIs that do not support tweaking and allowlists the new public-hash re-export.

Sequence Diagram(s)

sequenceDiagram
  participant EddsaSecretKey
  participant EddsaSignature
  participant EddsaPublicKey
  EddsaSecretKey->>EddsaSignature: sign(message)
  EddsaSecretKey->>EddsaPublicKey: public_key()
  EddsaPublicKey->>EddsaSignature: verify(message, signature)
Loading

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to d95cd

The EdDSA and PlatformNodeId integration has no confirmed merge-blocking issue.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 76.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 50 functions across 16 files. (5 skipped:… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: adding rudimentary Ed25519 support backed by ed25519-dalek.
Description check ✅ Passed The description directly covers Ed25519 support, unavailable key tweaking, the PlatformNodeId change, and testing performed.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 76.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 50 functions across 16 files. (5 skipped: 5 unsupported.)

  • Fix all pre-merge checks with AI

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown

Note

This pull request has no conflicts! 🎊 🎉 🎊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant