Guide to Using Sia Skynet

Learn how to use the main features of the Skynet network in order to share content with others.


Introduction

Some things to know about the Sia Skynet network.

Last Updated June 3, 2020

This guide will help you get started on the Sia Skynet network. The guide is writting using Sia v1.4.8 with examples for Windows. The instructions provided should apply to the Sia-UI on all major operating systems. This guide mainly focuses on using Skynet through your own Sia-UI for uploading and pinning files, but it also contains information on using public Skynet Portals to upload files.

Skynet Limitations and Considerations

There are a few things you may want to know about before you utilize Skynet. If you haven't yet, we'd also recommend reading through our Skynet section to learn more about what Skynet is and the basics of how it works. It's important to understand Skylinks and Portals, and how they interact.

Notice: Sia and Skynet are still in development. It is not currently recommended to store critical data on Sia or Skynet without having another backup elsewhere.

  • For now, Skynet use in Sia-UI is limited to the Terminal/command line. Because Skynet has recently launched, the Sia-UI does not yet support Skynet operations in the Sia-UI graphically, so command line statements through the Terminal must be used. The commands are fairly basic, though, and we'll walk you through them.
  • Normal renting limitations still apply to Skynet files. This includes paying for storage and upload bandwidth, atomic file sizes, and contract lengths. While we'll discuss the Skynet specifics, we suggest you also review our section on Renting on Sia if you aren't familiar with how renting storage on Sia works.
  • By default, Skynet files are unencrypted and public. Skynet is intended to distribute content to others, not to store your own personal files privately. If you're looking to backup your own files and be the only one to access them, you're probably interested in being a normal renter on Sia instead of uploading to Skynet.
  • You can upload files via Skynet web Portals, but you have less control over them. We'll discuss the specifics of uploading files to Skynet from your own Sia client versus using a Skynet web Portal to upload files, as there are pros and cons to each method. However, if you want to ensure your Skynet files stay online, the best thing to do is upload them from your own Sia client instead of uploading via a web Portal.

Ready to get started? Read on!


Prerequisites

The following items MUST be completed before you can continue.

Note: These prerequisites only apply to uploading files via your own Sia client. You can also upload files via Skynet web Portals at no cost - if you choose to do this, you can skip these prerequisites and proceed to Uploading Via web Portal.

Prerequisite 1: Download the Sia-UI Client and Set Up a Wallet

You must first install the Sia-UI Client, create a wallet, and wait for your client to fully synchronize. If you haven't done this yet, instructions on downloading the Sia-UI Client and setting up a wallet can be found in our Wallet Setup Guide.

Prerequisite 2: Acquire Siacoins

You'll need some Siacoins to rent storage on the Sia (Skynet) network. Instructions on buying Siacoins can be found in our Guide to Buying Siacoins.

Prerequisite 3: Get Set Up as a Sia Renter

To upload or pin files to Skynet, you'll need to set up your Sia client as a renter. See our Guide to Renting on Sia and follow the directions. You only need to get through Step 4 of the renting guide, where contracts form and you're ready to upload data - then you can continue below to upload data via Skynet instead of as a normal renter.

Before you continue, make sure you've taken care of these steps first.


After Prerequisites Are Complete

All set on the prerequisites? Let's get started!

Jump to a section:
Uploading New Files Via Local Sia Client Converting Sia Renter Files to Skynet Uploading Via web Portal Downloading Pinning Skylinks Becoming a Portal Operator


Uploading a New File to Skynet Via a Local Sia Client

Uploading files to Skynet will negotiate Sia contracts with hosts like normal, so you will be charged storage and upload fees as a renter, and must have Siacoins available in your wallet for such a transation. The file is basically stored the same way as a normal Sia file as far as renting is concerned.

There are a few ways to upload new files to Skynet using Sia locally - select a method below for instructions.

Upload a new file using the Sia-UI Terminal

Note: The Terminal method is partially broken, as it doesn't accept file paths with spaces. It also sits unresponsive during uploads, and output formatting is not great. You may want to try one of the other methods below if your filename or path to your file has spaces, or if you're uploading a large file.

