Time Capsules

Time-lock mechanism, scheduling, and unlock workflow

Time Capsule Lifecycle

Complete journey of a time capsule from creation to unlock.

sequenceDiagram participant Creator participant App participant API participant S3 participant Glacier participant Scheduler as EventBridge participant Recipient participant Push as Push Notifications Creator->>App: Create time capsule App->>API: POST /capsules API->>S3: Store encrypted content API->>API: Generate unlock date API->>Scheduler: Schedule unlock event API-->>App: Capsule created Note over S3,Glacier: Time passes (days/years) S3->>Glacier: Auto-archive (lifecycle) Note over Scheduler: Unlock date arrives Scheduler->>API: Trigger unlock API->>Glacier: Initiate restore Glacier-->>S3: Content restored API->>API: Update capsule status API->>Push: Notify recipients Push->>Recipient: "Your time capsule is ready!" Recipient->>App: Open capsule App->>API: GET /capsules/{id} API->>API: Verify unlock date passed API->>S3: Generate signed URL API-->>App: Video URL App->>Recipient: Play video

Security Model

Server-side enforcement ensures content cannot be accessed early.

flowchart TB subgraph Client["Client (Untrusted)"] App["Mobile App"] end subgraph Server["Server (Trusted)"] API["API Gateway"] Lambda["Lambda Function"] Clock["Server Clock"] end subgraph Storage["Storage (Encrypted)"] S3["S3 / Glacier"] end App -->|1. Request content| API API -->|2. Check auth| Lambda Lambda -->|3. Check unlock date| Clock Clock -->|4. Date comparison| Lambda Lambda -->|If date passed| S3 S3 -->|Generate signed URL| Lambda Lambda -->|Return video| App Lambda -->|If date NOT passed| App Note right of Lambda: No early access possible Note right of S3: Content encrypted at rest

Unlock Scheduling

Hourly check for capsules ready to unlock.

flowchart TB subgraph Trigger["EventBridge"] Schedule["Rate: 1 hour"] end subgraph Lambda["Unlock Checker"] Query["Query GSI2\nUNLOCK#today"] Check["Check each capsule"] Restore["Initiate Glacier restore"] Update["Update status"] Notify["Send notifications"] end subgraph Data["DynamoDB"] GSI2["GSI2: Capsules by unlock date"] end subgraph Storage["S3"] Glacier["Glacier"] Standard["Standard"] end subgraph Notifications["Notifications"] Push["Push Notification"] Email["Email"] end Schedule -->|Every hour| Query Query --> GSI2 GSI2 --> Check Check --> Restore Restore --> Glacier Glacier -->|Restore| Standard Restore --> Update Update --> Notify Notify --> Push Notify --> Email

Glacier Restore Flow

Restoring archived content for unlock.

sequenceDiagram participant Scheduler participant Lambda participant Glacier participant S3 participant DDB Note over Scheduler: 24 hours before unlock date Scheduler->>Lambda: Pre-unlock trigger Lambda->>DDB: Get capsules unlocking tomorrow DDB-->>Lambda: Capsule list loop Each capsule in Glacier Lambda->>Glacier: InitiateRestore (Expedited) Note right of Glacier: 1-5 min for Expedited Glacier-->>Lambda: Restore initiated Lambda->>DDB: Update: status=restoring end Note over Glacier,S3: Content restores to S3 Standard Glacier->>S3: Content available S3->>Lambda: S3 event notification Lambda->>DDB: Update: status=available Note over Scheduler: Unlock time arrives Scheduler->>Lambda: Unlock trigger Lambda->>DDB: Update: status=unlocked Lambda->>Lambda: Send notifications

Unlock Date Ranges

Duration Storage Class Restore Time Cost Model
< 30 days S3 Standard Instant Standard pricing
30 days - 1 year Intelligent Tiering Instant Auto-optimized
1 - 10 years Glacier 1-5 minutes Low storage, restore fee
10 - 50+ years Glacier Deep Archive 12 hours Minimal storage, trust fund

Trust Fund Model

For very long-term capsules (50+ years), storage costs are pre-paid into a trust fund to ensure the content remains accessible.

Duration Estimated Cost (1GB) One-time Payment
10 years ~$0.12 $5 minimum
25 years ~$0.30 $10 minimum
50 years ~$0.60 $25 minimum
100 years ~$1.20 $50 minimum

Note: Pricing assumes continued cost reduction in storage. Trust fund covers potential increases.