Executable Transactions: Transaction Inside Transaction (Part-1)

Sarvesh Jain
Coinmonks
3 min readApr 6, 2019

--

The increasing popularity of ethereum blockchain has attracted many businesses to leverage blockchain for their existing consumer applications. However, one fundamental challenge that businesses face is to educate their consumers about blockchain, public-private keys management, gas consumption and what not!

Imagine for every action that consumer performs on the application, they need to sign a transaction using meta mask, think about gas consumption and think about ether in the account for paying gas.

Blockchain end user be like

Executable transactions, also called ether-less transaction or transaction insider a transaction, is a very effective approach to simplify user interaction with the blockchain.

Entities involved in the executable transaction:
1. An end user with ether-less key: End-user has an ether-less key, which is used to sign a transaction.

2. Transaction Relayer: Transaction relayer has a job to submit the signed transaction on the blockchain on behalf of someone else. Transaction relayer actually pays gas for the transaction. Usually, the transaction is submitted to a smart contract which executes the executable transaction.

3. A smart contract: Responsibility of smart contract is to verify the signature of the end user and execute the executable transaction submitted by relayer. It also calculates the gas consumption of the transaction so that gas station can refund amount to relayer at the end of the transaction.

4. Gas station: It’s a smart contract which holds tokens/eth. These tokens are used to refund gas paid by transaction relayer to execute a transaction on behalf of the end user.

The sequence of actions:
1. End-user signs a transaction with an ether-less key registered with the smart contract.

2. End user sends the transaction to a relayer to submit to the blockchain.

3. Relayer creates a new transaction(calling smart contact method) which wraps end user’s transaction.

4. Relayer submits the transaction to the blockchain and pays for the gas.

5. Smart contract verifies the signature of the end user.

6. Smart contract tracks the gas consumption and executes the end user’s transaction.

7. Smart contract asks gas station to refund the consumed gas to the relayer.

This approach solves major blockchain UX problems like:
1. The user doesn’t need to think in terms of ether.
2. The user doesn’t need to use extensions like meta-mask to sign the transaction. Signing with the ether-less key can easily be encapsulated with app logic.

I would discuss the implementation details of this approach in part-2 of this blog. Stay tuned. 🙌

Happy Coding 😇

linkedin.com/in/jainsarvesh
twitter.com/sarvesh_jain_
medium.com/@sarvesh.sgsits

References:
https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1077.md
https://ethereum-magicians.org/t/eip-1077-executable-signed-message/405

Get Best Software Deals Directly In Your Inbox

--

--