Click on the Terminal (>) icon at the top of Sia-UI, and type clear and press enter first. This will clear the help text from the Terminal and make it easier to see when our upload has finished. Then, enter the command skynet upload [source] [destination]. Replace [source] with the path to the file or folder on your local machine, and [destination] with the path and filename you want to store the file as on Skynet. For example, we'll upload a file called STV.mp4 using skynet upload G:\STV.mp4 STV.mp4:

Uploading a file to Skynet using the Sia-UI Terminal.

Note that once we enter our upload command, the Terminal will sit unresponsive until it spits out a bunch of text after everything is finished. Once the upload is done, we'll see a bunch of text - in the screenshot above, we scrolled to the top to see the beginning of the output. Below is the end of the output:

Our upload via the Sia-UI is complete.

We need to get our Skylink in order to be able to share our file - if you're not given one, type skynet ls into the Terminal. This will show your uploaded Skynet files and their Skylinks:

Getting a list of our Skynet uploads in the Sia-UI Terminal.

We can now use our Skylink to access our file through a Portal, i.e. https://siasky.net/AAAw8hI5sYFWrwhqi4gALaZizrfY5SE_5kVRfabbVBeFHg, and share the link with others.

Upload a new file using siac

Note: See this FAQ topic if you need help finding the location of siac.

We can use siac to upload a file to Skynet. Type siac skynet upload [source] [destination], replacing [source] with the path to the file or folder on your local machine, and [destination] with the path and filename you want to store the file as on Skynet. For example, we'll upload a file called Skynet Test Video.mp4 using siac skynet upload "G:\Skynet Test Video.mp4" "Skynet Test Video.mp4":

Uploading to Skynet using a system Command Prompt window and siac.

We'll be able to see our upload progress, and after the upload is done, our file will be pinned - we'll see "pinning" with a little indicator showing that Sia is working on it. Once it's done, we'll get a message that our file was uploaded successfully. If siac doesn't give us a Skylink, we can type siac skynet ls to see our uploaded Skynet files and their Skylinks:

Getting our Skylink via siac.

We also see the file we uploaded from the Sia-UI Terminal in the first tutorial section above. We can now use our Skylink to access our file through a Portal, i.e. https://siasky.net/AAC_cqa6GUkfIwnDSdACcpMeLUm2Stc9QZlThp34qea3vw, and share the link with others.

Upload a new file using the Sia Daemon API

The Sia Daemon API can be used to upload files using a utility like curl and a POST call. See the API documentation for complete details. We'll upload our test video using the API and the Windows Command Prompt with curl to demonstrate. You could also use this method to integrate Skynet uploads into your own application.

The Sia Daemon needs to be running in order to use the API, so we can either start siad manually or we can just open Sia-UI and leave it running in the background. We like less work, so we chose the Sia-UI method. Once it's running and unlocked, we can open a Command Prompt or Terminal window on our operating system - on Windows, we can open the Start menu and start typing Command Prompt, and open it from the list of results.

Then, we can use curl to upload a file to Skynet via the Sia Daemon's API and a POST call. The general format we'll use is shown in the API documentation, so for our demonstration to upload Skynet API Test Video.mp4, we'll use:

curl -A "Sia-Agent" -u "":[apipassword] "localhost:9980/skynet/skyfile/Skynet%20API%20Test%20Video.mp4?filename=Skynet%20API%20Test%20Video.mp4" --data-binary "@G:\Skynet API Test Video.mp4"

[apipassword] must be replaced with our API password for our Sia Daemon - see this FAQ topic for more information on API authentication and where to find the password on your machine. Note that inside the POST string, spaces in the path need to be replaced with %20, which is standard URL encoding for a space character.

Uploading to Skynet using a system Command Prompt window and the Sia Daemon API.

There will be no progress shown while the upload occurs, but once it completes, we should be given a JSON return containing a Skylink to the file as shown above. If we don't get a Skylink, we can use siac skynet ls to see our uploaded Skynet files and their Skylinks (see the tutorial section above on using siac to find the path to it on your system):

Getting our Skylink via siac.

Now we've got three files uploaded to Skynet from all of these tutorials. We can now use our Skylink to access our file through a Portal, i.e. https://siasky.net/AADd-pHf2LFMbRgILkrxlKGw4Y06wVkEUQaXs2rA-ZMT5A, and share the link with others.


