Jarrod Watts Profile picture
May 8 26 tweets 7 min read Read on X
Vitalik just proposed EIP-7702.

It's one of the most impactful changes Ethereum is going to have... EVER.

So, here's everything you need to know about how it works and how we got here:
The new EIP-7702 proposal is surprisingly short! Leaving some people confused as to how this is going to work.

To understand 7702, there are first three other proposals that it mentions that we'll walk through:
1/ EIP-4337
2/ EIP-3074
3/ EIP-5003

(1/23)
Let's start with the goal of *all* of these proposals.

EOAs ("normal" accounts) on Ethereum suck. They're risky and have very limited capabilities.

Account abstraction allows you to use a smart contract as your account to add more features & safety to address this.

(2/23) Image
ERC-4337 went live on mainnet in March 2023.

It allowed smart contracts to be written in a way that they can act like accounts, such that they can validate and execute transactions (UserOps).

This enabled a lot of UX improvements, for example:



(3/23)
Since its release, ERC-4337 has gained solid adoption, largely dominated by Polygon, with Base picking up in activity in the past few months.

As we can see thanks to this dashboard by @0xKofi -

(4/23) dune.com/niftytable/acc…
Image
The most recent innovation built with 4337 is from the Coinbase ecosystem with their Coinbase smart wallet.

With support for biometrics, the UX is amazing.

I built another little demo showcasing this on the weekend here at ETH Global Sydney:



(5/23)
So what's wrong with 4337? Why is there another account abstraction proposal today?

The answer: EOAs are still the most used type of account by far!

In addition to this, most 4337 smart contract accounts are controlled by a single EOA signer!

Example code below.

(6/23) Image
Because there is:

A) No way to "convert" your EOA to a smart contract account, we have this weird middle-step solution.

and

B) A lack of native support by web3 apps to connect smart contract accounts.

Most people still use EOAs through extensions like MetaMask today.

(6/23)
This leads us to our next proposal. EIP-3074.

Actually, this proposal was made *before* 4337 was! However, it has not been merged into mainnet.

EIP-3074's tries to give EOAs more power, by allowing them to delegate control of their EOA to a smart contract.

(7/23)
The proposal outlines the following:

Add two new opcodes.

1/ AUTH: EOAs can call AUTH to authorize a given smart contract to perform actions on their EOA's behalf.

2/ AUTHCALL: An authorized smart contract can use AUTHCALL to perform transactions for the EOA.

(8/23) Image
This enables many of the same use cases as 4337 does, without each user having to deploy a new smart contract.

One key difference is that transactions come from your EOA, not a new contract that has none of your account history, or ETH, NFTs, tokens, etc.

(9/23)Image
A common reaction to 3074 was "what if people make malicious contracts and users delegate to them?"

Delegating to a malicious contract could result in EVERYTHING being drained from your wallet.

@adietrichs puts this well in this tweet below.



(10/23)
The way around this is likely that wallet providers will not even allow you to AUTH to just any contract.

They would likely keep a list of allowed contracts that you can delegate to, and any contract outside this list is not shown to users.

(11/23)Image
A key part of the EIP-3074 delegation is that the delegation is not permanent.

"A single tx from the EOA will cause the nonce to increase, invalidating outstanding authorizations"

Essentially, after you make a transaction, the delegation is no longer valid!

(12/23)Image
We also don't really want to give more power to EOAs.

After all, the goal of these proposals is to move users from EOAs to smart contract accounts, so why are we adding features to EOAs?

This leads us nicely to our next proposal: EIP-5003.

(13/23)
EIP-5003 adds another opcode, "AUTHUSURP", that deploys code at an EIP-3074 authorized address.

- 3074 is a temporary delegation to a smart contract, which is revocable.

- 5003 is a permanent migration from EOA and "conversion" from EOA to a smart contract account.

(14/23)
A big issue with EIP-3074 + EIP-5003 is that it is not very compatible with the current account abstraction via ERC-4337.

Some of the Ethereum community is concerned that we would be "creating two separate code ecosystems" with both types of account abstraction.

(15/23)
That brings us to Vitalik's proposal today: EIP-7702.

His proposal modifies EIP-3074 to make it leaner and more compatible with ERC-4337; so that we don't end up with two separate AA ecosystems.

It also considers EIP-5003 as the next step for permanent migrations.

(16/23)
EIP-7702 proposes a new transaction type that accepts both a contract_code and signature field.

At the start of executing a transaction, it sets the contract code of the signer account to contract_code.

At the end of the transaction, it sets the code back to empty.

(17/23)
This achieves the same temporary delegation of an EOA to a smart contract that EIP-3074 does.

However, instead of adding new opcodes (which require a hard fork), it defines functions to be called instead.

AUTH -> a call to "verify"
AUTHCALL -> a call to "execute"

(18/23)Image
To break this down, it:

1. Checks if your account contract code is empty
2. If it is empty, sets it to the provided contract code
3. Executes the transaction based on how the provided smart contract handles transactions
4. Sets the account contract code back to empty

(19/23)
"Contract code" is exactly what it sounds like.

It's where the code of the smart contract lives.

Since EOAs are not contracts, this is typically empty... however, EIP-7702 temporarily populates it with some smart contract code for the lifetime of the transaction.

