Turnkey offers flexible infrastructure to create and manage private keys. By combining the secure private key infrastructure and with gas abstracted transactions, developers can easily integrate account abstraction features for any Turnkey-powered wallets.

Setting up Gasless Transactions on Tron (TVM)

Turnkey offers deep and robust support for the Tron (TVM) ecosystem. We utilize the SECP256K1 elliptic curve as the primitive for signing transactions, and provide address derivation support. Beyond this, Tron developers can also leverage TVM transaction parsing and policies for additional security and transaction granularity, all managed by the Turnkey Policy Engine.

Below, we demonstrate how to take advantage of Tron’s existing smart contract functions, combining it with Turnkey’s infrastructure to give end-users a gasless wallet experience, while maintaining the high standard for security, flexibility, and scalability.

Gasless Architecture: Setup guide

  1. Stake TRX for Bandwidth (resource)
    • Ensure that your organization’s Turnkey wallet is funded with a sufficient TRX balance

      TIP: This can be a wallet contained within your parent organization

    • Initialize the staking activity by calling the freezeBalanceV2 function

      Refer to Tron Network’s official documentation for further information

  2. Delegate the resource to end-user wallets
    • After you’ve initialized the staking operation using freezeBalanceV2 (Step 1) you’re now able to delegate the resources to end-user wallets
    • From the staking wallet, make a call to the Tron network using DelegateResource function
      • owner_address: Wallet that is staking TRX (Step 1A)
      • receiver_address: Wallet controlled by the end-user
      • resource: The resource you’re delegating, bandwidth
  3. Transaction flow (end-user)
    • After the staking has been initialized and resources delegated, the user experience is trivial: end-user wallets (receiver_address) can transact via the Tron network without needing to provide gas for their own transactions.

Leveraging delegateResource smart contract function

As shown above, we are leveraging the existing DelegateResource call to delegate bandwidth or energy resources to other accounts. Note that this operation requires you to have Tron’s native network token TRX staked in order to fund end-user’s transactions.

{
  "owner_address": "TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g",
  "receiver_address": "TPswDDCAWhJAZGdHPidFg5nEf8TkNToDX1",
  "balance": 1000000,
  "resource": "BANDWIDTH",
  "lock": false,
  "visible": true
}

Remember: In the context of Tron, owner_address will be the Turnkey wallet that holds and stakes TRX. The receiver_address will be the end-user wallets.

Setting up Gasless Transactions on Ethereum (EVM) and Solana (SVM)

At the moment, Turnkey does not offer out-of-the-box gas sponsorships for the EVM ecosystem. This may change soon, and any updates will be announced via our official channels. 

For now, you can leverage Turnkey’s partnerships with ZeroDev and Alchemy to provide gasless experiences to the end-users. Refer to the Account Abstraction article for more information.

For Solana, head on over to How to Integrate Gasless Transactions on Solana With Turnkey article to learn how to create an in-house Solana Paymaster!

Thinking about gasless transactions for other chains?

If you have questions, feedback, or find yourself in need of a gas abstraction or integration that doesn’t exist yet, please get in touch with us! You  can