Skip to content

Commit 082ddf1

Browse files
committed
docs: add a section to explain Lit resources
1 parent 5374f72 commit 082ddf1

File tree

3 files changed

+53
-3
lines changed

3 files changed

+53
-3
lines changed

docs/guides/server-sessions.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ This pattern keeps the delegation scoped (resources and expiration are enforced
1212
# Workflow
1313

1414
1. **Client generates a session keypair** with `generateSessionKeyPair()`.
15-
2. **Client creates a delegation auth signature** with `authManager.generatePkpDelegationAuthSig`, scoping the allowed Lit resources and expiration.
15+
2. **Client creates a delegation auth signature** with `authManager.generatePkpDelegationAuthSig`, scoping the allowed [Lit resources](/sdk/resources/lit-resources-and-abilities) and expiration.
1616
3. **Client sends the bundle** { sessionKeyPair, delegationAuthSig, pkpPublicKey }` to the server over a secure channel.
1717
4. **Server restores an auth context** using `authManager.createPkpAuthContextFromPreGenerated`.
1818
5. **Server issues fresh session signatures on demand** (e.g., `authManager.createPkpSessionSigs`) immediately before calling SDK helpers such as the wrapped-keys API or `pkpSign`.
@@ -116,7 +116,7 @@ await serverLitClient.chain.ethereum.pkpSign({
116116
# Security considerations
117117

118118
- **Treat the session keypair like a secret.** Whoever holds the private key can mint new session signatures until the delegation expires.
119-
- **Scope the delegation.** Restrict resources to the minimal Lit resources needed and set conservative expirations.
119+
- **Scope the delegation.** Restrict resources to the minimal [Lit resources](/sdk/resources/lit-resources-and-abilities) needed and set conservative expirations.
120120
- **Rotate on failure.** If a node joins or leaves the network the server can simply regenerate session signatures with the current handshake; if that fails, request a fresh delegation from the client.
121121

122122
# When to use this pattern

docs/sdk/auth-context-consumption/wrapped-keys.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Unlike the Core API flows (`pkpSign`, `executeJs`, `encryptAndDecrypt`) that acc
1212
# How the flow differs from other Core API methods
1313

1414
- **Why generate a delegation auth sig?**
15-
You delegate your PKP to an ephemeral session key so the wrapped-keys Lit Actions can execute without presenting your long-lived auth credentials. The delegation constrains the permissions (`pkp-signing`, `lit-action-execution`, `access-control-condition-decryption`) and sets an expiry window, limiting blast radius if the session key is ever leaked.
15+
You delegate your PKP to an ephemeral session key so the wrapped-keys Lit Actions can execute without presenting your long-lived auth credentials. The delegation constrains the permissions (`pkp-signing`, `lit-action-execution`, `access-control-condition-decryption`) and sets an expiry window, limiting blast radius if the session key is ever leaked. Refer to the [Lit resources guide](/sdk/resources/lit-resources-and-abilities) for the full catalogue of resource prefixes and abilities.
1616

1717
- **Why supply PKP session signatures?**
1818
Wrapped-keys endpoints reuse the same session bundle across all networks (for example, Lambda functions in the v7 stack). Provide `pkpSessionSigs` produced by `authManager.createPkpSessionSigs` so the Lit nodes can verify the delegated permissions before executing the action.
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
---
2+
title: Lit Resources & Abilities
3+
description: "Understand which resource prefixes the Lit network recognises, the abilities each unlocks, and how capability objects scope them."
4+
---
5+
6+
# Overview
7+
8+
Lit Resources describe **what** you want a delegated capability to touch. Lit Abilities describe **which operation** the holder may perform against that resource. Every delegation or session signature lists both so downstream nodes can enforce the scope before a request executes.
9+
10+
This page summarises the resource prefixes supported by the Lit nodes today, the abilities each exposes, and how wildcard scoping works when building capability objects (e.g., SIWE + ReCap or `createAuthManager` flows).
11+
12+
## Resource catalogue
13+
14+
| Prefix | Shorthand | Description | Resource key format | Supported abilities |
15+
| ------ | --------- | ----------- | ------------------- | ------------------- |Ç
16+
| `lit-accesscontrolcondition` | `ACC` | Access control condition hashes. Used when decrypting or signing data gated by a condition. | `lit-accesscontrolcondition://<hash>` | `access-control-condition-decryption`, `access-control-condition-signing` |
17+
| `lit-pkp` | `PKP` | Programmable Key Pair NFT token IDs. Grants threshold signing with that PKP. | `lit-pkp://<tokenId>` | `pkp-signing` |
18+
| `lit-litaction` | `LA` | Lit Action IPFS content identifiers. Authorises deterministic JavaScript execution hosted by the network. | `lit-litaction://<cid>` | `lit-action-execution` |
19+
| `lit-paymentdelegation` | `PD` | Payment delegation tokens proving prepaid usage. Lets a delegate authenticate against the payment delegation balance. | `lit-paymentdelegation://<tokenId>` | `lit-payment-delegation` |
20+
21+
<Note>
22+
The Lit nodes reserve an additional prefix, `lit-resolvedauthcontext`, for internal bookkeeping. End-user delegations should only target the four prefixes in the table above.
23+
</Note>
24+
25+
### Wildcards
26+
27+
- Use `prefix://*` to authorise every resource under a prefix (for example, `lit-pkp://*` allows PKP signing with any PKP controlled by the delegator).
28+
- Use `*/*` within a capability object to wildcard every ability for a resource entry. This is rarely necessary; prefer enumerating the specific ability (e.g., `Threshold/Decryption`) whenever possible.
29+
30+
## Ability mapping
31+
32+
Internally, each ability maps into a Recap namespace/action pair:
33+
34+
| Lit ability | Recap namespace / ability | Typical operation |
35+
| ----------- | ------------------------ | ----------------- |
36+
| `access-control-condition-decryption` | `Threshold/Decryption` | Decrypting symmetric keys or JWT payloads behind an access control condition. |
37+
| `access-control-condition-signing` | `Threshold/Signing` | Threshold signing checks required by some access control conditions. |
38+
| `pkp-signing` | `Threshold/Signing` | Using a PKP NFT for message or transaction signing. |
39+
| `lit-action-execution` | `Threshold/Execution` | Running Lit Actions (`executeJs`) hosted on IPFS or supplied inline. |
40+
| `lit-payment-delegation` | `Auth/Auth` | Presenting a payment delegation token to prove prepaid execution quota. |
41+
42+
The Lit SDK builds these mappings automatically when you call helpers such as `generatePkpDelegationAuthSig` or `createAuthManager`. When constructing capability objects manually (for example, via SIWE + ReCap), ensure you choose the namespace/action pair that matches the desired Lit ability.
43+
44+
## Capability enforcement
45+
46+
- Delegations are only honoured if the resource key and ability pair appear in the capability object obtained during authentication.
47+
- The node accepts either an exact resource key or a wildcard entry under the same prefix. If neither exists, the request is rejected before any signing, decryption, or execution occurs.
48+
- Mixing unrelated prefixes or abilities (for example, requesting `lit-action-execution` for a PKP resource) fails validation because the node cross-checks the allowed combinations at verification time.
49+
50+
By scoping to precise resources and short expirations, you can safely hand session materials (like delegation auth signatures) to backend services without granting broader access than intended.

0 commit comments

Comments
 (0)