
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/">
    <channel>
        <title><![CDATA[ The Cloudflare Blog ]]></title>
        <description><![CDATA[ Get the latest news on how products at Cloudflare are built, technologies used, and join the teams helping to build a better Internet. ]]></description>
        <link>https://blog.cloudflare.com</link>
        <atom:link href="https://blog.cloudflare.com/" rel="self" type="application/rss+xml"/>
        <language>en-us</language>
        <image>
            <url>https://blog.cloudflare.com/favicon.png</url>
            <title>The Cloudflare Blog</title>
            <link>https://blog.cloudflare.com</link>
        </image>
        <lastBuildDate>Thu, 09 Apr 2026 19:44:50 GMT</lastBuildDate>
        <item>
            <title><![CDATA[Ethereum Gateway support for Görli + Sepolia Testnets and the Ethereum Merge]]></title>
            <link>https://blog.cloudflare.com/ethereum-merge-and-testnet-gateways/</link>
            <pubDate>Tue, 13 Sep 2022 13:00:00 GMT</pubDate>
            <description><![CDATA[ Today we are excited to announce support for the upcoming Ethereum Merge and Sepolia and Görli testnet support ]]></description>
            <content:encoded><![CDATA[ 
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/79McHksywcc4Cmxb88p74G/2803159a95a5c01cc2bb7f7999417d4c/image1-6.png" />
            
            </figure><p>Today we are excited to announce support for the <a href="https://ethereum.org/en/upgrades/merge/">Ethereum Merge</a> on the Ethereum network and that our Ethereum gateways now support the <b>Görli</b> and <b>Sepolia</b> test networks (testnets). Sepolia and Görli testnets can be used to test and develop full decentralized applications (<a href="https://ethereum.org/en/dapps/">dapps)</a> or test upgrades to be deployed on the mainnet Ethereum network. These testnets also use the Ethereum protocol, with the major difference that the Ether transacted on the testnet has no value.</p><p>Ethereum is a decentralized blockchain with smart contract functionality which Cloudflare allows you to interact with through an HTTP API. For a quick primer on Ethereum and our gateway, please refer to our previous blog post on the <a href="/cloudflare-ethereum-gateway/">Ethereum Gateway</a>.</p><p>As preparation for the merge, the Ethereum Foundation has executed merges on multiple testnets to ensure that the actual mainnet merge will occur with minimal to no disruption. These testnets both successfully upgraded to Proof of Stake and Proof of Authority, respectively. Cloudflare’s Testnet Gateway handled the <a href="https://blog.ethereum.org/2022/07/27/goerli-prater-merge-announcement/">Görli-Prater merge</a> without issue, ensuring that we will be ready and prepared for the upcoming Ethereum Merge for mainnet. Our testnet gateways are live and ready for use by Cloudflare Ethereum Gateway customers.</p><p>In this blog, we are going to discuss the consensus transition entailed by the Ethereum Merge, changes in the Cloudflare Ethereum Gateway, and how you can start using them today.</p>
    <div>
      <h2>Consensus Mechanisms</h2>
      <a href="#consensus-mechanisms">
        
      </a>
    </div>
    <p><b>Proof of Work</b> is the original consensus mechanism of the Ethereum blockchain, popularized by Bitcoin. Miners compete to be the first to solve the puzzle, allowing them to update the blockchain with the latest transactions and receive a reward in exchange. The more miners and more processing power focused on solving these puzzles, the more secure the network. While this was first thought to help decentralization as it could be run on commodity hardware, users started to run highly powerful computer hardware, like ASICs and GPUs, to solve these complex math puzzles. This means the security of the network comes with a massive tradeoff. This massive network of Ethereum miners <a href="https://digiconomist.net/ethereum-energy-consumption/">consume more than 80 terawatt Hours per year – more than the country of Chile</a>. Clearly, this is not a sustainable mechanism for consensus, especially as use of cryptocurrency and web3 technologies becomes more widespread.</p><p><b>Proof of Stake</b> is a consensus mechanism that lets users that have staked a specified amount of cryptocurrency run nodes to propose and validate blocks and receive a cryptocurrency reward. These nodes, commonly referred to as validators, are responsible for keeping the network secured and progressing. For every slot, one random validator node is chosen to be the proposer and a committee of random validator nodes is chosen to validate the proposed block. In the case of validators acting dishonestly or being unavailable, the validator will be penalized economically by having their stake “slashed”. Proof of Stake is significantly more sustainable – the Ethereum Foundation estimates that it will consume <a href="https://ethereum.org/en/energy-consumption/#introduction">99.95%</a> less electricity than Proof of Work. Plus, it comes with the additional benefit that validators have a financial incentive to uphold the health of the blockchain.</p><p><b>Proof of Authority</b> is very similar to Proof of Stake, as validators propose and validate blocks to progress their blockchain. However, a significant difference is that nodes can only become validators if they’re approved by an authority node, instead of putting up a stake. Cloudflare currently runs one such authority node for the <a href="https://blog.ethereum.org/2022/06/21/testnet-deprecation">now-deprecated Rinkeby testnet</a>. This is a fairly uncommon consensus algorithm for public blockchains in comparison to Proof of Work and Proof of Stake, but is commonly used in trusted communities like internal networks for corporations and governments.</p>
    <div>
      <h2>Cloudflare Ethereum Gateway</h2>
      <a href="#cloudflare-ethereum-gateway">
        
      </a>
    </div>
    
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/5QTb34ARQFJNVKdwmZ6EIh/65b4718c68a286205164a42099d1265b/image4-1.png" />
            
            </figure><p>At Cloudflare, we believe in using our own technologies to build our products, and the Ethereum Gateway is no exception. The Ethereum Gateway allows any customer to interact with the Ethereum network without needing to run their own dedicated node. A JSON-RPC call is first received by <a href="https://workers.cloudflare.com/">a Worker</a>, serverless code deployed in all of our data centers, ensuring that queries from any geographic region are processed quickly, and that requests are normalized using the latest block number known to the Worker.</p><p>The Worker then passes the call to a <a href="https://www.cloudflare.com/load-balancing/">Cloudflare Load Balancer</a>, corresponding to the specified Ethereum mainnet or testnet, which sends the call to Ethereum Node proxies inside our Kubernetes cluster. The Ethereum Node proxies queue calls and distributes them to ready and synced Ethereum Nodes that have the requested block. Our Ethereum nodes consist of an execution client and a consensus client.</p><p>The consensus client is responsible for Proof of Stake consensus, and we’ve added it to prepare the gateway for the merge. Ethereum Nodes then communicate with the specified Ethereum network to fulfill the RPC request. To ensure maximal speed, reliability, and availability, we have built in redundant Ethereum Node proxy instances and Ethereum Nodes in our cluster.</p>
    <div>
      <h2>The Merge</h2>
      <a href="#the-merge">
        
      </a>
    </div>
    <p>The Ethereum Merge is a long-awaited upgrade to the Ethereum network, changing the consensus method from the current and wasteful Proof of Work protocol to a more efficient Proof of Stake protocol. The merge also opens up the door for further developments to the Ethereum network, such as <a href="https://vitalik.ca/general/2021/04/07/sharding.html">sharding</a>, which promises to speed up transactions and lower costs.</p><p>The Ethereum Merge combines the current Ethereum Blockchain with the Ethereum Beaconchain, a Proof of Stake chain, when the <a href="https://github.com/ethereum/execution-specs/pull/585/commits/eefb60633047975c6b3dca6cc2b15bd4a56e74a2">Terminal Total Difficulty (TTD)</a> is <a href="https://bordel.wtf/">hit</a>. Once the merge is completed, the Ethereum Beaconchain will be where consensus clients will communicate to propose and validate blocks. The existing blockchain will merge with the beaconchain, linking every block after the merge to a slot on the beaconchain. The blockchain will continue to handle Ethereum transactions and smart contracts.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/2dDCJEL69Jg9O6URVnVcEX/0120cceef0eb92175b09be8967527a92/image3-4.png" />
            
            </figure><p>To prepare for the merge, a node operator must deploy a consensus client like <a href="https://github.com/prysmaticlabs/prysm">Prysm</a> or <a href="https://github.com/sigp/lighthouse">Lighthouse</a> alongside their execution client. If this doesn’t occur prior to the merge, their node’s copy of the blockchain will stop syncing and the execution client will be stuck on the last block prior to the merge.</p>
    <div>
      <h3>Sepolia and Görli Testnets</h3>
      <a href="#sepolia-and-gorli-testnets">
        
      </a>
    </div>
    
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/6AENg8mTFzZJVcSlRNJcNN/8ead43625ba393f55ccd969696eaa794/image2-5.png" />
            
            </figure><p>As per our <a href="https://developers.cloudflare.com/web3/ethereum-gateway/reference/supported-networks/">Ethereum gateway documentation</a>, we have made it extremely easy to send JSON-RPC calls to your preferred testnet. After you have <a href="https://developers.cloudflare.com/web3/how-to/manage-gateways/#create-a-gateway">created your Ethereum gateway</a>, change the network in the URL from mainnet to <b>sepolia</b> or <b>goerli</b>. For example, calling eth_blockNumber to the sepolia testnet for this example gateway will look like this:</p>
            <pre><code>$ curl -X POST -H "Content-Type: application/json" --data '{"jsonrpc": "2.0", "method": "net_version", "params": [], "id": 35}'  https://web3-trial.cloudflare-eth.com/v1/sepolia
{"jsonrpc":"2.0","result":"11155111","id":35}</code></pre>
            <p>This testnet support will help you ensure that your changes can be easily tested and hardened before deploying to the Ethereum Mainnet without incurring additional risk to your brand trust or product availability, all while not having to worry about operating your own infrastructure.</p><p>We want to ensure that anyone leveraging our Ethereum Gateway is able to achieve confidence and trust that whatever changes are pushed forward do not impact the end user experience. At the end of the day, the Internet is for end users and their experience and perception must always be kept within our purview at all times.</p>
    <div>
      <h3>Rinkeby</h3>
      <a href="#rinkeby">
        
      </a>
    </div>
    <p>As part of this announcement, we will be deprecating our Rinkeby signer with public address 0xf10326c1c6884b094e03d616cc8c7b920e3f73e0, which we operated to support the Ethereum ecosystem. We will stop Rinkeby testnet support on January 15, 2023, following the <a href="https://blog.ethereum.org/2022/06/21/testnet-deprecation/">Ethereum Foundation’s move to deprecate the Rinkeby testnet</a>.</p><p>Also, if you can’t wait to start building on our web3 gateways, check out our <a href="https://developers.cloudflare.com/web3/">product documentation</a> for more guidance.</p> ]]></content:encoded>
            <category><![CDATA[Web3]]></category>
            <category><![CDATA[Ethereum]]></category>
            <category><![CDATA[Internship Experience]]></category>
            <guid isPermaLink="false">3o7GtDnGrRBz6cFZX9wckv</guid>
            <dc:creator>Ainesh Arumugam</dc:creator>
        </item>
        <item>
            <title><![CDATA[Public access for our Ethereum and IPFS gateways now available]]></title>
            <link>https://blog.cloudflare.com/ea-web3-gateways/</link>
            <pubDate>Mon, 16 May 2022 12:57:48 GMT</pubDate>
            <description><![CDATA[ Today we are excited to announce that our Ethereum and IPFS gateways are publicly available to all Cloudflare customers for the first time ]]></description>
            <content:encoded><![CDATA[ <p></p><p>Today we are excited to announce that our Ethereum and IPFS gateways are publicly available to all Cloudflare customers for the first time. Since our announcement of our private beta last September the interest in our Eth and IPFS gateways has been overwhelming. We are humbled by the demand for these tools, and we are excited to get them into as many developers' hands as possible. Starting today, any Cloudflare customer can log into the dashboard and configure a zone for Ethereum, IPFS, or both!</p><p>Over the last eight months of the private beta, we’ve been busy working to fully operationalize the gateways to ensure they meet the needs of our customers!</p><p>First, we have created a new <a href="https://api.cloudflare.com/#web3-hostname-properties">API</a> with end-to-end managed hostname deployment. This ensures the creation and management of gateways as you continue to scale remains extremely quick and easy! It is paramount to give time and focus back to developers to focus on your core product and services and leave the infrastructural components to us!</p><p>Second, we’ve added a <a href="http://dash.cloudflare.com/?to=/:account/:zone/web3">brand new UI</a> bringing web3 to Cloudflare's zone-level dashboard. Now, regardless of the workflow you are used to, we have parity between our UI and API to ensure we fit into your existing processes and no time is wasted internally to have to figure out ‘how we integrate’, but rather, a quick setup and start to serve content or connect your services!</p><p>Third, we are pleased to say that you will soon have testnet support to ensure your new development can be easily tested, hardened, and deployed to your mainnet without incurring additional risk to your brand trust, product availability, or concern that something may fail silently and begin a cascade of problems throughout your network. We want to ensure that anyone leveraging our web3 gateways is able to achieve more confidence and trust that whatever changes are pushed forward do not impact end user experience. At the end of the day, the Internet is for end users and their experience and perception must always be kept within our purview at all times.</p><p>Lastly, Cloudflare loves to build on top of Cloudflare. This helps us stay resilient and also shows our commitment and belief in all the products we create! We have always used our SSL for SaaS and Workers products in the background. Building on our own services gives our customers the ability to define and control their own HTTP features on top of traffic destined for web3 gateways, including: rate limits, WAF rules, custom security filters, serving video, customer defined Workers logic, custom redirects and more!</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/30FMdovSIlUpWq4n63c0KR/c623107c8c1991700c55cefdbd592378/image1-42.png" />
            
            </figure><p>Today thousands of different individuals, companies, and DAO's are building new products leveraging our web3 gateways -- the most reliable web3 infrastructure with the largest network</p><p>Here are just a few snippets of how people are already using our web3 Gateways, and we can’t wait to see what you build on them:</p><ul><li><p>DeFi DAO’s use the Cloudflare IPFS gateway to serve their front end web applications globally without latency or cache penalties.</p></li><li><p>NFT designers use the Ethereum Gateway to effortlessly drop new offerings, and the IPFS gateway to store them in a fully decentralized system.</p></li><li><p>Large Dapp developers trust us to handle huge traffic spikes quickly and efficiently, without rate limits or overage caps. They combine all our offerings into a single pane of glass so that they don’t have to juggle multiple systems.</p></li></ul><p>As part of this announcement, we will begin migrating our existing users away from the legacy gateway endpoints and onto our new API, which is easier, highly managed, and more robust. To ensure a smooth transition, you will first need to make sure you have signed up for a <a href="https://developers.cloudflare.com/fundamentals/get-started/setup/account-setup/">Cloudflare account</a> if you did not already have one. On top of that, we have made sure to keep our free users in mind and thus our free users will continue to use the gateways at no cost with our free tier option! This includes no cap in the amount of traffic that can be pushed through our gateways along with offering the most transparent and forecastable pricing models in the market today. We are very excited about the future and look forward to sharing the next iterations of web3 at Cloudflare!</p><p>Also, if you can’t wait to start building on our gateways, check out our <a href="https://developers.cloudflare.com/web3/">product documentation</a> for more guidance.</p> ]]></content:encoded>
            <category><![CDATA[Platform Week]]></category>
            <category><![CDATA[Web3]]></category>
            <category><![CDATA[Ethereum]]></category>
            <category><![CDATA[IPFS]]></category>
            <guid isPermaLink="false">21fRaPsfontOlRPBBt88E5</guid>
            <dc:creator>Wesley Evans</dc:creator>
            <dc:creator>Brian Batraski</dc:creator>
        </item>
        <item>
            <title><![CDATA[Announcing The Cloudflare Distributed Web Gateways Private Beta: Unlocking the Web3 Metaverse and Decentralized Finance for Everyone]]></title>
            <link>https://blog.cloudflare.com/announcing-web3-gateways/</link>
            <pubDate>Fri, 01 Oct 2021 12:59:48 GMT</pubDate>
            <description><![CDATA[ Cloudflare announces the Private Beta of their Web3 gateways for Ethereum and IPFS. Unlocking the Metaverse, Web3, and Decentralized Finance for every developer. ]]></description>
            <content:encoded><![CDATA[ 
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/4fgIKsu1B2OUYfIvoufy4J/2c3e73dd9e7c7082aabaf224daf3c13a/image8-2.png" />
            
            </figure><p>It’s cliché to say that the Internet has undergone massive changes in the last five years. New technologies like distributed ledgers, NFTs, and cross-platform metaverses have become all the rage. Unless you happen to hang out with the Web3 community in Hong Kong, San Francisco, and London, these technologies have a high barrier to entry for the average developer. You have to understand how to run distributed nodes, set up esoteric developer environments, and keep up with the latest chains just to get your app to run. That stops today. Today you can <a href="https://docs.google.com/forms/d/11_oXpvGGVtP0DJenWBzLfxE4cyCjHHbqrbIibLAz2wQ/edit">sign up for the private beta</a> of our Web3 product suite starting with our Ethereum and IPFS gateway.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/6CPHhwfETpZPYPZ7YMspBP/ccc8a837b76989d9cdf9c3b31fb1628c/image9.png" />
            
            </figure><p>Before we go any further, a brief introduction to blockchain (<a href="https://ethereum.org/en/what-is-ethereum/">Ethereum</a> in our example) and the <a href="https://ipfs.io/#how">InterPlanetary FileSystem</a> (IPFS). In a Web3 setting, you can think of Ethereum as the compute layer, and IPFS as the storage layer. By leveraging decentralised ledger technology, Ethereum provides verifiable decentralised computation. Publicly available binaries, called "smart contracts", can be instantiated by users to perform operations on an immutable set of records. This set of records is the state of the blockchain. It has to be maintained by every node on the network, so they can verify, and participate in the computation. Performing operations on a lot of data is therefore expensive. A common pattern is to use IPFS as an external storage solution. IPFS is a peer-to-peer network for storing content on a distributed file system. Content is identified by its hash, making it inexpensive to reference from a blockchain context.</p><p>If you want an even deeper understanding of how Web3 works check out our other blog posts on <a href="/what-is-web3/">what is Web3</a> and <a href="/get-started-web3/">creating Web3 Dapps with Cloudflare Workers</a>.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/2Or8TSruyUwyvrcwMsEoNp/bb4cde50e8ad68f9cb48f390a455d76c/image1-4.png" />
            
            </figure>
    <div>
      <h3>Web3 and the Metaverse</h3>
      <a href="#web3-and-the-metaverse">
        
      </a>
    </div>
    <p>Over the last four years, while we have been working to mature the technology required to provide access to Web3 services at a global scale, the idea of the Metaverse has come back into vogue. Popularized by novels like “Snowcrash,” and "Ready Player One," the idea is a simple one. Imagine an Internet where you can hop into an app and have access to all of your favorite digital goods available for you to use regardless of where you purchased them. You could sell your work on social media without granting them a worldwide license, and the buyer could use it on their online game. The Metaverse is a place where copyright and ownership can be managed through NFTs (<a href="/get-started-web3/">Non-Fungible Tokens</a>) stored on IPFS, and accessed trustlessly through Ethereum. It is a place where everyday creators can easily monetize their content, and have it be used by everyone, regardless of platform, since content is not being stored in walled gardens but decentralised ecosystems with open standards.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/2ZeZo9C6EniEeJ89QF4DjE/e4b8513f15f77389c63e5f8f2937931f/image3.png" />
            
            </figure>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/7iwQLeHJRogEM9WvWyu3An/8a40b9d4763bfd5c320fc7a748d7d540/image6.png" />
            
            </figure><p>This shifts the way users and content creators think about the Internet. Questions like: “Do you actually need a Model View Controller system with a server to build an application?” “What is the best way to provide consistent naming of web resources across platforms?” “Do we actually need to keep our data locked behind another company's systems or can the end-user own their data?”. This builds different trust assumptions. Instead of trusting a single company because they are the only one to have your users' data, trust is being built leveraging a source verifiable by all participants. This can be people you physically interact with for <a href="https://support.signal.org/hc/en-us/articles/360007060632-What-is-a-safety-number-and-why-do-I-see-that-it-changed-#safety_number_view">messaging applications</a>, X.509 certificates logged in a <a href="https://certificate.transparency.dev/">public Certificate Transparency</a> Log for websites, or public keys that interact with blockchains for distributed applications.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/6r8YeF8xw3ABv5x3bFzlbE/9363c73ddd6882d1866a47d889023af8/image10-1.png" />
            
            </figure><p>It’s an exciting time. Unlike the emergence of the Internet however, there are large established companies that want to control the shape and direction of Web3 and this Metaverse. We believe in a future of a <a href="/what-is-web3/">decentralised and private web</a>. An open, standards-based web independent of any one company or centralizing force. We believe that we can be one of the many technical platforms that supports Web3 and the growing Metaverse ecosystem. It’s why we are so excited to be announcing the private beta of our Ethereum and IPFS gateways. Technologies that are at the forefront of Web3 and its emerging Metaverse.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/7hWZ5XkA9Y9v3ZxT7YXbRw/8839a7c61076625531ef2c8c48bad198/image4-1.png" />
            
            </figure><p>Time and time again over the last year we have been asked by our customers to support their exploration of Web3, and oftentimes their core product offering. At Cloudflare, we are committed to helping build a better Internet for everyone, regardless of their preferred tech stack. We want to be the pickaxes and shovels for everyone. We believe that Web3 and the Metaverse is not just an experiment, but an entirely new networking paradigm where many of the next multi-billion dollar businesses are going to be built. We believe that the first complete metaverse could be built entirely on Cloudflare today using systems like Ethereum, IPFS, RTC, <a href="https://www.cloudflare.com/developer-platform/r2/">R2 storage</a>, and Workers. Maybe you will be the one to build it...</p><p>We are excited to be on this journey with our Web3 community members, and can’t wait to show you what else we have been working on.</p>
    <div>
      <h3>Introducing the Cloudflare Web3 Gateways!</h3>
      <a href="#introducing-the-cloudflare-web3-gateways">
        
      </a>
    </div>
    <p>A gateway is a computer that sits between clients (such as your browser or mobile device) and a number of other systems and helps translate traffic from one protocol to another, so the systems powering an application required to handle the request can do so properly. But there are different types of gateways that exist today.</p><p>You have probably heard mention of an <a href="https://www.cloudflare.com/learning/security/api/what-is-an-api-gateway/">API gateway</a>, which is responsible for accepting API calls inbound to an application and aggregating the appropriate services to fulfill those requests and return a proper response to the end user. You utilize gateways every time you watch Netflix! Their company leverages an API gateway to ensure the hundreds of different devices that access their streaming service can receive a successful and proper response, allowing end users to watch their shows. Gateways are a critical component of how Web3 is being enabled for every end user on the planet.</p><p>Remember that Web3 or the distributed web is a set of technologies that enables hosting of content and web applications in a serverless manner by leveraging purely distributed systems and consensus protocols. Gateways let you use these applications in your browser without having to install plugins or run separate pieces of software called nodes. The distributed web community runs into the same problem of needing a stable, reliable, and resilient method to translate HTTP requests into the correct Web3 functions or protocols.</p><p>Today, we are introducing the Cloudflare Ethereum and IPFS Gateways to help Web3 developers do what they do best, develop applications, without having to worry about also running the infrastructure required to support Ethereum (Eth) or IPFS nodes.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/4jEKbTRVOn95CzcJoLEE5E/f8f4c167512b17069711ce74e0bedded/image5-1.png" />
            
            </figure>
    <div>
      <h3>What’s the problem with existing Eth or IPFS Web Gateways?</h3>
      <a href="#whats-the-problem-with-existing-eth-or-ipfs-web-gateways">
        
      </a>
    </div>
    <p>Traditional web technologies such as HTTP have had decades to develop standards and best practices that make sites fast, secure, and available. These haven’t been developed on the distributed web side of the Internet, which focuses more on redundancy. We identified an opportunity to bring the optimizations and infrastructure of the web to the distributed web by building a gateway — a service that translates HTTP API calls to IPFS or Ethereum functions, while adding Cloudflare added-value services on the HTTP side. The ability for a customer to operate their entire network control layer with a single pane of glass using Cloudflare is huge. You can manage the DNS, Firewall, Load Balancing, Rate Limiting, Tunnels, and more for your marketing site, your distributed application (Dapp), and corporate security, all from one location.</p><p>For many of our customers, the existing solutions for Web3 gateway do not have a large enough network to handle the growing amount of requests within the Ethereum and IPFS networks, but more importantly do not have the degree of resilience and redundancy that businesses expect and require operating at scale. The idea of the distributed web is to do just that… stay distributed, so no single actor can control the overall market. Speed, security, and reliability are at the heart of what we do. We are excited to be part of the growing Web3 infrastructure community so that we can help Dapp developers have more choice, scalability, and reliability from their infrastructure providers.</p><p>A clear example of this is when existing gateways have an outage. With too few gateways to handle the traffic, the result of this outage is pre-process transactions falling behind the blockchain they are accessing, thus leading to increased latency for the transaction, potentially leading to it failing. Worse, when decentralised application (Dapp) developers use IPFS to power their front end, it can lead to their entire application falling over. Overall, this leads to massive amounts of frustration from businesses and end users alike — not being able to collect revenue for products or services, thus putting a portion of the business at a halt and breaking trust with end users who depend on the reliability of these services to manage their Web3 assets.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/1JgXilj9lnei2QHAcsRFtx/21d90693861fa2b02a7e1bad7e86e5db/image7.png" />
            
            </figure>
    <div>
      <h3>How is Cloudflare solving this problem?</h3>
      <a href="#how-is-cloudflare-solving-this-problem">
        
      </a>
    </div>
    <p>We found that there was a unique opportunity in a segment of the Web3 community that closely mirrored Cloudflare’s traditional customer base: the distributed web. This segment has some major usability issues that Cloudflare could help solve around reliability, performance, and caching. Cloudflare has an advantage that no other company in this space — and very few in the industry — have: a global network. For instance, content fetched through our <a href="https://cloudflare-ipfs.com/">IPFS Gateway</a> can be cached near users, allowing download latency in the milliseconds. Compare this with up to seconds per asset using native IPFS. This speed enables services based on IPFS to go hybrid. Content can be served over the source decentralised protocols while browsers and tools are maturing to access them, and served to regular web users through a gateway like Cloudflare. We do provide a convenient, fast and secure option to browse this distributed content.</p><p>On Ethereum, users can be categorised in two ways. Application developers that operate smart contracts, and users that want to interact with the said contracts. While smart contracts operate autonomously based on their code, users have to fetch data and send transactions. As part of the chain, smart contracts do not have to worry about the network or a user interface to be online. This is why decentralised exchanges have had the ability to operate continuously across multiple interfaces without disruptions. Users on the other hand do need to know the state of the chain, and be able to interact with it. Application developers therefore have to require the users to run an Ethereum node, or can point them to use remote nodes through a <a href="https://ethereum.org/en/developers/docs/apis/json-rpc/">standardised JSON RPC API</a>. This is where Cloudflare comes in. Cloudflare Ethereum gateway relies on Ethereum nodes and provides a secure and fast interface to the Ethereum network. It allows application developers to leverage Ethereum in front-facing applications. The gateway can interact with any content part of the Ethereum chain. This includes NFT contracts, DeFi exchanges, or name services like ENS.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/4VtJXJP7vwn9gAM0e25eod/ee26e0bc56ff0d7b98113557245ebf16/image2.png" />
            
            </figure>
    <div>
      <h3>How are the gateways doing so far?</h3>
      <a href="#how-are-the-gateways-doing-so-far">
        
      </a>
    </div>
    <p>Since our alpha release to very early customers as research experiments, we’ve seen a staggering number of customers wanting to leverage the new gateway technology and benefit from the availability, resiliency, and caching benefits of Cloudflare’s network.</p><p>Our current alpha includes companies that have raised billions of dollars in venture capital, companies that power the decentralised finance ecosystem on Ethereum, and emerging metaverses that make use of NFT technology.</p><p>In fact, we have over 2,000 customers leveraging our IPFS gateway lending to over 275TB of traffic per month. For Ethereum, we have over 200 customers transacting over 13TB, including 1.6 billion requests per month. We’ve seen extremely stable results from these customers and fully expect to see these metrics continue to ramp up as we add more customers to use this new product.</p><p>We are now very happy to announce the opening of our private beta for both the Ethereum and IPFS gateways. <a href="https://docs.google.com/forms/d/11_oXpvGGVtP0DJenWBzLfxE4cyCjHHbqrbIibLAz2wQ/edit">Sign up to participate in the private beta</a> and our team will reach out shortly to ensure you are set up!</p><p>P.S. We are hiring for Web3! If you want to come work on it with us, check out our <a href="https://boards.greenhouse.io/cloudflare/jobs/3352190?gh_jid=3352190">careers page</a>.</p> ]]></content:encoded>
            <category><![CDATA[Birthday Week]]></category>
            <category><![CDATA[Web3]]></category>
            <category><![CDATA[Distributed Web]]></category>
            <category><![CDATA[IPFS]]></category>
            <category><![CDATA[Ethereum]]></category>
            <category><![CDATA[Research]]></category>
            <guid isPermaLink="false">3JkUkPfA7HavDc4YUSBMaw</guid>
            <dc:creator>Wesley Evans</dc:creator>
            <dc:creator>Brian Batraski</dc:creator>
        </item>
        <item>
            <title><![CDATA[A Name Resolver for the Distributed Web]]></title>
            <link>https://blog.cloudflare.com/cloudflare-distributed-web-resolver/</link>
            <pubDate>Wed, 13 Jan 2021 12:00:00 GMT</pubDate>
            <description><![CDATA[ We are proud to announce a new resolver for the Distributed Web, where IPFS content indexed by the Ethereum Name Service (ENS) can be accessed. ]]></description>
            <content:encoded><![CDATA[ <p></p><p>The Domain Name System (DNS) matches names to resources. Instead of typing 104.18.26.46 to access the Cloudflare Blog, you type blog.cloudflare.com and, using DNS, the <a href="https://www.cloudflare.com/learning/dns/glossary/what-is-a-domain-name/">domain name</a> resolves to 104.18.26.46, the Cloudflare Blog IP address.</p><p>Similarly, distributed systems such as Ethereum and IPFS rely on a naming system to be usable. DNS could be used, but its resolvers’ attributes run contrary to properties valued in distributed Web (dWeb) systems. Namely, dWeb resolvers ideally provide (i) locally verifiable data, (ii) built-in history, and (iii) have no single trust anchor.</p><p>At Cloudflare Research, we have been exploring alternative ways to resolve queries to responses that align with these attributes. We are proud to announce a new resolver for the Distributed Web, where IPFS content indexed by the <a href="http://ens.domains/">Ethereum Name Service</a> (ENS) can be accessed.</p><p>To discover how it has been built, and how you can use it today, read on.</p>
    <div>
      <h2>Welcome to the Distributed Web</h2>
      <a href="#welcome-to-the-distributed-web">
        
      </a>
    </div>
    
    <div>
      <h3>IPFS and its addressing system</h3>
      <a href="#ipfs-and-its-addressing-system">
        
      </a>
    </div>
    <p>The InterPlanetary FileSystem (IPFS) is a peer-to-peer network for storing content on a distributed file system. It is composed of a set of computers called nodes that store and relay content using a common addressing system.</p><p>This addressing system relies on the use of <a href="https://github.com/multiformats/cid">Content IDentifiers</a> (CID). CIDs are self-describing identifiers, because the identifier is derived from the content itself. For example, QmXoypizjW3WknFiJnKLwHCnL72vedxjQkDDP1mXWo6uco is the CID version 0 (CIDv0) of the <a href="https://en.wikipedia-on-ipfs.org">wikipedia-on ipfs homepage</a>.</p><p>To understand why a CID is defined as self-describing, we can look at its binary representation. For QmXoypizjW3WknFiJnKLwHCnL72vedxjQkDDP1mXWo6uco, the CID looks like the following:</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/2A7q58l0WReM66ndaxQmms/fc93187cd6f358d2291944cd57cbc419/image2-1.png" />
            
            </figure><p>The first is the algorithm used to generate the CID (sha2-256 in this case); then comes the length of the encoded content (32 for a sha2-256 hash), and finally the content itself. When referring to the <a href="https://github.com/multiformats/multicodec/blob/master/table.csv">multicodec table</a>, it is possible to understand how the content is encoded.</p><table><tr><td><p><b>Name</b></p></td><td><p><b>Code (in hexadecimal)</b></p></td></tr><tr><td><p>identity</p></td><td><p>0x00</p></td></tr><tr><td><p>sha1</p></td><td><p>0x11</p></td></tr><tr><td><p>sha2-256</p></td><td><p>0x12 = 00010010</p></td></tr><tr><td><p>keccak-256</p></td><td><p>0x1b</p></td></tr></table><p>This encoding mechanism is useful, because it creates a unique and upgradable content-addressing system across multiple protocols.</p><p>If you want to learn more, have a look at <a href="https://proto.school/#/anatomy-of-a-cid">ProtoSchool’s tutorial</a>.</p>
    <div>
      <h3>Ethereum and decentralised applications</h3>
      <a href="#ethereum-and-decentralised-applications">
        
      </a>
    </div>
    <p>Ethereum is an account-based blockchain with smart contract capabilities. Being account-based, each account is associated with addresses and these can be modified by operations grouped in blocks and sealed by Ethereum’s consensus algorithm, Proof-of-Work.</p><p>There are two categories of accounts: user accounts and contract accounts. User accounts are controlled by a private key, which is used to sign transactions from the account. Contract accounts hold bytecode, which is executed by the network when a transaction is sent to their account. A transaction can include both funds and data, allowing for rich interaction between accounts.</p><p>When a transaction is created, it gets verified by each node on the network. For a transaction between two user accounts, the verification consists of checking the origin account signature. When the transaction is between a user and a smart contract, every node runs the smart contract bytecode on the Ethereum Virtual Machine (EVM). Therefore, all nodes perform the same suite of operations and end up in the same state. If one actor is malicious, nodes will not add its contribution. Since nodes have diverse ownership, they have an incentive to not cheat.</p>
    <div>
      <h2>How to access IPFS content</h2>
      <a href="#how-to-access-ipfs-content">
        
      </a>
    </div>
    <p>As you may have noticed, while a CID describes a piece of content, it doesn't describe where to find it. In fact, the CID describes the content, but not its location on the network. The location of the file would be retrieved by a query made to an IPFS node.</p><p>An IPFS URL (Unified Resource Locator) looks like this: <code>ipfs://QmXoypizjW3WknFiJnKLwHCnL72vedxjQkDDP1mXWo6uco</code>. Accessing this URL means retrieving <code>QmXoypizjW3WknFiJnKLwHCnL72vedxjQkDDP1mXWo6uco</code> using the IPFS protocol, denoted by ipfs://. However, typing such a URL is quite error-prone. Also, these URLs are not very human-friendly, because there is no good way to remember such long strings. To get around this issue, you can use DNSLink. DNSLink is a way of specifying IPFS CIDs within a DNS TXT record. For instance, <a href="http://wikipedia-on-ipfs.org">wikipedia on ipfs</a> has the following TXT record</p><p><code>$ dig +short TXT _dnslink.en.wikipedia-on-ipfs.org</code></p><p><code>_dnslink=/ipfs/QmXoypizjW3WknFiJnKLwHCnL72vedxjQkDDP1mXWo6uco</code></p><p>In addition, it's A record points to an IPFS gateway. This means that, when you access en.wikipedia-on-ipfs.org, your request is directed to an IPFS HTTP Gateway, which then looks out for the CID using your domain TXT record, and returns the content associated to this CID using the IPFS network.</p><p>This is trading ease-of-access against security. The web browser of the user doesn't verify the integrity of the content served. This could be because the browser does not implement IPFS or because it has no way of validating domain signature — <a href="https://www.cloudflare.com/dns/dnssec/how-dnssec-works/">DNSSEC</a>. We wrote about this issue in our previous blog post on <a href="/e2e-integrity/">End-to-End Integrity</a>.</p>
    <div>
      <h2>Human-readable identifiers</h2>
      <a href="#human-readable-identifiers">
        
      </a>
    </div>
    <p>DNS simplifies referring to IP addresses, in the same way that postal addresses are a way of referring to geolocation data, and contacts in your mobile phone abstract phone numbers. All these systems provide a human-readable format and reduce the error rate of an operation.</p><p>To verify these data, the trusted anchors, or “sources of truth”, are:</p><ul><li><p><a href="https://www.cloudflare.com/en-gb/dns/dnssec/root-signing-ceremony/">Root DNS Keys</a> for DNS.</p></li><li><p>The government registry for postal addresses. In the UK, addresses <a href="https://www.nidirect.gov.uk/articles/how-streets-are-named-and-numbered">are handled</a> by cities, boroughs and local councils.</p></li><li><p>When it comes to your contacts, you are the trust anchor.</p></li></ul>
    <div>
      <h2>Ethereum Name Service, an index for the Distributed Web</h2>
      <a href="#ethereum-name-service-an-index-for-the-distributed-web">
        
      </a>
    </div>
    <p>An account is identified by its address. An address starts with "0x" and is followed by 20 bytes (<a href="https://ethereum.github.io/yellowpaper/paper.pdf">ref 4.1 Ethereum yellow paper</a>), for example: 0xf10326c1c6884b094e03d616cc8c7b920e3f73e0. This is not very readable, and can be pretty scary when transactions are not reversible and one can easily mistype a single character.</p><p>A first mitigation strategy was to introduce a new notation to capitalise some letters based on the hash of the address 0xF10326C1c6884b094E03d616Cc8c7b920E3F73E0. This can help detect mistype, but it is still not readable. If I have to send a transaction to a friend, I have no way of confirming she hasn't mistyped the address.</p><p>The <a href="https://ens.domains/">Ethereum Name Service</a> (ENS) was created to tackle this issue. It is a system capable of turning human-readable names, referred to as domains, to blockchain addresses. For instance, the domain <a href="https://app.ens.domains/name/privacy-pass.eth">privacy-pass.eth</a> points to the Ethereum address 0xF10326C1c6884b094E03d616Cc8c7b920E3F73E0.</p><p>To achieve this, the system is organised in <a href="https://docs.ens.domains/">two components</a>, registries and resolvers.</p><p>A registry is a smart contract that maintains a list of domains and some information about each domain: the domain owner and the domain resolver. The owner is the account allowed to manage the domain. They can create subdomains and change ownership of their domain, as well as modify the resolver associated with their domain.</p><p>Resolvers are responsible for keeping records. For instance, Public Resolver is a smart contract capable of associating not only a name to blockchain addresses, but also a name to an IPFS content identifier. The resolver address is stored in a registry. Users then contact the registry to retrieve the resolver associated with the name.</p><p>Consider a user, Alice, who has direct access to the Ethereum state. The flow goes as follows: Alice would like to get Privacy Pass’s Ethereum address, for which the domain is privacy-pass.eth. She looks for privacy-pass.eth in the ENS Registry and figures out the resolver for privacy-pass.eth is at 0x1234... . She now looks for the address of privacy-pass.eth at the resolver address, which turns out to be 0xf10326c....</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/6yVOgswqi6HQ38qlhTaTdK/0956f47fa306bebb2233e9601d0b430c/image1-3.png" />
            
            </figure><p>Accessing the IPFS content identifier for privacy-pass.eth works similarly. The resolver is the same, only the accessed data is different — Alice calls a different method from the smart contract.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/1CjIbo1euB3DG5EZgnL3Bm/9b59d7bd3c7fa63870238274ef5a0200/image5.png" />
            
            </figure>
    <div>
      <h2>Cloudflare Distributed Web Resolver</h2>
      <a href="#cloudflare-distributed-web-resolver">
        
      </a>
    </div>
    <p>The goal was to be able to use this new way of indexing IPFS content directly from your web browser. However, accessing the ENS registry requires access to the Ethereum state. To get access to IPFS, you would also need to access the IPFS network.</p><p>To tackle this, we are going to use Cloudflare’s Distributed Web Gateway. Cloudflare operates both an Ethereum Gateway and an IPFS Gateway, respectively available at cloudflare-eth.com and cloudflare-ipfs.com.</p>
    <div>
      <h3>EthLink</h3>
      <a href="#ethlink">
        
      </a>
    </div>
    <p>The <a href="https://github.com/wealdtech/coredns-ens">first version</a> of EthLink was built by Jim McDonald and is operated by True Name LTD at eth.link. Starting from next week, eth.link will transition to use the Cloudflare Distributed Web Resolver. To that end, we have built EthLink on top of Cloudflare Workers. This is a proxy to IPFS. It proxies all ENS registered domains when .link is appended. For instance, privacy-pass.eth should render the Privacy Pass homepage. From your web browser, <a href="https://privacy-pass.eth.link">https://privacy-pass.eth.link</a> does it.</p><p>The resolution is done at the Cloudflare edge using a Cloudflare Worker. Cloudflare Workers allows JavaScript code to be run on Cloudflare infrastructure, eliminating the need to maintain a server and increasing the reliability of the service. In addition, it follows Service Workers API, so results returned from the resolver can be checked by end users if needed.</p><p>To do this, we set up a wildcard DNS record for *.eth.link to be proxied through Cloudflare and handled by a Cloudflare Worker.  When a user Alice accesses <a href="https://privacy-pass.eth.link">privacy-pass.eth.link</a>, the worker first gets the CID of the CID to be retrieved from Ethereum. Then, it requests the content matching this CID to IPFS, and returns it to Alice.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/WivGoQhRDcSaDh99sVdNI/0e9bca31a378146d49d92c3af71180e8/image3.png" />
            
            </figure><p>All parts can be run locally. The worker can be run in a service Worker, and the Ethereum Gateway can point to both a local Ethereum node and the IPFS gateway provided by IPFS Companion. It means that while Cloudflare provides resolution-as-a-service, none of the components has to be trusted.</p>
    <div>
      <h2>Final notes</h2>
      <a href="#final-notes">
        
      </a>
    </div>
    <p>So <a href="https://arewedistributedyet.com/">are we distributed yet</a>? No, but we are getting closer, building bridges between emerging technologies and current web infrastructure. By providing a gateway dedicated to the distributed web, we hope to make these services more accessible to everyone.</p><p>We thank the ENS team for their support of a new resolver on expanding the distributed web. The ENS team has been running a similar service at <a href="https://eth.link">https://eth.link</a>. On January 18th, they will switch <a href="https://eth.link">https://eth.link</a> to using our new service.</p><p>These services benefit from the added speed and security of the Cloudflare Worker platform, while paving the way to run distributed protocols in browsers.</p> ]]></content:encoded>
            <category><![CDATA[Research]]></category>
            <category><![CDATA[IPFS]]></category>
            <category><![CDATA[Ethereum]]></category>
            <category><![CDATA[Distributed Web]]></category>
            <guid isPermaLink="false">5GZYZoddJJgvOcmn2ALKWL</guid>
            <dc:creator>Thibault Meunier</dc:creator>
        </item>
        <item>
            <title><![CDATA[Cloudflare's Ethereum Gateway]]></title>
            <link>https://blog.cloudflare.com/cloudflare-ethereum-gateway/</link>
            <pubDate>Wed, 19 Jun 2019 13:01:00 GMT</pubDate>
            <description><![CDATA[ Today, we are excited to announce Cloudflare's Ethereum Gateway, where you can interact with the Ethereum network without installing any software on your computer. ]]></description>
            <content:encoded><![CDATA[ <p></p><p>Today, as part of <a href="/welcome-to-crypto-week-2019/">Crypto Week 2019</a>, we are excited to announce Cloudflare's Ethereum Gateway, where you can interact with the Ethereum network without installing any additional software on your computer.</p><p>This is another tool in Cloudflare’s Distributed Web Gateway tool set. Currently, Cloudflare lets you host content on the InterPlanetary File System (IPFS) and access it through your own custom domain. Similarly, the new Ethereum Gateway allows access to the Ethereum network, which you can provision through your custom hostname.</p><p>This setup makes it possible to add interactive elements to sites powered by <a href="https://blockgeeks.com/guides/smart-contracts/">Ethereum smart contracts</a>, a decentralized computing platform. And, in conjunction with the IPFS gateway, this allows hosting websites and resources in a decentralized manner, and has the extra bonus of the added speed, security, and reliability provided by the Cloudflare edge network. You can access our Ethereum gateway directly at <a href="https://cloudflare-eth.com">https://cloudflare-eth.com</a>.</p><p>This brief primer on how Ethereum and smart contracts work has examples of the many possibilities of using the Cloudflare Distributed Web Gateway.</p>
    <div>
      <h3><b>Primer on Ethereum</b></h3>
      <a href="#primer-on-ethereum">
        
      </a>
    </div>
    <p>You may have heard of Ethereum as a cryptocurrency. What you may not know is that Ethereum is so much more. Ethereum is a distributed virtual computing network that stores and enforces smart contracts.</p><p>So, what is a smart contract?</p><p>Good question. Ethereum smart contracts are simply a piece of code stored on the Ethereum blockchain. When the contract is triggered, it runs on the Ethereum Virtual Machine (EVM). The EVM is a distributed virtual machine that runs smart contract code and produces cryptographically verified changes to the state of the Ethereum blockchain as its result.</p><p>To illustrate the power of smart contracts, let's consider a little example.</p><p>Anna wants to start a VPN provider, but she lacks the capital. To raise funds for her venture she decides to hold an Initial Coin Offering (ICO). Rather than design an ICO contract from scratch Anna bases her contract off of <a href="https://ethereum.org/en/developers/docs/standards/tokens/erc-20/">ERC-20</a>. ERC-20 is a template for issuing fungible tokens, perfect for ICOs. Anna sends her ERC-20 compliant contract to the Ethereum network, and starts to sell stock in her new company, VPN Co.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/125yD5Cd5Q1meFIupmLr5M/77b5e343b8b0d2ac74eb701b9da71349/ico_2x.png" />
            
            </figure><p>Once she's sorted out funds, Anna sits down and starts to write a smart contract. Anna’s contract asks customers to send her their public key, along with some Ether (the coin product of Ethereum). She then authorizes the public key to access her VPN service. All without having to hold any secret information. Huzzah!</p><p>Next, rather than set up the infrastructure to run a VPN herself, Anna decides to use the blockchain again, but this time as a customer. Cloud Co. sells managed cloud infrastructure using their own smart contract. Anna programs her contract to send the appropriate amount of Ether to Cloud Co.'s contract. Cloud Co. then provisions the servers she needs to host her VPN. By automatically purchasing more infrastructure every time she has a new customer, her VPN company can scale totally autonomously.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/2Ir87Td7jTHxaC3kL7oLOH/74246966422e55ddf4cd4e4b3922eeb5/VPN-co-_2x.png" />
            
            </figure><p>Finally, Anna pays dividends to her investors out of the profits, keeping a little for herself.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/6tosVrjURmYmMFxqzRAn4t/5e0bc26c6915e1e67cdd6f963afee1a9/slice-of-pie-_2x.png" />
            
            </figure><p>And there you have it.</p><p>A decentralised, autonomous, smart VPN provider.</p><p>A smart contract stored on the blockchain has an associated account for storing funds, and the contract is triggered when someone sends Ether to that account. So for our VPN example, the provisioning contract triggers when someone transfers money into the account associated with Anna’s contract.</p><p>What distinguishes smart contracts from ordinary code?</p><p>The "smart" part of a smart contract is they run autonomously. The "contract" part is the guarantee that the code runs as written.</p><p>Because this contract is enforced cryptographically, maintained in the tamper-resistant medium of the blockchain and verified by the consensus of the network, these contracts are more reliable than regular contracts which can provoke dispute.</p>
    <div>
      <h3><b>Ethereum Smart Contracts vs. Traditional Contracts</b></h3>
      <a href="#ethereum-smart-contracts-vs-traditional-contracts">
        
      </a>
    </div>
    <p>A regular contract is enforced by the court system, litigated by lawyers. The outcome is uncertain; different courts rule differently and hiring more or better lawyers can swing the odds in your favor.</p><p>Smart contract outcomes are predetermined and are nearly incorruptible. However, here be dragons: though the outcome can be predetermined and incorruptible, a poorly written contract might not have the intended behavior, and because contracts are immutable, this is difficult to fix.</p>
    <div>
      <h3><b>How are smart contracts written?</b></h3>
      <a href="#how-are-smart-contracts-written">
        
      </a>
    </div>
    <p>You can write smart contracts in a number of languages, some of which are Turing complete, e.g. <a href="https://solidity.readthedocs.io">Solidity</a>. A Turing complete language lets you write code that can evaluate any computable function. This puts Solidity in the same class of languages as Python and Java. The compiled bytecode is then run on the EVM.</p><p>The EVM differs from a standard VM in a number of ways:</p>
    <div>
      <h5>The EVM is distributed</h5>
      <a href="#the-evm-is-distributed">
        
      </a>
    </div>
    <p>Each piece of code is run by numerous nodes. Nodes verify the computation before accepting a block, and therefore ensure that miners who want their blocks accepted must always run the EVM honestly. A block is only considered accepted when more than half of the network accepts it. This is the consensus part of Ethereum.</p><h6>The EVM is entirely deterministic</h6><p>This means that the same inputs to a function always produce the same outputs. Because regular VMs have access to file storage and the network, the results of a function call can be non-deterministic. Every EVM has the same start state, thus a given set of inputs always gives the same outputs. This makes the EVM more reliable than a standard VM.</p><p>There are two big gotchas that come with this determinism:</p><ul><li><p>EVM bytecode is Turing complete and therefore discerning the outputs without running the computation is not always possible.</p></li><li><p>Ethereum smart contracts can store state on the blockchain. This means that the output of the function can vary as the blockchain changes. Although, technically this is deterministic in that the blockchain is an input to the function, it may still be impossible to derive the output in advance.</p></li></ul><p>This however means that they suffer from the same problems as any piece of software – bugs. However, unlike normal code where the authors can issue a patch, code stored on the blockchain is immutable. More problematically, even if the author provides a new smart contract, the old one is always still available on the blockchain.</p><p>This means that when writing contracts authors must be especially careful to write secure code, and include a kill switch to ensure that if bugs do reside in the code, they can be squashed. If there is no kill switch and there are vulnerabilities in the smart contract that can be exploited, it can potentially lead to the theft of resources from the smart contract or from other individuals. EVM Bytecode includes a special <code>SELFDESTRUCT</code> opcode that deletes a contract, and sends all funds to the specified address for just this purpose.</p><p>The need to include a kill switch was brought into sharp focus during the <a href="https://en.wikipedia.org/wiki/The_DAO_(organization)">infamous DAO incident</a>. The DAO smart contract acted as a complex decentralized venture capital (VC) fund and held Ether worth 250 million dollars at its peack collected from a group of investors. Hackers exploited vulnerabilities in the smart contract and stole Ether wirth 50 million dollars.</p><p>Because there is no way to undo transactions in Ethereum, there was a highly controversial “hard fork,” where the majority of the community agreed to accept a block with an “irregular state change” that essentially drained all DAO funds into a special “WithdrawDAO” recovery contract. By convincing enough miners to accept this irregular block as valid, the DAO could return funds.</p><p>Not everyone agreed with the change. Those who disagreed rejected the irregular block and formed the Ethereum Classic network, with both branches of the fork growing independently.</p><p>Kill switches, however, can cause their own problems. For example, when a contract used as a library flips its kill switch, all contracts relying on this contract can no longer operate as intended, even though the underlying library code is immutable. This caused over 500,000 ETH to become <a href="https://www.parity.io/security-alert-2/">stuck in multi-signature wallets</a> when an attacker triggered the kill switch of an underlying library.</p><p>Users of the multi-signature library assumed the immutability of the code meant that the library would always operate as anticipated. But the smart contracts that interact with the blockchain are only deterministic when accounting for the state of the blockchain.</p><p>In the wake of the DAO, various tools were created that check smart contracts for bugs or enable bug bounties, for example <a href="https://securify.chainsecurity.com/">Securify</a> and <a href="https://thehydra.io/">The Hydra</a>.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/62DZdNA9leTphizaCEyR5k/6073b3bcfb18e38fc049cd06fdab7a57/bug_3x.png" />
            
            </figure><p>Come here, you ...</p><p>Another way smart contracts avoid bugs is using standardized patterns. For example, ERC-20 defines a standardized interface for producing tokens such as those used in ICOs, and ERC-721 defines a standardized interface for implementing non-fungible tokens. Non-fungible tokens can be used for trading-card games like <a href="https://www.cryptokitties.co/">CryptoKitties</a>. CryptoKitties is a trading-card style game built on the Ethereum blockchain. Players can buy, sell, and breed cats, with each cat being unique.</p><p>CryptoKitties is built on a collection of smart contracts that provides an <a href="https://github.com/cryptocopycats/awesome-cryptokitties/tree/master/contracts">open-source Application Binary Interface (ABI</a>) for interacting with the KittyVerse -- the virtual world of the CryptoKitties application. An ABI simply allows you to call functions in a contract and receive any returned data. The <code>KittyBase</code> code may look like this:</p>
            <pre><code>Contract KittyBase is KittyAccessControl {
	event Birth(address owner, uint256 kittyId, uint256 matronId, uint256 sireId, uint256 genes);
	event Transfer(address from, address to, uint256 tokenId);
    struct Kitty {
        uint256 genes;
        uint64 birthTime;
        uint64 cooldownEndBlock;
        uint32 matronId;
        uint32 sireId;
        uint32 siringWithId;
        uint16 cooldownIndex;
        uint16 generation;
    }
	[...]
    function _transfer(address _from, address _to, uint256 _tokenId) internal {
    ...
    }
    function _createKitty(uint256 _matronId, uint256 _sireId, uint256 _generation, uint256 _genes, address _owner) internal returns (uint) {
    ...
    }
	[...]
}</code></pre>
            <p>Besides defining what a Kitty is, this contract defines two basic functions for transferring and creating kitties. Both are internal and can only be called by contracts that implement <code>KittyBase</code>. The <code>KittyOwnership</code> contract implements both ERC-721 and <code>KittyBase</code>, and implements an external <code>transfer</code> function that calls the internal <code>_transfer</code> function. This code is compiled into bytecode written to the blockchain.</p><p>By implementing a standardised interface like ERC-721, smart contracts that aren’t specifically aware of CryptoKitties can still interact with the KittyVerse. The CryptoKitties ABI functions allow users to create distributed apps (dApps), of their own design on top of the KittyVerse, and allow other users to use their dApps. This extensibility helps demonstrate the potential of smart contracts.</p>
    <div>
      <h3><b>How is this so different?</b></h3>
      <a href="#how-is-this-so-different">
        
      </a>
    </div>
    <p>Smart contracts are, by definition, public. Everyone can see the terms and understand where the money goes. This is a radically different approach to providing transparency and accountability. Because all contracts and transactions are public and verified by consensus, trust is distributed between the people, rather than centralized in a few big institutions.</p><p>The trust given to institutions is historic in that we trust them because they have previously demonstrated trustworthiness.</p><p>The trust placed in consensus-based algorithms is based on the assumption that most people are honest, or more accurately, that no sufficiently large subset of people can collude to produce a malicious outcome. This is the democratisation of trust.</p><p>In the case of the DAO attack, a majority of nodes <i>agreed</i> to accept an “irregular” state transition. This effectively undid the damage of the attack and demonstrates how, at least in the world of blockchain, perception is reality. Because most people “believed” (accepted) this irregular block, it became a “real,” valid block. Most people think of the blockchain as immutable, and trust the power of consensus to ensure correctness, however if enough people agree to do something irregular, they don't have to keep the rules.</p>
    <div>
      <h3><b>So where does Cloudflare fit in?</b></h3>
      <a href="#so-where-does-cloudflare-fit-in">
        
      </a>
    </div>
    <p>Accessing the Ethereum network and its attendant benefits directly requires running complex software, including downloading and cryptographically verifying hundreds of gigabytes of data, which apart from producing technical barriers to entry for users, can also exclude people with low-power devices.</p><p>To help those users and devices access the Ethereum network, the Cloudflare Ethereum gateway allows any device capable of accessing the web to interact with the Ethereum network in a safe, reliable way.</p><p>Through our gateway, not only can you explore the blockchain, but if you give our gateway a signed transaction, we’ll push it to the network to allow miners to add it to their blockchain. This means that you can send Ether and even put new contracts on the blockchain without having to run a node.</p><p>"But Jonathan," I hear you say, "by providing a gateway aren't you just making Cloudflare a centralizing institution?"</p><p>That’s a fair question. Thankfully, Cloudflare won’t be alone in offering these gateways. We’re joining alongside organizations, such as <a href="https://infura.io">Infura</a>, to expand the constellation of gateways that already exist. We hope that, by providing a fast, reliable service, we can enable people who never previously used smart-contracts to do so, and in so doing bring the benefits they offer to billions of regular Internet users.</p><blockquote><p>"We're excited that Cloudflare is bringing their infrastructure expertise to the Ethereum ecosystem. Infura has always believed in the importance of standardized, open APIs and compatibility between gateway providers, so we look forward to collaborating with their team to build a better distributed web." - E.G. Galano, <a href="https://infura.io/">Infura</a> co-founder.</p></blockquote><p>By providing a gateway to the Ethereum network, we help users make the jump from general web-user to cryptocurrency native, and eventually make the distributed web a fundamental part of the Internet.</p>
    <div>
      <h3><b>What can you do with Cloudflare's Gateway?</b></h3>
      <a href="#what-can-you-do-with-cloudflares-gateway">
        
      </a>
    </div>
    <p>Visit <a href="https://cloudflare-eth.com">cloudflare-eth.com</a> to interact with our example app. But to really explore the Ethereum world, access the RPC API, where you can do anything that can be done on the Ethereum network itself, from examining contracts, to transferring funds.</p><p>Our Gateway accepts <code>POST</code> requests containing JSON. For a complete list of calls, visit the <a href="https://github.com/ethereum/wiki/wiki/JSON-RPC">Ethereum github page</a>. So, to get the block number of the most recent block, you could run:</p>
            <pre><code>curl https://cloudflare-eth.com -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}'</code></pre>
            <p>and you would get a response something like this:</p>
            <pre><code>{
  "jsonrpc": "2.0",
  "id": 1,
  "result": "0x780f17"
}</code></pre>
            <p>We also invite developers to build dApps based on our Ethereum gateway using our API. Our API allows developers to build websites powered by the Ethereum blockchain. Check out <a href="https://developers.cloudflare.com/distributed-web/ethereum-gateway/">developer docs</a> to get started. If you want to read more about how Ethereum works check out this <a href="https://medium.com/@preethikasireddy/how-does-ethereum-work-anyway-22d1df506369">deep dive</a>.</p>
    <div>
      <h3><b>The architecture</b></h3>
      <a href="#the-architecture">
        
      </a>
    </div>
    <p>Cloudflare is uniquely positioned to host an Ethereum gateway, and we have the utmost faith in the products we offer to customers. This is why the Cloudflare Ethereum gateway runs as a Cloudflare customer and we <a href="https://en.wikipedia.org/wiki/Eating_your_own_dog_food">dogfood</a> our own products to provide a fast and reliable gateway. The domain we run the gateway on (<a href="https://cloudflare-eth.com">https://cloudflare-eth.com</a>) uses <a href="https://www.cloudflare.com/products/cloudflare-workers/">Cloudflare Workers</a> to cache responses for popular queries made to the gateway. Responses for these queries are answered directly from the Cloudflare edge, which can result in a ~6x speed-up.</p><p>We also use <a href="/introducing-load-balancing-intelligent-failover-with-cloudflare/">Load balancing</a> and <a href="/argo-tunnel/">Argo Tunnel</a> for fast, redundant, and secure content delivery. With Argo Smart Routing enabled, requests and responses to our Ethereum gateway are tunnelled directly from our Ethereum node to the Cloudflare edge using the best possible routing.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/4JQmJaXMtzmPq4OuuP2897/580a60e6443392ff0da26a94f7842dc2/imageLikeEmbed--1-.png" />
            
            </figure><p>Similar to our <a href="https://cloudflare.com/distributed-web-gateway">IPFS gateway</a>, <a href="https://cloudflare-eth.com">cloudflare-eth.com</a> is an <a href="https://www.cloudflare.com/ssl-for-saas-providers/">SSL for SaaS</a> provider. This means that anyone can set up the Cloudflare Ethereum gateway as a backend for access to the Ethereum network through their own registered domains. For more details on how to set up your own domain with this functionality, see the Ethereum tab on <a href="https://cloudflare.com/distributed-web-gateway">cloudflare.com/distributed-web-gateway</a>.</p><p>With these features, you can use Cloudflare’s Distributed Web Gateway to create a fully decentralized website with an interactive backend that allows interaction with the IPFS and Ethereum networks. For example, you can host your content on IPFS (using something like <a href="https://pinata.cloud">Pinata</a> to pin the files), and then host the website backend as a smart contract on Ethereum. This architecture does not require a centralized server for hosting files or the actual website. Added to the power, speed, and security provided by Cloudflare’s edge network, your website is delivered to users around the world with unparalleled efficiency.</p>
    <div>
      <h3>Embracing a distributed future</h3>
      <a href="#embracing-a-distributed-future">
        
      </a>
    </div>
    <p>At Cloudflare, we support technologies that help distribute trust. By providing a gateway to the Ethereum network, we hope to facilitate the growth of a decentralized future.</p><p>We thank the Ethereum Foundation for their support of a new gateway in expanding the distributed web:</p><blockquote><p>“Cloudflare's Ethereum Gateway increases the options for thin-client applications as well as decentralization of the Ethereum ecosystem, and I can't think of a better person to do this work than Cloudflare. Allowing access through a user's custom hostname is a particularly nice touch. Bravo.” - Dr. Virgil Griffith, Head of Special Projects, Ethereum Foundation.</p></blockquote><p>We hope that by allowing anyone to use the gateway as the backend for their domain, we make the Ethereum network more accessible for everyone; with the added speed and security brought by serving this content directly from Cloudflare’s global edge network.</p><p>So, go forth and build our vision – the distributed crypto-future!</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/5fM3vAj1tUUkBVxyauQZQq/093ceaa41694d5b6493ac02f173ca5a0/crypto-week-2019-header-circle_2x.png" />
            
            </figure> ]]></content:encoded>
            <category><![CDATA[Crypto Week]]></category>
            <category><![CDATA[Cryptography]]></category>
            <category><![CDATA[IPFS]]></category>
            <category><![CDATA[Ethereum]]></category>
            <category><![CDATA[Security]]></category>
            <category><![CDATA[Research]]></category>
            <guid isPermaLink="false">4oOx6ebFXMI1k3UBQBDy6j</guid>
            <dc:creator>Jonathan Hoyland</dc:creator>
        </item>
    </channel>
</rss>