https://github.com/cheqd/did-resolver-rs
DID Resolver implementation for the did:cheqd method in Rust
https://github.com/cheqd/did-resolver-rs
Last synced: about 2 months ago
JSON representation
DID Resolver implementation for the did:cheqd method in Rust
- Host: GitHub
- URL: https://github.com/cheqd/did-resolver-rs
- Owner: cheqd
- License: apache-2.0
- Created: 2025-10-13T06:58:13.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2025-10-16T06:33:36.000Z (9 months ago)
- Last Synced: 2025-10-16T15:52:05.288Z (9 months ago)
- Language: Rust
- Homepage:
- Size: 95.7 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
- Notice: NOTICE.md
Awesome Lists containing this project
README
# cheqd DID Resolver Rust
[](https://github.com/cheqd/did-resolver-rs/releases/latest)  [](https://github.com/cheqd/did-resolver-rs/blob/main/LICENSE)
[](https://github.com/cheqd/did-resolver-rs/releases/)  [](https://github.com/cheqd/did-resolver-rs/graphs/contributors)
[](https://github.com/cheqd/did-resolver-rs/actions/workflows/dispatch.yml) [](https://github.com/cheqd/did-resolver-rs/actions/workflows/codeql.yml) 
## âšī¸ Overview
DID methods are expected to provide [standards-compliant methods of DID and DID Document ("DIDDoc") production](https://w3c.github.io/did-resolution/#resolver-architectures). The **cheqd DID Resolver** is designed to implement the [W3C DID _Resolution_ specification](https://w3c.github.io/did-resolution/) for [`did:cheqd`](https://docs.cheqd.io/identity/architecture/adr-list/adr-001-cheqd-did-method) method in Rust.
### đ Architecture
The [Architecture Decision Record for the cheqd DID Resolver](https://docs.cheqd.io/identity/architecture/adr-list/adr-003-did-resolver) describes the architecture & design decisions for this software package.
#### gRPC Endpoints used by DID Resolver
Our DID Resolver uses the [Cosmos gRPC endpoint](https://docs.cosmos.network/main/core/grpc_rest) from `cheqd-node` to fetch data. Typically, this would be running on port `9090` on a `cheqd-node` instance.
You can either use [public gRPC endpoints for the cheqd network](https://cosmos.directory/cheqd/nodes) (such as the default ones mentioned above), or point it to your own `cheqd-node` instance by enabling gRPC in the `app.toml` configuration file on a node:
```toml
[grpc]
# Enable defines if the gRPC server should be enabled.
enable = true
# Address defines the gRPC server address to bind to.
address = "0.0.0.0:9090"
```
**Note**: If you're pointing a DID Resolver to your own node instance, by default `cheqd-node` instance gRPC endpoints are _not_ served up with a TLS certificate. This means the `useTls` property would need to be set to `false`, unless you're otherwise using a load balancer that provides TLS connections to the gRPC port.
This crate contains a resolver for DIDs of the [did:cheqd](https://docs.cheqd.io/product/architecture/adr-list/adr-001-cheqd-did-method) method.
The implementation resolves DIDs via gRPC network requests to the configured nodes. Default nodes for cheqd's `mainnet` & `testnet` can be used,
or custom nodes can be opt-in by supplying a different gRPC URL configuration.
This crate uses gRPC types and clients generated using [tonic](https://github.com/hyperium/tonic).
The generated rust code is checked-in to this repository for monitoring, [see here](./src/proto/mod.rs).
These generated rust files are checked-in alongside the V2 cheqd proto files & dependencies.
which are sourced from [cheqd's Buf registry](https://buf.build/cheqd/proto/docs).
Since the generated code & proto files are not relatively large nor overwhelming in content, they are checked-in rather than pulled and/or generated at build time. The benefit is that the contents of the files can be monitored with each update, making supply-chain attacks obvious. It also reduces the build time complexity for consumers - such as reducing requirements for any 3rd party build tools to be installed (`protobuf`). The drawback is that it introduces some more manual maintainence.
The crate exports the `DIDCheqd` type which implements the
[`ssi_dids_core::DIDMethod`] and
[`ssi_dids_core::resolution::DIDMethodResolver`] traits. This crate is
uses cheqd network's GRPC
##### Example
The example below is intentionally minimal and self-contained so it can be
executed as a doc-test (no network calls, no async runtime). It verifies the
public associated constant and basic construction of the type. This keeps
`cargo test --doc` and tools like `cargo-rdme` reliable.
```rust
use did_resolver_cheqd::DIDCheqd;
use ssi_dids_core::DIDMethod;
// Confirm the API constant and that we can construct the value
assert_eq!(DIDCheqd::DID_METHOD_NAME, "cheqd");
let _ = DIDCheqd::default();
let _ = DIDCheqd::new(None);
let _ = DIDCheqd::new(Some(DidCheqdResolverConfiguration {
networks: vec![
NetworkConfiguration {
grpc_url: "https://grpc.cheqd.net:443".to_string(),
namespace: "mainnet".to_string(),
},
],
}));
```
##### Library features
- Implements a `DIDMethodResolver` for the `did:cheqd` DID method.
- Exposes `resolution`, `proto` and `error` modules for integration.
## đ Bug reports & đ¤ feature requests
If you notice anything not behaving how you expected, or would like to make a suggestion / request for a new feature, please create a [**new issue**](https://github.com/cheqd/did-resolver-rs/issues/new/choose) and let us k
## đŦ Community
Our [**Discord server**](http://cheqd.link/discord-github) is the primary chat channel for the open-source community, software developers, and node operators.
Please reach out to us there for discussions, help, and feedback on the project.
## đ Find us elsewhere
[](https://t.me/cheqd) [](http://cheqd.link/discord-github) [](https://twitter.com/intent/follow?screen_name=cheqd_io) [](http://cheqd.link/linkedin) [](https://blog.cheqd.io) [](https://www.youtube.com/channel/UCBUGvvH6t3BAYo5u41hJPzw/)