Endpoint: 'resolveDid' #3
Replies: 4 comments
-
|
👀 @insipx |
Beta Was this translation helpful? Give feedback.
-
|
Suggested initial setup: pub const REQUIRED_CONFIRMATIONS: usize = 2;
// did registry prototype is currently deployed here - this address is stable
pub const DID_ETH_REGISTRY: &str = "0xd1D374DDE031075157fDb64536eF5cC13Ae75000"; |
Beta Was this translation helpful? Give feedback.
-
|
So, my thoughts on setting up this modular gateway/server format so far: It makes sense to use JSONRPC or derivative. It's Already standard on ETH/Optimism/Other Chains, and it's easier to interact without prior protobuf encoding setups (i.e on the cli or with a debugging app somewhere like PostMan) As far as it goes though, I think we need to decide whether we want endpoints to live in each gateway individually, or within one place. We can define endpoints within each gateway and have a separate crate spin up a server with just selected functionality (resolver, inbox, or both) or just have one crate that uses didresolver and postal_service as libraries and defines endpoints in one place and still able to spin both up I think for now, a super simple server will be totally fine for what we're doing, but as we get going and want to add, maybe, proxies/websockets or whatever else for security / functionality it could get hairy and we'll want to split that code off. As far as a design for this goes, I will draft up a doc that uses the rust Protobuf Pros:
Protobuf Cons:
JsonRPC Pros:
Would be good to get @snormore input too |
Beta Was this translation helpful? Give feedback.
-
|
JSONRPC makes sense to me. I like the idea of organizing xps-gateway with multiple crates for the different modules (resolver, inbox, etc), and think we should probably just expose those via a single server crate like you suggested too. The resolver spec from the OP in here LGTM too. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Endpoint Documentation:
resolveDidOverview
The
resolveDidendpoint is designed to receive an Ethereum public key and return did document in a JSON format. This endpoint is part of our decentralized data service, which provides access to decentralized identity.Endpoint
Request Format
The request should be a JSON object containing one field:
publicKey.publicKey(string, required): The Ethereum public key (starting with '0x').Example Request:
{ "publicKey": "0x123abc..." }Response Format
The response will be a JSON object containing a did document for related to the provided Ethereum public key.
Example Response:
{ "@context": [ "https://www.w3.org/ns/did/v1", "https://w3id.org/security/suites/ed25519-2020/v1" ], "controller": "did:ethr:0x6CEb0bF1f28ca4165d5C0A04f61DC733987eD6ad", "id": "did:ethr:0x6CEb0bF1f28ca4165d5C0A04f61DC733987eD6ad", "service": [ { "id": "did:ethr:0x6CEb0bF1f28ca4165d5C0A04f61DC733987eD6ad", "recipientKeys": "0x6CEb0bF1f28ca4165d5C0A04f61DC733987eD6ad", "serviceEndpoint": "https://xmtp.com/resolver", "type": "MessagingService" } ], "verificationMethod": [ { "controller": "did:ethr:0x6CEb0bF1f28ca4165d5C0A04f61DC733987eD6ad", "id": "did:ethr:0x6CEb0bF1f28ca4165d5C0A04f61DC733987eD6ad", "publicKeyMultibase": "0x6CEb0bF1f28ca4165d5C0A04f61DC733987eD6ad", "type": "Ed25519VerificationKey2020" } ]Error Handling
In case of an error (e.g., invalid public key, server error), the endpoint will return a JSON object with an
errorfield describing the issue.Example Error Response:
{ "error": "Invalid public key format" }Security and Authentication
Future requirements
Support
Please refer to the DID specification: DID
Beta Was this translation helpful? Give feedback.
All reactions