> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tinycloud.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# DID Formats

> Use the right DID for identity, delegation, and debugging.

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.

```typescript theme={null}
await tc.signIn();

console.log(tc.did);
// did:pkh:eip155:1:0x...
```

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.

```typescript theme={null}
console.log(tc.sessionDid);
// did:key:z6Mk...#z6Mk...
```

Use the session DID for:

* debugging
* tracing the active session key
* understanding temporary session-only setups

## What `tc.did` returns

| State             | `tc.did`    | `tc.sessionDid` |
| ----------------- | ----------- | --------------- |
| Wallet signed in  | owner DID   | session DID     |
| Session-only mode | session DID | session DID     |

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.
