How to Create Decentralized Storage
One of Avail’s core functionalities is allowing users to store data on the decentralized network. This guide will walk you through how to use Avail Coin to store files in a decentralized way (as a client) and how to contribute your own storage to the network (as a provider). In a decentralized storage workflow, a user uploads data, the network distributes and secures it, and later the user (or others they authorize) can retrieve it.
Figure: High-level overview of a decentralized storage process. In a typical storage transaction, (1) a user pays a storage miner (provider) in cryptocurrency to store their file; (2) the provider commits to this contract by publishing proof of the file’s storage on the blockchain (making it publicly verifiable); (3) the network continuously checks that miners are storing files correctly via cryptographic proofs, and (4) when needed, the user (or any requester with proper authorization) pays a miner to retrieve the file back. This trustless cycle ensures data is safely stored and available on-demand without centralized servers.
As a User (Storing Files):
Install Avail Storage Client: Download and install the Avail client software or use the web decentralized application (dApp) for storage. This client is your gateway to the network – it will handle file encryption, splitting, and communication with storage providers. During setup, connect your cryptocurrency wallet containing $AVAIL to the app.
Prepare Data for Upload: Choose the file or dataset you wish to store. The Avail client will automatically encrypt your file on your device using your private key or a passphrase (ensuring only you can decrypt it), and then break the encrypted file into many small pieces. For example, a 100 MB file might be split into dozens of shards. Erasure coding is applied to add redundancy, meaning even if only a subset of shards are later available, the file can be reconstructed. All this happens behind the scenes for the user.
Select Storage Terms: Specify your storage requirements – for example, how long you want the data stored (duration), and agree to a storage fee rate. The Avail network has a marketplace mechanism: your client will find storage providers (nodes) offering space and negotiate a deal. You can either accept the best automatic quote or manually select providers from a marketplace listing. Decentralized protocols like Avail often use smart contracts or deal offers to lock in terms (e.g. X GB for Y months at Z AVAIL per month).
Fund the Storage Contract: Ensure you have enough $AVAIL in your wallet to cover the storage fees (and a small transaction fee). When you initiate the storage, the client will create a storage contract on the blockchain, paying the agreed amount of $AVAIL into an escrow that will be released to the provider over time as they prove they are holding your data. This on-chain contract includes the data’s content identifier (a cryptographic hash) and terms of the deal. The transaction will be signed by your wallet and sent to the network for confirmation.
Data Distribution: Once the contract is confirmed, your Avail client transfers the encrypted shards of your file to the chosen storage providers across the network. For example, if you opted for 3× redundancy, the network might distribute your file shards to at least three independent nodes in different geographic regions. Each provider stores only encrypted fragments, not any complete or plaintext file, preserving your privacy.
Verification and Storage Proofs: After storing the data, providers must continuously prove they still have it. The Avail blockchain will require providers to submit periodic proof-of-storage (similar to Filecoin’s Proof-of-Spacetime) for your file’s shards. These proofs are automatic – the software on the provider’s side generates cryptographic evidence that they possess the data chunks. The blockchain verifies these without needing the actual file (using the file’s content hash and the provider’s responses). If a provider fails to submit a valid proof in time (e.g., due to going offline or losing the data), the contract can be terminated and their collateral or future payment is slashed. From the user perspective, these audits are invisible but they are what keep providers honest.
Retrieving Your File: When you want to retrieve your data, the Avail client will find the pieces from the network. You (or anyone with the file’s access credentials) can request the file by its content hash or ID. Providers holding the shards will respond by uploading the pieces. Typically, you pay a small retrieval fee in $AVAIL to whichever provider delivers the data (similar to step 1 but for download). The client then reassembles the shards and decrypts the file with your key, giving you back the original file. Thanks to the network’s redundancy, even if some nodes have gone offline, others still have the needed pieces, ensuring your file is available when requested. Retrieval is usually fast – since multiple nodes might send pieces in parallel, download speeds can be high and latency low.
Renewal or Termination: If your storage term is expiring and you still need the file stored, you can renew the contract (pay additional tokens to extend the duration). If you no longer need the data stored (or have retrieved and backed it up elsewhere), you can let the contract expire. The providers will eventually drop the data when they are no longer being paid, freeing up space for other users. All of this is handled by smart contract rules – you don’t need to manually intervene except to initiate renewal.
Behind the scenes, Avail’s network ensures that the prices for storage remain competitive due to the open marketplace of providers, and that your data remains safe. Two key features guarantee safety: (a) Encryption means only you (the data owner) can ever read the data, since the keys never leave your hands. (b) Distributed storage means there's no single point of failure – even power outages or node failures won’t lose your data, as copies exist on other nodes. This process, from upload to verification, happens seamlessly through the Avail application, giving you a cloud-like experience without trusting any single cloud company.
As a Provider (Contributing Storage):
If you have spare disk space and want to earn $AVAIL, you can become a storage node in the Avail network:
Set Up a Storage Node: Install the Avail node software on a system with reliable internet and available storage capacity. This could be a home server, a VPS, or even your personal computer with an external hard drive (the requirements are flexible – no specialized hardware needed beyond standard commodity drives). Configure the node by allocating a certain amount of disk space (for example, 2 TB) for the network to use.
Connect Wallet & Stake (if required): Register your node on the network by linking a wallet that can receive payments. Avail may require a small stake or collateral from providers to discourage bad actors (similar to Filecoin’s model of requiring miners to lock some FIL). This stake could be a modest amount of $AVAIL deposited in a smart contract. If your node misbehaves (e.g., consistently fails proofs), a portion could be slashed; if you operate correctly, it’s released when you exit the network. (The staking mechanism helps ensure accountability and trust, as also seen in other networks)
Announce Service & Get Deals: Once online, your node will announce its presence and terms (price per GB, available capacity, minimum contract duration, etc.) to the network’s storage marketplace. You can set these terms via a config file or dashboard. The node software will start receiving proposals from clients who want to store data. When a user’s storage request matches your criteria, you can accept the deal. The contract is then created on-chain, and you’ll receive the data shards to store (plus any initial payment as per the contract).
Store Data and Provide Proofs: After accepting deals, your node’s main job is to store the data reliably and produce timely proofs. The software will periodically generate cryptographic proofs that it still holds the data (without you needing to manually do anything). Make sure your node stays online as much as possible and has consistent power and connectivity – this maximizes your chance of success. If you meet your proof obligations, you will continuously earn the storage fees escrowed in the contract (paid out perhaps incrementally or at contract end). If you fail, the contract might be reassigned or you lose the reward for that period (and potentially some collateral). Essentially, honesty and uptime are financially rewarded.
Earn $AVAIL Rewards: In addition to client-paid storage fees, the Avail blockchain may provide block rewards to storage farmers as part of the consensus mechanism. Since Avail uses proof-of-space, your node also contributes to securing the blockchain by committing disk space. Each time your node (as a farmer) helps produce a block or a proof-of-space challenge, you could earn a block reward in $AVAIL. The more storage you contribute relative to the whole network, the higher your probability of earning these rewards. This incentivizes more participants to join and secures the network.
Maintain and Upgrade: Over time, maintain your hardware (replace failed drives, upgrade software to latest version, etc.). You can add more storage to earn more, or gracefully remove your node from the network if you no longer wish to participate (after completing any active contracts). Monitoring tools in the Avail node software allow you to track your deals, usage, and earnings. Many providers set up alerts to notify if a proof was missed or if the node went offline unexpectedly, so they can react and maintain a good reputation.
Becoming a storage provider helps the Avail network grow and, in return, you earn $AVAIL for your contributions. The entry barrier is low – any capable computer with free space can join – promoting a truly decentralized, global network of storage nodes. Importantly, as a node you never have access to users’ plaintext data (all files arrive encrypted), keeping liability low and privacy intact. All your interactions with clients are governed by smart contracts on Avail’s blockchain, which transparently handles payments and verifies that you fulfill your promises.
Last updated