How Does Gas Work on Facet V2?

Paying For Gas on Facet

Facet, like all EVM chains, has a gas mechanism to prevent DOS attacks. Also like other EVM chains, Facet gas is paid in Facet's native currency, which is called Facet Compute Token (FCT). This is where the similarities end, however.

In order to preserve Facet's commitment to decentralization, we have adopted a unique approach when designing FCT.

Why Does Facet Need a Unique Approach?

Let's look at the "standard L2 gas token approach," its deficiencies, and how we might fix them.

On the Ethereum L1 the native currency is ether. Other Layer 2s try to simulate the experience of having ether as the native currency by using a bridge. Users deposit L1 ether into an L1 smart contract and in return they are minted L2 ether. Users burn L2 ether to withdraw L1 ether from the L1 smart contract.

The bridge approach can be convenient, but it isn't secure. Why?

First, note that the L1 bridge smart contracts must be upgradeable. This is for two reasons. First, these bridges are sufficiently complicated such that it's not possible to prove that they are bug-free. With billions of dollars at stake, L2 operators must retain the power to fix bugs.

Second, when the L2 protocol is upgraded, the L1 smart contracts might require upgrades as well. This is because the L1 smart contracts must verify whether a user is eligible to withdraw under current protocol rules, and if the L1 smart contract didn't keep up with L2 protocol rule changes it could incorrectly prevent or allow withdrawals.

And if the L1 contracts can be upgraded, the person or people who control the private keys to do so will always be in a privileged position over ordinary users. In the extreme case they can drain the L1 contract and burn the L2 ether, but even in less extreme cases they can subtly bend protocol development to their advantage.

On the Ethereum L1, by contrast, there are no privileged keys. As far as the protocol is concerned you have just as much power as Vitalik. This is possible because ether is not "backed by" another currency. Instead it is issued in a neutral manner to anyone who follows the appropriate protocol rules.

Facet Compute Token works the same way.

But Ethereum issues its native token as a reward for securing Ethereum's consensus mechanism. Facet has no consensus mechanism of its own (it inherits Ethereum's). Given this, how can Facet have a neutral, unbridged, native token?

Enter Facet Compute Token (FCT)

Users earn Facet Compute Token (FCT) by burning L1 ether in the creation of Facet transactions.

Here's how it works:

  1. As described above, users create Facet transactions by sending Ethereum transactions to the Facet inbox address that contain special calldata payloads. Here's an example.

  2. Every Ethereum transaction burns some ether. You can see how much by clicking "show more" on Etherscan. The amount burned equals the gas usage (25,256) multiplied by the block's base fee (0.106772501 Gwei).

  3. The amount of ether burned (in this case 0.000002696646285256) is added to the transaction sender's Facet Compute Token balance, and this change takes effect before the user's Facet transaction is processed.

Because the FCT credit is applied before the user is required to pay for the gas of their Facet transaction, and because users earn FCT for something they were doing anyway (submitting a Facet transaction), in the majority of cases users won't have to worry about gas at all on Facet, much like they didn't on Facet V1.

A Note on Smart Contracts

L1 smart contracts can create Facet Transactions, and yet they don't pay gas. This means they don't burn ether and ordinarily wouldn't earn any FCT. Under the default rules this means that if you wanted an L1 smart contract to initiate a Facet Transaction for your benefit you would have to first send that smart contract FCT, which is inconvenient.

For this reason, when there are multiple calls in an Ethereum transaction that creates one or more Facet Transactions the FCT mint is split equally between the from addresses on each of the separate calls.

Last updated