Skip to content

Commit d8b6574

Browse files
committed
wip
1 parent bb5cb51 commit d8b6574

File tree

1 file changed

+30
-74
lines changed

1 file changed

+30
-74
lines changed

docs/reference/specifications/psp-1.mdx

Lines changed: 30 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1118,6 +1118,8 @@ Grants and transient proof-of-use.
11181118

11191119
#### 5.2.3 Normative Requirements
11201120

1121+
A conforming Presentation MUST satisfy all of the following.
1122+
11211123
- Proof-of-possession and channel binding
11221124
- The Presentation MUST be signed by the presenter (PoP). The CEP MUST verify
11231125
PoP.
@@ -1177,12 +1179,7 @@ A CEP MUST deny if any of the following holds:
11771179
- Required parent Grants are not locally available at enforcement (e.g., TAP
11781180
forbids resolution or resolution failed).
11791181

1180-
#### 5.2.5 Structure and Informative Projection
1181-
1182-
Note: The names below are non-normative conceptual labels used by PSP-1. The
1183-
normative on-wire field names and encodings are defined in PSP-3. This list of
1184-
fields and the subsequent JSON example are informative; deployments MAY map to
1185-
alternative encodings but MUST preserve the semantics.
1182+
#### 5.2.5 Illustrative Projection
11861183

11871184
- **presenter**: DID of the holder (Subject).
11881185
- **grantRef**: canonical digest of the leaf Grant (per PSP-3).
@@ -1205,9 +1202,9 @@ alternative encodings but MUST preserve the semantics.
12051202
proof). PSP-1 core does not define or require such artifacts and forbids
12061203
embedding raw Grant bodies in Presentations.
12071204

1208-
**Example:** The following JSON projection illustrates one possible mapping of
1209-
the conceptual fields. Names and encodings are illustrative only; the normative
1210-
specification of on-wire fields is defined in PSP-3.
1205+
The following illustrates the Presentation structure relevant to PSP-1. Names
1206+
and encodings are illustrative only; the normative specification of on-wire
1207+
fields is defined in PSP-3.
12111208

