Articles

Implementing Gas Fee Abstraction on the Coinweb Protocol

Introduction
Each blockchain uses a distinct native token to compensate network participants such as nodes, validators, or miners for their contributions. These fees are known as “Gas Fees” on Ethereum, “Miner Fees” on Bitcoin, and various other names on different networks. The native cryptocurrency of a blockchain is intrinsically linked to the transfer, computation, and execution of information, data, and storage on that particular blockchain. As a result, there are multiple cryptocurrencies needed for transactions on each respective chain in any given cross-chain environment.

Gas fees have been a long-standing UX problem for dApps, negatively affecting the user experience of dApps and limiting their adoption. However, with Gas Fee Abstraction, this problem can be eliminated, and users can enjoy a more seamless and optimal cost-overhead experience. In this blog post, we will take a closer look at what Gas Fee Abstraction is, how it works using Web3 gaming as an example, and its potential impact on the future of decentralized applications.

What is Gas Fee Abstraction?
Gas Fee Abstraction is a feature that abstracts away both L1 native fees and L2 fees, allowing users to transact in dApp-issued tokens without worrying about the complexities of holding gas fees across various layers of the network. This feature vastly improves the end-user experience, resulting in optimal cost overhead and increased scope compared to other solutions.

Some implementations of gas fee abstraction and substitution already exist at the Layer 1 (L1) level, but they come with drawbacks, such as increased gas consumption and spam-related issues. Improved user experience often comes at the cost of increased computational requirements. This is why end-users of L1 dApps are still interacting with low-level protocol components such as gas tokens. Coinweb’s high-capacity computational framework removes such constraints.

The Coinweb protocol features a unique execution model that enables atomic gas-fee abstraction at the protocol and application levels and across various blockchains, wallets, and decentralized application (dApp) ecosystems. Expanding gas-fee abstraction across a broader spectrum of the blockchain ecosystem is likely to reduce entry barriers for non-tech-savvy users and increase overall adoption. This will facilitate the composability of other dApps, allowing users to engage with a larger set of applications within specific projects, resulting in a seamless and consistent user experience.

How does Gas Fee Abstraction work?
Gas Fee Abstraction is achieved by using a blockchain routing system that allows for interoperability between blockchains and scalability on Layer 2. Coinweb is an example of a protocol that is able to implement a blockchain routing system that employs Gas Fee Abstraction. The routing system allows dApps to move around freely on different blockchains, simplifying transactions for dApp users.

The objective is to use the CWEB utility token to abstract L1 native fees for recording Coinweb transactions into underlying blockchains. CWEB can be abstracted for Coinweb Layer 2 (L2) operations using the L2 token with the L2 Coinweb Decentralized Exchange, DeconX, which includes implementations of token bonding curves, price discovery, and liquidity pools. Additionally, L1 fees and CWEB can be abstracted for L1-native transactions for Coinweb-enabled L1 tokens by utilizing the L1 to Coinweb L2 DEX to exchange L1 tokens for CWEB.

Equivalent methods will be available for users without incurring native L1 fees for each implemented token specification API (e.g., ERC20, ERC721, ERC1155) method (transfer, approve, burn). While using our software, these equivalent methods will appear identical to the specified methods. Additionally, with Coinweb-enabled L1 tokens, it will be possible to use Uniswap (and Uniswap-compatible) smart contracts without native L1 gas fees while using our software. However, using the Uniswap frontend without native L1 gas would not be possible for these smart contracts otherwise.

Furthermore, any contract utilizing well-defined gas-less standards, such as ERC2771, can be used. It will be possible to create a Gnosis Safe-like contract for a user and enable any external action by this Safe without incurring L1 gas fees.

Token Wrapping
Token wrappers can be employed for L1 gas fee abstraction and facilitate interaction between L2 dApps and tokens with L1 dApps. These wrappers can be designed to support both Coinweb-compatible wallets and existing Web3 wallets.

Using Web3 gaming as an example, the front end can be implemented as replicas of the L1 dApp frontends, integrated into the Web3 dApp user interface, or as custom skins that harmonize with the rest of the UI elements. Alternatively, iFrames can be utilized, showcasing specific elements of the original L1 dApp frontend, while incorporating user interaction components within the token wrapper. Some dApps, such as OpenSea, already offer API access. OpenSea requires projects to apply for an API key, which comes with rate limits and usage requirements, such as linking back to OpenSea. Additionally, Uniswap and Pancakeswap each provide APIs for fetching elements.

Coinweb-issued L2 tokens can also be used, as well as the Coinweb wallet. However, a multi-tenancy wallet solution is preferred to align with the game UI and provide a consistent, seamless interaction. Hybrid solutions, such as incorporating Metamask or other third-party wallets, can be used as per the application designer’s preference. The currently available functionality allows the use of Coinweb L2 as a standalone solution (bridgeless), but further development is required to realize the options mentioned above.

