Chapter 4 gave us authorization — authenticated stores where access is proven structurally from roots. Each user has a scoped tree. How does Alice give Bob read access to a subtree without her full root?
No new primitives. Just a shares map convention in every root,
plus a claim protocol. Users share with users; server shares with
users — uniform mechanism.
root = {
\"value\": <app data>,
\"shares\": {name: {target: #H, authorized: Set}, ...},
\"groups\": {name: Set, ...}
}
Managed via PUTs.
shares[\"photos\"] = {#T, #{bob}}CLAIM \"photos\" alicesequenceDiagram
participant A as Alice
participant B as Bob
participant S as Server
Note over A: shares["photos"]:<br/>{target: #T, authorized: #{bob}}
A->>B: out-of-band: "claim 'photos' from me"
B->>S: CLAIM "photos" from Alice
Note over S: look up Alice's root<br/>find shares["photos"]<br/>check bob ∈ authorized ✓<br/>extract #T
S-->>B: added #T to valid roots
B->>S: GET/PUT using #T as proof root
server-root.shares = {
\"alice\": {#RA, #{alice}},
\"team\": {#TP, #{alice,bob}}
}
Auth = claim server share. No special server state.
graph TD
SR["Server Root"] --> SV["value: config"]
SR --> SS["shares"]
SS --> SA["'alice': {#RA, #{alice}}"]
SS --> SB["'bob': {#RB, #{bob}}"]
SS --> ST["'team': {#TP, #{alice,bob,carol}}"]
SA --> RA["Alice's tree"]
SB --> RB["Bob's tree"]
ST --> TP["Team tree"]
style SR fill:#4a9,stroke:#333,color:#fff
Claim → read/incorporate → your share back. Bidirectional, no write-back.
authorized: \"team\" → root.groups["team"] = #{alice,bob}
Update once → everywhere.
\"public\": #{neg} — cofinite (Ch2).
| Type | Auth Set |
|---|---|
| Private | #{me} |
| Direct | #{me,bob} |
| Shared | #{team} |
| Public | #{neg} |
Alice updates target → Bob reclaims latest. Revoke: dissoc/auth change.
Photos: update target. Edits: re-share modified. Team: multi-auth share.
graph TD
AE["Alice's tree"] --> SM["Shared subtree #SM"]
BE["Bob's tree"] --> SM
SM --> N1["shared nodes"]
SM --> N2["shared nodes"]
style SM fill:#aa4,stroke:#333,color:#fff
Deduplication natural.
Proof chains = trail.
| Old | New |
|---|---|
| Grants/lifecycle | Shares in data |
| Gift queues | Claim-time lookup |
| Service root | Server shares |
| Fn | Sig |
|---|---|
claim |
(Server, id, sharer, name) → #H |
authorized? |
(Root, name, id) → bool |
share, unshare, add-group — hamt ops.
Zero new primitives — conventions atop Ch4.
Top of stack: hash → values → stores → auth → sharing.