Blog home

What is an IPFS Gateway?


Published on

4 min read

What is an IPFS Gateway?

In this #Pinata101 post, learn how IPFS gateways work and why they're a game-changer for any web3 builder.

If you think of IPFS as a city, and the individual nodes that make up the city as neighborhoods, IPFS gateways are the streets that connect everything together. Just like city streets, some have more traffic, some have higher speed limits, some go through the middle of the city, and some go straight from neighborhood to neighborhood.

IPFS gateways are the necessary link between IPFS and the traditional web (HTTP), letting you access files faster and more reliably than ever before. In this blog post, we’ll explain how IPFS gateways work, how to use them, and how to decide the type of gateway for your use case.

How does an IPFS Gateway work?

IPFS gateways are public services (just like roads!) that act as the bridge between the traditional web protocol (HTTP) and decentralized storage protocol (IPFS). They retrieve content from the IPFS network and serve that content to a web browser (Safari, Chrome, etc.) in a way that the browser can understand. IPFS gateways are the literal connection between web2 and web3.

Let’s look at an example.

Say you’ve built a decentralized social network app called Freeple that uses IPFS to store user-generated content such as photos, videos, and status updates. When a user uploads content to Freeple, the content is added to the IPFS network and assigned a unique content address—also known as a CID.

Users access Freeple through a traditional web interface, either on their computer or mobile device, using their HTTP browser of choice. When a Freeple user wants to view someone’s image or video on their profile, a request is sent to an IPFS gateway. The IPFS gateway retrieves the content’s CID from the IPFS network based on the content address assigned by Freeple.

Once the content has been retrieved from the IPFS network, the IPFS gateway serves it to the user through their web browser where they can view it as if they normally would on any other social network.

For the user, there isn’t much difference. For the developers and people running the project, there are quite a few:

  • Lower costs (for speed, storage and distribution)
  • Better security
  • More stability

Sounds like a pretty good deal, no? There are really only two caveats. One, for best performance, you should use the gateway closest to you. More on that later. Two, your speed will depend heavily on whether you’re using a public gateway or a private gateway.

The difference between Public IPFS Gateways and Private IPFS Gateways

In most cities there are public roads that everyone can use, and private roads only available to those that have special access. The nice roads where the big fancy houses are.

Public gateways and private IPFS gateways (known at Pinata as Dedicated Gateways) both connect you to the same IPFS network, but public gateways are sensitive to traffic since there is only a limited amount of bandwidth. If lots of people are using the public IPFS gateway in your area, your content will load slowly, and in some extreme cases, slow enough to cause users to bounce.

Private IPFS gateways give you your own personal bridge to the IPFS network, so your content always loads quickly, no matter how many people are requesting content.

Private vs Public IPFS Gateways

Going back to the Freeple example: you can imagine how poor of an experience it would be if a user clicked someone’s new profile picture and it took 10 seconds to load, just because there’s a lot of activity on the network. Wouldn't leave a great taste in their mouth. This situation could happen when using a public IPFS network.

Luckily for you, you don’t have to be one of those big fancy house people to have a private dedicated gateway.

Using Pinata’s Dedicated IPFS Gateways

We’ve made our name as a trusted liaison to IPFS, with over 300,000 users using our platform since 2018.

A couple reasons why companies like OpenSea, Rarible and Polygon trust us for their IPFS gateways:

Speed: We mentioned earlier that for the best performance, you should use the gateway closest to you. Not only do we have a built-in CDN (content delivery network) that greatly speeds things up, we also have 200 server locations around the world. So we definitely have a server near you.

Scalability: Pinata’s IPFS gateways are designed to automatically scale up or down in response to changes in demand, ensuring that any content stored on the IPFS network can be accessed quickly and efficiently as the user base grows. In other words, we’re built for growth.

Security: Pinata's dedicated IPFS gateways use SSL encryption to protect content from unauthorized access or tampering. Our dedicated IPFS gateways also have access controls that can be used to restrict access to sensitive or confidential content, ensuring that only authorized users can access it and preventing it from being modified or deleted by unauthorized users.

You can use Pinata’s Dedicated IPFS Gateways from our web app, or via API. And while our paid plans have all the bandwidth, speed and storage you’ll ever need, our free plans pack a mighty punch for anyone new to the game.

Stay up to date

Join our newsletter for the latest stories & product updates from the Pinata community.

No spam, notifications only about new products, updates and freebies. You can always unsubscribe.