Skip to content

dpp, sdk: close the ECDSA test gaps and helper duplication left after the typed-key migration #6388

Backlog

Description

@Claudius-Maginificent

TL;DR: The ECDSA migration in #5519 works, but its review found test gaps and a few small cleanups that were left out of that PR. This issue collects them so they are not lost.

User story

As a maintainer of the DPP and SDK crypto code, I want the remaining ECDSA test gaps and duplicated helpers closed, so a later change to key handling cannot silently change signatures, keys or accepted inputs.

Scenario

Base flow

#5519 moves DPP and its consumers from the raw secp256k1 crate to the typed ECDSA API while keeping signature, key and accepted-input bytes unchanged.

Actual behavior

  • Two test fixtures in packages/rs-sdk/src/platform/dashpay/invitation.rs (signed_high_key, claim_through_the_sdk::claim_keys) still use raw secp256k1 only to derive public keys, which keeps the raw dependency in the SDK tests.
  • packages/rs-dpp/src/util/ecdsa/random_secret_key.rs keeps a local sampler (with a TODO) although the pinned Core crate offers generate_with; its temporary scalar buffer is not wiped, and its test does not force the rejection of invalid scalars.
  • The low-S rule exists both in rs-dpp/src/util/ecdsa/mod.rs and in rs-platform-wallet/src/wallet/identity/crypto/auto_accept.rs.
  • CI (.github/workflows/tests-rs-workspace.yml) does not run the compatibility tests of simple-signer and wasm-dpp2.
  • Scalar negation in rs-dpp/src/tests/utils/mod.rs is local; the pinned Core facade has none.
  • Tests lack fixed vectors for: high_s_twin borrow propagation, DIP14 derivation output and a forced invalid IL (wasm-sdk/src/wallet/dip14.rs), KeyType byte conversion with an invalid scalar (identity_public_key/key_type.rs), and signature-recovery header bounds and recovery IDs (rs-sdk-cxx/src/signer.rs, state_transition/mod.rs).
  • A high-S signature from an external signer can be rejected only later, depending on the path and protocol version (state_transition/mod.rs, rs-sdk-cxx/src/signer.rs).
  • WASM entry points that take secrets (wasm-sdk/src/encrypted_for.rs, moderation_charters.rs) do not wipe them on every path.

Expected behavior

Each item above is fixed or explicitly declined, with tests that pin today's bytes.

Detailed discussion

Prior work

Attribution

🤖 Co-authored by Claudius the Magnificent AI Agent

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions