Skip to content

Remove CDD claim checks and add DID Registrars#1873

Open
tgntr wants to merge 36 commits intopolymesh-v8-next-featuresfrom
MESH-2295-replace-cdd-checks-with-did
Open

Remove CDD claim checks and add DID Registrars#1873
tgntr wants to merge 36 commits intopolymesh-v8-next-featuresfrom
MESH-2295-replace-cdd-checks-with-did

Conversation

@tgntr
Copy link

@tgntr tgntr commented Feb 3, 2026

This PR removes the CDD claim requirement and replaces it with a simpler DID existence check.

changelog

new features

  • Replaced CDD claim checks with DID existence checks - has_valid_cdd()is_did_active()
  • Added new register_did extrinsic - simplified DID registration without secondary keys support

other

  • Renamed CddServiceProvidersDidRegistrars across all runtimes and config traits and related types/functions/errors
  • Deprecated CDD extrinsics - cdd_register_did, cdd_register_did_with_cdd, invalidate_cdd_claims, change_cdd_requirement_for_mk_rotation
  • Removed CDD RPC methods - is_identity_has_valid_cdd and valid_cdd_claims
  • Removed dead CDD validation code
  • Added new tests for register_did and updated existing tests/benchmarks
  • Updated polymesh_schema.json
  • Updated CLI types in scripts/cli/src/interfaces

Neopallium and others added 28 commits October 25, 2025 03:46
* Start moving our changes out of the core Staking code.

* Refactor chill/nominate code.

* Refactor slashing switch.

* Add missing "Polymesh added" notes.

* FIXUP

* Access Polymesh staking logic through an associated type.

* Impl PermissionedStaking on the pallet.

* Refactor some of our logic out of the benchmarking and testing code.

* Avoid using our User type.

* Add ED check to trait.
* Revert benchmarking and testing utils to Substrate code.

* Port our staking benchmarks onto the Substrate code.

* Split the permissioned validator logic into a different pallet.

* Update tests.

* cargo fmt

* Move Polymesh types out of staking pallet.

* Cleanup

* Clean and revert some changes.

* Import Substrate mock/tests.

* Use staking pallet from Substrate.

* Fix tests.

* Remove old PolymeshStorageVersion.

* Remove unused events.

* Add migration.

* Switch Substrate branches.

* FIXUP: weights.
* Remove pallet-balances

* Fix benchmarks

* Remove cdd check; Fix bench

* Fix bench and integration tests

* Add polymesh_v8 feature to polymesh-api

* Update ci commands

* Change ci flag

* Remove error
* Add workspace dependency

* Update Substrate

* Update WeightMeter

* Deprecated GenesisBuild, use BuildGenesisConfig

* Use Weight::from_parts instead of Weight::from_ref_time

* T::BlockNumber update

* Fix chrono deprecated warnings.

* Fix deprecated check_accrue call.

* Add TypeInfo to Runtime API types.

* System pallet renamed Index -> Nonce.

* Update contracts

* Update weights

* Bump recursion_limit

* Update Babe and Grandpa.

* Update staking pallet

* Update im-online.

* Require serde.

* no_std GenesisConfig.

* Update node binary service/command code.

* Add missing runtime_version attribute.

* Fix wasm-builder

* Remove old test.

* Fix warnings.

* Fix warnings about OldWeight.

* Fix benchmark build.

* Fix RPC port number.

* System.set_code doesn't use max block weight anymore.

* Use sensible maths for `from_rational`.

paritytech/substrate#13660

* Bump contract gas fees.

* Add NoopMigration for v10 contracts pallet.

* Add feature flag for ed; Fix tests and runtime

* Update Weights

* Fix integration tests

* Update .toml and .lock; Update rustc --version; Remove old testing feature

* Fix compilation errors - part I

* Fix compilation errors - part II

* Fix compilation errors - part III

* Fix compilation errors - part IV

* Fix compilation errors - Tx payment

* Fix compilation errors - Remove deprecated scheduler

* Fix compilation erros - Impl TransactionExtension for pallet_permissions

* Fix compilation errors - Remove deprecated scheduler

* Remove deprecated calls - pallet_sudo pallet_validators

* Fix compilation errors - pallet_tx_payments currency adapter

* Fix compilation errors - Update dependency; add Preimage

* Update develop runtime

* Update mainnet and testnet runtime

* Fix rpc-protocol-fee - part I

* Fix node-rpc errors - part I

* Fix node-rpc errors

* Fix group and protocol rpc build

* Updating node part I

* Update node part II

* Update chain_spec - part I

* Update chain spec - part II

* Update node - part III

* Remove warnings; Remove local dependecies

* Impl TransactionExtension

* Add missing GenesisBuilder impl; Use camel case for json genesis; Add validators genesis config

* Remove duplicated chainspec merge; Update toml; Cargo fmt

* Update rust version

* Add ci_runtime

* Fix sudo mock

* Fix tests - part I; Fix storage and builder

* Fix tests - part I

* Fix tests - pips committee

