Ethereum Meta Transactions


Introduction

Dapps require way too much onboarding. The Ethereum ecosystem needs to push toward mass adoption by allowing new users immediate access to functionality and interactivity without all the hoops to jump through.

This means paying the gas for first time users. There is no native method to do this in the Ethereum protocol, yet. However, thanks to public/private key pairs, users can sign meta transactions and incentivize desktop miners to pay the gas for them.

Key pairs will exist in your browser first and will be generated automatically. The cypherpunks are really going to hate this one, but users shouldn’t be bothered with downloading a wallet up front. First, they need to use the product and provide value within the Dapp. Once they receive some tokens or Ether, they should be prompted to move to a wallet like MetaMask or Trust.


Basics

I want to cover a few underlying concepts to lay the groundwork for explaining meta transactions on Ethereum. Scroll away cryptography gurus…

Hashes

Hash functions take in information of varying size and map it to a predictable (deterministic) result of an arbitrary size. It’s a great way to take a bunch of information and get a small, digestible “fingerprint” of the data. The resulting “fingerprint” for a given input is always the same. If any little thing in your original data changes, the resulting hash will change drastically.

Key Pairs

Public/Private key pairs employ some heady math but the concept is simple; A message can be signed with a private key and anyone can use the public key to prove it was signed correctly. To reiterate, I can give you a message along with a signature and using only my public information you can mathematically prove that I signed the specific message . A private key is very sensitive and should never be moved around. A public key can be shared far and wide. Your Ethereum address is your public key and it acts as your identity .

A public key can also encrypt a small message too. Then, only the owner of the private key can decrypt the message. This isn’t really important here, but it’s cool so I thought I should share. :)


From @cooganbrennan: “By signing a hash of data you achieve three things:

non-corruptibility: you know the data has not been tampered with

identity: you know the transaction is definitely from the person who sent it

non-repudiation: the person who sent it can not rescind the transaction later”


Transactions

In order to interact with the blockchain, you need to send a transaction. A transaction consists of a few parts and I like to use the snail mail analogy:

Smart Contracts

My grandfather told me a story about his brother who used to grow tomatoes in his backyard in Kansas. He would put the last night’s harvest in a box on the front step with a scale with an asking price. Every night he would go out and collect the money from a cigar box. This system relied heavily on trust. A smart contract is like this, but it’s backed by math, not trust. I like to think of a smart contract like a set of rules with storage. There are 25 tomatoes in the box and the rule is 15 cents for a pound of tomatoes. If you send an envelope with 30 cents in it to the cigar box, two pounds of tomatoes will be transferred to your address. This will continue until there are no more tomatoes left. At the end of the day, the contract owner can empty the cigar box because he proves who he is with is private key. Contracts can also talk to other contracts. They can even do the trick we talked about earlier where they prove a specific message was signed by a particular account. This concept is the heart of the trick…


Meta Transactions

First, I craft a transaction similar to the structure of a traditional Ethereum transaction, but I also add in some extra information:

Demo Screencast of Ethereum Meta Transactions


Conclusion

Using this method we are able to interact with the blockchain from accounts that don’t hold any Ether. This is may be necessary to drive mass adoption of Ethereum. Users don’t care about decentralization or private keys; they care about using your Dapp to do something important to them.

Universal Logins

Another great use case for this technology is ‘ Universal Logins ’. You should store your Ether in a “cold” wallet and use that to charge up a proxy contract. This contract will hold funds and tokens on your behalf and act as your on-chain identity. Then, as new devices come in and out of your life, you can tell your identity proxy to trust them. These devices never hold funds and their private key is never moved. At the same time, they are able to interact with the blockchain using meta transactions.


Thanks for checking out meta transactions on Ethereum. Hit me up on Twitter: https://twitter.com/austingriffith or learn more about me here:

Credits and Inspiration:

@avsa — https://www.youtube.com/watch?v=qF2lhJzngto

@mattgcondon — https://twitter.com/mattgcondon/status/1022287545139449856 && https://twitter.com/mattgcondon/status/1021984009428107264

@owocki — https://twitter.com/owocki/status/1021859962882908160

@danfinlay — https://twitter.com/danfinlay/status/1022271384938983424

@PhABCD — https://twitter.com/PhABCD/status/1021974772786319361

gnosis-safe

uport-identity