github.com/avahowell/sia@v0.5.1-beta.0.20160524050156-83dcc3d37c94/doc/whitepaper.tex (about)

     1  \documentclass[twocolumn]{article}
     2  \usepackage{amsmath}
     3  
     4  \begin{document}
     5  \frenchspacing
     6  
     7  \title{Sia: Simple Decentralized Storage}
     8  
     9  \author{
    10  {\rm David Vorick}\\
    11  Nebulous Inc.\\
    12  david@nebulouslabs.com
    13  \and
    14  {\rm Luke Champine}\\
    15  Nebulous Inc.\\
    16  luke@nebulouslabs.com
    17  }
    18  
    19  \maketitle
    20  
    21  \subsection*{Abstract}
    22  The authors introduce Sia, a platform for decentralized storage.
    23  Sia enables the formation of storage contracts between peers.
    24  Contracts are agreements between a storage provider and their client, defining what data will be stored and at what price.
    25  They require the storage provider to prove, at regular intervals, that they are still storing their client's data.
    26  
    27  Contracts are stored in a blockchain, making them publicly auditable.
    28  In this respect, Sia can be viewed as a Bitcoin derivative that includes support for such contracts.
    29  Sia will initially be implemented as an altcoin, and later financially connected to Bitcoin via a two-way peg.
    30  
    31  \section{Introduction}
    32  Sia is a decentralized cloud storage platform that intends to compete with existing storage solutions, at both the P2P and enterprise level.
    33  Instead of renting storage from a centralized provider, peers on Sia rent storage from each other.
    34  Sia itself stores only the storage contracts formed between parties, defining the terms of their arrangement.
    35  A blockchain, similar to Bitcoin \cite{btc, btcdg}, is used for this purpose.
    36  
    37  By forming a contract, a storage provider (also known as a \textit{host}) agrees to store a client's data, and to periodically submit proof of their continued storage until the contract expires.
    38  The host is compensated for every proof they submit, and penalized for missing a proof.
    39  Since these proofs are publicly verifiable (and are publicly available in the blockchain), network consensus can be used to automatically enforce storage contracts.
    40  Importantly, this means that clients do not need to personally verify storage proofs; they can simply upload their file and let the network do the rest.
    41  
    42  We acknowledge that storing data on a single untrusted host guarantees little in the way of availability, bandwidth, or general quality of service.
    43  Instead, we recommend storing data redundantly across multiple hosts.
    44  In particular, the use of erasure codes can enable high availability without excessive redundancy.
    45  
    46  Sia will initially be implemented as a blockchain-based altcoin.
    47  Future support for a two-way peg with Bitcoin is planned, as discussed in ``Enabling Blockchain Innovations with Pegged Sidechains'' \cite{side}.
    48  The Sia protocol largely resembles Bitcoin except for the changes noted below.
    49  
    50  \section{General Structure}
    51  Sia's primary departure from Bitcoin lies in its transactions.
    52  Bitcoin uses a scripting system to enable a range of transaction types, such as pay-to-public-key-hash and pay-to-script-hash.
    53  Sia opts instead to use an $M$--of--$N$ multi-signature scheme for all transactions, eschewing the scripting system entirely.
    54  This reduces complexity and attack surface.
    55  
    56  Sia also extends transactions to enable the creation and enforcement of storage contracts.
    57  Three extensions are used to accomplish this: contracts, proofs, and contract updates.
    58  Contracts declare the intention of a host to store a file with a certain size and hash.
    59  They define the regularity with which a host must submit storage proofs.
    60  Once established, contracts can be modified later via contract updates.
    61  The specifics of these transaction types are defined in sections \ref{sec:contracts} and \ref{sec:storage}.
    62  
    63  \section{Transactions}
    64  A transaction contains the following fields: \\
    65  
    66  \noindent
    67  \begin{tabular}{ l | l }
    68  	\textbf{Field} & \textbf{Description} \\ \hline
    69  	Version        & Protocol version number \\
    70  	Arbitrary Data & Used for metadata or otherwise \\
    71  	Miner Fee      & Reward given to miner \\
    72  	Inputs         & Incoming funds \\
    73  	Outputs        & Outgoing funds (optional) \\
    74  	File Contract  & See: File Contracts (optional) \\
    75  	Storage Proof  & See: Proof of Storage (optional) \\
    76  	Signatures     & Signatures from each input \\
    77  \end{tabular}
    78  
    79  \subsection{Inputs and Outputs}
    80  An output comprises a volume of coins.
    81  Each output has an associated identifier, which is derived from the transaction that the output appeared in.
    82  The ID of output $i$ in transaction $t$ is defined as:
    83  \[
    84  	H(t || \text{``output''} || i)
    85  \]
    86  where $H$ is a cryptographic hashing function, and ``output'' is a string literal.
    87  The block reward and miner fees have special output IDs, given by:
    88  \[
    89  	H(H(\text{Block Header}) || \text{``blockreward''})
    90  \]
    91  Every input must come from a prior output, so an input is simply an output ID.
    92  
    93  Inputs and outputs are also paired with a set of \textit{spend conditions}.
    94  Inputs contain the spend conditions themselves, while outputs contain their Merkle root hash \cite{merkle}.
    95  
    96  \subsection{Spend Conditions}
    97  Spend conditions are properties that must be met before coins are ``unlocked'' and can be spent.
    98  The spend conditions include a time lock and a set of public keys, and the number of signatures required.
    99  An output cannot be spent until the time lock has expired and enough of the specified keys have added their signature.
   100  
   101  The spend conditions are hashed into a Merkle tree, using the time lock, the number of signatures required, and the public keys as leaves.
   102  The root hash of this tree is used as the address to which the coins are sent.
   103  In order to spend the coins, the spend conditions corresponding to the address hash must be provided.
   104  The use of a Merkle tree allows parties to selectively reveal information in the spend conditions.
   105  For example, the time lock can be revealed without revealing the number of public keys or the number of signatures required.
   106  
   107  It should be noted that the time lock and number of signatures have low entropy, making their hashes vulnerable to brute-forcing.
   108  This could be resolved by adding a random nonce to these fields, increasing their entropy at the cost of space efficiency.
   109  
   110  \subsection{Signatures}
   111  Each input in a transaction must be signed.
   112  The cryptographic signature itself is paired with an input ID, a time lock, and a set of flags indicating which parts of the transaction have been signed.
   113  The input ID indicates which input the signature is being applied to.
   114  The time lock specifies when the signature becomes valid.
   115  Any subset of fields in the transaction can be signed, with the exception of the signature itself (as this would be impossible).
   116  There is also a flag to indicate that the whole transaction should be signed, except for the signatures.
   117  This allows for more nuanced transaction schemes.
   118  
   119  The actual data being signed, then, is a concatenation of the time lock, input ID, flags, and every flagged field.
   120  Every such signature in the transaction must be valid for the transaction to be accepted.
   121  
   122  \section{File Contracts}
   123  \label{sec:contracts}
   124  A file contract is an agreement between a storage provider and their client.
   125  At the core of a file contract is the file's Merkle root hash.
   126  To construct this hash, the file is split into segments of constant size and hashed into a Merkle tree.
   127  The root hash, along with the total size of the file, can be used to verify storage proofs.
   128  
   129  File contracts also specify a duration, challenge frequency, and payout parameters, including the reward for a valid proof, the reward for an invalid or missing proof, and the maximum number of proofs that can be missed.
   130  The challenge frequency specifies how often a storage proof must be submitted, and creates discrete \textit{challenge windows} during which a host must submit storage proofs (one proof per window).
   131  Submitting a valid proof during the challenge window triggers an automatic payment to the ``valid proof'' address (presumably the host).
   132  If, at the end of the challenge window, no valid proof has been submitted, coins are instead sent to the ``missed proof'' address
   133  (likely an unspendable address in order to disincentivize DoS attacks; see section \ref{subsec:host-protect}).
   134  Contracts define a maximum number of proofs that can be missed; if this number is exceeded, the contract becomes invalid.
   135  
   136  If the contract is still valid at the end of the contract duration, it \textit{successfully terminates} and any remaining coins are sent to the valid proof address.
   137  Conversely, if the contract funds are exhausted before the duration elapses, or if the maximum number of missed proofs is exceeded, the contract \textit{unsuccessfully terminates} and any remaining coins are sent to the missed proof address.
   138  
   139  Completing or missing a proof results in a new transaction output belonging to the recipient specified in the contract.
   140  The output ID of a proof depends on the contract ID, defined as:
   141  \[
   142  	H(\text{transaction} || \text{``contract''} || i)
   143  \]
   144  where $i$ is the index of the contract within the transaction.
   145  The output ID of the proof can then be determined from:
   146  \[
   147  	H(\text{contract ID} || \text{outcome} || W_i)
   148  \]
   149  Where $W_i$ is the window index, i.e. the number of windows that have elapsed since the contract was formed.
   150  The outcome is a string literal: either ``validproof'' and ``missedproof'', corresponding to the validity of the proof.
   151  
   152  The output ID of a contract termination is defined as:
   153  \[
   154  	H(\text{contract ID} || \text{outcome})
   155  \]
   156  Where outcome has the potential values ``successfultermination'' and ``unsucessfultermination'', corresponding to the termination status of the contract.
   157  
   158  File contracts are also created with a list of ``edit conditions,'' analogous to the spend conditions of a transaction.
   159  If the edit conditions are fulfilled, the contract may be modified.
   160  Any of the values can be modified, including the contract funds, file hash, and output addresses.
   161  As these modifications can affect the validity of subsequent storage proofs, contract edits must specify a future challenge window at which they will become effective.
   162  
   163  Theoretically, peers could create ``micro-edit channels'' to facilitate frequent edits; see discussion of \mbox{micropayment} channels, section \ref{sec:uptime}.
   164  
   165  \section{Proof of Storage}
   166  \label{sec:storage}
   167  Storage proof transactions are periodically submitted in order to fulfill file contracts.
   168  Each storage proof targets a specific file contract.
   169  A storage proof does not need to have any inputs or outputs; only a contract ID and the proof data are required.
   170  
   171  \subsection{Algorithm}
   172  Hosts prove their storage by providing a segment of the original file and a list of hashes from the file's Merkle tree.
   173  This information is sufficient to prove that the segment came from the original file.
   174  Because proofs are submitted to the blockchain, anyone can verify their validity or invalidity.
   175  Each storage proof uses a randomly selected segment.
   176  The random seed for challenge window $W_i$ is given by:
   177  \[
   178  	H(\text{contract ID} || H(B_{i-1}))
   179  \]
   180  where $B_{i-1}$ is the block immediately prior to the beginning of $W_i$.
   181  
   182  If the host is consistently able to demonstrate possession of a random segment, then they are very likely storing the whole file.
   183  A host storing only 50\% of the file will be unable to complete approximately 50\% of the proofs.
   184  
   185  \subsection{Block Withholding Attacks}
   186  The random number generator is subject to manipulation via block withholding attacks, in which the attacker withholds blocks until they find one that will produce a favorable random number.
   187  However, the attacker has only one chance to manipulate the random number for a particular challenge.
   188  Furthermore, withholding a block to manipulate the random number will cost the attacker the block reward.
   189  
   190  If an attacker is able to mine 50\% of the blocks, then 50\% of the challenges can be manipulated.
   191  Nevertheless, the remaining 50\% are still random, so the attacker will still fail some storage proofs.
   192  Specifically, they will fail half as many as they would without the withholding attack.
   193  
   194  To protect against such attacks, clients can specify a high challenge frequency and large penalties for missing proofs.
   195  These precautions should be sufficient to deter any financially-motivated attacker that controls less than 50\% of the network's hashing power.
   196  Regardless, clients are advised to plan around potential Byzantine attacks, which may not be financially motivated.
   197  
   198  \subsection{Closed Window Attacks}
   199  Hosts can only complete a storage proof if their proof transaction makes it into the blockchain.
   200  Miners could maliciously exclude storage proofs from blocks, depriving themselves of transaction fees but forcing a penalty on hosts.
   201  Alternatively, miners could extort hosts by requiring large fees to include storage proofs, knowing that they are more important than the average transaction.
   202  This is termed a \textit{closed window attack}, because the malicious miner has artificially ``closed the window.''
   203  
   204  The defense for this is to use a large window size.
   205  Hosts can reasonably assume that some percentage of miners will include their proofs in return for a transaction fee.
   206  Because hosts consent to all file contracts, they are free to reject any contract that they feel leaves them vulnerable to closed window attacks.
   207  
   208  \section{Arbitrary Transaction Data}
   209  Each transaction has an arbitrary data field which can be used for any type of information.
   210  Nodes will be required to store the arbitrary data if it is signed by any signature in the transaction.
   211  Nodes will initially accept up to 64 KB of arbitrary data per block.
   212  
   213  This arbitrary data provides hosts and clients with a decentralized way to organize themselves.
   214  It can be used to advertise available space or files seeking a host, or to create a decentralized file tracker.
   215  
   216  Arbitrary data could also be used to implement other types of soft forks.
   217  This would be done by creating an ``anyone-can-spend'' output but with restrictions specified in the arbitrary data.
   218  Miners that understand the restrictions can block any transaction that spends the output without satisfying the necessary stipulations.
   219  Naive nodes will stay synchronized without needing to be able to parse the arbitrary data.
   220  
   221  \section{Storage Ecosystem}
   222  Sia relies on an ecosystem that facilitates decentralized storage.
   223  Storage providers can use the arbitrary data field to announce themselves to the network.
   224  This can be done using standardized template that clients will be able to read.
   225  Clients can use these announcements to create a database of potential hosts, and form contracts with only those they trust.
   226  
   227  \subsection{Host Protections}
   228  \label{subsec:host-protect}
   229  A contract requires consent from both the storage provider and their client, allowing the provider to reject unfavorable terms or unwanted (e.g. illegal) files.
   230  The provider may also refuse to sign a contract until the entire file has been uploaded to them.
   231  
   232  Contract terms give storage providers some flexibility.
   233  They can advertise themselves as minimally reliable, offering a low price and a agreeing to minimal penalties for losing files;
   234  or they can advertise themselves as highly reliable, offering a higher price and agreeing to harsher penalties for losing files.
   235  An efficient market will optimize storage strategies.
   236  
   237  Hosts are vulnerable to denial of service attacks, which could prevent them from submitting storage proofs or transferring files.
   238  It is the responsibility of the host to protect themselves from such attacks.
   239  
   240  \subsection{Client Protections}
   241  \label{subsec:client-protect}
   242  Clients can use erasure codes, such as regenerating codes \cite{reg}, to safeguard against hosts going offline.
   243  These codes typically operate by splitting a file into $n$ pieces, such that the file can be recovered from any subset of $m$ unique pieces.
   244  (The values of $n$ and $m$ vary based on the specific erasure code and redundancy factor.)
   245  Each piece is then encrypted and stored across many hosts.
   246  This allows a client to attain high file availability even if the average network reliability is low.
   247  As an extreme example, if only 10 out of 100 pieces are needed to recover the file, then the client is actually relying on the 10 most reliable hosts, rather than the average reliability.
   248  Availability can be further improved by rehosting file pieces whose hosts have gone offline.
   249  Other metrics benefit from this strategy as well; the client can reduce latency by downloading from the closest 10 hosts, or increase download speed by downloading from the 10 fastest hosts.
   250  These downloads can be run in parallel to maximize available bandwidth.
   251  
   252  \subsection{Uptime Incentives}
   253  \label{sec:uptime}
   254  The storage proofs contain no mechanism to enforce constant uptime.
   255  There are also no provisions that require hosts to transfer files to clients upon request.
   256  One might expect, then, to see hosts holding their clients' files hostage and demanding exorbitant fees to download them.
   257  However, this attack is mitigated through the use of erasure codes, as described in section \ref{subsec:client-protect}.
   258  The strategy gives clients the freedom to ignore uncooperative hosts and work only with those that are cooperative.
   259  As a result, power shifts from the host to the client, and the ``download fee'' becomes an ``upload incentive.''
   260  
   261  In this scenario, clients offer a reward for being sent a file, and hosts must compete to provide the best quality of service.
   262  Clients may request a file at any time, which incentivizes hosts to maximize uptime in order to collect as many rewards as possible.
   263  Clients can also incentivize greater throughput and lower latency via proportionally larger rewards.
   264  Clients could even perform random ``checkups'' that reward hosts simply for being online, even if they do not wish to download anything.
   265  However, we reiterate that uptime incentives are not part of the Sia protocol; they are entirely dependent on client behavior.
   266  
   267  Payment for downloads is expected to be offered through preexisting micropayment channels \cite{mpc}.
   268  Micropayment channels allow clients to make many consecutive small payments with minimal latency and blockchain bloat.
   269  Hosts could transfer a small segment of the file and wait to receive a micropayment before proceeding.
   270  The use of many consecutive payments allows each party to minimize the risk of being cheated.
   271  Micropayments are small enough and fast enough that payments could be made every few seconds without having any major effect on throughput.
   272  
   273  \subsection{Basic Reputation System}
   274  Clients need a reliable method for picking quality hosts.
   275  Analyzing their history is insufficient, because the history could be spoofed.
   276  A host could repeatedly form contracts with itself, agreeing to store large ``fake'' files, such as a file containing only zeros.
   277  It would be trivial to perform storage proofs on such data without actually storing anything.
   278  
   279  To mitigate this Sybil attack, clients can require that hosts that announce themselves in the arbitrary data section also include a large volume of time locked coins.
   280  If 10 coins are time locked 14 days into the future, then the host can be said to have created a lock valued at 140 coin-days.
   281  By favoring hosts that have created high-value locks, clients can mitigate the risk of Sybil attacks, as valuable locks are not trivial to create.
   282  
   283  Each client can choose their own equation for picking hosts, and can use a large number of factors, including price, lock value, volume of storage being offered, and the penalties hosts are willing to pay for losing files.
   284  More complex systems, such as those that use human review or other metrics, could be implemented out-of-band in a more centralized setting.
   285  
   286  \section{Siafunds}
   287  Sia is a product of Nebulous Incorporated.
   288  Nebulous is a for-profit company, and Sia is intended to become a primary source of income for the company.
   289  Currency premining is not a stable source of income, as it requires creating a new currency and tethering the company's revenue to the currency's increasing value.
   290  When the company needs to spend money, it must trade away portions of its source of income.
   291  Additionally, premining means that one entity has control over a large volume of the currency, and therefore potentially large and disruptive control over the market.
   292  
   293  Instead, Nebulous intends to generate revenue from Sia in a manner proportional to the value added by Sia, as determined by the value of the contracts set up between clients and hosts.
   294  This is accomplished by imposing a fee on all contracts.
   295  When a contract is created, 3.9\% of the contract fund is removed and distributed to the holders of \textit{siafunds}.
   296  Nebulous Inc. will initially hold approx. 88\% of the siafunds, and the early crowd-fund backers of Sia will hold the rest.
   297  
   298  Siafunds can be sent to other addresses, in the same way that siacoins can be sent to other addresses.
   299  They cannot, however, be used to fund contracts or miner fees.
   300  When siafunds are transferred to a new address, an additional unspent output is created, containing all of the siacoins that have been earned by the siafunds since their previous transfer.
   301  These siacoins are sent to the same address as the siafunds.
   302  
   303  \section{Economics of Sia}
   304  The primary currency of Sia is the siacoin.
   305  The supply of siacoins will increase permanently, and all fresh supply will be given to miners as a block subisdy.
   306  The first block will have 300,000 coins minted.
   307  This number will decrease by 1 coin per block, until a minimum of 30,000 coins per block is reached.
   308  Following a target of 10 minutes between blocks, the annual growth in supply is:\\
   309  
   310  \tabcolsep=0.11cm \noindent
   311  \begin{tabular}{ l | *{7}{c} }
   312  	Year   &   1  &  2   &   3  &   4    &   5   &  8    & 20    \\ \hline
   313  	Growth & 90\% & 39\% & 21\% & 11.5\% & 4.4\% & 3.2\% & 2.3\%
   314  \end{tabular} \\
   315  
   316  There are inefficiencies within the Sia incentive scheme.
   317  The primary goal of Sia is to provide a blockchain that enforces storage contracts.
   318  The mining reward, however, is only indirectly linked to the total value of contracts being created.
   319  
   320  The siacoin, especially initially, is likely to have high volatility.
   321  Hosts can be adversely affected if the value of the currency shifts mid-contract.
   322  As a result, we expect to see hosts increasing the price of long-term contracts as a hedge against volatility.
   323  Additionally, hosts can advertise their prices in a more stable currency (like USD) and convert to siacoin immediately before finalizing a contract.
   324  Eventually, the use of two-way pegs with other crypto-assets will give hosts additional means to insulate themselves from volatility.
   325  
   326  % \section{Under Consideration}
   327  % The primary foundation of Sia has been established above.
   328  % Other considerations, such as mining algorithms, block time, etc., can be assumed to mirror those found in Bitcoin.
   329  
   330  % Giving careful attention to ``A Treatise on Altcoins'' \cite{alts}, we are considering the following changes to Sia for the overall improvement of the cryptocurrency.
   331  % We caution that these propositions have not yet been rigorously examined from a security standpoint.
   332  
   333  % \subsection{Flexible Contracts}
   334  % Contracts, in their present form, are fairly strict.
   335  % There is a set penalty for each missed storage proof, and a termination upon $n$ total missed storage proofs.
   336  % Increased flexibility in the penalty schedule may be desirable.
   337  
   338  % Contracts are also permanent, creating what is essentially an uneditable file on the network.
   339  % There may be value in enabling clients and hosts to negotiate an updated file hash or other updated contract terms.
   340  % Updating the terms of the contract would require consent from all parties.
   341  
   342  % \subsection{Proof of Existence Windows}
   343  % In an attempt to partially resolve the closed window attacks, we could use a proof of existence strategy.
   344  % A host can create a hash of the storage proof which they submit to the blockchain within the window.
   345  % The host then has a greatly extended window in which they can demonstrate that the proof of storage was created during the required window.
   346  
   347  % This has two advantages.
   348  % First, an attacker cannot selectively exclude proof of existence hashes, because there's no way to figure out who owns each hash.
   349  % Either the attacker doesn't include any unknown proof of existence hashes, or the attacker risks including undesired proof of existence hashes.
   350  % Second, this allows hosts to submit small transactions to the network during peak hours and then the larger transactions when the traffic has died down.
   351  
   352  % A further improvement would enable Merkle Tree proofs of existence.
   353  % This would enable a host to submit multiple proofs of storage in a single proof of existence hash.
   354  
   355  % % delete/expand this section?
   356  % \subsection{Siafund the Miner fees}
   357  % Have some portion of siafunds contribute to the miner fees, which ensures that miners have compensation so long as Sia is being used for its core purpose - storage.
   358  
   359  % \subsection{Miner Fee Adjustments}
   360  % If a block has miner fees which are significantly higher than the fees in the current block, there is incentive for miners to re-mine the previous block and change who gets the miner fees.
   361  % This can be mitigated by putting all of the fees into a pool which pays out 50\% every block, making re-mining unprofitable for any party with less than 50\% of the network hashing power.
   362  % Link to discussion threads of this potential change.
   363  
   364  % Additionally, miners have incentives not to propagate high fee transactions, because this will prevent other miners from mining the transaction and collecting the fees.
   365  % It may be possible to construct a system using fee deterioration that means a miner has the highest expected total reward when the transaction is mined as soon as possible - regardless of who mines the transaction.
   366  % Link to discussion threads of this potential change.
   367  
   368  % \subsection{More Frequent Target Adjustments}
   369  % % This section could use a few citations, but the discussion on this seems pretty well scattered. I could find things like the Kimoto Gravity Well, but other than alts.pdf I couldn't find any comments by respected individuals. I know that these discussions are out there, I've seen them before, just can't find them.
   370  % Bitcoin adjusts its block difficulty every 2016 blocks, with a target of 10 minutes per block.
   371  % This often means that the final blocks in a difficulty window are produced faster than 10 minutes (sometimes substantially) on account of rapid growth in available mining power.
   372  % To mitigate this effect, we are considering adjusting the difficulty after every block.
   373  
   374  % % I don't understand this paragraph
   375  % The bi-weekly adjustments to the Bitcoin difficulty can also cause coordinated drops in mining power---all at once, miners lose a percentage of their dollars-per-energy efficiency.
   376  % Difficulty adjustments every block creates a much smoother function for when mining rigs are no longer profitable.
   377  
   378  % The clamp on mining growth can also be increased.
   379  % The clamp serves to prevent an attacker from being easily manipulating the difficulty.
   380  % % 2,016,000 what?
   381  % In Bitcoin, raising the difficulty from 1000 to 4000 requires a minimum of 2,016,000 of work, and the difficulty can adjust by a maximum of 4x every week.
   382  % If the difficulty is being adjusted every block, however, and clamped at 1.001\% per block, an attacker will need 3,000,050 work to raise the difficulty from 1000 to 4000.
   383  % At this rate, the difficulty can shift by a maximum of 7.5x every week, which both increases the flexibility of the difficulty and makes difficulty raising attacks more difficult.
   384  
   385  % Though the difficulty will be adjusted every block, it will still be adjusted according to the amount of time taken to produce the previous 2016 blocks, preventing randomly fast or slow blocks from having large impact on the network.
   386  
   387  % \subsection{Committing to State}
   388  % One thing that could allow for substantially lighter weight clients is if the miners committed to the current state of the network, instead of just to the new transactions.
   389  % This would mean creating a structure for a database that represents the state of the network and hashing it.
   390  % We could follow suggestions similar to those presented in ``Ultimate blockchain compression'' \cite{ubc}.
   391  
   392  % \subsection{Variance Enforced Merge Mining}
   393  % Bitcoin enforces a number of leading 0s on a winning block.
   394  % Sia could enforce something like a single leading 1, followed by a bunch of leading 0s.
   395  % This creates the property that no hash is ever valid for both Bitcoin and Sia.
   396  
   397  % The value to this is that the number of payouts a miner gets from finding blocks goes up.
   398  % The total payout is still the same, but the number of payouts increases by the number of blocks that would have been valid for both.
   399  % A block that solves the coin with the highest difficulty will always be valid for both blockchains.
   400  % (I need to read more about merge mining before I publish this section)
   401  
   402  \section{Conclusion}
   403  Sia is a variant on the Bitcoin protocol that enables decentralized file storage via cryptographic contracts.
   404  These contracts can be used to enforce storage agreements between clients and hosts.
   405  After agreeing to store a file, a host must regularly submit storage proofs to the network.
   406  The host will automatically be compensated for storing the file regardless of the behavior of the client.
   407  
   408  Importantly, contracts do not require hosts to transfer files back to their client when requested.
   409  Instead, an out-of-band ecosystem must be created to reward hosts for uploading.
   410  Clients and hosts must also find a way to coordinate; one mechanism would be the arbitrary data field in the blockchain.
   411  Various precautions have been enumerated which mitigate Sybil attacks and the unreliability of hosts.
   412  
   413  Siafunds are used as a mechanism of generating revenue for Nebulous Inc., the company responsible for the release and maintenance of Sia.
   414  By using Siafunds instead of premining, Nebulous more directly correlates revenue to actual use of the network, and is largely unaffected by market games that malicious entities may play with the network currency.
   415  Miners may also derive a part of their block subsidy from siafunds, with similar benefits.
   416  Long term, we hope to add support for two-way-pegs with various currencies, which would enable consumers to insulate themselves from the instability of a single currency.
   417  
   418  We believe Sia will provide a fertile platform for decentralized cloud storage in trustless environments.
   419  
   420  \onecolumn
   421  \begin{thebibliography}{9}
   422  
   423  \bibitem{btc}
   424  	Satoshi Nakamoto,
   425  	\emph{Bitcoin: A Peer-to-Peer Electronic Cash System}.
   426  
   427  \bibitem{merkle}
   428  	R.C. Merkle,
   429  	\emph{Protocols for public key cryptosystems},
   430  	In Proc. 1980 Symposium on Security and	Privacy,
   431  	IEEE Computer Society, pages 122-133, April 1980.
   432  
   433  \bibitem{cpr}
   434  	Hovav Shacham, Brent Waters,
   435  	\emph{Compact Proofs of Retrievability},
   436  	Proc. of Asiacrypt 2008, vol. 5350, Dec 2008, pp. 90-107.
   437  
   438  \bibitem{reg}
   439  	K. V. Rashmi, Nihar B. Shah, and P. Vijay Kumar,
   440  	\emph{Optimal Exact-Regenerating Codes for Distributed Storage at the MSR and MBR Points via a Product-Matrix Construction}.
   441  
   442  \bibitem{side}
   443  	Adam Back, Matt Corallo, Luke Dashjr, Mark Friedenbach, Gregory Maxwell, Andrew Miller, Andrew Peolstra, Jorge Timon, Pieter Wuille,
   444  	\emph{Enabling Blockchain Innovations with Pegged Sidechains}.
   445  
   446  \bibitem{alts}
   447  	Andrew Poelstra,
   448  	\emph{A Treatise on Altcoins}.
   449  
   450  \bibitem{ibf}
   451  	Gavin Andresen,
   452  	\emph{O(1) Block Propagation},
   453  	https://gist.github.com/gavinandresen/e20c3b5a1d4b97f79ac2
   454  
   455  \bibitem{hdw}
   456  	Gregory Maxwell,
   457  	\emph{Deterministic Wallets},
   458  	https://bitcointalk.org/index.php?topic=19137.0
   459  
   460  \bibitem{ubc}
   461  	etotheipi,
   462  	Ultimate blockchain compression w/ trust-free lite nodes, \newline
   463  	https://bitcointalk.org/index.php?topic=88208.0
   464  
   465  \bibitem{poc}
   466  	Gregory Maxwell,
   467  	\emph{Proof of Storage to make distributed resource consumption costly.} \newline
   468  	https://bitcointalk.org/index.php?topic=310323.0
   469  
   470  \bibitem{mpc}
   471  	Mike Hearn,
   472  	\emph{Rapidly-adjusted (micro)payments to a pre-determined party},\newline
   473  	https://en.bitcoin.it/wiki/Contracts\#Example\_7:\_Rapidly-adjusted\_.28micro.29payments\_to\_a\_pre-determined\_party
   474  
   475  \bibitem{btcdg}
   476  	Bitcoin Developer Guide,
   477  	https://bitcoin.org/en/developer-guide
   478  
   479  
   480  \end{thebibliography}
   481  
   482  \end{document}