If you're familiar with web3, then you’re likely familiar with the InterPlanetary File System (IPFS). IPFS gateways are the bridge between the traditional web and the decentralized IPFS network, making it easier for users to access IPFS-hosted content without specialized software. When it comes to gateways, two important things to cover are how to set them up and how to ensure the safest experience while doing so.
But first, we should understand how files are distributed across IPFS.
In order to get a file onto the IPFS network and ensure it stays there, you need to upload the file and make sure it is pinned to a storage node. This can be done on your own or through a pinning service. Once the file is pinned, it is now available for the rest of the network and can be fetched through gateways.
Public vs. Dedicated Gateways: Understanding the DifferenceThere are two types of gateways - public and Dedicated. A public gateway is used to upload content to IPFS, as well as retrieve content and serve it to a traditional web browser. Without a gateway, your content wouldn’t load by just copying and pasting the content identifier (CID) for the file into your browser. Public gateways are highly convenient since they are accessible by everyone due to their public nature, but can also be considered risky for that exact reason. They can be prone to high network traffic making load times slow, as well as more vulnerable to failures. Public gateways are often useful for testing IPFS content, but not the superior option for serving large quantities of data.
On the flipside, Dedicated gateways provide blazing fast delivery of your content. This is because they are reserved exclusively for you and your selected audience, avoiding slowdowns and limitations you’d normally experience with a public gateway. They connect to IPFS in the same way as a public gateway, except these Dedicated Gateways are focused more on performance for faster content retrieval, and include customized URL paths and more control over who can access your content. You might prefer to use a Dedicated gateway with a high-traffic application or platform such as an NFT marketplace, or if you’re dealing with sensitive or private data (more on access controls below).
Access Controls: Securing Your IPFS Content
IPFS is public at its core, meaning any piece of content can be loaded through a gateway. An easy way to enhance security and protect your content is by implementing access controls. These controls will open your gateway to the broader IPFS network to allow a wider range of updates, but only load content that meets these access control parameters. Pinata offers easy access controls so that the gateway will only serve content if the designated access token is present.
To Run Your Own Gateway Or To Utilize A Service Like Pinata
Running your own gateway grants you maximum control over security and access. However, it requires technical expertise, maintenance, and infrastructure costs. This option is ideal for those who prioritize security and have the resources and technical knowledge to manage a gateway.
Services like Pinata offer convenience by managing the gateway for you. With an easy to use interface, Pinata can aid in simplifying the process, making IPFS more accessible to a broader audience. However, regardless of which provider you choose, you must trust the service provider with your data and consider their security measures.
Custom Domains: Personalizing Your Gateway
Custom domains allow you to brand your Dedicate Gateway and provide users with a familiar and trustworthy experience. By configuring a custom domain, you can enhance the legitimacy and professionalism of your gateway while ensuring that users recognize your brand. For example, with a public gateway, the URL of your pinned files looks something like this: gateway.pinata.cloud/ipfs/abc. With a custom domain, your content URLs will be yourproject.mypinata.cloud. Your users will get a fast experience that feels like an authentic extension of your brand.
With the ability to choose between a public and Dedicated gateway, implement access controls, and set a custom domain, you’re able to securely upload and distribute content to IPFS. If you don’t want to handle the complexities of running your own gateway, Pinata makes it easy for you to upload to IPFS with all the security parameters you need.
September 20, 2023
Ready to shape the future?
Explore our plans