Skip to content

fix(drive-abci)!: refuse an identity create from addresses with a failed key signature unpaid (PV14) - #4968

Merged
QuantumExplorer merged 1 commit into
v4.2-devfrom
claude/icfa-key-signatures-up-front
Sep 24, 2026
Merged

QuantumExplorer merged 1 commit into
v4.2-devfrom
claude/icfa-key-signatures-up-front

Conversation

@QuantumExplorer

@QuantumExplorer QuantumExplorer commented Sep 24, 2026 •

Copy link
Copy Markdown
Member

Issue being fixed or feature implemented

Follow-up to #4961 and #4966.

An IdentityCreateFromAddresses proves possession of each key it registers with a signature over the transition's signable bytes. The address witnesses sign the same bytes, so they cannot cover those key signatures. A failed proof of possession was nonetheless charged to the inputs (the validation_of_added_keys_proof_of_possession_failure penalty plus the fee, with the input nonces bumped), although the owners of the inputs never signed the key signatures being judged. check_tx did not run the key checks at all, so such a transition could enter the mempool.

What was done?

  • New advanced_structure v1 for IdentityCreateFromAddresses, selected by DRIVE_ABCI_VALIDATION_VERSIONS_V10 (protocol version 14). It is v0 except that a failed proof of possession returns the errors with no action, so the transition is refused unpaid, like one whose witnesses fail. A key structure failure (duplicate key ids and the like) is still a paid refusal with a nonce bump: those fields are signed by the witnesses. Protocol version 13 keeps v0.
  • requires_advanced_structure_validation_with_state_on_check_tx now includes IdentityCreateFromAddresses, so check_tx transforms it and runs its advanced structure (key structure and proofs of possession) at admission. Admission is not consensus, so this applies at every protocol version.
  • The advanced structure dispatcher knows v1; the PV14 notes in v14.rs and the validation pipeline chapter of the book describe the change.

Example: a transition whose first key signature does not verify, from an input holding 1.1 Dash, at protocol version 14.

Before:

check_tx:       admitted
block result:   PaidConsensusError(SignatureError)
input:          1.1 Dash - 50,376,540 credits, nonce bumped

After:

check_tx:       refused (SignatureError)
block result:   UnpaidConsensusError(SignatureError), if a proposer includes it anyway
input:          unchanged, nonce unchanged

At protocol version 13 the block result is unchanged (a paid refusal); only check_tx refuses the transition earlier.

How Has This Been Tested?

  • New in identity_create_from_addresses/tests.rs:
    • should_refuse_an_invalid_key_signature_unpaid: at the latest version the block result is an unpaid SignatureError, and the input keeps its balance and nonce.
    • should_refuse_an_invalid_key_signature_at_check_tx: check_tx refuses the transition at protocol versions 13 and latest. It fails if the transition is taken out of requires_advanced_structure_validation_with_state_on_check_tx.
  • should_conserve_credits_when_a_key_signature_is_invalid now runs at protocol version 13, where the paid refusal remains. should_charge_the_penalty_unscaled_by_the_user_fee_increase uses the key structure failure, which is paid at every version.
  • test_invalid_key_data_for_ecdsa and test_invalid_key_data_for_bls fail on the key signature, so at the latest version they now expect an unpaid refusal.
  • should_return_true_only_for_batch_and_identity_create_from_addresses pins the check_tx list.
  • cargo test -p drive-abci --lib -- identity_create_from_addresses advanced_structure_with_state: 212 passed. cargo test -p drive-abci --lib -- check_tx execution_event block_processing_end_events processor address_funding_from_asset_lock: 275 passed.
  • cargo fmt --all -- --check and cargo clippy -p drive-abci -p platform-version --tests are clean.

Breaking Changes

From protocol version 14, an IdentityCreateFromAddresses whose key proof of possession fails is refused unpaid instead of charging its inputs the penalty and fee. Protocol version 13 and earlier are unchanged. The check_tx change affects mempool admission only.

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/e2e tests
  • I have added "!" to the title and described breaking changes in the corresponding section if my code contains any
  • I have made corresponding changes to the documentation if needed
  • If I added or changed GroveDB structure, I described it in the area's structure.rs, regenerated grovedb-structure.json, and checked the structure viewer link posted on this pull request

For repository code-owners and collaborators only

  • I have assigned this pull request to a milestone

🤖 Generated with Claude Code

PR Hygiene · 29d85be

  • Bots — coderabbitai ✓ · thepastaclaw not yet — /skip-bots proceeds without the ones not yet reported
  • Self-review — post /self-reviewed once the bots are done
  • Within your 5 open PRs
  • Build running
  • Approvals — you own every area touched; none needed

When every box is checked the PR Hygiene check passes and this can merge.

