Blockchain + Distributed Storage = Sia

    Hello! We all have data that we want to keep under control. We do not want to lose access to them and do not want anyone else to have access. Where to store such data? I believe that Sia can be an ideal place for this and will tell you why.


    Sia

    Disclaimer: Sia is actively developing and, according to the developers, is still not suitable to be the only place for backup.


    Sia (pronounced "Saya") is a distributed blockchain-based system whose members store information on each other's hard drives for a fee. A system participant can decide to be only the user who uploads the data (in Sia - renter terminology), or the server that receives the data (in Sia - renter terminology), or combine these two roles. Hosts are interested in storing data, since they are at a loss if they lose data. This is ensured as follows: when concluding a data storage contract, the host makes a deposit and daily confirms the storage of the downloaded data; if he does not, then he loses part of the deposit. We will leave the details of the process for dessert :-)


    Calculation of Reed-Solomon codes


    In order for the data to survive even if several hosts fail, Reed-Solomon codes are used . Data is uploaded to 40 hosts and remains available if at least 10 of these hosts are available. Storage redundancy is 3x. In the future, uptime hosts are expected to increase, after which redundancy can be reduced.


    Sia uses its own altcoin - Siacoin. It has its own blockchain, which stores both ordinary transactions and file storage contracts. (Bitcoin blockchain would not be suitable for Sia, since there is no way to conclude such contracts in it.) There is also its own explorer , and miners, and exchanges for exchange - in a word, everything that is attached to the altcoin.


    Siacoin Poloniex exchange page
    Siacoin page on the Poloniex exchange.


    So why do I like to store data in such a system? Have you ever wondered what other methods are at our disposal? There are a huge number of ways that have a single point of failure . A single point of failure justifies its name and sooner or later refuses. In addition, such systems tend to centralize and abandon anonymity and become a convenient place for enforcing state control over user data. I hate the idea that someone could deprive me of access to my own data. What choice is left for people who want to store data in a decentralized manner? For example, to buy a place or servers in several centralized systems. For most people, this means huge overheads in the form of time and money spent, especially if done anonymously.


    A few words about why anonymity is so important when storing data. If the state knows about your property, then in fact it does not belong to you, since the state determines the rules of the game and tomorrow may decide to take it from you (or partially pick it up, taxing it). For example, in the United States, gold was seized from people during the Great Depression. The only reliable way to secure property is to untie it from any information the state has.


    When I realized this, I decided to make a system devoid of these shortcomings: decentralized, anonymous and reliable. First, I decided to check if there was anything ready on the github. And I found Sia - exactly what you need! From the user's point of view, Sia is a ready-made analogue of buying a bunch of servers for manually downloading data. And the analogue is more efficient, since one server stores data from thousands of users. The storage cost calculator on the Sia website shows that 5TB storage for a month will cost $ 10. (Disclaimer: the real price will be higher due to the fees for creating contracts and triple storage redundancy, but still remains very, very attractive.)


    How to upload files to Sia


    Sia-ui


    See also the manual on the official website .


    1. Download and run Sia-UI .
    2. Buy siacoins .
    3. Download files using the Sia-UI interface .

    All private keys used in the wallet are obtained from seed, which the program issues at the beginning of work. To restore access to wallet siacoins (but, unfortunately, not to files yet), it is enough to know this seed.


    To be honest, I have never run Sia-UI, since I live on the command line, and Sia provides excellent tools for this: siad and siac . (By the way, all Sia code is written in Go, which cannot but rejoice.) The basics of working with siadand siaccan be found in the article about launching the host and from the hells of these programs. A program is siadusually simple enough to run, and interact with it through siac.


    Examples of commands:


    • siac wallet unlock - unlock the wallet (input of seed is required),
    • siac wallet balance - show the current wallet balance,
    • siac renter setallowance money time_period - enter into contracts with hosts,
    • siac renter upload /path/to/source/file path/in/sia - upload the file to Sia,
    • siac renter contracts - display all concluded contracts with hosts.

    siacinteracts with siadthrough the HTTP API . With it, you can build your systems using Sia as storage. The Sia team is betting that in the future, companies will store their data in Sia.


    To store data you need information in a folder renter/. There are plans to recover data exclusively from seed (see the "plans" section).


    Optionally, you can save information about the volume downloaded using siac renter exportand upload it to the "puzomerka": rankings.sia.tech .


    rankings


    How to start your Sia host


    siad


    The Sia host will generate revenue in siacoins to its owner. This is a good way to monetize unused portions of hard drives. Paid not only storage, but also traffic.


    There is a whole article about starting your server . I’ll run upstairs again.


    1. Need programs siadand siac. The program is siadlaunched, and all actions are carried out through siac. We must wait until the siadblockchain downloads. It takes several hours, there are plans for significant acceleration.
    2. Make an address ( siac wallet address), throw siacoins bought in any way on it .
    3. Add folder: siac host folder add /path/to/dir size
    4. Set a price for the storage, loading and unloading of data: siac config.
    5. Publish information about the host: siac host announce.

    After some time, the host will begin to receive contracts and data will be downloaded to it.


    Hosting revenues can be viewed at siahub.info . An example of a revenue graph for a host that has 585 downloaded from the available 999 GB:


    siahub


    This host receives 57 siacoins every day. 1 siacoin today costs about 1.5 cents, which means this host receives about 50 rubles daily. Let there be a 4Tb NAS for 20k rubles. With a similar percentage of filling, he would give out about 200 rubles a day, that is, 6k rubles a month - a good payback.


    Proof of storage


    image


    Sia hosts regularly prove that they store downloaded data. This is an important point, because otherwise unscrupulous hosts could dump all the data in / dev / null, while continuing to receive a fee. Above, I promised to tell you how the proof of storage works. This is described in detail in an article from the creator of Sia. Below is my explanation on the fingers.


    Contract data can be represented as an array of fragments of the same size. Arrange tree hashingthese fragments. To do this, we calculate the strong cryptographic hashes of these fragments. Then we divide the received hashes into pairs and calculate the hashes from the connected hashes of each pair. We will split the received hashes into pairs again, and so on, until we get one hash. This is what is stored in the contract and is updated when the user downloads new data for this contract. Now we return to a separate fragment of the file and trace its "path" to the root of the tree. At each step in the hash, the hash coming from another group of fragments will be “mixed in”. If we provide this fragment and these additional hashes that are on the way from the fragment to the root, we can prove that this fragment is present at this position in the data. Faking such proof is tantamount to finding a hash function collision.


    How does this apply in Sia? The fragment number, the storage of which the host must prove, is determined depending on the hashes of the previous blocks, so it is difficult to predict in advance. At a certain period of time (in blocks, not in hours), the host must upload proof of storage of the selected fragment, otherwise it loses money.


    An attentive reader might have a question - what if a malicious host stores data, but does not allow the user to download it? Or just have a low uptime, which makes it impossible to use it. To combat this, Sia came up with a host rating system. Each running client calculates this rating independently, including uptime, so it’s better to let the program idle before concluding contracts so that statistics on hosts are collected. All factors affecting the rating are understood in the article about the rating . Host ratings can be viewed by the team siac hostdb -vand at siahub.info .


    Siafund


    Siacoin has one feature that I have not seen in altcoins before. Siafund is a special type of resource that can be stored on the same blockchain and at the same addresses as Siacoin. The addresses on which Siafund is stored receive a portion of the revenue of the hosts. Deductions in the amount of 3.9% of payments under successful contracts are distributed proportionally between Siafund holders. In nature, there is exactly 10k Siafund. Most of them are held by developers (Nebulous Inc.), but a little more than 1000 were sold out at one time. Siafund is sold on the bitsquare.io exchange and on the #siafunds Slack chat channel . Currently, the price of one Siafund is approximately 2 bitcoins. Siafunds are indivisible.


    Siafund is an alternative to pre-mining your own cryptocurrency by altcoin developers. As conceived by the creators, due to the high price, only people who are committed to the ideas of the project, including developers, will be Siafund owners. The more Sia will be used to store files, the more revenue Siafund will bring.


    Network Browsers


    There are beautiful host maps on siapulse.com and siahub.info .


    map


    Hosts are already on all continents except Africa. The total number of active ones is 275. Including hosts there are in several cities of Russia and Ukraine. I invite everyone who needs help starting the host, and in general with Sia, to Slack chat channels , including #help, #russian and #farming.


    Plans


    Some plans from the official roadmap :


    • the ability to share the downloaded file with another Sia user (in the next release) and with anyone (after 2 years).
    • Download parts of a file.
    • Efficient storage of small files.
    • Streaming video.
    • Automatic pricing by the host.
    • Recover files from seed.
    • Support for mobile and other lightweight clients.

    Community



    Thanks to everyone who read to the end!


    Also popular now: