--- title: Remote log specification version: 0.1.1 status: Draft authors: Oskar Thorén oskar@status.im, Dean Eigenmann dean@status.im redirect_from: - /remote-log.html --- ## Table of Contents 1. [Abstract](#abstract) 2. [Definitions](#definitions) 3. [Wire Protocol](#wire-protocol) 1. [Secure Transport, storage, and name system](#secure-transport-storage-and-name-system) 2. [Payloads](#payloads) 4. [Synchronization](#synchronization) 1. [Roles](#roles) 2. [Flow](#flow) 3. [Remote log](#remote-log) 4. [Next page semantics](#next-page-semantics) 5. [Interaction with MVDS](#interaction-with-mvds) 5. [Changelog](#changelog) 6. [Acknowledgements](#acknowledgements) 7. [Copyright](#copyright) 8. [Footnotes](#footnotes) ## Abstract A remote log is a replication of a local log. This means a node can read data from a node that is offline. This specification is complemented by a proof of concept implementation[^1]. ## Definitions | Term | Definition | | ----------- | -------------------------------------------------------------------------------------- | | CAS | Content-addressed storage. Stores data that can be addressed by its hash. | | NS | Name system. Associates mutable data to a name. | | Remote log | Replication of a local log at a different location. | ## Wire Protocol ### Secure Transport, storage, and name system This specification does not define anything related to: secure transport, content addressed storage, or the name system. It is assumed these capabilities are abstracted away in such a way that any such protocol can easily be implemented. ### Payloads Payloads are implemented using [protocol buffers v3](https://developers.google.com/protocol-buffers/). **CAS service**: ```protobuf syntax = "proto3"; package vac.cas; service CAS { rpc Add(Content) returns (Address) {} rpc Get(Address) returns (Content) {} } message Address { bytes id = 1; } message Content { bytes data = 1; } ``` **NS service**: ```protobuf syntax = "proto3"; package vac.cas; service NS { rpc Update(NameUpdate) returns (Response) {} rpc Fetch(Query) returns (Content) {} } message NameUpdate { string name = 1; bytes content = 2; } message Query { string name = 1; } message Content { bytes data = 1; } message Response { bytes data = 1; } ``` **Remote log:** ```protobuf syntax = "proto3"; package vac.cas; message RemoteLog { repeated Pair pair = 1; bytes tail = 2; message Pair { bytes remoteHash = 1; bytes localHash = 2; bytes data = 3; } } ``` ## Synchronization ### Roles There are four fundamental roles: 1. Alice 2. Bob 2. Name system (NS) 3. Content-addressed storage (CAS) The *remote log* protobuf is what is stored in the name system. "Bob" can represent anything from 0 to N participants. Unlike Alice, Bob only needs read-only access to NS and CAS. ### Flow
Figure 1: Remote log data synchronization.