Skip to content

Commit 3a4d9c3

Browse files
committed
wip: working on presentations
1 parent e59b097 commit 3a4d9c3

File tree

1 file changed

+89
-5
lines changed

1 file changed

+89
-5
lines changed

docs/reference/specifications/PSP-1 - Capability Model and Grammar.mdx

Lines changed: 89 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,14 @@ Design goals:
6464
- Secure by default: Holder-of-key (PoP) + channel binding; short TTLs for Presentations; pure, bounded builtins only.
6565
- Receipt-ready: CEPs can emit Access PoARs with program projection/proof traces (see PSP-2).
6666

67-
Non-goals (out of scope for PSP-01):
67+
Non-goals (out of scope for PSP-1):
6868

6969
- Enforcement placement/modes: CEP/BA placements (P/S/R) and mediate/derive/reveal semantics are specified in the CEP/BA spec.
7070
- Lease lifecycle/rotation: Lease issuance and rotation policies are defined elsewhere; PSP-1 only requires Lease freshness to be verified when Grants touch non-native SoA (enforced by CEP per TAP).
7171
- Receipt schemas: All receipt formats (PoAR/VOR/View) are specified in PSP-2.
7272
- Transport/envelope and sigchain framing (JOSE/COSE/DSSE, canonical bytes): specified in PSP-3.
7373
- Channel-binding mechanisms: Concrete binding profiles (e.g., TLS exporter, DPoP) are profiled elsewhere; PSP-1 only requires a verified binding.
74-
- Global time/ordering: PSP-01 does not require a global clock or total order. Acceptance (TAP) specifies clock sources and tolerances.
74+
- Global time/ordering: PSP-1 does not require a global clock or total order. Acceptance (TAP) specifies clock sources and tolerances.
7575
- Secret issuance/derivation/aggregation crypto and interactive evaluation flows.
7676
- No ZK/succinct delegation proofs in core; no signature aggregation (e.g., BLS).
7777
- No recursion or negation-as-failure in the Program (monotone only).
@@ -443,7 +443,7 @@ A conforming Grant MUST satisfy all of the following.
443443
- If any resource string in a declaration cannot be normalized under its scheme's rules, verification MUST deny.
444444
- If program_bytes cannot be parsed into a valid CPL/0 Program per PSP-1 (e.g., type errors, prohibited terms), verification MUST deny.
445445
7. Determinism and normalization invariants
446-
- A CEP MUST evaluate using only `{program_bytes/program_id, bundled Declarations, builtins_id, channel_lattice_id when used, and the scheme comparator selected by scheme name}`. No other registry artifacts may change the decision at verification.
446+
- The CEP MUST evaluate using only `{program_bytes/program_id, bundled Declarations, builtins_id, channel_lattice_id when used, and the scheme comparator selected by scheme name}`. No other registry artifacts may change the decision at verification.
447447
- At verification time the CEP MUST normalize the environment resource using the same scheme comparator semantics as those used during declaration canonicalization; normalization failure MUST cause deny.
448448

