Blog

Decentralized File Storage of Callisto

Decentralized File Storage of Callisto

Decentralized file storage for short is a method to store data in a decentralized network.  The internet is dominated by client-server relationships, which rely on the Internet Protocol suite.  The method/protocol used is Hypertext Transfer Protocol (HTTP).  Data is stored in centralized servers and accessed by location-based addressing.  This makes it easier to distribute, manage, secure data, and to scale the capacity of both servers and clients.

However, there are some weaknesses in terms of security, privacy and efficiency: control of the server translates to control of the data. This means your data can be accessed, altered and removed by any party with control of the server; this could be an entity with legitimate authority over the server or a malicious hacker.  In location-based addressing, data is identified by where it is located, rather than its content. This limitation means you have to go to all the way to a specific location to access a piece of data, even if that same data is available somewhere closer.  There is also no way of knowing whether the data has been altered, since the client only needs to know where it is, not what it is.

The InterPlanetary File System

IPFS attempts to address the weaknesses of the client-server model and HTTP web through a p2p protocol file sharing system.  IPFS is an open-source project created by Protocol Labs, an R&D lab for network protocols and former Y Combinator startup.  These are the main components of IPFS systems:

  • With the Distributed Hash Table, nodes can store & share data without central coordination;
  • IPFS allows exchanged data to be instantly pre-authenticated and verified using public key cryptography;
  • The Merkle DAG enables uniquely identified, tamper-resistant and permanently stored data;
  • You can access past versions of edited data via the Version Control System.

IPFS provides high throughput, low-latency data distribution.  It is also decentralized and secure.  This opens up several interesting and exciting use cases.  It can be used to deliver content to websites, globally store files with automatic versioning & backups, facilitate secure file sharing and encrypted communication.

Callisto File System solves the problem of independently and securely storing an archive of security audit reports.  The main purpose of this file system is to provide an opportunity to upload, store and view security audit reports, independently from any third-party services.  At the same time, the Callisto file system enables users to store custom files in a distributed storage system maintained by elected Callisto IPFS-host-nodes.  The system can be scaled according to demand.

Callisto file system relies on CallistoFS.sol core smart-contract (https://github.com/Dexaran/Callisto-file-system/blob/master/CallistoFS.sol ).  A user can create a link to the IPFS file name by invoking the upload() (https://github.com/Dexaran/Callisto-file-system/blob/master/CallistoFS.sol#L21 ) function of the smart-contract and providing a refundable deposit of CLO.  Then the user needs to upload the file to one of the IPFS host-nodes.  Once the FileUpload (https://github.com/Dexaran/Callisto-file-system/blob/master/CallistoFS.sol#L18 ) event has been broadcast, each host-node should verify the file and replicate it if the payment condition is met.  A file is guaranteed to be stored until the deposit for the file is in the contract.  A user can withdraw the deposit at any time.  After the deposit has been withdrawn, file storage is no longer guaranteed.

Each elected IPFS host-node will receive a monthly salary for maintaining node.  If one of the nodes does not work correctly, fails to provide a file or maintains a bad connection, then another node can be elected to replace it.  IPFS host-nodes may receive different salaries depending on the quality, volume of their storage, and statistics of processed requests.  For each node, an individual treasury proposal must be created and the decision for electing/removing a node is voted on by cold stakers.

The amount of storage available per CLO is determined using the Bancor algorithm that maintains a Constant Reserve Ratio (CRR) of 10.  A CRR means that the storage will never be completely consumed, as the price (fixed in CLO per megabyte) will increase as free capacity decreases.

Price = Balance / (Supply * CRR)

Where:

  • Balance is the total amount of storage consumed
  • Supply is the total amount of storage the host-nodes physically have
  • CCR is the constant (10 in EOS and CLO)

In Summary, Callisto File System is a method to upload, store, and distribute audit reports from auditors of the Callisto Security Audit Department.  A community member can help setup an IPFS host-node, and receive an incentive for doing so.

Topics:News