Announcing Faucetful - the cheapest way to get testnet ETH
I’m excited to release Faucetful, an accelerationist good to tackle the problem of easily acquiring Goerli ether. With just one click, you can bridge from Arbitrum Mainnet to Ethereum Goerli using the Hyperlane interoperability protocol.
Due to Arbitrum’s fixed 0.1 gwei fee, it only costs 0.032 Goerli ETH to bridge from Goerli to Arbitrum, making it an enticingly cost-effective choice - boasting an impressive 100-500x reduction in costs compared to bridging Ethereum mainnet which is what LayerZero’s testnet bridge is currently doing. From Arbitrum, it costs just 8.8e7 eth to bridge over, making purchasing goerli ether more economical.
Under the hood, Faucetful uses Hyperlane’s Warp Routes to deploy a permissionless bridge. Both the contracts and the interface are forked from the template provided by the team, albeit with some modifications. This includes deploying custom InterchainSecurityModule contracts (more on this later), utilizing the existing validators for both Goerli and Arbitrum and deploying the two unidirectional relayers between the chains. All of the contracts and infrastructure is open-source, with comprehensive documentation and guides to guarantee adaptability and seamless integration. Warp Routes Guide
Delving into more details below:
Problem
One of the Ethereum developer pain points is the shortage of Goerli ether needed to test your smart contracts on the Goerli testnet, the most popular testnet. Major faucets like Alchemy drip at most 0.2eth/day which is roughly equal to doing 200-250 borrow
calls on Aave.For developers who need to deploy multiple contracts or execute testing suites, the scarcity of Goerli ETH can escalate from a minor inconvenience to a significant source of frustration. If you are taking part in a hackathon or need to ship something quick, this is further amplified and you’re at the mercy of people on some Discord server or random accounts on Twitter.
This issue has been raised and discussed on the Ethereum forums but it’s been largely unresolved or sidetracked. While there’re alternative options like using Sepolia or utilizing local nodes and forks more, the testing environment is not fully representative of mainnet, the former lacks official deployment of major protocols like Uniswap, Aave, or Layer-2s and bridges and for the latter, you need a more extensive setup and cheat codes, which results in unwanted developer overhead. The solution of ephemeral testnets or periodically sunsetting official testnets solves the problem for tomorrow, not today. Goerli testnet will be fully deprecated end of 2023 which means developers need to still face this issue for another 9 months.
Moreover, over 48% of the total supply, or 50 million is held by the top 1000 EOA addresses. Many of these addresses received these large sums of ether through the initial premint who act as the distributors of goerli ETH. One way to solve this problem is to enable a free market traded against mainnet ether so developers can buy testnet ether at nominal prices and this acts more efficiently than the existing OTC market. This is the problem Faucetful is designed for.
How does it work?
There are three main components needed for Faucetful to work:
Bridge contracts on the two chains.
HypNative
andHypERC20
contracts have been deployed on Ethereum Goerli and Arbitrum Mainnet. TheHypNative
contract sends and receives native ether with payable_transferTo
and_transferFromSender
methods whereas theHypERC20
, being ERC20 compatible itself, mints and burns GETH, i.e., the synthetic wrapper of goerli ether on Arbitrum Mainnet. On eachdispatch
method call, the message containing destination chainID, recipient, and amount is encoded and inserted into an incremental Merkle tree. On each process call, on verification, thehandle
method is called which does the required transfers.Verification and relaying. The
Mailbox
contracts act as the core smart contracts responsible for sending and receiving interchain messages. They store the outbound messages in the Merkle tree, the roots of which the validators sign, and the stored signatures serve as the metadata used for the verification of messages by theInterchainSecurityModule
contract.WETH-GETH uniswap pool. A 0.3% or 30 bps pool has been deployed on Arbitrum mainnet where you can swap from GETH to WETH and subsequently unwrap it to native ETH or vice versa.
Building with Hyperlane
Hyperlane leverages Proof-of-stake security akin to Cosmos’ IBC (coming soon). Each origin-to-destination chain route needs a validator set. Faucetful uses 4 out of 6 validators (addresses listed here) to sign the latest Merkle root. If a validator misbehaves, it gets slashed. This means that the relayer, i.e., the actual transport of the interchain messages can be run trustlessly, listening to and sending outbound signed messages. More details can be found in the Hyperlane docs.
The on-chain verification of messages happens in the InterchainSecurityModule
contract on the destination chain. Faucetful has implemented the MultiISM type which is a multi-signature of m out on n staked validators where m=4
and n=6
. This implementation is available off-the-shelf from Hyperlane’s monorepo which can be found here. This is the simplest and most commonly used security model but the ISM contract is extensible and can be configured and adjusted as per the application requirements. Faucetful, for example, could have used a snark-based design, but the tradeoff between increased security and increased latency and costs was not worth it. Also, pointing to a different ISM enables you to upgrade to a more modern verification mechanism as they become well-tested.
Another quirk of bridging is to decide how you’re going to compensate relayers who pay for transactions on your behalf on the destination chain, specifically, you need to answer two questions: how do I obtain the most accurate estimate and how do I enforce it? The GasRouter
pattern provides you with an internal _dispatchWithGas
method for making gas payments while transferring messages. You get refunded back whatever native tokens are overpaid relative to the estimate to the address you specified as the refundAddress
for this method. The InterchainGasPayment
or igp contract enforces gas payments using a GasOracle
contract for each destination chain. The GasOracle contract uses a static quote price which is exchangeRate x destinationGasPrice
where the exchangeRate
is the price of the destination native token to the price of the source native token. For Faucetful, I’ve set the exchangeRate as 5000 for goerli to Arbitrum and 0.0002 and vice versa. The gas price is 0.1gwei on Arbitrum and 30 gwei on goerli (trailing 30-day median). You can call the igp.quoteGasPrice
before calling transferRemote
to make sure you get accurate quotes.
The Permissionless Interoperability or PI feature enables any application to “build your own” bridge between two arbitrary chains (EVM-compatible currently) and Hyperlane’s docs guide you to define your own security model with ISMs, run your own validators and relayers, and quote and enforce relayer gas fees as per your requirements.
Future work
Procuring goerli eth was a frequent problem I faced as a developer in the past. Native testnet token is a public good and shouldn’t have a financial value associated with it. But given the circumstances, it is the next best option. Moreover, as dApp developers start migrating to Sepolia, the demand for goerli eth will diminish. In the ideal world, you’ll have two public testnets, one for validators and stakers and one for app developers. Bigger projects should also have the provision to host their own private forks of mainnet for more end-to-end public testing either ephemerally or for a prolonged period of time. While this might not yet be a reality, at least you can implement your own bridge using Hyperlane and hopefully, my article helped you along the way. Feel free to DM me on Twitter at @aroralanuk if you have any questions or comments. Link to contracts and interface.
I would like to thank the Hyperlane team for their invaluable support and collaboration throughout the course of my project. You can read more about Hyperlane here.