X-Chain NFTPaymaster

Mint a NFT on Hedera and enjoy gasless transactions on Ethereum

X-Chain NFTPaymaster

Created At

ETHOnline 2025

Project Description

X-Chain NFTPaymaster bridges the gap between Hedera and Ethereum by allowing users to mint NFTs on Hedera and then enjoy gasless transactions on Ethereum. It showcases how EVM-compatible networks can interoperate securely to provide seamless cross-chain user experiences.

There is a smart contract deployed on Hedera that interacts directly with the Hedera Token Service System Contract to create and manage its NFT collection. When a user initiates a mint transaction on the frontend, a secure backend holding an admin private key signs a message binding the user's wallet address to a specific token ID. This signature is passed to the contract as part of the transaction, enabling it to successfully mint the token. The same signature serves as a cryptographic proof of ownership that can now be used on Ethereum.

Consequently, when the user performs a transaction on Ethereum, this proof is included in the paymasterAndData field of the user operation. The Paymaster contract uses ECDSA signature recovery, a shared standard across EVM-compatible networks, to verify that the message was indeed signed by the Hedera NFT contract's admin key, thus confirming the user's NFT ownership. It also verifies that the user wishes to execute the current transaction, by verifying a user-provided signature against a combination of the Paymaster contract address and a unique nonce. Upon complete verification, the Paymaster then sponsors the transaction - including the cost of creating the user's smart contract wallet if needed - allowing the user to interact on Ethereum without paying gas fees.

This project demonstrates a practical cross-chain design that leverages Hedera's EVM compatibility and low-cost minting with Ethereum's Account Abstraction capabilities. The result is a secure, user-friendly system where ownership on one chain seamlessly unlocks utility on another.

How it's Made

The project is composed of two main parts - a Next.js frontend and a Hardhat backend for smart contract development and deployment. Together, they enable a seamless cross-chain experience between Hedera Testnet and Ethereum Sepolia.

On the frontend, the Next.js application manages NFT minting on the Hedera Testnet, user wallet connections, and cross-network interactions. It captures the user's wallet address, handles the signing process, and sends minting and verification requests to the backend. Once an NFT is minted, the application uses the Hedera Hashgraph SDK to fetch and display the NFT details. Users can then either increment a simple counter or execute a more advanced action, swapping USDC for WETH on Ethereum Sepolia via integrated smart contracts.

To enhance the user experience, the frontend also integrates the Blockscout SDK, which provides real-time transaction notifications and displays the transaction history of the counter contract directly in the interface. Overall, the UI is designed for clarity, guiding users through the entire cross-chain flow - from minting an NFT on Hedera Testnet to transacting on Ethereum Sepolia.

On the backend, smart contracts are developed, tested, deployed, and verified using the Hardhat framework. It serves as the foundation for all administrative on-chain tasks, including:

  • An Ignition module for deploying Paymaster, Wallet Factory, and Counter contracts to Ethereum Sepolia
  • Scripts to top up the Paymaster's deposit, deploy the NFT contract to Hedera Testnet and other demo-related activities
  • A custom task for programmatically verifying the Hedera NFT contract on Hedera's bespoke blockchain explorer
  • A test suite for sending and validating user operations on Ethereum Sepolia

In terms of the contracts themselves, the three most important ones are the NFT contract deployed to Hedera Testnet, and the Wallet Factory and Paymaster contracts deployed to Ethereum Sepolia. On Hedera Testnet, the NFT contract interacts directly with the Hedera Token Service System Contract to create and manage an NFT collection. As part of the process to mint a new token, the frontend will call a secure backend to generate an admin signature over a unique hash of a concatenation of the new token ID and the user's address. This signature is then be passed to the minting function and verified using the admin public key stored in the smart contract so that the new token can be successfully minted.

On Ethereum Sepolia, the Wallet Factory contract executes the initCode of an ERC-4337 User Operation to deploy a new smart contract wallet at a deterministic address if one does not yet exist for the user. This wallet has two main responsibilities. Firstly, it ensures that the User Operation was legitimately authorized by the user by verifying a user-provided signature. Internally, the wallet performs ECDSA signature recovery, checking that the hash of the User Operation matches the signature provided and confirming that it was indeed signed by the wallet owner. Secondly, once the signature is validated, the wallet executes the user's intended transaction, as specified in the callData field of the User Operation.

Meanwhile, the Paymaster is responsible for verifying data contained in the paymasterAndData field of the User Operation before sponsoring user transactions. This data includes the same admin signature, token ID and user address that were used earlier for NFT minting, as well as a user signature to prevent spoofing attacks. Again using ECDSA recovery, the Paymaster confirms both the user's authorized ownership of the Hedera NFT and his current intent to transact on the Ethereum network. Only after both verifications succeed does the Paymaster sponsor the transaction, covering gas costs of the entire pipeline from possible wallet creation to actual transaction execution. This entire flow facilitates a truly gasless transaction where the user need not hold any ETH to interact with the Ethereum blockchain.

Overall, the system combines Hedera's EVM compatibility, Ethereum's Account Abstraction, and Hardhat's robust tooling to demonstrate how cross-chain logic can be implemented securely, transparently, and efficiently.

background image mobile

Join the mailing list

Get the latest news and updates

X-Chain NFTPaymaster | ETHGlobal