Mim Protocol v0.1
Heads up: this documentation is currently a work in progress - it is being made public as part of a product that is actively being built. There is no guarantee of a stable API. If you would like to be kept up to date with it, please sign up for the mailing list at getaether.net.
Mim is a open, distributed, peer-to-peer network protocol that distributes objects in a fashion that aims to be easy to build from a developer's standpoint. It's the protocol underlying Aether, which is the reference implementation of the Mim protocol.
It comes with efficient mechanisms that can sync one node to another with minimal amount of state that is being passed. It does not come with a distributed consensus mechanism; the actions taken cannot have any side effects that can split the network timeline. If the blockchain is C, Mim is Haskell. If you are used to the blockchain method of thinking, it appears at first that constraint renders it unable to do anything (similar to most people's first reactions to functional programming, actually), but it is actually possible to do almost anything — and not only that, it is actually much easier to do so as well.
Mim will probably eventually come with a small blockchain implementation for those of you that cannot live without a state. But for the time being, it is a purely 'functional' distributed network. It is also under heavy development, so please do not these docs too seriously yet! When it is ready, a binary Mim Runtime Environment that can be configured for the distribution logic of your particular app's objects will be provided.
How do I build my own Mim app?
- Download MRE binary or compile it from source code.
- In the configuration files, define your objects, and two variables, size of your NETWORK_MEMORY and NETWORK_HEAD. NETWORK_MEMORY controls for how long your network will remember objects that cease to be referenced before being garbage collected, and NETWORK_HEAD determines how long of a time period is considered a 'HEAD' state (per git parlance) that will be tracked and distributed to new entrants.
- MRE will establish your network, and start to connect to other nodes as required. You might want to talk to other people running Mim apps at this point and ask whether they would be willing to allow their apps (also based on an identical MRE instance) to distribute your objects as well (any Mim node can carry any Mim based object regardless of the subprotocol), even if they don't use your objects. If you can convince some other app owners, this is a good way to instantly have some network availability for your project.
- Create your app in a way that uses MRE effectively as a database. The network sync will happen completely invisibly to you and the binary will keep you tracking the HEAD. Do consider caching your objects in your own app - in the case of Aether, the objects (entities) that compose of a thread is distributed across the network as independent objects, but Aether precompiles it into threads, posts, users etc. so that a user going into a thread does not cause a huge Mim database seek to find all the objects that relate to it, and construct on the fly. You should be asking your MRE regularly for updates, which will provide you either full replacement objects or deltas based on your preference and what is possible at that time.
- After you're done, consider allowing your app's MRE to handle other Mim based subprotocols (i.e. other people's apps) so that they can benefit from your user base.
How do I build my own Aether app?
Aether is just an app that utilises two mim subprotocols called c0 and dweb. You can build your own app that uses c0 subprotocol with what's provided in "How to build my own Mim app?" section.
This documentation is mostly about c0 protocol (distributed forums), as it started out as a documentation for Aether. This will be rectified by further updates making a more clear delineation between c0 and Mim.
Mim provides, in a peer-to-peer fashion:
- The ability to freely create boards, threads and posts within them
- Upvoting, downvoting posts and thus provide community moderation
- Admin-moderating the communities you have created,
- But also the right for your communities to reject your moderation
- Add and remove moderators for admins
- And also the ability to have unmoderated communities that rely completely on community moderation
- Spam and sybil protection with proof-of-work, blocking and a reputation system
- Unique identities and usernames with cryptographic signatures (optional)
- On the other side, posting without a signature, thus remaining anonymous
- An extensible protocol that can accommodate new object types, and proper structure to declare extensions.
- In addition, it provides static nodes, which are static websites that can be used as containers of information available for everyone
Mim does not require need infrastructure, and is completely independent of anything except a working Internet connection. Nodes bootstrap off of each other when they join the network. The only thing you need to know is an IP and a Port that is a Mim node. In most practical cases, Mim client applications come with their own bootstrap nodes.
The aim of the author is to create an underlying common-language between computers for human discussion that is ubiquitous and free.
"Mim" name is a reference to mime, the technique of suggesting action, character, or emotion without words, using only gesture, expression, and movement.
In a semi-cheeky fashion, Mim handles everything else; the words, however, are yours to add.
How to use this document
This document provides everything you need to write your own Mim-speaking program that can communicate with other Mim clients.
- Entities: Basic protocol objects
- API: Information on how to use and query other Mim clients
- Endpoints: Building and targeting queries for other clients, and the answer format
- Common flow: The most common series of actions that you will likely need to implement
- Usage examples: Example requests and responses