Sequencing and Batch Transactions
Unlike other roll-ups with their own consensus mechanisms, Coinweb does not require additional sequencing of transactions from the L1 level, as the order of transactions is preserved. This advantage stems from the use of a deterministic protocol, such as Refereed Delegation of Computation, which maintains the security of the underlying blockchain network in L2, eliminating attack vectors and giving greater protection against MeV frontrunning via transaction reordering or sandwich attacks. This is achieved by using CWEB to abstract away L1-native fees for writing batched Coinweb transactions into underlying blockchains and abstracting away CWEB for Coinweb L2 operations using the L2 token and L2 Coinweb DEX, DeconX.

Web3 Interface
The Web3 interface would enable existing Web3 wallets to interact with Coinweb dApps, including Coinweb Wrappers for L1 dApps, and allow Coinweb tokens to be added to Web3 wallets like Metamask. Coinweb will implement an interface that supports the necessary functions from this RPC API. Coinweb supports blockchain-specific interfaces that translate data and functions to L1 native structures. Any potential issues can be addressed using application-specific tech support. Finally, smart contracts can support variable interfaces to interact with the Ethereum standard.

Coinweb’s gas-fee abstraction can enhance existing Web3 solutions and gaming wallets. Furthermore, improved gas-fee abstraction for L1 dApps can be achieved using the Coinweb L1 — L2 DEX, DeconX, resulting in seamless L1 interaction with third-party wallets and game contracts on individual L1 blockchains. By combining gas-fee abstraction with L2 to L1 bridges for a frictionless experience across various dApps and blockchains, the token exchange process can become fully integrated into the gaming experience without hindering the use of multiple in-game tokens.

Retrofitting and Upgrading
There are several methods for retrofitting smart contracts for Coinweb use or upgrading them:

  • Users change to smart contract addresses: moderate complexity
    By changing their addresses to smart contracts, users could enable gas-fee abstraction while keeping the underlying L1 contracts unchanged. Users could decide whether to continue using their existing EOA addresses directly or switch to smart contract addresses. A drawback is that smart contract addresses consume more gas than EOA addresses.
  • Contract migration: high complexity
    Contract migration involves a full redeployment of the L1 contract(s). The state from the old contract can be transferred to the new contract, but users would need to update the contract addresses in their Web3 wallets. Additionally, all contracts interacting with the old contract and exchanges would need to be updated to use the new contract addresses. This method can be time-consuming and costly, but it may be necessary in some cases.
  • Proxy contracts: low complexity
    On the other hand, proxy contracts migration is a low-complexity approach that can be used if the current L1 smart contract is deployed using a proxy contract. The old smart contract logic can be replaced simply by updating the contract address it points to. This utilizes the delegate-call opcode, which allows contracts stored in the proxy contract to be called. The proxy solution can also be extended to call different contracts using function selectors if the dApp smart contract exceeds 24k (EVM limit) or for other reasons.

Retrofitting and upgrading smart contracts for Coinweb use can be accomplished using various methods, each with different levels of complexity and benefits. Smart contract developers and dApp creators should weigh their options carefully to determine which approach is best suited for their specific use case.

Summary
Using our Blockchain Routing System, the ability for Gas Fee Abstraction as a feature becomes a turnkey solution for any project seeking the vast benefits of interoperability between blockchains and scalability on Layer 2.

As dApps can move around freely on different blockchains, simplifying transactions for dApp users has never been more important. Gas fees have been a long-standing problem in the world of decentralised applications. But with Gas Fee Abstraction, things are looking up for both L1 and L2-centric dApps.

Gas Fee Abstraction abstracts away both L1 native fees and L2 $CWEB fees. This means users only have to transact in the dApp-issued tokens, vastly improving end-user experience with optimal cost overhead and increased scope compared to other solutions. This is great news for users of dApps. No longer do they need to worry about the complexities of gas fees and the different fees across various layers of the network. Instead, they can focus on using the dApp in the way it was intended, without any transactional obstacles.

By way of example, with a dApp built on the Coinweb Stack and anchored to Ethereum, the user doesn’t need to hold $ETH or $CWEB as long as the dApp’s own token is issued through the Coinweb protocol. Nothing more to worry about due to our Gas Fee Abstraction, which will enable a seamless and vastly more robust technological foundation that offers a more accessible, bespoke, and cross-chain user experience.

With Gas Fee Abstraction, dApp developers can now create more user-friendly experiences and offer greater functionality to their users. This directly translates to the potential for wider adoption of dApps, which is great news for the entire blockchain community.

Contact us

Need to discuss your next endeavor?
Connect with Coinweb Labs for any questions.
Email: [email protected]

PRODUCTS
B02FB253-3FAC-4BBD-B064-A0B948EDDCB57ADE9AF8-1B2E-4483-B161-14E2D0A10183
EXPLORE
B02FB253-3FAC-4BBD-B064-A0B948EDDCB57ADE9AF8-1B2E-4483-B161-14E2D0A10183
RESOURCES
B02FB253-3FAC-4BBD-B064-A0B948EDDCB57ADE9AF8-1B2E-4483-B161-14E2D0A10183
CONNECT
B02FB253-3FAC-4BBD-B064-A0B948EDDCB57ADE9AF8-1B2E-4483-B161-14E2D0A10183

Join the waitlist

Join the waitlist to get your exclusive referral link.
By joining, I agree to Terms & Conditions and Privacy Poilcy.