// uuid_generator
GYST UUID v8
Generate and decode GYST UUID v8 identifiers. Every entity in PopSoc is addressed by a 128-bit UUID with embedded type, domain, and timestamp.
UUID Generator
UUID Decoder
Bit Structure (128 bits)
Key Features
Entity Type Codes
0x01016User accounts and profiles
0x02032Root GYST event containers
0x03048Visual canvas/page layouts
0x04064Saved view configurations
0x05080Vendor/sublicant entities
0x06096Products and offerings
0x070112Scheduled sessions/talks
0x080128Communication channels
0x090144Grouped entity collections
0x100256Individual messages
Usage Example
import { generateUUID, parseUUID } from '@/lib/uuid'
// Generate UUIDs for different entity types
const eventUuid = generateUUID('event', 'wine-fest-2026')
const vendorUuid = generateUUID('vendor', 'wine-fest-2026', eventUuid)
const userUuid = generateUUID('user')
// Parse a UUID to extract metadata
const parsed = parseUUID(vendorUuid)
console.log(parsed)
// {
// entityType: 'vendor',
// entityCode: 80,
// eventHash: 1234,
// timestamp: 12345678,
// isValid: true
// }
// Check if entities belong to same event
const sameEvent = parseUUID(vendorUuid).eventHash === parseUUID(eventUuid).eventHashImplementation Notes
Event Hash Generation
The 12-bit event hash is derived from the event slug using a consistent hashing function. This allows all entities within an event to share the same event hash, enabling efficient filtering without joins.
Timestamp Precision
The 24-bit timestamp represents seconds since January 1, 2024. This provides a range of ~194 days at second precision, or can be scaled for longer ranges at reduced precision.
Parent-Child Relationships
Child entities (vendors, sessions) inherit the event hash from their parent, establishing a queryable hierarchy. The parent_uuid column provides explicit relationships for complex queries.
Database Indexing
Index on SUBSTR(uuid, 1, 3) for entity type queries, and SUBSTR(uuid, 4, 3) for event scoping. SQLite/Turso handles these efficiently.
Full Specification
The complete GYST UUID v8 protocol specification, including edge cases, migration guides, and language-specific implementations, is maintained as a GitHub Gist.
gist.github.com/SoMaCoSF/aabf2966a198b03de2434fab5e717d3a