Converting Existing Sia Renter Files to Skynet

If you've already uploaded a file to Sia as a renter and want to make it accessible on Skynet, you can do this using the Sia-UI Terminal, siac, or the Sia Daemon API - basically, the same ways we can upload a new file.

Sorry! Simply renter file conversion is not yet functional with Skynet. This section will be updated when it is possible to convert renter files without needing to re-upload them, which should be a completed feature in Sia v1.5.0. For now, you'll need to upload your files to Skynet as new files as explained above, or upload them using a public Portal as explained below.

In all instances, we need to know the path to the file we want to convert as shown in our Sia renter storage. On the Rent tab in the File Manager, find the file or folder you want to convert to Skynet.

  • If your file is in the root folder, you'll just need the filename.
  • If your file is in another folder, you'll need the full path to the file, i.e. My Folder/Skynet Renter Conversion Test Video 2.mp4 for one of the files shown below.

Finding our file path in the Sia-UI File Manager.

If you're not using the Sia-UI, you can see your Sia renter files using siac renter ls or the Renter Files API. Once you've got the full path to your file or folder, select an option below to convert the file.

Convert a Sia Renter file Using the Sia-UI Terminal

Sorry! The Terminal method is currently broken, as it doesn't accept file paths with spaces or properly set a filename in its API call in the background. We'll try to update this section when this is fixed. Try another method below.

It also sits unresponsive during uploads, and output formatting is not great. You may want to try one of the other methods below if your filename or path to your file has spaces, or if you're uploading a large file.

Click on the Terminal (>) icon at the top of Sia-UI, and type clear and press enter first. This will clear the help text from the Terminal and make it easier to see when our conversion has finished. Then, enter the command skynet convert [source] [destination]. Replace [source] with the path to the file or folder in your Sia renter storage, and [destination] with the path and filename you want to store the file as on Skynet. For example, we'll upload a file called SkynetRenterConversionTestVideo1.mp4 stored in the root of our Sia renter storage using skynet convert SkynetRenterConversionTestVideo1.mp4 ConvertedSkynetTestVideo1.mp4:

Uploading a file to Skynet using the Sia-UI Terminal.

Convert a Sia Renter file Using siac

Note: See this FAQ topic if you need help finding the location of siac.

We can use siac to convert our renter file to Skynet. Type siac skynet convert [source] [destination], replacing [source] with the path to the file or folder in our Sia renter storage, and [destination] with the path and filename you want to store the file as on Skynet. For example, we'll upload a file from our renter storage called Skynet Renter Conversion Test Video 2.mp4 stored in a folder called "My Folder" using siac skynet convert "My Folder/Skynet Renter Conversion Test Video 2.mp4" "Converted Renter Test Video 2.mp4":

Uploading to Skynet using a system Command Prompt window and siac.

We'll be able to see our upload progress, and after the upload is done, our file will be pinned - we'll see "pinning" with a little indicator showing that Sia is working on it. Once it's done, we'll get a message that our file was uploaded successfully. If siac doesn't give us a Skylink, we can type siac skynet ls to see our uploaded Skynet files and their Skylinks:

Getting our Skylink via siac.

We also see the file we uploaded from the Sia-UI Terminal in the first tutorial section above. We can now use our Skylink to access our file through a Portal, i.e. https://siasky.net/AAC_cqa6GUkfIwnDSdACcpMeLUm2Stc9QZlThp34qea3vw, and share the link with others.


Uploading Data to Skynet Via a web Portal

A Portal is essentially a website running software to interface with the Sia network, which allows users to upload or download files without needing to run a full Sia installation. There are several free and public Skynet Portals - for more information on portals, see our Skynet page.

The default Skynet Portal implementation provides a way to upload files through a Portal's public-facing web interface. Most Portals are currently configured this way. If you upload files via a Portal on the web, the Portal operator assumes the costs for storing and transferring the file. However, the file may be allowed to expire after a certain amount of time. You may need to upload the file again, or re-pin the file and assume responsibility for the storage costs yourself if you want the file to continue to be accessible.