* Fix settlement tests; Add subsidiser to tx_payment pallet

* Fix relayer tests

* Fix tx_payment tests

* Fix Utility tests

* Compile staking tests

* Fix staking tests - UseNominatorsAndValidatorsMap does not sort

* Fix toml files missing runtime-benchmark feature

* Fix toml files for benchmarks part II

* Fix benchmarks - part III

* Order toml dependencies

* Update .lock; Change rust-toolchain

* Change rust version

* Fix benchmarks build

* Change rust version for ci

* Run cargo fmt

* Fix the ci pipeline; Remove contracts from benchmarks temporarily

* FIx manual_slash benchmark

* Build docker temporarily

* Add CA certs to debian docker image.

* FIXUP: ca cert install

* Remove unimplemented call

* Add migrations (#1850)

* update Cargo.lock

* Fix CI pipeline.

* FIXUP: ci pipeline.

* Add missing pallet_contract migrations.

* Fix Rust integration build with v8 chain metadata.

* Update tests to use TransferWithMemo event.

* Update TS integration tests.

* Fix Rust integration build against v8.

* Fix initial funding amounts.

* Update Substrate to fix CheckNonce.

* Fix proofSize limit for contract calls.

* Bump transaction version to 8.

---------

Co-authored-by: Robert G. Jakabosky <rjakabosky+neopallium@neoawareness.com>
* Update Substrate deps to stable2512.

* Fix runtime_interface for benchmark host functions.

* Fix runtime build errors.

* Fix runtime compile errors.

* Fix staking tests.

* Fix node services code.

* Use polymesh builder tool again.

* cargo update.  Update non-substrate deps.

* Use the Sudo pallet from Substrate instead of our forked version.

* Move Substrate Staking tests to Validators pallet.

* Don't rustfmt the Staking test code.

* Cleanup some TODOs.

* Update branches in CI pipeline.

* Store runtimes as artifacts of CI jobs.

* Fix CI pipeline config.

* Remove PR branch from CI pipeline.
* Fix migration of permissioned validators from Staking pallet.

* Bump spec.
…`total_weight` (#1863)

* Fix fee withdraw

* Fix tests; Improve validate and prepare code

* Change total_weight to call_weight

* Remove duplicated check in tx extension; Fix call_weight usage

* Another call_weight -> total_weight fix.

---------

Co-authored-by: Robert G. Jakabosky <rjakabosky+neopallium@neoawareness.com>
* Reuse pallet-transaction-payment from Substrate, split our ChargeTransactionPayment code out.

* Use improved transaction priority calculation from Substrate.

* Implement support for disable fees.

* Add benchmark of ChargeTransactionPayment tx extension.

* Benchmark ChargeTransactionPayment extension.

* Return the extension weight.

* Use git paths instead of version for Substrate deps.

* Update to Substrate release polkadot-stable2512.

* Fix tests build.
Copy link
Contributor

@Neopallium Neopallium left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here are some initial comments.

let value = match self {
SystematicIssuers::Committee => "Committee",
SystematicIssuers::CDDProvider => "CDD Trusted Providers",
SystematicIssuers::DIDRegistrar => "DID Registrars",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please leave these issuers as-is. We don't need one for DID providers, since they don't need to be issued a CDD claim.

#[derive(Clone, Debug, Deserialize, TypeInfo, Serialize)]
pub enum AuthorizationData<AccountId> {
/// CDD provider's attestation to change primary key
/// DID registrar's attestation to change primary key
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This authorization variant was never used and we don't need it anymore. For now just mark it as deprecated.

use scale_info::TypeInfo;

/// A CDD ID only has meaning to the CDD provider that issues a CDD claim.
/// A CDD ID only has meaning to the DID registrar that issues a CDD claim.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DID providers will not issue claims. So the original comment is still correct. The CDD claim and this CDDId type can be used by other companies if they want to provide CDD services (instead of full KYC services).

Comment on lines 254 to 255
pallet_identity::Pallet::<T>::is_did_active(identity),
Error::<T>::IdentityIsMissingDID
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Identity == DID (they are the same thing). The error here should be identity not found or doesn't exist, since an identity can't be missing a DID.


#[runtime::pallet_index(8)]
pub type CddServiceProviders = pallet_group::Pallet<Runtime, Instance2>;
pub type DidRegistrars = pallet_group::Pallet<Runtime, Instance2>;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will require a storage migration, since the pallet name is used in the storage key.

@Neopallium
Copy link
Contributor

Items from the meeting:

  • Don't need to call is_did_active for the sender of assets, only the receiver.
  • If we get the identity from an on-chain lookup (e.g. query the caller's identity from their account id), we should only do a is_did_locked check. For now the is_did_locked method will just return true.

)]
#[pallet::weight(<T as Config>::WeightInfo::cdd_register_did(secondary_keys.len() as u32))]
#[pallet::call_index(0)]
pub fn cdd_register_did(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Neopallium Since we will be adding this for v8.0, can't we just remove this? The same applies to all deprecated extrinsics

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.

3 participants