12121209
```json
12131210
{
@@ -1458,7 +1455,7 @@ binary encoding, envelope framing, and multihash identity).
14581455
and each query is an AND of ground predicates.
14591456
- Structural mapping (CPL/0 -> Biscuit):
14601457
- Program (ALL of Checks) $\cong$ a set of Biscuit check blocks, all of which
1461-
MUST pass.
1458+
need to pass.
14621459
- Check (ANY of Queries) $\cong$ a Biscuit check containing multiple queries
14631460
(OR).
14641461
- Query (AND of Literals) $\cong$ a Biscuit query whose predicates match CPL/0
@@ -1468,29 +1465,28 @@ binary encoding, envelope framing, and multihash identity).
14681465
(Str/Int/Bool/Bytes).
14691466
- Conversion constraints (Biscuit -> CPL/0 normalizer):
14701467
1. No rules or user facts are consumed during conversion; only checks are
1471-
considered. Any presence of rules, variables, non-ground terms, or
1472-
unsupported predicates MUST cause conversion to fail (out of scope for
1473-
CPL/0 interop).
1474-
2. All predicate identifiers MUST correspond to recognized builtin operations
1475-
(`op` strings) in the pinned `builtinsId`; argument arity and types MUST
1468+
considered. If rules, variables, non-ground terms, or unsupported
1469+
predicates are present, conversion fails (out of scope for CPL/0 interop).
1470+
2. Predicate identifiers should correspond to recognized builtin operations
1471+
(`op` strings) in the pinned `builtinsId`; argument arity and types should
14761472
match; strings are NFC; Bytes are exact octets.
14771473
3. The resulting CPL/0 Program is constructed as `all(check_i)`; each Biscuit
14781474
check yields one CPL/0 Check; each Biscuit query yields one CPL/0 Query;
14791475
each recognized predicate yields one CPL/0 Literal.
1480-
- Equivalence goal (informative): For tokens inside this fragment and under
1481-
identical pinned semantics (builtins/channel lattice/scheme comparators),
1482-
verification outcomes SHOULD coincide between Biscuit's check evaluation and
1483-
CPL/0 Program evaluation over the same environment facts. Outside this
1484-
fragment, issuers SHOULD precompute finite sets and ship a CPL/0 guard, or use
1485-
a TAP-gated policy that provides an approved CEP runtime.
1476+
- Equivalence goal: For tokens inside this fragment and under identical pinned
1477+
semantics (builtins/channel lattice/scheme comparators), verification outcomes
1478+
are expected to coincide between Biscuit's check evaluation and CPL/0 Program
1479+
evaluation over the same environment facts. Outside this fragment, issuers can
1480+
precompute finite sets and ship a CPL/0 guard, or use a TAP-gated policy that
1481+
provides an approved CEP runtime.
14861482

14871483
Because CPL/0 is checks-only over ground terms with pure, bounded builtins, CEPs
1488-
evaluate Programs deterministically and emit minimal proof traces (which check,
1489-
which query, which literals). This keeps receipts auditable without a general
1490-
Datalog engine. If richer inference is required in a domain, issuers or
1491-
attestors SHOULD precompute finite sets (content-addressed) and reference them
1492-
from the Program; alternative extensions that carry ruleful logic MUST remain
1493-
TAP-gated and provide either a compiled CPL/0 guard or an approved CEP runtime.
1484+
evaluate Programs deterministically and can emit minimal proof traces (which
1485+
check, which query, which literals). This keeps receipts auditable without a
1486+
general Datalog engine. If richer inference is required in a domain, issuers or
1487+
attestors can precompute finite sets (content-addressed) and reference them from
1488+
the Program; alternative extensions that carry ruleful logic should remain
1489+
TAP-gated with either a compiled CPL/0 guard or an approved CEP runtime.
14941490

14951491
## 6. Security Considerations
14961492

@@ -2230,59 +2226,19 @@ Expect: Deny at chain verification due to a pin mismatch.
22302226

22312227
## 10. Implementation Considerations
22322228

2233-
### 10.1 Placement and operational considerations
2234-
2235-
### 10.2 Placement-Specific Guidance
2236-
22372229
- Resource-side CEPs (physics-bound)
22382230
- Keep Programs/ctx minimal; pre-normalize resources; precompile program
22392231
plans; pre-mirror chains/revocation; enforce microsecond/millisecond budgets
22402232
with deterministic scheduling. If deadlines cannot be met, fail-closed and
22412233
apply domain-safe fallback per TAP.
2242-
- Principal/Subject-side CEPs
2234+
- Principal-/Subject-side CEPs
22432235
- Preload and cache Grants and revocation state; amortize verification with
2244-
sessions (outside PSP-1) and avoid unbounded ctx.
2245-
2246-
### 10.3 Example implementation notes
2247-
2248-
- PSP-1 does not mandate exact Presentation field names or encodings; those
2249-
appear in PSP-3. The CEP's obligations here are limited to PoP verification,
2250-
channel binding verification, custody/attenuation verification, and Program
2251-
evaluation under the pinned semantics and bundled declarations.
2252-
- Per-use narrowing is achieved by the Program's literals (e.g., ctxEq, ttlOk)
2253-
evaluated against Presentation-supplied ctx and iat/exp. TAP policy MAY
2254-
introduce presentation overlays with strict attenuation and receipt
2255-
requirements.
2256-
2257-
- db:// scheme: register a PSP-4 comparator (normalization + subset semantics).
2258-
Often equality on cluster/app, or bounded prefix if you expose sub-scopes.
2259-
- If the Resource is PK-native, use Resource-side CEP; otherwise bridge at
2260-
Principal-side (as shown).
2261-
- Presentations remain small; do not embed Grant bodies in PSP-1 core. If
2262-
parents aren't local at enforcement, deny (TAP defines pre-enforcement
2263-
hydration or stapling chain proof).
2264-
- Receipts: PoAR should capture enough to audit the decision (`programId`,
2265-
declaration CIDs, pins, minimal trace), plus derivation metadata (tokenRef),
2266-
but never the token itself.
2267-
2268-
- Resource normalization: ensure env.resource is normalized using the scheme
2269-
comparator (vault:, door:) that was used to canonicalize Declarations;
2270-
failures must deny.
2271-
- Pins must match across delegation hops: `langVersion`, `builtinsId`, and, when
2272-
used, `channelLatticeId`. Mismatches deny.
2273-
- Presentations remain small and referential; do not embed Grant bodies in PSP-1
2274-
core. If parents are required and not locally available at enforcement, deny
2275-
(TAP governs pre-enforcement hydration or profile-level stapling).
2276-
- Receipts (PSP-2): PoARs SHOULD record `programId`, declaration CIDs, pins,
2277-
minimal evaluation trace, and revocation/freshness context; redactions and
2278-
selective disclosure are TAP/PSP-2 concerns.
2279-
2280-
### 10.4 Informative guidance
2281-
2282-
Keep operator identifiers stable and registry-pinned to avoid PCF instability
2283-
from renaming. When referencing Declarations by content address (e.g.,
2284-
"Pairs#CID"), ensure the reference syntax and encoding are deterministic and
2285-
consistent.
2236+
sessions (outside PSP-1) and avoid unbounded ctx. Keep long-lived upstream
2237+
leases only at the Principal side when bridging legacy (PS-BA); Subject-side
2238+
should handle only session/short-scope credentials (SSA).
2239+
- Receipts: "the enforcer mints the proof." Write the PoAR on the enforcer's
2240+
sigchain (P/R/S per placement) and deliver to the Subject; structure per
2241+
PSP-2.
22862242

22872243
## 11. References
22882244

0 commit comments

Comments
 (0)