Skip to main content
TinyCloud uses two DID shapes in the SDK:
  • a persistent owner DID, usually did:pkh:...
  • an ephemeral session DID, usually did:key:...#...
The SDK exposes both through tc.did and tc.sessionDid. Which value you get depends on whether the instance has an authenticated wallet-backed identity or is running in session-only mode.

Owner DID

After signIn() with a wallet, tc.did returns the owner DID.
Use the owner DID for:
  • delegations to other users or services
  • persistent user identity
  • records that should survive wallet re-authentication

Session DID

tc.sessionDid always returns the session key DID.
Use the session DID for:
  • debugging
  • tracing the active session key
  • understanding temporary session-only setups

What tc.did returns

The practical rule is simple: after wallet sign-in, use tc.did for delegation targets and user identity. Reach for tc.sessionDid only when you need the ephemeral key itself.

Source note

The SDK behavior described here is implemented in TinyCloudNode.ts and shared through the browser wrapper. The docs use owner DID and session DID to avoid the did:pkh vs did:key mix-up that breaks delegation chains.