Uploading a file via a Skynet Portal is like uploading a file anywhere, pretty much.

To upload a file via a Skynet Portal, see our list of current Skynet Portals to visit a Portal, and upload your file using the upload section on the Portal's front page if the option is available. If you don't see an Upload section, try a different Portal. Uploading may take a while depending on the size of your file. Once you upload your file, you'll be given a Skylink which you can then use to access your file or share it with other people.

Here's our Skylink after our upload is complete.

Share your Skylink with others and they'll be able to access your file. Remember, your file may be allowed to expire after some amount of time, so you may want to re-pin it yourself or upload files via your own Sia-UI if you want to make sure they stay online. Portal operators may also blacklist any Skylink they see fit, such as if you upload something illegal.


Using a Portal to Download Skynet Data

Skynet files are associated with Skylinks, which can be accessed through Skynet Portals. A Skylink can be accessed by visiting a Portal and entering the Skylink under the appropriate section to retrieve a file. For our example above where we uploaded a file to a public Portal, we'd use sia://AADWLu-Tvlq5l3UdNH_1L7pw9J4hykhbR9kFd654AweeJw under "Have a Skylink?". Doing so starts playing our uploaded video:

Playing our video through a Skynet portal. If you recognize it, now you've got a new way to use it!

Skylinks may also be accessed using any Portal with a default configuration by entering the Skylink ID after a Portal domain as if you were trying to access a file or page on a website, i.e. https://siasky.net/AADWLu-Tvlq5l3UdNH_1L7pw9J4hykhbR9kFd654AweeJw - this is the same format the Skylink was given to us after uploading our file via a Portal. These links could be used to embed content on a website, or even used to store and host an entire website, just like many other web storage resources. You can share links in this format with others to make it easier for them to go directly to your shared content.

See our list of current Skynet Portals to visit a Portal, then enter your Skylink to retrieve its contents.


Re-Pinning a Skylink

After content has been uploaded to Skynet, anybody can re-pin a Skylink to that content if they have the Skylink, and the content is public and not encrypted. This can also only be done via the Terminal or command line, as the Sia-UI does not yet have support to easily pin files. If you re-pin somebody else's Skylink, it will be copied to your Sia renter storage and you will assume the costs for storing the file just like a normal Sia file is stored as a renter. As such, you need to be set up as a renter on the Sia network prior to pinning a Skylink, which was covered in the prerequisites above. Re-pinning a file only applies to files already on Skynet which you did not originally upload - if you want to convert your own files you uploaded as a Sia renter to Skynet files, see the section above on Converting Existing Sia Renter Files to Skynet.

As long as at least one person continues to pin a Skylink before all other storage contracts run out on the file, the file will be available on Skynet indefinitely. Once you pin a file, contracts on that file will continue to renew the same as a normal Sia renter file, so it will stay online forever if you keep an allowance for renting and continue to open your Sia client in time to renew the contracts. Select a method below for instructions on how to pin a Skylink:

Re-pinning a Skylink using the Sia-UI Terminal

Note: The Terminal method is partially broken, as it doesn't accept file paths with spaces. It also sits unresponsive during pinning, and output formatting is not great. You may want to try one of the other methods below if your filename or path to your file has spaces, or if you're uploading a large file.

Click on the Terminal (>) icon at the top of Sia-UI, and type clear and press enter first. This will clear the help text from the Terminal and make it easier to see when our upload has finished. Then, enter the command skynet pin [skylink] [destination]. Replace [skylink] with the Skylink you want to pin, and [destination] with the path and filename you want to store the file as in your local Sia renter storage. For example, we'll re-pin the file we uploaded using the public Skynet portal above and call it SkynetPinTestVideo.mp4 using skynet pin AADWLu-Tvlq5l3UdNH_1L7pw9J4hykhbR9kFd654AweeJw SkynetPinTestVideo.mp4:

Re-pinning a Skylink using the Sia-UI Terminal.

Note that once we enter our pin command, the Terminal will sit unresponsive until it spits out a bunch of text after everything is finished. Once the pinning is done, we'll see a confirmation that our file was pinned, along with the same Skylink the file originally had. Now the file will stay online as long as we remain an active Sia renter, and will be accessible using the same Skylink, i.e. https://siasky.net/AADWLu-Tvlq5l3UdNH_1L7pw9J4hykhbR9kFd654AweeJw.

