Portals serve many functions on Skynet, but put simply, they do the work to serve content to users from Sia and store content from users on Sia. Different type of portals serve different functions in the ecosystem, as you'll see below.
Much of the work that a Portal does is interacting with the Sia network. Describing the details of Sia is beyond the scope of this documentation, but for further reading, start with Sia Support's Sia 101.
Portals act on behalf of Skynet users on the Sia network. They run full blockchain nodes and act as special "Renters" on the network. They hold Siacoins in a wallet, and they create file contracts and pay hosts for their storage and bandwidth.
When you upload files to Skynet using a portal, the portal creates a contract with several hosts, committing to pay them to store the file for a period of time. For more info on the specifics of how files are treated on Sia, see the Sia Support article for Uploading.
Currently, there are two main differences for how Skynet handles uploads compared to Sia's default behavior:
Uploads on Skynet use 1-to-10 Reed-Solomon encoding for extra-high redundancy, but at additional cost to the portals. (Setting this to a custom value will be possible in the near future.)
Files on Skynet are not encrypted before being erasure-coded and sent across the network. Encryption for skyfiles is the responsibility of the application.
When you download files from Skynet using a portal, the portal finds the pieces it needs to reconstruct the file from hosts across Sia. It reconstructs the file and streams it to you with minimal lag or latency. For more information on how Skynet can do this in a performant way, see the Skyrocket page.
When you "pin" a file on Skynet using a portal, the portal is creating file contracts with hosts and committing to pay for the storage of that file on the Sia network. You don't need to be the original uploader to pin a file -- as long as you have access to the file when you pin it, portals take care of the process needed to keep the file alive on the network and "repairing" it if hosts cannot prove they're still storing the data.
Portals at their most basic are a special type of renter on the Sia network. If you run a Sia node, you can easily upload files to Skynet or pin files you find on the network. See Using a Sia node as a Portal for more information.
Web Portals enable much of the functionality that make Skynet accessible on the web for users and developers. In addition to the work that all portals do on the Sia network, Web Portals allow:
Uploading and Downloading by using standard HTTP requests
Interacting with Web Apps
Full Handshake node for trustlessly hosting web apps and files at human-readable URLs
Skynet Web Portals that are available to any user are called public web portals. Skynet Labs operates the public web portal hosted at http://siasky.net/.
For more information on the technology stack that makes this work, see Running a Web Portal.
Portals can be used to access any data uploaded to Skynet. This creates certain difficulties, as portal operators cannot control what data may have been uploaded to the network by other portals.
Web portals, by virtue of being open to the public, have to contend with data that may put them in danger of legal consequences or with data they do not want to serve.
Portals maintain a list of "blocklisted" files that are not downloadable through their portal. Blocklisted files will also not be uploaded to the Sia network if a user tries to upload the file to the portal.
Blocklists are an important way for portals to remain compliant with legal obligations. Blocklists are also saved in an obfuscated format to allow portals to share blocklists without publishing the skylinks of the material they've chosen to block.
Skynet Labs cannot give legal advice in any jurisdiction, so please operate public web portals with extreme caution. We do believe that code is speech and that free software, open access, and user-control are key to a better, freer internet.
See Running a Web Portal.