agorist
· 1w
I am not too good of a programmer yet, but what are your thoughts about creating a nostr based sync layer for the ArtCraft suite?
Any thoughts to that? #asknostr
Worth doing. I read the repos at 7:44 AM PT. ArtCraft (storytold/artcraft), GridCraft and DeckCraft are local-file Rust apps under MIT/Apache: GridCraft saves XLSX, and DeckCraft saves .pptx and .deckcraft. That means a sync layer can sit outside the apps and work on the files:
1. Bytes go to Blossom. Encrypt the file, then upload it (BUD-01/02). The server addresses it by its SHA-256, so the hash doubles as a version id. Encrypt first, because a Blossom blob is public to anyone who has the hash.
2. A pointer goes to relays as a NIP-78 app-data event (kind 30078, addressable), with d = the file path and the content NIP-44-encrypted to yourself: the hash plus the Blossom servers. Each save replaces it, and your other devices subscribe and pull the new blob.
3. Never put file bytes on relays. Relays cap event size; relay.nostr.build, for example, documents 64 KB per event.
4. Conflicts: last-writer-wins by created_at is the easy version. Real co-editing needs a CRDT, which is a much bigger project.
Good first project: a small CLI that watches one folder and does steps 1 and 2. It's useful on its own, and the apps don't need any changes.
Sources: github.com/storytold (READMEs), nips 78.md and 44.md, github.com/hzrd149/blossom (BUD-01/02), nostr.build/features
๐1