Re-pinning a Skylink using siac

Note: See this FAQ topic if you need help finding the location of siac.

Type siac skynet pin [skylink] [destination], replacing [skylink] with the Skylink you want to pin, and [destination] with the path and filename you want to store the file as in your local Sia renter storage. For example, we'll re-pin the file we uploaded using the public Skynet portal above and call it "Skynet Pin Test Video.mp4" using siac skynet pin AADWLu-Tvlq5l3UdNH_1L7pw9J4hykhbR9kFd654AweeJw "Skynet Pin Test Video.mp4":

Re-pinning a Skylink using a system Command Prompt window and siac.

No progress will be shown while our file is re-pinned, but once it's done, we'll get a message that our file was pinned successfully, along with the same Skylink the file originally had. Now the file will stay online as long as we remain an active Sia renter, and will be accessible using the same Skylink, i.e. https://siasky.net/AADWLu-Tvlq5l3UdNH_1L7pw9J4hykhbR9kFd654AweeJw.

Re-pinning a Skylink using the Sia Daemon API

Note: As of Sia v1.4.8, the /skynet/pin API exists but is not yet documented. The API documentation link below is where we expect the documentation to exist once it's done. Our example below should still work to use the API to re-pin a file.

The Sia Daemon API can be used to re-pin Skylinks using a utility like curl and a POST call. See the API documentation for complete details. We'll re-pin our Portal upload test video using the API and the Windows Command Prompt with curl to demonstrate. You could also use this method to integrate Skynet re-pinning into your own application.

The Sia Daemon needs to be running in order to use the API, so we can either start siad manually or we can just open Sia-UI and leave it running in the background. We like less work, so we chose the Sia-UI method. Once it's running and unlocked, we can open a Command Prompt or Terminal window on our operating system - on Windows, we can open the Start menu and start typing Command Prompt, and open it from the list of results.

Then, we can use curl to re-pin our Skylink via the Sia Daemon's API and a POST call. The general format we'll use is shown in the API documentation, so for our demonstration to re-pin our Skylink as Skynet API Pin Test Video.mp4, we'll use:

curl -X POST -A "Sia-Agent" -u "":[apipassword] "localhost:9980/skynet/pin/AADWLu-Tvlq5l3UdNH_1L7pw9J4hykhbR9kFd654AweeJw?siapath=Skynet%20API%20Pin%20Test%20Video.mp4"

[apipassword] must be replaced with our API password for our Sia Daemon - see this FAQ topic for more information on API authentication and where to find the password on your machine. Note that inside the POST string, spaces in the path need to be replaced with %20, which is standard URL encoding for a space character.

Uploading to Skynet using a system Command Prompt window and the Sia Daemon API.

No progress will be shown while our file is re-pinned, or once it's done. However, if no error is presented, the file will stay online as long as we remain an active Sia renter, and will be accessible using the same Skylink, i.e. https://siasky.net/AADWLu-Tvlq5l3UdNH_1L7pw9J4hykhbR9kFd654AweeJw.


Becoming a Portal Operator

Anyone may become a Skynet Portal operator, however it is not necessary to operate a Portal in most cases if you simply want to upload or download data on Skynet. Users wishing to upload Skynet data without running a Portal can do so as explained at the beginning of this guide, and can also upload or download data using one of the many available public web Portals.

There are two ways to set up a Skynet Portal: privately, either with or without a web interface, or publicly, where others can see and use your Portal. Either way, running a Portal costs about $10 per month in additional transaction fees related to Skynet contracts being made in order for each Portal to be able to function.

Private Portal

You can run a private Portal and have access to Skynet content privately. This will allow you to view the contents of Skynet and download any public Skynet data without needing to go through a public Portal. You can do this by configuring a local Sia instance to operate as a Portal (such as for use in your own applications), and you can also run the full web Portal interface privately if you want an easy way to interact with Skynet.

