Rosco Kalis Profile picture
May 19 1 tweets 2 min read Read on X
Now that EIP7702 is live, I think it is time to retire Permit2, as it provides nothing that EIP7702 doesn't, and it is an added security risk.

What is Permit2?

Before Permit2, there was Permit: a method to grant token approvals using gasless signatures.

Permit improved UX for things like swaps so that you don't need to send two separate transactions for approve + swap.

However, there was one important drawback to Permit: it needed to be implemented by the token.

That is where Permit2 came in. Permit2 was created by Uniswap as a way to add Permit functionality to any token, even if the token didn't explicitly add support for it.

This sounds great in theory but in practice it came with quite a few drawbacks.

Drawback 1: easier to exploit

Permit2 requires users to give an unlimited approval to the official Permit2 contract, and this approval then enables the new signature functionality.

But Permit2 signatures are very flexible and allow you to give permissions to many tokens at once. This makes it easier for scammers to abuse and steal multiple assets with just a single signature.

Drawback 2: friction for developers

Supporting Permit or Permit2 signatures required quite a bit of extra development effort, and supporting both of them on top of "regular" approvals was an even bigger hassle, especially within smart contracts.

In some cases dapps decided to unify this into only using Permit2, but that actually can lead to worse UX than before, since now you need to give an unlimited approval to Permit2 even if the token you're swapping already supported Permit signatures natively.

Solution: EIP7702

Now that EIP7702 (and EIP5792) are live on Ethereum, developers can replace Permit2 with batch transactions. While developers do need to implement this explicitly on the dapp UI side, there is no extra code required in the smart contracts (unlike Permit2).

While similar security concerns exist for batch transactions as they do for Permit2, batch transactions offer more benefits, and there is no reason to keep multiple solutions to the same problem around long-term.

While it still may take a while for all wallets and dapps to catch up with EIP7702, I expect we can properly retire Permit2 by the end of this year.Image

• • •

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

Keep Current with Rosco Kalis

Rosco Kalis 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 @RoscoKalis

Dec 2, 2021
NFTs have become increasingly popular in 2021. Most trading happens on big marketplaces like OpenSea. But in my latest blog post I take a look at the best platforms for trading NFTs in a peer-to-peer manner.

kalis.me/best-nft-tradi…
To do so I asked the help of @snooplyin42 and took @NftTrader, @sudoswap, and @swapkiwi for a test drive. We compared the platforms on their UI, UX, features, costs and usage and I compiled our findings in the blog post.
To measure usage, I wrote a script that looks at the on-chain completed swaps for each of the platforms, classifies them and calculates their value.

Tools used:
@AlchemyPlatform's Transfers API
@MoralisWeb3's Price API
@rarible's Orders API

github.com/rkalis/nft-swa…
Read 6 tweets
May 25, 2020
#CashScript v0.4.0 has been released! What's new?
- 🔣 Bitwise operators
- 🔢 Variable size NUM2BIN
- 🔃 .reverse()
- 🏗️ Fluent Transaction interface
- 💰 Manual UTXO selection
- 🏇 Optimisations
- 🐛 Bug fixes
- 🎉 Brand new website

cashscript.org/docs/releases/…
1. 🔣 Bitwise operators

Bitcoin Cash has had support for bitwise AND, XOR and OR for a while. These were initially disabled in CashScript because they can be error-prone. CashScript has added more type safety features since its release, so these operators can now be added.
2. 🔢 Variable size NUM2BIN

Casting int values to sized bytes is commonly done with this syntax: `bytes8(5)` or `bytes4(10)`. But you don't always know what the size of the output should be if it depends on variables. So v0.4.0 adds an alternative syntax: `bytes(12, x + 1)`.
Read 11 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!

:(