iotaledger / iotaledger/identity

[Bug] Resolution of DID Documents fails when the controller's DID method is not "iota"

Open
#1,392 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
346
Forks
100
Avg merge
13h 41m
Merged PRs (30d)
2

Description

## Bug description
When a document stored on the iota network (i.e. an `IotaDocument`) has its `controller` property set to a DID with a DID method different that "iota" (e.g. did:key:....), resolution of such DID document fails.

## IOTA Identity version
latest

## Expected behaviour
Resolution of such a document should not fail, producing a valid `IotaDocument`. Further operation on the document that expect the document's controller to have a certain DID method should fail instead.

## Actual behaviour
The document can't be resolved, failing with `DIDSyntaxError` as they expect the controller to be a `did:iota` DID.

This error originates in `StateMetadataDocument`, a structure used internally upon deserialization of a DID document from a Stardust AliasOutput's state_metadata property. Fixing this should be as simple as parsing the document's controller property into a `CoreDID` instead of an `IotaDID`.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.