Call Ethereum smart contracts from Etherless wallets using the Tangany Gas Tank

Martin Kreitmair

Chief Executive Officer, Co-Founder, Tangany

Call Ethereum smart contracts from Etherless wallets using the Tangany Gas Tank

Traditionally the Ethereum ecosystem requires a native currency (“Ether”) to participate in smart contract transactions — that is e.g. exchanging Ethereum Tokens such as ERC20 or ERC721. Requiring wallet holders to obtain cryptocurrency in order to trade cryptocurrencies is a bad user experience for many Ethereum users and is a well known hampering factor for broader Ethereum adoption. While multiple approaches exist aiming to circumvent this problem, often they require complex infrastructure migrations and redeployment of established smart contracts possibly disrupting the user base.

With WaaS 1.4 we introduced an elegant turnkey solution that eliminates these inconveniences while honoring existing smart contract business logic. Our WaaS Gas Tank enables participating wallets sending Ethereum transactions without the requirement of actually holding any Ether balance by transparently pre-funding the mandatory transaction fees to the sending entity from our centrally managed Ether tank.

Using the Gas Tank in a WaaS transaction is enabled by simply adding the HTTP header tangany-use-gas-tank=true to any asynchronous Ethereum API endpoint request (e.g. POST eth/contract/:contract/:wallet/send-async).

The amount of Ether required to fund an outgoing transaction is based on the amount of gas (so to speak “CPU units”) the transaction is going to use up during its execution times the gas price — the amount of Ether the sending wallet is willing to spend per gas unit. The required amount of gas for a transaction is estimated automatically by WaaS during the API call. The gas price is either pre-set via the optional header tangany-ethereum-speed header or defined manually using the tangany-ethereum-gas-price header

Once the transaction with the requested fee has arrived at the sending wallet, WaaS proceeds to transmit the original transaction to the Ethereum network using the pre-funded budget to pay for the transaction.

Most of the times the smart contract transaction completely consumes the pre-funded amount. In some edge cases, a smart contract transaction may not exhaust 100% of the estimated gas amount. Consequently, a fraction of the pre-funded Ether amount would be added to the wallet’s total balance. Since the pre-funded amount is based on an initial gas estimation for the smart contract, a non-deterministic smart contract may not be compatible with Gas Tank usage. To ensure compatibility with WaaS Gas Tank it is required that an Ethereum smart contract method always behaves the same on each request given the same input.

Ready to give it a spin? Book your free WaaS sandbox account and get started with the Tangany Gas Tank with our handy Postman collection in minutes.

Weiterlesen

Weiter lernen und weiterlesen

Bleiben Sie auf dem Laufenden über die Welt der Kryptoregulierung und erhalten Sie Neuigkeiten über Tangany.