Chris Pollett > Students >

    ( Print View)



    [CS297 Proposal]

    [Overview on IPFS and SWARM - PDF]

    [Deliverable 1]

    [Deliverable 2]

    [Deliverable 3]

    [Solidity Overview - PDF]

    [Deliverable 4]

    [CS297 Report - PDF]

    [CS298 Proposal]

    [CS298 Final Report-PDF]

    [CS298 Defense Slides-PDF]

CS297 Deliverable 3

Basic file structure to store a file in a decentralized way

Description:This project contains an implementation of the basic file structure which can be used to implement a decentralized file system

Results Deliverable 3 includes the basic structure of the File system. It includes an example of how a file could be stored in a decentralized manner and leverage the DHT architecture to locate and reconstruct the files. The approach implemented below makes use of the Merkle tree file structure. Results:

1. File size spanning from a few KBs to a couple of GBs can be easily mapped to a Merkle tree structure using their hashes and
stored easily. The below example uses a file 2.02 GB file.


Below shoes the file structure generated as metadata where every node which is not a root or a leaf node will contain 128
or lesser entries leading to their children's nodes until the leaf node is reached. Leaf node contains chunk of data bytes


Each file containing 128 entries with each entry of 256 bytes hash string is of 8KB size. Each entry leads to another file until it leads to a block of data. The root file with its hash as the name and its children:


Normal file with 128 hash strings


The below screenshot shows the time required to create tree structure for a 48kb file with its root hash which can be used to check the credibility of a file bay reconstructing the tree from received bytes. Followed by a basic tree structure which contains 12 children of the root node with their end bytes:


In conclusion IPFS performs better than Storj when it comes to uploading a file as big as 400 MB or 1 GB.
It took merely a few seconds for IPFS to store a 400 MB file and about a couple of minutes to store a 1 GB file. On the contrary
Storj nearly took more than 12 minutes to store a 400 MB file.

The Java implementation is available at [ Download - Zip ]