Ethereum Meta Transactions
Editor's Note: This article comes fromEthereum enthusiasts (ID: ethfans), Original author: Austin Thomas Griffith, translation & proofreading: Zeng Mi & A Jian, reproduced by Odaily with authorization.

introduce
first level title
introduce
This means that new users need to pay Gas fees in advance. The current Ethereum protocol does not provide a native way to do this. However, thanks to the public/private key pair, users can sign meta transactions and incentivize desktop miners to pay for them in gas.
In the beginning, a key pair is automatically generated and saved in your browser. Those cypherpunks will surely scoff at this approach, but users shouldn't be put off by the requirement to download a wallet. First, they need to be able to use the product and provide value through the Dapp. Once they receive some tokens or Ether, they should immediately transfer these coins to a wallet like MetaMask or Trust.
First, I want to introduce some basic concepts to lay the foundation for explaining meta transactions on Ethereum. But if you are a cryptography expert, just skip it...
hash
hash
Through the hash function, information of different lengths can be converted into a piece of arbitrary length but predictable (deterministic) results. This is a magical class of functions that can turn a large amount of information into a short string of data "fingerprints" that can be used as summaries. For a given input, the resulting "fingerprint" is always consistent. If there is any slight change in your original data, the resulting hash will be very different.
secondary title
key pair
A public/private key pair uses some mind-bending math, but of course it's not hard to figure out the concept; a message can be signed with a private key, and anyone can use the corresponding public key to sign a message. Prove the correctness of the signature Again, I can give you a message with my signature on it, and you can mathematically prove that I signed this particular message just using my public information. The private key is extremely sensitive and must not be disclosed to others, while the public key can be widely shared. Your Ethereum address is your public key, which represents your identity (Translator's Note: To be precise, your Ethereum address is derived one-way using your public key).
The public key can also be used to encrypt a short message, which can then be decrypted only by the owner of the private key. It's not important, but pretty cool isn't it? So I think I should tell you :) (Translator's Note: This is called "asymmetric encryption".)
From @cooganbrennan: "By signing a hash of a string of data, you achieve three things:
Non-repudiation: the person who sent the transaction cannot later deny sending it"
trade
secondary title
- trade
- To interact with the blockchain, you need to send a transaction. A transaction consists of a few parts, and I like to use the analogy of a very slow email:
- Target Address: The target Ethereum address to which the transaction is sent. It could be another person or a smart contract. You can think of it like the delivery address written on the front of the envelope.
- Value: It's like putting a tiny bit of cash in an envelope for the recipient.
- Data: This is like what goes on a letter you send. This section is usually empty when you are only sending the value.
- Nonce (serial number): Since the content you send is digital information, it may be copied. To prevent the same letter from being mailed twice, we keep track of a count. It's kind of like the logo on the envelope itself. (Another metaphor for a nonce is the check number. Technically, a bank should not cash a cashier's check before the last cashier's check)
- Gas Price: This is like some change you put in the mailbox to incentivize the postman to deliver the letter for you. The more change you put in, the more likely it is that the postman will pick up your letter.
This is a very loose analogy, and I still have a lot of analogies like this in my head. Come and chat over a beer, I'll be waiting for you at Devcon.
smart contract
secondary title
smart contract
Contracts can also communicate with each other. They can even use the skill we mentioned earlier - proving that a particular message was signed by a particular account. This is the core of this technology (meta transaction)...
meta transaction
first level title
meta transaction
First, I crafted a transaction with a structure similar to a normal Ethereum transaction, but I added some extra information:
Data: This part of the letter gets more complicated. It is encoded information detailing what to do, including a hash of the function name to call and the arguments to pass to that function.
Rewards: In a decentralized system, economic incentives are especially important. If you want "desktop miners" to pay the gas for your transactions, you have to pay. However, the money does not come from your account, but from the smart contract of the proxy identity. Ether or other tokens can be used to pay miners.
Next, instead of sending this transaction directly to a smart contract, I will send this transaction to a secondary network. This network analyzes the legitimacy of my request and ensures the validity of my signature. They then choose which transactions are worth submitting and interact directly with the blockchain.
Eventually, when my proxy contract receives my transaction from a third party, it will analyze the instructions in the transaction, pay the third party, and execute my order. These instructions can be sending tokens, calling functions, or anything that a normal blockchain transaction can do.
Metatransactions via Identity Proxy Contracts on Ethereum
in conclusion
first level title


