Expand description
Common types that describe how to mount and operate on our internal representation of a ‘bucket’. Represents the contents of a bucket at a given version Bucket data structures and operations
This module defines the core types for JaxBucket’s encrypted, content-addressed file storage:
- [
Manifest]: Bucket metadata including ID, name, shares, and content-addressed pointers - [
Node]: DAG structure representing directories and files - [
Mount]: In-memory representation of a bucket with CRUD operations - [
Pins]: Set of content hashes that should be kept available - [
Principal]: Access control entries (peer identity + role)
§Architecture
§Buckets as DAGs
A bucket is a Directed Acyclic Graph (DAG) of encrypted nodes:
Manifest (unencrypted) --entry--> Root Node (encrypted)
|
+------------------+------------------+
| | |
File1 Dir Node File2
(encrypted) (encrypted) (encrypted)
|
+-------+-------+
| |
File3 File4
(encrypted) (encrypted)§Content Addressing
All nodes and files are content-addressed by their (post-encryption) hash.
Links between nodes use Link, which includes:
- Hash (BLAKE3)
- Codec (DAG-CBOR for nodes, Raw for encrypted data)
- Format (Raw blob or HashSeq)
§Encryption Model
Structs§
- Base
Wins - Base-wins conflict resolution (conservative)
- Conflict
- A detected conflict between two operations on the same path
- Conflict
File - Conflict-file resolution (recommended for peer sync)
- Fork
OnConflict - Fork-on-conflict resolution
- Last
Write Wins - Last-write-wins conflict resolution (default CRDT behavior)
- Manifest
- The root metadata structure for a bucket.
- Merge
Result - Result of a merge operation with conflict information
- Mount
- Node
- OpId
- Operation identifier for causal ordering
- Path
OpLog - The path operation log - an operation-based CRDT
- Path
Operation - A single path operation in the CRDT log
- Pins
- Principal
- A principal identity on a bucket.
- Resolved
Conflict - A conflict that was resolved
- Share
- A principal’s share of bucket access.
Enums§
- Manifest
Error - Errors that can occur during manifest operations.
- Mount
Error - Node
Error - Node
Link - OpType
- Type of path operation
- Principal
Role - The role of a principal on a bucket.
- Resolution
- Resolution decision for a conflict
Traits§
- Conflict
Resolver - Trait for conflict resolution strategies
Functions§
- conflicts_
with_ mv_ source - Check if an operation at this path would conflict with a move operation
- merge_
logs - Merge multiple PathOpLogs from divergent chains into a single log
- operations_
conflict - Check if two operations conflict
Type Aliases§
- Shares
- Map of hex-encoded public keys to their shares.