449449
### Attenuation by Derivation (Grant → Derived Grant)
@@ -471,9 +471,9 @@ Informative note: The precise tightening rules for builtins (e.g., within_time i
471471
- Presentations are ephemeral proofs that reference a Grant by its canonical digest (grant_ref). They carry PoP, channel binding, iat/exp, and ctx facts. Presentations are NOT recorded on sigchains.
472472
- CEPs verify the Grant (signatures, revocation per PSP-3), verify custody and syntactic attenuation along any delegation chain under the pinned registries, then evaluate the leaf Program against CEP-provided environment facts and the Grant's bundled Declarations.
473473
- On success, enforcement MAY proceed, and the CEP SHOULD emit an Access PoAR containing program_id, declaration CIDs, registry pins, and a minimal evaluation trace per PSP-2.
474-
- CEPs MUST deny if grant_ref cannot be resolved to a valid Grant under PSP3 framing and signatures.
474+
- CEPs MUST deny if grant_ref cannot be resolved to a valid Grant under PSP-3 framing and signatures.
475475

476-
### Minimial Illustrative Projection (Non-Normative)
476+
### Minimal Illustrative Projection (Non-Normative)
477477

478478
The following illustrates only the Grant payload structure relevant to PSP-1. Envelope fields, signatures, canonical claim bytes, and multihash details are defined in PSP-3.
479479

@@ -498,6 +498,90 @@ Implementers MUST NOT rely on this projection for wire encoding; the normative t
498498

499499
## Presentations
500500

501+
A Presentation is an ephemeral, on-path proof by the Subject (S) that it possesses a specific Grant and is exercising it now, on this live channel, in this runtime context. Presentations are NOT written to sigchains. They reference a Grant by its canonical digest (grant_ref, per PSP-3), are proof-of-possession (PoP) bound to the holder's key, and are cryptographically bound to the live session via a channel-binding profile. PSP-1 defines what a CEP must verify and evaluate; PSP-3 defines the on-wire framing and field mappings.
502+
503+
### Purpose and Role
504+
505+
- Ephemeral proof: Demonstrates holder-of-key (PoP) and binds use to the current session.
506+
- Grant reference: Points to the leaf Grant (grant_ref per PSP-3) that carries the Program and bundled Declarations.
507+
- Runtime facts: Conveys ctx and timing (iat/exp) the CEP uses to evaluate the Program's literals (e.g., ctx_eq, ttl_ok, within_time).
508+
509+
### Structure (Informative Projection)
510+
511+
Note: The names below are non-normative conceptual labels used by PSP-1. The normative on-wire field names and encodings are defined in PSP-3.
512+
513+
- presenter: DID of the holder (Subject).
514+
- grant_ref: canonical digest of the leaf Grant (per PSP-3).
515+
- iat: Int (NumericDate seconds) - mint time.
516+
- exp: Int (NumericDate seconds) - expiry; exp - iat SHOULD be short; MAY be bounded by Program via ttl_ok.
517+
- jti: nonce (unique) for replay resistance.
518+
- channel_binding: `{ profile: Str, value: BytesOrB64 }` - binding to the live session (e.g., TLS exporter, DPoP).
519+
- ctx: `Map<Str, Term>` — runtime context; MUST include at least the k/v required by the Program's ctx_eq literals.
520+
- chain (delegation material; TAP-governed; one is REQUIRED):
521+
- grants: OPTIONAL embedded Grant bodies (leaf→root) for offline verification (RECOMMENDED for air-gapped CEPs), or
522+
- grant_refs (+ resolvers): OPTIONAL parent digests and resolvers to fetch/verify custody; TAP MAY forbid network fetches.
523+
524+
### Normative Requirements
525+
526+
- Proof-of-possession and channel binding
527+
- The Presentation MUST be signed by the presenter (PoP). The CEP MUST verify PoP.
528+
- The Presentation MUST be bound to the live session per the declared channel_binding profile. The CEP MUST verify that the binding matches the live session and deny on mismatch.
529+
- Lifetime and timing
530+
- The CEP MUST reject if the Presentation is expired (now ≥ exp) or used too early (now < iat), subject to TAP clock discipline.
531+
- If the Program contains ttl_ok or within_time literals, the CEP MUST enforce them using iat/now/exp as appropriate.
532+
- If the Grant envelope carries a validity window (not_before/not_after) per PSP-3, the CEP MUST enforce it and, where both apply, MUST enforce the intersection with the Presentation's lifetime.
533+
- If the Program does not constrain Presentation lifetime via ttl_ok, TAP MAY impose a default maximum Presentation TTL.
534+
- Context
535+
- ctx MUST be a superset of the required ctx_eq(k, v) literals in the Program. Missing keys or unequal values MUST cause deny.
536+
- Grant reference and custody
537+
- grant_ref MUST resolve to a valid leaf Grant under PSP-3 framing and signatures; failure MUST cause deny.
538+
- If delegation is present, the Presentation MUST carry (or allow resolution of) sufficient delegation material to verify:
539+
- custody hop-by-hop (issuer(child) == subject(parent)),
540+
- prev linkage (per PSP-3),
541+
- pins compatibility (lang_version, builtins_id, and channel_lattice_id when channel_geq is used),
542+
- syntactic attenuation (checks/literals tightening and declarations subset).
543+
- Any failure in the above MUST cause deny.
544+
- Storage
545+
- Presentations MUST NOT be recorded on sigchains.
546+
547+
### Fail-Closed Conditions
548+
549+
A CEP MUST deny if any of the following holds:
550+
551+
- PoP signature invalid or channel binding does not match the live session.
552+
- Presentation lifetime invalid or violates ttl_ok/within_time literals.
553+
- grant_ref cannot be resolved to a valid Grant (PSP-3).
554+
- Custody/attenuation verification fails (missing parents; signature or prev linkage failure; cycle; TAP depth exceeded; pins mismatch; non-attenuating child).
555+
- Unknown or unavailable builtin referenced by the Program; unknown channel_lattice_id when channel_geq is present.
556+
- Unknown or unavailable scheme comparator required for declaration evaluation; env.resource normalization failure under the active comparator.
557+
- Missing required ctx keys or mismatched ctx_eq values.
558+
- Grant envelope validity window is violated (now outside not_before/not_after per PSP-3).
559+
560+
### Minimal Illustrative Projection (Non-Normative)
561+
562+
Note: PSP-3 defines the authoritative on-wire encoding and field mapping.
563+
564+
```
565+
{
566+
"iss": "did:pk:S",
567+
"grant_ref": "cid://G_leaf",
568+
"iat": 1768099200,
569+
"exp": 1768099320,
570+
"jti": "uuid-1234",
571+
"channel_binding": {
572+
"profile": "tls_exporter:v1",
573+
"value": "base64url(exporter)"
574+
},
575+
"ctx": { "ns": "ci", "pod": "runner-xyz" },
576+
"grants": [ /* OPTIONAL: embedded leaf→root chain for offline */ ]
577+
}
578+
```
579+
580+
### Notes (informative)
581+
582+
- PSP-1 does not mandate exact Presentation field names or encodings; those appear in PSP-3. The CEP's obligations here are limited to PoP verification, channel binding verification, custody/attenuation verification, and Program evaluation under the pinned semantics and bundled declarations.
583+
- Per-use narrowing is achieved by the Program's literals (e.g., ctx_eq, ttl_ok) evaluated against Presentation-supplied ctx and iat/exp. A future TAP-gated profile MAY introduce presentation overlays with strict attenuation and receipt requirements.
584+
501585
## Delegation && Attenuation
502586

503587
## CEP Verification Algorithm

0 commit comments

Comments
 (0)