To configure a Sia node to act as a Portal, you first need to configure Sia as a renter, which requires a balance of Siacoins and a renting allowance. Details on this can be found in our Guide to Renting on Sia. Note that the Skynet web Portal setup instructions recommend certain allowance settings, which can be seen here, though these settings assume your Portal is going to upload and store a lot of data, so you may want to adjust them to your needs. Then, you can use siac to run the command siac renter setallowance --payment-contract-initial-funding 10SC (see this FAQ topic if you need help finding the location of siac). This command is what sets your Sia instance to act as a Portal (or a "viewnode"), and tells it to make contracts with as many Sia hosts as it can in order to be able to view all Skynet files stored on Sia hosts.

If you want to run the web Portal frontend, you can follow the instructions to set it up in the skynet-webportal GitHub. If you set the web Portal up on a local machine, it will not normally be visible to others outside of your machine. If you set the web Portal up on a web server, make sure to configure your Portal to be private and disallow access from the general public. Configuring your Portal to be private with such a setup will not be covered here because the process will vary based on your web server or hosting provider.

Remember that content uploaded via your Portal is still public by default, even if your Portal is set up to be private. If the Skylink to your content is discovered, the content can be accessed by others. Skylinks can be viewed by other Portal operators, so don't rely on security through obscurity, because there is a non-zero chance that your Skylinks could be viewed by others, catalogued, or even posted publicly. If you want to store content on Sia privately, you would be better off doing so as a regular Sia renter and not on Skynet.

Public Portal

Warning: Running a public Skynet Portal may have serious legal risks and liability concerns - see this FAQ section for more information.

If you wish to set up your own public Skynet web Portal, the software and basic installation instructions can be found at https://github.com/NebulousLabs/skynet-webPortal. Running a Portal involves running a regular Sia instance, as well as the web Portal software. As a Portal operator, if you allow free uploads and downloads for public visitors to your Portal under the standard configuration, you will also be responsible for bandwidth and storage costs of that data on the Sia network. For these reasons, you'll need to maintain a significant balance of Siacoins in order to run a public Portal.

Please note that running a public Portal is equivalent to acting as a web hosting provider, as you are functioning in the capacity of an intermediary between the Sia storage network and anonymous Internet users who are downloading (and possibly uploading) data on the Sia network. Your Portal will take a Skylink, retrieve the associated content from the Sia network, and deliver the content to the user. There may be legal considerations behind serving illegal content as a Portal operator, and you may be required to respond to takedown requests or deal with other legal actions as a result. It may be impossible to successfully operate as a legal Portal without implementing your own filters and controls over the data you serve, and who you serve it to. In other words, running a public Portal is likely to be a substantial responsibility, and may require a large amount of work and additional development of the base Portal software in order to operate your Portal legally.


Other Good Things to Know

Now that you're working with Skynet, here are a few tips.

Files on Skynet are Public by Default

Files uploaded to Skynet are stored publicly and in an unencrypted fashion. Hosts receive a full copy of your unencrypted file. As a result, you should either avoid storing sensitive data on Skynet, or encrypt it first before uploading. Additionally, even if you don't share your Skylink, if it is discovered by someone else, they can access your uploaded file. Keep this in mind when using Portals, as a Portal operator has the opportunity to save all Skylinks created by their Portal and do as they please with them. There is also an extremely small chance that your Skylink could be discovered randomly.

Skynet Files Don't Show in your Normal Renter Storage

Normally, you can see your uploaded files under the Rent tab in the Sia-UI. Skynet files aren't yet shown in the Sia-UI - you can view them in the Terminal or with siac by using the command skynet ls. This will show your Skynet files and folders, as well as their Skylinks.

Operating a Public Skynet Portal is a Potential Liability

We know we've said this already, but it bears repeating once more - if you operate a public Portal, you're providing public access to the Sia network and any Skylinks contained within. You are also potentially offering to pay for and store content from strangers on the Internet. This could be likened to both operating a Tor exit node, and opening a free FTP or other storage server on your system on which anyone could store anything they want. If anything illegal transits your Portal, you may end up in serious legal trouble. Only operate a public Skynet Portal if you understand what you're doing, including the risks involved.

For more tips, visit our Skynet FAQs page.


Top
Highlight and share