Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

qsb-did-resolver workspace

Structure

core/
  Cargo.toml
  src/
    lib.rs
    did.rs
    resolver.rs
    document.rs
    error.rs
    rpc.rs

cli/
  Cargo.toml
  src/main.rs

server/
  Cargo.toml
  src/main.rs

What each crate does

  • core: DID domain models, RPC client, mapping DidDetails -> DID Resolution result.
  • server: HTTP DID resolver (GET /1.0/identifiers/{did}) backed by an HTTP(S) or WS(S) QSB node RPC endpoint.
  • cli: CLI utility for ad-hoc DID resolution from terminal.

Build

cargo check --workspace

Run server

cargo run -p qsb-did-resolver-server -- \
  --listen-addr 127.0.0.1:8080 \
  --node-rpc-url http://127.0.0.1:9944

Against the public Poseidon WebSocket RPC:

cargo run -p qsb-did-resolver-server -- \
  --listen-addr 127.0.0.1:8080 \
  --node-rpc-url wss://qsb.qbck.io:9945 \
  --allow-insecure-tls

Resolve from CLI

cargo run -p qsb-did-resolver-cli -- \
  --node-rpc-url http://127.0.0.1:9944 \
  --did did:qsb:YOUR_DID_ID \
  --pretty

WebSocket RPC is also supported:

cargo run -p qsb-did-resolver-cli -- \
  --node-rpc-url wss://qsb.qbck.io:9945 \
  --allow-insecure-tls \
  --did did:qsb:YOUR_DID_ID \
  --pretty

Endpoints

  • GET /health
  • GET /1.0/identifiers/{did}

The resolver calls node JSON-RPC method:

  • did_getByString

--node-rpc-url accepts HTTP and WebSocket JSON-RPC endpoints:

  • http://127.0.0.1:9944
  • https://example.node/rpc
  • ws://127.0.0.1:9944
  • wss://qsb.qbck.io:9945

If a development node uses a certificate that is not trusted by the local system, pass --allow-insecure-tls or set QSB_ALLOW_INSECURE_TLS=true. Use this only for development/test endpoints.

DID validation behavior

Resolver validates DID input before RPC call:

  • prefix must be did:qsb:
  • identifier part must be valid Base58
  • decoded identifier length must be exactly 32 bytes
  • invalid input returns DID Resolution error invalidDid

Multikey / codec behavior

  • Resolver maps DidKeyMaterial::Multikey to type: "Multikey" and publicKeyMultibase.
  • Resolver maps DidKeyMaterial::Jwk to type: "JsonWebKey2020" and publicKeyJwk.
  • publicKeyMultibase is reconstructed from multicodec + raw public_key returned by chain state.
  • JWK bytes are parsed as JSON for DID Document output when they contain valid JSON, otherwise they are returned as a string.
  • Resolver does not enforce codec allowlist itself; codec policy is enforced by runtime.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages