今天偶然看到一篇Sia Coin(SC)相关文章,才知道Sia是与去中心化云存储相关的一个区块链项目,Sia Coin是这个项目发行的代币。


因我所处的行业正好是企业云服务,而目前的企业云服务大多是基于阿里云、腾讯云、AWS这些中心化的平台 (IaaS)。Sia 会成为云存储服务的革命性项目吗?行业相关,加上Sia的名气,我决定深入了解一下它。


网上有很多SIA相关的介绍,这里简单引用其中一个:


Sia的目的是让云储存去中心化。在这个平台上,您可以存放和提取各种各样的文件,并不需要为您的文件隐私和安全担心。


通过运用加密技术,加密合约,和重复备份,Sia 能够使一群互不信任的和互不了解的计算机节点联合起来成为一种有统一运行逻辑和程序的云储存平台。


 这种平台将比传统的云储存平台更快,更便宜,和更可靠。因为这些互不信任的计算机节点分布于世界各地,Sia 可以在无需添加成本的情况下成为一个有效的文件及其内容的分销网络。


其中我最关心两个问题:


一是如何才能实现去中心化云存储;

二是数据分布存在网络不同节点上,它们如何免于网络攻击以保证数据安全。


为了获取到这两个问题的“一手知识”,我找到了SIA Coin这个项目的白皮书(https://sia.tech/sia.pdf)。由于SIA相关的内容很多能在网上找到,故下文涉及到的翻译采取了意译的方式。



1. 云存储去中心化是如何实现的?


Clients can use erasure codes, such as regenerating codes, to safeguard against hosts going offline. 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. (The values of n and m vary based on the specific erasure code and redundancy factor). Each piece then encrypted and stored across many hosts. This allows a client to attain high file availability even if the average network reliability is low.


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. Availability can be further improved by rehosting the file pieces whose hosts have gone offline. 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. These downloads can be run in parallet to maximize avaliable bandwidth.


用户可以使用“擦除算法”(又译“纠错码”)将一个文件分片存成n小份,这样一个文件就可以从其子集 m个分片中进行下载。n的值取决于用户愿意做几倍的冗余。每个分片在上传和存储之前都将先被加密(以避免数据在云端被篡改的风险)。


这样一来,用户对文件的获取就不依赖于全网整体的网络可靠性。举个例子,如果100个文件切片中拿出10个就可以完整地恢复文件,那么用户实际上只需要依赖10个最可靠的租户,而不是全网的平均可靠性。


当然,获取文件切片的前提是租户的服务器不能离线,否则就无法提供下载服务了。但,如果把存储在原服务器上的文件切片进行二次存储,那显然会进一步增强下载可靠性!如此,用户可以选择离自己最近的10个节点,或者最“健壮”的10个节点,提高整体的下载速度。


另外,一个常识是:文件分割并不会像分割纸张一样,把可见的实体分裂开。文件的保存可以简单理解为1和0,把这些字符分开存,必要的时候合并在一起就可以了。



2. 如何保证节点不受攻击?


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. The provider may also refuse to sign a contract until the entire file has been uploaded to them. Contract terms give storage providers some flexibility. 


They can advertise themselves as minimally reliable, offering a low price and a agreeing to minimal penalties for losing files; or they can advertise themselves as highly reliable, offering a higher price and agreeing to harsher penalties for losing files. An efficient market will optimize storage strategies. Hosts are vulnerable to denial of service attacks, which could prevent them from submitting storage proofs or transferring files. It is the responsibility of the host to protect themselves from such attacks.


租户和用户可以双向选择。这种租用规则非常灵活,租户可以声明存储的低可靠性和文件丢失时的低罚款额,相应的,他所提供的存储服务价格也会更低一些;或声明高可靠性和高罚款额,相应的,用户想使用他的服务时,也会被要求出更高的价格。项目方相信,在这种双向选择机制下,一个有效的市场实现存储策略的最优化


至于节点攻击,文中提到:易受攻击的租户会由于安全性不够,会丢失部分的工作量证明(PoW, 可能会以信用评分的形式影响用户对他的选择)。所以,提高网络安全性不再需要任何监督,而成为每个服务提供者自身必须解决的问题


也就是,通过市场的双向选择机制,提高全网络的安全意识,也相应地提高了社会协作的效率。




好了,今天的白皮书就读到这里。网上关于SIA 这个项目的文章有很多,但看到白皮书后,我才发现这些文章大多不够完整。接触到“一手知识”给人的通透感和成就感,很棒。希望我们能够一起读更多。