User Tools

Site Tools


renter:renting



Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
renter:renting [2017/03/24 15:48]
Stéphane Roche created
renter:renting [2018/01/04 08:31] (current)
Fornax [Uploading and Downloading] correction chunk sizes
Line 1: Line 1:
-Users wanting to upload files to the Sia network must have the insurance that their files are kept private and available. This is why Sia uses encryption and erasure coding (or Reed-Solomon algorithm) to ensure redundancy.+====== Renting ======
  
-Let's describe the uploading process. First the file is striped into //chunks// of 40MB, then erasure coding is applied on each chunk, expanding them into 30 pieces of 4MB. Erasure coding is like M-of-N multisig protocol but for files. It allows us to recreate a valid file even if some pieces are missing. This process ensure a high level of redundancy.  +//For a practical guide about how to use the UI for renting, check [[renter:using_the_ui_for_renting|Using the UI for renting]]// 
-Note that no host will receive more than 1 piece of any given chunk. There are thousands and thousands of chunks but each chunk can have a piece on any hostso hosts end up with thousands of pieces, but none of those pieces belong to more than 1 chunk.+ 
 +Renters pay hosts to store their data on the Sia network. 
 + 
 +===== Contract Formation ===== 
 + 
 +In order to store files on Sia, renters must first form [[renter:contracts]] with various hosts. A contract sets aside a fixed amount of siacoins to be spent on storing and transferring data over a fixed period. The renter pays all the siacoins in advance, and any unused coins are returned to them at the end of the contract period. 
 + 
 +To help facilitate this process, the Sia client allows users to set an //allowance//. An allowance specifies the maximum amount of siacoins to be spent, and the period (in blocks) in which they are spent. The client then intelligently chooses hosts and forms contracts with them such that each contract can store the same amount of data. 
 + 
 + 
 +===== Uploading and Downloading ===== 
 + 
 +Sia uses encryption and erasure coding to ensure that files are private and remain available even if hosts go offline. 
 + 
 +The uploading process is as follows. Firstthe file is striped into //chunks// of 40MiB. Reed-Solomon erasure coding is then applied on each chunk, expanding them into 30 //pieces// of 4MiB. Erasure coding is like an M-of-N multisig protocolbut for data: out of //N// total pieces, only //M// are needed to recover the full 40MiB chunk. This ensures a high level of redundancy, much greater than traditional replication.
  
 Each piece is then encrypted with the Twofish algorithm. It was one of the five finalists of the Advanced Encryption Standard contest, but it was not selected for standardization. Nonetheless, this algorithm is considered very secure. Each piece is then encrypted with the Twofish algorithm. It was one of the five finalists of the Advanced Encryption Standard contest, but it was not selected for standardization. Nonetheless, this algorithm is considered very secure.
  
-Finally the pieces are sent to hosts to be stored. +Finally the pieces are sent to hosts to be stored. Currently, no host receives more than one piece of any given chunk. For example, host 1 might contain the first piece of chunk 1, chunk 2, chunk 3, etc., and host 2 might contain the second piece of the same chunks. This ensures that if host 1 is offline, you can still download pieces from every chunk. Even if host 1 is not offline, but merely slow, this scheme prevents you from being bottlenecked by the slow host.
- +
  
 +===== Contract Renewal =====
  
 +Since contracts expire after a fixed duration (i.e. number of blocks), new contracts must be formed to take their place. In the simplest case, the renter could repeat the contract formation process and then reupload their data to the hosts. But this is obviously inefficient for both the renter and host. To address this, Sia's renter-host protocol supports directly replacing a previously-formed contract. A new contract is formed with a new duration, and references the current data stored on the host instead of starting over from scratch. The new contract may also contain a different amount of siacoins than the original.
  
 +The Sia client will automatically renew contracts when they are within a certain window of expiring. This means that there will be some overlap between the old contract and the new contract. The expiration height of the new contract will be equal to the current height plus the allowance period.
renter/renting.1490370530.txt.gz · Last modified: 2017/03/24 15:48 by Stéphane Roche