Summary by CodeRabbit

  • Bug Fixes
    • Identity creation transitions with invalid key proof-of-possession signatures are now rejected during admission checks, before they can enter the mempool.
    • From protocol version 14, these failures are rejected without charging a fee or applying a penalty. Earlier protocol versions retain their existing fee behavior.
  • Documentation
    • Clarified how key proof-of-possession checks affect identity creation and transaction fees.

…led key signature unpaid (PV14)

The address witnesses of an IdentityCreateFromAddresses cannot sign the
proofs of possession of the keys it registers: both sign the same bytes.
A failed proof of possession was nonetheless charged to the inputs as a
penalty. From protocol version 14 (advanced_structure v1) it is refused
unpaid, like a failed witness; a key structure failure stays paid.

check_tx now runs the advanced structure of this transition, so one whose
key signatures fail is refused at admission at every protocol version.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions github-actions Bot added this to the v4.2.0 milestone Sep 24, 2026
@github-actions github-actions Bot added the waiting-bots Waiting for the review bots to report on this head label Sep 24, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📖 Book Preview built successfully.

Download the preview from the workflow artifacts.
To view locally: download the artifact, unzip, and open index.html.

Updated at 2026-09-24T05:53:34.831Z

@coderabbitai

coderabbitai Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: dashpay/platform/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 68072067-9b6d-46b1-b0ba-38dbfabed2c4

📥 Commits

Reviewing files that changed from the base of the PR and between e246f55 and 29d85be.

📒 Files selected for processing (8)
  • book/src/state-transitions/validation-pipeline.md
  • packages/rs-drive-abci/src/execution/validation/state_transition/processor/traits/advanced_structure_with_state.rs
  • packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/identity_create_from_addresses/advanced_structure/mod.rs
  • packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/identity_create_from_addresses/advanced_structure/v1/mod.rs
  • packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/identity_create_from_addresses/mod.rs
  • packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/identity_create_from_addresses/tests.rs
  • packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_validation_versions/v10.rs
  • packages/rs-platform-version/src/version/v14.rs

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


📝 Walkthrough

Walkthrough

Protocol version 14 selects version 1 advanced-structure validation for identity creation from addresses. Invalid proof-of-possession signatures are refused without a penalty, and check_tx runs the validation for this transition at all protocol versions.

Changes

Identity creation validation

Layer / File(s) Summary
Versioned advanced-structure validation
packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/identity_create_from_addresses/..., packages/rs-platform-version/src/version/...
Adds version 1 validation and dispatch. Protocol version 14 selects it. Tests cover unpaid signature failures and the existing penalty for key-structure failures.
check_tx validation and documentation
packages/rs-drive-abci/src/execution/validation/state_transition/processor/traits/advanced_structure_with_state.rs, packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/identity_create_from_addresses/tests.rs, book/src/state-transitions/validation-pipeline.md
Runs advanced-structure validation for this transition during check_tx, adds check_tx coverage, and documents the validation behavior.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Sequence Diagram(s)

sequenceDiagram
  participant CheckTx
  participant AdvancedStructureValidation
  participant IdentityCreateFromAddressesV1
  CheckTx->>AdvancedStructureValidation: validate transition
  AdvancedStructureValidation->>IdentityCreateFromAddressesV1: validate structure and signatures
  IdentityCreateFromAddressesV1-->>AdvancedStructureValidation: signature error or validation result
  AdvancedStructureValidation-->>CheckTx: reject transition when signature validation fails
Loading

Suggested reviewers: lklimek

Merge Risk: ⚪ Minimal · up to 29d85

The protocol-version behavior and check_tx rejection have no identified merge-blocking issue; the change is ready for normal checks.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the primary change: refusing an IdentityCreateFromAddresses transition with a failed key signature without payment at protocol version 14.
Docstring Coverage ✅ Passed Docstring coverage is 92.86% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 14 functions across 7 files. (1 skipped: 1 …
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.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

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.

@thepastaclaw

thepastaclaw commented Sep 24, 2026 •

Copy link
Copy Markdown
Collaborator

🕓 Queued for automated review — 4th in line, estimated start in ~1.0 h (commit 29d85be)
Estimated review time once started: ~40 min (two-phase automated review; median of recent runs).

  • Request priority review — click to move this review to the front of the queue.

@QuantumExplorer

Copy link
Copy Markdown
Member Author

Agreed with this approach.

@QuantumExplorer
QuantumExplorer merged commit 68aa586 into v4.2-dev Sep 24, 2026
19 of 20 checks passed
@QuantumExplorer
QuantumExplorer deleted the claude/icfa-key-signatures-up-front branch September 24, 2026 06:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

waiting-bots Waiting for the review bots to report on this head

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants