identity.rs
identity.rs copied to clipboard
[Task] Stardust Method
Description
This is the tracking issue for tasks required for the Stardust UTXO-based DID Method.
A small proof-of-concept is on the feat/stardust-poc
branch, which simply embeds an empty DID Document in the stateMetadata
of an Alias Output. The identity_stardust
crate on that branch is separate from the workspace, this is due to incompatible dependencies related to iota-client
. I suggest continuing parallel development with the new and old DID Methods for the least friction, since the alternative would break all existing tests and examples that interact with the Tangle. Development should continue in isolation, with generic components incrementally being updated to support multiple DID Methods.
Note that the current intention is not to release did:stardust
as a separate DID Method, but rather use it as a working title; the did:iota
method (at least in name) will be replaced with this in the future.
Notes
There were a number of issues encountered during development of the proof-of-concept, most minor.
- The
AliasId
is inferred from theBlock
, so need to use a placeholder DID when creating a new DID Document, or publish twice: first to get theAliasId
, then publish the DID Document. Publishing twice seems ill-advised and likely to cause more problems than fix them; the proof-of-concept resolution simply replaces all occurrences of the placeholder DID when extracting the DID Document. - Cannot get an
OutputId
(needed to resolve anAliasOutput
) back from anAliasId
(hash ofOutputId
), need to use Indexer API. This is fine sinceiota-client
provides functions to do so, just needs a few steps and some type wrangling. - The response from the Indexer is an Output, not a
Block
, so cannot infer anAliasId
from it. Fine since we use theAliasId
from the DID to retrieve theOutput
in the first place. TheOutputDto
conversion is a bit annoying though. - The pieces needed to publish an update are fragmented (
OutputId
for input, amount, DID Document, etc.), bit annoying to reconstruct. Maybe use a holder struct likeHolder { AliasOutput, StardustDocument }
with convenience functions? - Inferred fields such as the
controller
andgovernor
need to reflect in the (JSON) Document but excluded from theStardustDocument
serialization when published. Handle with a separatepack
function like with current DID Messages? -
AliasId
addresses are stringified as prefixed hex strings, e.g.0xa1b2c3...
. Initially I stripped the prefix for the DID tag, sodid:stardust:a1b2c3...
but maybe keeping the prefix is fine?did:stardust:0xa1b2c3...
? Doesn't save many bytes and some Ethereum DID Methods keep the prefix, which is simpler.
Regarding iota-client
: I think we should just implement a trait for it rather than re-export all its builder methods which we currently do. Then for the Wasm bindings we can just implement the trait for the iota.js
equivalent, if possible?
To-do list
Please link PRs that match the To-do list item behind the item after it has been submitted.
These are just the initial steps for the immediate term.
- [ ] Types.
- [x]
StardustDID
(including placeholder +StardustNetwork
for Mainnet, devnet + Shimmer equivalents?). - [x]
StardustDocument
+ features. (#951) - [ ] ~
ResolvedStardustDocument
wrapper forStardustDIDDocument
+AliasOutput
?~ - [ ]
StardustDocument
stateMetadata
packing (#942).
- [x]
- [ ]
StardustClient
interface- [x] Trait-based or wrapper-based (like current
IotaClient
)? - [ ] DID resolution.
- [ ] DID creation + updates? Could be left for the
Account
, rely oniota-client
to publish in low-level API?
- [x] Trait-based or wrapper-based (like current
- [x] Generalise
Resolver
interface for multiple DID Methods. Pluggable interface abstraction possible similar toAgent
? #970 - [x] Generalise credential, presentation validation for multiple DID Methods (#935)
- [ ] Private Tangle in CI for testing? Need to request funds from faucet for byte deposit.