(20/23)
It's a way of providing new behaviour (in the form of code) for how this particular transaction should be executed from your EOA.

The next step to this would be to make this a permanent behaviour change, by simply opting to "not set the code back to empty at the end".

(21/23)
One of the best parts about this proposal is that it is super compatible with all the AA work that has been built out for ERC-4337 so far.

"The contract code that users would need to sign could literally be existing ERC-4337 wallet code".

(22/23)
Once this change goes through, your existing EOA will be able to execute any smart contract code.

With an additional EIP, EOAs will be able to permanently upgrade to run specific code!

Over time, this could completely change how all of us interact with web3 apps.

(23/23)
If you enjoyed this breakdown, the best way to support it is by engaging with the original tweet below to give it more visibility :)

Consider following if you want to see more in the future!

• • •

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

Keep Current with Jarrod Watts

Jarrod Watts 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 @jarrodWattsDev

Jan 24
Ethereum L2s have now reached over $20B TVL.

But users still have almost no way of performing cross-chain L2 transactions.

I spent the past week reading about how different kinds of sequencers (and Polygon's AggLayer) are being built to solve this.

Here's everything I learned:
First, what even is a sequencer?

Rollups consist of several components, but all of them include some kind of sequencer that performs 2 critical tasks:

1/ Read transactions from the L2 mempool & execute them
2/ Batch transactions together, and send the batches to L1 Image
Today, most rollups:

1/ Use their own sequencer, responsible for reading transactions exclusively for their L2.

2/ Use their own L1 rollup contract, where the batches of transactions are stored exclusively from their L2. Image
Read 25 tweets
Jan 11
EigenLayer just crossed $1 billion in deposits.

So, is restaking the future of Ethereum? Or just another overhyped narrative?

I spent the past few days reading through the EigenLayer whitepaper & founder Sreeram's interviews.

Here's everything I learned:
To understand EigenLayer and restaking, we first need to quickly re-cap Ethereum's consensus mechanism.

After Ethereum's "merge" event in September 2022, Ethereum swapped from Proof of Work to Proof of Stake.
Proof of stake is actually pretty simple:

- Your "stake" is money. In the form of ETH.
- Ethereum provides a way to earn more ETH by running a validator node and "staking" 32 ETH.
- If you run your validator properly, you earn more ETH. If you don't you have your ETH "slashed".
Read 40 tweets
Jan 3
EVM parallelization is the hottest new narrative.

So, is it all hype? Or is innovating on the EVM something we'll continue to see throughout 2024?

Here's everything you need to know:
Typically, EVM-based blockchains have a bottleneck; block proposers and validators verify every transaction in sequential order.

One by one.

This is because transaction X may depend on transaction Y which may depend on transaction Z, etc. etc.
This sequential method is great for ensuring the chain works logically and transactions are executed the way you expect.

But, when an EVM chain is flooded with transactions like they were recently with inscriptions, things start to break down (like reaching ~$400 in gas fees).
Read 15 tweets
Dec 19, 2023
Inscriptions are responsible for ~90% of transactions on many EVM chains this week.

Is this just another crypto FAD? Or are inscriptions actually genius, and here to stay long-term?

To find out, I spent the past few days exploring them.

Here's everything I learned: Image
The Bitcoin blockchain doesn't support smart contracts; meaning there's no way to create tokens such as NFTs on the Bitcoin network.

That is until earlier this year, around April 2023, when something called Bitcoin "Ordinals" started to gain traction. Image
Ordinals/ordinal theory is not a change or a new feature added to the Bitcoin network.

It works out of the box using one concept: Each Bitcoin is made up of "Satoshis" (sat).

1 Bitcoin = 100,000,000 Satoshis.

Satoshi is therefore the native currency of the Bitcoin network.
Read 25 tweets
Nov 23, 2023
"Blast is just a 3/5 multisig..."

I spent the past few days diving into the source code to see if this statement is actually true.

Here's everything I learned:
Let's start at the beginning.

A fresh wallet, 0x52c31 deploys two contracts:

1/ 0xa01: The Blast Deposit Proxy Contract
2/ 0x5f6: The Blast Deposit Implementation Contract

If you aren't familiar with these "proxy contract" setups, np, we'll come back to this later.

(1/24) Image
After 0x52c31 deploys these contracts, it transfers the ownership to a Gnosis Safe smart contract.

Gnosis Safe, or "Safe" contracts are the most popular & trusted multi-sig smart contracts.

They require the majority of signers to sign in order to execute a transaction.

(2/24) Image
Read 25 tweets
Aug 11, 2023
We all know Layer 2s batch transactions together and send a single transaction back to Ethereum.

But what *actually* gets posted to L1?

I followed a transaction all the way from being submitted on Polygon zkEVM through to being part of a ZK proof on L1.

Here's what I learned:
The full flow of transactions can be broken down into 5 steps:

1/ Submitting
2/ Executing
3/ Batching
4/ Sequencing
5/ Aggregating

(1/25)
1/ Submitting

On the zkEVM, transactions go through almost instantly.

I built a demo application last week showcasing how quickly the state is updated from the user's POV on the Polygon zkEVM.

(2/25)
Read 28 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

Don't want to be a Premium member but still want to support us?

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

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us!

:(