Add Mosaic DID types and pallet implementation (Phase 1 MVP)#2
Closed
MarkusMaiwald wants to merge 2 commits intodevelopfrom
Closed
Add Mosaic DID types and pallet implementation (Phase 1 MVP)#2MarkusMaiwald wants to merge 2 commits intodevelopfrom
MarkusMaiwald wants to merge 2 commits intodevelopfrom
Conversation
Implements Phase 1 (MVP) of the Mosaic Trust Network DID specifications
from gitlab.dlabs.hu/mosaic-trust-network/specifications, integrating
them into the iop-rs codebase for the Polkadot Substrate-SDK (Mosaik
Blockchain).
New crates:
- mosaic-did-types: Core type definitions for did:mosaic
- BLAKE3-256 for DID identifier derivation (replacing BLAKE2b)
- W3C DID Core 1.0 compliant document structure
- Expanded rights model (6 rights: Update, Impersonate, Delegate,
Issue, Revoke, Recovery)
- Multi-algorithm signatures (Ed25519, secp256k1)
- SCALE codec support behind optional "substrate" feature flag
- 26 unit tests passing
- pallet-mosaic-did: Substrate pallet for on-chain DID registry
- submit_did_operations extrinsic (atomic batch of signed operations)
- register_before_proof extrinsic (proof-of-existence timestamping)
- DID document state reconstruction from operation log
- Anti-censorship design: any account can submit for any DID
- Validation flow: nonce, signature, rights, tombstone checks
- Full event and error definitions per specification
Phase 1 operations: AddKey, RevokeKey, AddRight, RevokeRight,
TombstoneDid, RegisterBeforeProof
Both iop_keyvault_wasm and json_digest_wasm export identical err_to_js and MapJsError symbols. Add explicit imports from iop_keyvault_wasm to disambiguate, and remove the redundant private glob import that was shadowed by the public re-export.
5f2d077 to
2276720
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR introduces the core infrastructure for the
did:mosaicDID method on the Mosaic Trust Network, derived from the IOP Morpheus SSI Stack. It includes type definitions, DID document state management, and a Substrate pallet implementing Phase 1 (MVP) operations.Key Changes
New Crates
mosaic-did-types— Core type definitions for the DID system:Did— DID identifiers derived from BLAKE3-256 hash of initial public keyKeyId,ContentId— Identifiers for keys and contentDidOperation— 5 core Phase 1 operations (AddKey, RevokeKey, AddRight, RevokeRight, TombstoneDid)Right— 6-right model (Update, Impersonate, Delegate, Issue, Revoke, Recovery)KeyType,KeyPurpose— Cryptographic algorithm and W3C verification relationship typesMultiSignature,MultiPublicKey— Algorithm-agile signature support (Ed25519, secp256k1)DidDocumentState— Internal state representation with key validity tracking and rights managementDidDocument— W3C DID Core 1.0 compliant JSON output structurepallet-mosaic-did— Substrate pallet for on-chain DID management:submit_did_operations— Atomic batch submission of signed DID operationsregister_before_proof— Permissionless BeforeProof timestamp registrationImplementation Details
AddKeyoperation creates the DID; identifier must equalBLAKE3-256(public_key)Testing
Notes