Repository navigation
Description
TL;DR: Which identity key types can sign a state transition is written down in three places: the node's validator, the signing code, and the new wallet preflight. They agree today. If a future change updates only one of them, a wallet could create an identity whose keys the node will not accept, or refuse keys the node accepts.
User story
As a maintainer of Dash Platform, I want one owner for the "key type can sign state transitions" rule, so the wallet, the signer and the node cannot drift apart when key types change.
Scenario
Base flow
A wallet checks that a new identity's required keys can sign before it funds the identity. The node checks the same thing when it validates an identity-signed state transition, and StateTransition::sign refuses the other key types.
Actual behavior
- Node:
SUPPORTED_KEY_TYPESinpackages/rs-drive-abci/src/execution/validation/state_transition/common/validate_state_transition_identity_signed/v0/mod.rs. - Signer: the per-type match in
StateTransition::sign(packages/rs-dpp/src/state_transition/mod.rs). - Wallet preflight:
KeyType::can_sign_state_transitionsinpackages/rs-dpp/src/identity/identity_public_key/key_type.rs, added by fix!: follow DIP-11 key rules when disabling keys and reading contact requests #5644 and fix(platform-wallet)!: check identity creation keys and funding in the Rust core #5645.
These are three independent lists with the same members (ECDSA_SECP256K1, BLS12_381, ECDSA_HASH160).
Expected behavior
- The node validator and the signer use the DPP predicate (or one versioned DPP rule), so a change to signing key types is made once.
- The node keeps its current results for every shipped protocol version.
Detailed discussion
- The node side is consensus code. Switching it to the shared predicate must give identical results for every shipped protocol version: a new validator generation selected only by an unreleased protocol version, or an in-place change proven not to alter consensus, per the coding conventions.
- If signing support ever differs by protocol version, the predicate needs a
platform_versionparameter. - Tests: a table test that the predicate, the signer and the node validator agree for every
KeyType.
Prior work
- fix!: follow DIP-11 key rules when disabling keys and reading contact requests #5644 and fix(platform-wallet)!: check identity creation keys and funding in the Rust core #5645 add
KeyType::can_sign_state_transitionsfor wallet preflights; review suggestion on fix(platform-wallet)!: check identity creation keys and funding in the Rust core #5645.
Attribution
🤖 Co-authored by Claudius the Magnificent AI Agent
Activity