TBD54566975 / web5-js

Monorepo for the Web5 JS TypeScript implementation
https://tbd54566975.github.io/web5-js/
Apache License 2.0
129 stars 52 forks source link

Add DWN endpoints to Agent DID and ensure they sync #652

Open csuwildcat opened 4 months ago

csuwildcat commented 4 months ago

Currently I believe Agent DIDs do not set endpoints when they are created, and should. We should set the endpoints and have them be capable of sync so any state change to their DID set or other data relevant to then can be synced across wallet instances.

frankhinek commented 4 months ago

@csuwildcat It shouldn't be all that difficult to add the capability to sync "other data relevant them".

The part that will require a bit of thought is how to handle changes to the Agent's DID state.

For practical reasons, the Agent DID's private key can't be stored in the DWN so that'll remain in the IdentityVault.

Additionally, because the Agent's DID is deterministically created from the 12 words, you will have to consider whether this is still a desirable characteristic, and if so, how to handle the non-deterministic service object that this issue proposes adding.

It may end up being simpler for an agent instantiated with the same 12 words to resolve the DID to determine the current state of the DID document. You could also look into attempting to store just the DID Document and metadata in the Agent's DWN tenant (but not the private key) but that may not work without additional code changes.

csuwildcat commented 4 months ago

Yeah, meant everything but the private key, which you'd presumably move via 12 word entry in the new wallet