TL;DR With a layer on top of the SAFE Network, we can have a planet-wide object store with orthogonal persistence. It’s a great opportunity to reinterpret what “data” is and how we should think about it.
I’m reading an interesting Gulliver story: https://ngnghm.github.io/. It reminds me what the SAFE Network is. And what it could be.
I found this from the Robigalia blog by Corey Richardson. He found inspirations from these stories. Coincidence: He builds a Rust ecosystem around a secure microkernel. Maybe Robigalia could be the future for the SAFE Network? (He’s not a wannabe OS developer: He was intern on seL4 verification team. Good reference. But the project goes very slow. Could use some help. Hint hint.)
One. Store everything user does. No need to think about persistence. No losing work anymore. (No losing post to safenet forum like yesterday. I didn’t retype it. Sorry. You missed my great wisdom forever.)
No SAVE button: You make a new text file, type a word. Saved automatically. Always. (If google docs can do, SAFE Network can do too.)
In SAFE Network: Append-only mutable data block. Pay once, append until block is full. Does it work like that? If not, could be useful.
From Chapter 2 of the interesting Gulliver story. Sorry for long quotes. It’s shorter than the full text.
Orthogonal Persistence
Ann explained to me that Houyhnhnm computing systems make data persistence the default, at every level of abstraction. Whether you open the canvas of a graphical interface and start drawing freely, or you open an interactive evaluation prompt and bind a value to a variable, or you make any kind of modification to any document or program, the change you made will remain in the system forever — that is, until Civilization itself crumbles, or you decide to delete it (a tricky operation, more below). Everything you type remains in your automatic planet-wide backups, providing several layers of availability and of latency — kept private using several layers of cryptography. [DESCRIPTION OF THE SAFE NETWORK!]
Notes about: User interface, security levels, and so on. User is always in control.
Of course, you can control what does or doesn’t get backed up where, by defining domains each with its own privacy policy that may differ from the reasonable defaults. The user interface is aware of these domains, and makes it clear at all times which domain you’re currently working with. It also prevents you from inadvertently copying data from a more private domain then pasting it into a more public one; in particular, you only type your primary passwords but in a very recognizable special secure domain that never stores them; and your secondary access keys are stored in a special private domain using stronger cryptography than usual, and also subject to various safety rules to avoid leakage.
Ideal situation: It is part of the operating system. EROS and KeyKOS did that: RAM is just write-through cache to persistent object store. A good OS could use the SAFE Network to have orthogonal persistence. Until that happens, SAFE Network libraries could implement it as default behavior for documents.
The adjective “orthogonal” means that the persistence of data is a property of the domain you’re working in, as managed by the system; it is not an aspect of data that programmers have to deal with in most ordinary programs; unless of course they are programmers specifically working on a new abstraction for persistence, which is after all an ordinary program, just in a narrow niche.
Anything an App does on SAFE Network uses this without thinking. The writer thought about safecoins too! Joke. But no stupid idealism: We know things has cost.
Regular programmers just manipulate the data with full confidence that the inputs they consume, the code that manipulates them, and the outputs they produce will each remain available as long as the user wants them, with the consistency guarantees specified by the user, as long as the user affords the associated costs.
NOTE: Persistence is not done by the App. It is done for the App:
Actually, ordinary programs don’t know and can’t even possibly know which domain they will be running in, and letting them query those details would be a breach of abstraction, with serious security implications and performance impediments, even assuming for a moment that it wouldn’t otherwise affect program correctness.
Maybe it needs a different model with a new layer between the App and the SAFE Network:
- Now: App gets a token, can do anything token allows.
- Then: Domain gets a token. App can’t connect to the SAFE Network directly. Instead: App is started “inside” a Domain and it uses syscalls to the Domain to request and manipulate objects.
The user can pick the Domain for the App. The App doesn’t need to know which. It never saves anything! The domain handles persistence for the objects the App works with. Copies of an App can run in multiple Domains at the same time.
The Domain owns the objects, not the App! It acts as write-through cache to the object store which is the SAFE Network. It applies persistence and other policies. (Described better in the quoted section above.)
Note: Not incompatible with current SAFE Network authentication. A “Domain” is just a special App, DomanApp is just an App that connects through Domain, not directly. Ideally, all “normal” Apps are turned into DomainApps (without access token, running inside Domains) and only Domains are “real” SAFE Network applications (with access token).
Will orthogonal persistence waste much space? Maybe not. From Chapter 3:
Dealing with Bad Memories
But, I inquired, if they log everything and almost never forget anything, don’t Houyhnhnm computing system quickly get filled with garbage? No, replied Ann. The amount of information that users enter through a keyboard and mouse (or their Houyhnhnm counterparts) is minute compared to the memory of modern computers, yet, starting from a well-determined state of the system, it fully determines the subsequent state of the system. Hence, the persistence log doesn’t need to record anything else but these events with their proper timestamp. This however, requires that all sources of non-determinism are either eliminated or recorded — which Houyhnhnm computing systems do by construction.
The writer talks about some methods to lower storage. But user has final control.
Of course, to save resources, you can also configure some computations so they are not recorded, or so their records aren’t kept beyond some number of days. For instance, you might adopt a model-view-controller approach, and consider the view as transient while only logging changes to the model and the controller, or even only to the model; or you might eschew long-term storage of your game sessions; or you might forget the awkward silences and the street noise from your always-on microphone; or you might drop data acquired by your surveillance camera when it didn’t catch any robber; or you might delete uninteresting videos; or you might expunge old software installation backups from long gone computers; or you might preserve a complete log only for a day, then an hourly snapshot for a few days, and a daily snapshot for a few weeks, a weekly snapshot for a few months, etc.; or you might obliterate logs and snapshots as fast as you can while still ensuring that the system will be able to withstand partial or total hardware failure of your personal device; or then again, given enough storage, you might decide to keep everything. It’s your choice — as long as you pay for the storage. The decision doesn’t have to be made by the programmer, though he may provide hints: the end-user has the last say.
Two. SAFE Network libraries could work with real objects as Chapter 3 talks. Algebraic Data Types.
Maybe it’s time to think about “files” differently? They are not blobs but real documents. How did we think about things before computers?
-
A picture is the original activations on a Bayer filter, the exposition settings, the date taken, the GPS location, the title given, the list of faces with pixel coordinates, the keywords, etc. And the editing steps! Like Lightroom: It doesn’t touch the original. It records transformation steps.
-
A book is not a string of numbers. It’s the author, the title, the cover, the chapters, the paragraphs. A snapshot at the end of the editing process.
-
If I am the writer, it’s all the outlines, the character descriptions, the revision graph. Every keypress, every word typed, every section moved from one place to other. The whole editing history, organized into bigger and bigger editing steps. Can my computer think about it like that? But it doesn’t. Want to look at an old version? I can’t. Want to “remove” a change from the history (create new version without that change)? I can’t. Save often? Use git? Great. But it should be automatic! Because it could be automatic.
If there are SAFE Network libraries that work with good document abstractions, it can be a new beginning: Revolutionize how we store data, but also revolutionize what data is and how people think about data. (Not the low level libraries, but higher level “SAFE Network Standard Libraries”.)
Data at the Proper Level of Abstraction
Because persistence in Human Computer Systems consists in communicating sequences of bytes to external processes and systems (whether disks or clouds of servers), all data they hold is ultimately defined in terms of sequences of bytes, or files; when persisting these files, they are identified by file paths that themselves are short sequences of bytes interpreted as a series of names separated by slashes / (or on some systems, backslashes , or yet something else). Because persistence in Houyhnhnm Computing Systems applies to any data in whichever high-level language it was defined, all Houyhnhnm computing data is defined in terms of Algebraic Data Types, independently from underlying encoding (which might automatically and atomically change later system-wide). For the sake of importing data in and out of independently evolving systems, as well as for the sake of keeping the data compressed to make the most of limited resources, some low-level encoding in terms of bytes may be defined for some data types. But on the one hand, this is the exception; on the other other, the data is still part of the regular Algebraic Data Type system, can still be used with type constructors (e.g. as part of sum, product or function types), etc. Whereas Human computer systems would require explicit serialization and deserialization of data, and would require ad hoc containers or protocol generators to allow larger objects to contain smaller ones, Houyhnhnm computing systems abstract those details away and generate any required code from type definitions.
When App sees a document and has better encoding, it can transform it. Transparently. Example: App learns FLAC encoding. It knows it is equivalent to WAV, so it searches for my documents encoded as WAV and recodes them. Without my instruction or knowledge. “It just works.”
Low-level encodings can even be replaced by newer and improved ones, and all objects will be transparently upgraded in due time — while preserving all user-visible identities and relationships across such changes in representation.
You are lucky because I only read this far so. Many great ideas that are good fit for the SAFE Network. Some impossible without the SAFE Network! (Or something similar. But there was nothing similar.) It’s time to make history?