ً Profile picture
16 Mar, 26 tweets, 6 min read
Ethereum wallets may be getting a significant upgrade soon. With the proposed change, EOAs will immediately be able to send batch txs, expiring txs, unordered txs, and more. (thread)
My colleagues, @_SamWilsn_ and @adietrichs, and I have been working on improving the UX of interacting with Ethereum. After many iterations, we've come up with EIP-3074: AUTH and AUTHCALL opcodes.
To use these opcodes, an EOA signs a message off-chain, provides the message to a relayer, the relayer passes the signature and calldata to a contract on-chain (called an invoker), the contract verifies the signature using AUTH, and then relays the EOA's call with AUTHCALL.
AUTHCALL behaves almost identically to CALL *except* it sets CALLER (e.g. msg.sender) as the EOA address that was recovered via AUTH. This allows users to interact with Ethereum with no ether. In other words, their transaction can be "sponsored" by a relayer.
This scheme may sound familiar. In fact, this is nearly identical to how meta-txs work. The one (large) caveat is that meta-txs cannot set msg.sender at will. Therefore, contracts must explicitly support meta-txs. EIP-3074 aims to eradicate meta-txs, reducing contract complexity.
To dig into exactly how this works, let's understand what we're trying to build. We want a mechanism that allows an EOA with no ether to *trustlessly* send a tx. "Trustless" is the key word. Users should not grant relayers any special privileges that could be exploited.
EIP-3074 allows trustless systems to be built by carefully choosing what parameters are included in the signature from the EOA. Users sign over keccak(0x03 ++ invoker_address ++ commit_hash).
The type byte is an EIP-2718 constant byte with a value of 0x03. This is used to avoid collisions with other signature schemes like EIP-2930 access list txs, EIP-1559 fee market txs, EIP-191 0x19 signed msgs, etc.
The invoker address binds the user's call to a specific contract. The signature is only valid for that contract, aka the invoker. This allows the user to choose an invoker that they trust -- just like choosing a smart contract wallet to trust assets with.
We expect only a small number of invokers to exist, because their users can be compromised if they're implemented incorrectly (note that invokers are opt-in). Developing a safe invoker will be expensive. It should be audited by multiple parties and statically proven to be sound.
This is not too different than the status quo though. Smart contract wallets should have thorough audits and proofs before they are entrusted with significant funds. Many large defi projects do the same.
The final signed parameter is commit_hash (or just commit from here on out). This is what provides invoker designers so much flexibility, and what allows for so many different schemes to be developed.
The commit binds the invoker to only perform certain actions and creates certain validity requirements to process a call. Users can trust the invoker will follow this procedure, because the code can be verified on-chain. This is the nice property of blockchains.
Let's look at a simple case. A user wants to send a call through an invoker. To avoid their call being relayed, they provide a nonce. They also provide other non-malleable values. Users hash these values to get the commit and use that commit in their signed message for AUTH.
The commit hash would be regenerated by the invoker using the values passed in. This way, if a sponsor changes a value, the invoker will compute a different commit hash than the EOA signed, causing AUTH to recover a junk address. That might look something like this:
Hopefully now you're convinced that the invoker is like a smart contract wallet that any EOA can use. Now let's look at how even more interesting schemes can be built using commit.
Generally, the rule of thumb is "one signature per action". This is a simplistic way to view things. A signature is created over the hash of a transaction, why not hash N transactions? It turns out this is possible with EIP-3074.
Once an account has been validated using AUTH, the invoker can make as many AUTHCALLs as that account as it likes. Because we trust the invoker to execute its code faithfully, this is fine. We can design schemes where commit is the hash of multiple calls.
In the scheme above, the invoker would take all the values (nonce1, nonce2, etc) and hash them together to generate the commit. It would call AUTH with that commit and the user's signature. AUTH would verify that the user did sign over those parameters.
The invoker would then loop through each call and verify the nonce and other parameters, then send the authenticated calldata to the authenticated address.
There are many more schemes that can be built on top of this. For example, suppose you add a new parameter "expiration". This parameter would be hashed into commit and during validation, the invoker would check if `expiration < block.number`. Now EOAs have expiring transactions!
EIP-3074 is a powerful primitive that will open the door to more seamless UX without additional trust assumptions. If you wish to read the EIP in full, you may find it here: eips.ethereum.org/EIPS/eip-3074
A prototype implementation in go-ethereum is being maintained here: github.com/quilt/go-ether…
We're working with several teams who are interested in using this mechanism. If this is something that you would find useful, let us know and let's work together! Feedback on the proposal is also welcome & greatly appreciated. Please direct feedback here: ethereum-magicians.org/t/eip-3074-spo…
Finally, if this type of work excites you, our team is hiring. We work heavily on medium to long term improvements of the Ethereum core protocol. Please send me a DM for more information.
s/relayed/replayed

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with ً

ً Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @lightclients

13 Jan
2021 will be the most innovative year for the Ethereum protocol since 2016. Here are the EIPs to keep an eye on this year (thread):
The next hardfork is named "Berlin" & is scheduled to ship with 4 EIPs:

* EIP-2929: Gas cost increases for state access opcodes
* EIP-2930: Optional Access List Txs
* EIP-2718: Typed Transaction Envelope
* EIP-2315: Simple Subroutines
EIP-2929: Gas cost increases for state access opcodes

Storage accessing opcodes have historically been underpriced & malicious txs which take 20-80 seconds to execute can be created today.

This EIP increases the cost of state accesses by ~3x.
Read 21 tweets
12 Jan
What are the most exciting new(ish) ERCs? cc @0xMaki @bantg @nicksdjohnson @thegostep @AndreCronjeTech @kaiynne @danfinlay
so far, the most interesting IMO (as a non-dapp dev) are EIP-2535 Diamond Standard (@mudgen), EIP-3009 Transfer with Authorization (@petejkim), EIP-3000 Optimistic enactment of governance (@izqui9), and EIP-3156 Flash Loans (@acuestacanada)
but i feel like there are interesting conversations happening in some lower number EIPs that I'm just not following. any standards to improve the readability of tx data when signing (or signing standards in general)?
Read 4 tweets
12 Nov 20
Yesterday's chain split will be cemented in Ethereum's history as an inadvertent hard fork. Let's look at exactly what the vulnerability was & how this transaction exploited it (thread): etherscan.io/tx/0x57f7f9ec3…
I also want to preface that this is completely an outsiders account of the incident & therefore everything posted here is only to the best of my knowledge. I look forward to the go-ethereum team's full disclosure of the vulnerability!
On 2019-11-07, Geth v1.9.7 was released. It contained a few fixes and optimization, including PR #20177 titled "core/evm: avoid copying memory for input in calls".
Read 25 tweets
1 Nov 20
Geth's transaction pool (aka mempool) can be boiled down to a few key data structures and processes. Transactions are the main building block. They are stored on the heap while references to them populate four objects: "all", "priced", "queue", and "pending".
The "all" object is a mapping of the transaction's hash to the actual transaction object on the heap. It is the canonical source of transactions in the mempool and is used to build (and rebuild) the "priced" object.
The "priced" object is a heap (data structure) that orders the transactions in the mempool highest to lowest priced. When the mempool is completely saturated, "priced" is asked to find the N cheapest transactions so that they can be fully evicted from the mempool.
Read 16 tweets
18 Jun 19
I'm going to live tweet as I read the @Libra_ whitepapers & relate it to Eth 2.0 where I can. [THREAD]
@Libra_ Please correct & discuss any of my thoughts, thanks!
Read 78 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!

Follow Us on Twitter!