知識分享(Community sharing)
  • 🔔中文教程
    • 📣TokenPocket安全/反詐
      • 💖TokenPocket授权管理工具使用教程
      • 💖Transit 追回资产认领教程
      • ❤️举报百度假TokenPocket链接你我共参与
      • ❤️举报谷歌假TokenPocket链接你我共参与
      • ❤️代币合约安全检测工具上线
      • ❤️以太坊官方授权管理工具
      • ❤️一款国外授权管理工具体验(PC端)
      • ❤️一款国外授权管理工具体验(移动端)
      • ❤️NFT权限管理(PC端)
      • ❤️NFT权限管理(移动端)
      • 🥇主流钱包DApp使用安全性测试
      • 🔰一文学会分辨TP钱包是否正版
      • ❗警惕“零金额”转账骗局
      • ❗警惕“精准伪装”盗币方式
      • ❗警惕私钥助记词钓鱼骗局
      • ❗警惕合约调用转账骗局
      • ❗警惕恶意授权骗局
      • ❗警惕假钱包骗局
      • ❗警惕波場釣魚錢包
      • 💯惡意授權防護須知
      • ‼️快速識別區塊鏈中的騙局
      • 📢使用Cointool管理授權記錄
      • 🚫警惕新型盜幣方式
    • 👨‍🔧交易所充值和提币教程
      • 🔱MEXC交易所
        • 0️⃣Mantle公链代币的提取和充值
          • ☑️Mantle公链主网币MNT提币教程
          • ☑️Mantle公链代币充值到交易所教程
      • 🔱Binance交易所
        • ☑️TON提币教程
        • ☑️TON充值教程
        • ☑️ETH(zkSync Era )提币教程
        • ☑️ETH(zkSync Era )充值教程
        • ☑️APT(Aptos)代币充值
        • ☑️APT(Aptos)代币提币
        • ☑️WAX(WAXP)ERC20代币的提币
        • ☑️WAX(WAXP)ERC20代币的充值
      • 🔱Bitfinex交易所
        • ☑️Bitfinex交易所充值
        • ☑️Bitfinex交易所提币
      • 🔱Coinbase交易所
        • ☑️Coinbase交易所提币
      • ☑️钱包充值到欧易交易所
      • ☑️钱包充值到Binance交易所
      • ☑️交易所提幣注意事項
      • ☑️火币交易所提币到TP钱包
      • ☑️Binance提币到TokenPocket
      • ☑️从抹茶交易所提币到TP钱包
      • ☑️从欧易交易所提币到TP钱包
      • ☑️从芝麻开门交易所提币到TP钱包
      • ☑️如何将PEOPLE从交易所提币到钱包
    • 🎮GameFi教程
      • ☑️TinyWorld鏈遊初體驗
      • ☑️精靈王國遊戲試玩
      • ☑️Dream Card遊戲試玩
      • ☑️Sunflower Farmers遊戲試玩
      • ☑️StarMon试玩教程
      • ☑️使用Crypts and Caverns购买NFT地牢教程
      • ☑️火爆的Monaco Planet社区注册教程
      • ☑️Worldwide Webb游戏试玩
    • ✈️领取空投教程
      • ☑️Dymension(DYM)空投资格查看
      • ☑️听说使用TokenPocket挖noss更快
      • ☑️使用TokenPocket参与ZKFair空投
      • ☑️Blast参与空投详细流程
      • ☑️火爆的 TipCoin 空投教程
      • ☑️SPACE ID 空投代币领取教程
      • ☑️ARB Token领取资格查验教程
      • ☑️Blur 空投 3 参与教程
      • ☑️如何通过TokenPocket领取Core空投?
      • ☑️Uniswap NFT市场/聚合平台空投领取教程
      • ☑️Mint “ETH合并证明” NFT
      • ☑️简单登记有机会获取星巴克NFT空投
      • ☑️使用TokenPocket领取BABT空投
      • ☑️注册以太坊WEB3.0邮箱并获取EMC代币
      • ☑️如何认领 Evmos Rektdrop
      • ☑️Optimism 空投領取教程
      • ☑️Optimism 空投查看
      • ☑️「ApeCoin」代幣空投規則和領取教程
      • ☑️$GDO空投領取教程
      • ☑️SOS空投領取教程
      • ☑️Meelon空投如何领取
      • ☑️如何領取RADAR空投
    • 💧DAO教程
      • ☑️一文读懂Juicebox经济机制
      • ☑️参与Juicebox平台DAO项目捐赠使用教程
    • 🆙TokenPocket多签钱包
      • ☑️TokenPocket多签钱包创建教程
      • ☑️TokenPocket多签钱包导入教程
    • 🔐TP钱包相关教程
      • ☑️Four.Meme 使用教程
      • ☑️TP Card KYC教程
      • ☑️Unichain 跨链教程
      • ☑️LNFI使用教程
      • ☑️使用TokenPocket添加World Chain
      • ☑️Connect 代币 WCT空投登记
      • ☑️BiHelix市场使用教程
      • ☑️ZKF代币质押教程
      • ☑️一文带你玩转Sun Pump
      • ☑️Bitlayer Lucky Helmet NFT铸造教程
      • ☑️使用Meson跨链教程
      • ☑️使用Owlto Finance跨链教程
      • ☑️Scallop(sui)使用教程
      • ☑️Orbiter使用教程
      • ☑️birdeye使用教程
      • ☑️使用Transit Swap兑换SOL资产
      • ☑️Orca使用教程
      • ☑️Jito使用教程
      • ☑️ZKF代币质押教程
      • ☑️Marginfi使用教程
      • ☑️Raydium使用教程
      • ☑️华为手机如何安装/更新TokenPocket
      • ☑️在TokenPocket中使用Jupiter教程
      • ☑️runealpha平台第二张PSBTS铭文mint教程
      • ☑️Nostr Assets充值和提币教程(币安篇)
      • ☑️在TokenPocket中使用FacetSwap
      • ☑️使用TP钱包铸造波场铭文
      • ☑️使用TP钱包交易Ethscriptions
      • ☑️使用TP钱包在Magic Eden中交易铭文资产
      • ☑️使用TP钱包在iDclub中交易铭文资产
      • ☑️使用TP钱包在Element中交易铭文资产
      • ☑️Friend.Tech使用教程(WEB端)
      • ☑️Base链最热应用,去中心化社交Friend.Tech使用教程
      • ☑️FIL代币从主网转移到FEVM链
      • ☑️无法打开PancakeSwap的解决方案(临时)
      • ☑️使用SWFT完成跨链操作
      • ☑️Shardeum公链测试网上线,参与交互可能会有空投。
      • ☑️使用transit跨链兑换HECO链代币
      • ☑️MM Finance使用教程(Polygon)
      • ☑️如何参与ETH2.0节点质押
      • ☑️快速转移代币到TokenPocket的SOL钱包
      • ☑️在TokenPocket导入ETC钱包
      • ☑️MojitoSwap使用教程
      • ☑️如何開啟TP錢包的深色模式
      • ☑️在TP钱包中提交NFT代币LOGO
      • ☑️在App Store给TP Wallet鼓励和反馈
      • ☑️TokenPocket多鏈批量轉賬工具
      • ☑️使用Biswap參與TPT挖礦
      • ☑️Transit Swap 使用教程
      • ☑️在TP錢包使用DApp List
      • ☑️TP插件錢包使用Opensea購買NFT
      • ☑️Quavo的首場元宇宙演唱會
      • ☑️Let me speak新手教程
      • ☑️在TP錢包Mint首屆NFT參賽皮膚
      • ☑️如何在TP錢包轉賬NFT資產
      • ☑️Transit首屆聚合交易大賽(火熱進行中)
      • ☑️X2Y2-NFT市場使用教程
      • ☑️TP錢包新春皮膚,快來Mint
      • ☑️TP钱包皮肤免费Mint
      • ☑️Opensea購買NFT流程
      • ☑️Opensea創建NFT流程
      • ☑️如何通过App Store已购记录恢复安装TP钱包
      • ☑️TP钱包合规版本“发现”界面功能如何使用
      • ☑️如何验证你的App Store版TP钱包是否正版
      • ☑️如何验证你的Google Play版TP钱包是否正版
      • ☑️如何在Opensea上挂单Meelon?
    • 🔝铭文、BRC-20相关教程
      • ☑️NOSTR Fair Mint 第一阶段参与教程
      • ☑️IOST铭文Mint教程
      • ☑️IOST铭文Mint教程
    • 🎊应用连接插件钱包
      • ☑️在zetahub赚取积分
      • ☑️使用TokenPocket添加和使用ETF钱包
      • ☑️使用BSC浏览器代币授权管理
      • ☑️Dtools初体验
      • ☑️ApeSwap使用教程
      • ☑️Syndicate操作教程(空投概率较大)
      • ☑️Wazirx操作教程(移動端)
      • ☑️Wazirx操作教程(插件版)
      • ☑️Cheers UP註冊“白名單”教程
      • ☑️ClaimSwap操作指南
      • ☑️dfox版本更新內容簡介2021/12/25
      • ☑️The Crypto You遊戲試玩
      • ☑️TP插件钱包使用教程
      • ☑️Mirror使用初体验
      • ☑️INBOX一款钱包之间的端到端加密通信应用
    • 🪃Transit Swap 相關教程
      • ☑️使用Transit Swap兑换Bitlayer的BTC
      • ☑️EOS主网资产兑换EOS-EVM资产
      • ☑️使用Transit Swap兑换SOL链代币
      • ☑️在Transit Swap購買SHIT
      • ☑️跨链兑换未到账解决方案
      • ☑️使用Transit進行OP代幣兌換
    • 📶TokenPocket新功能介绍
      • ☑️小额资产转账记录优化
      • ☑️固定矿工费功能介绍
    • ♨️热门项目教程
      • ☑️热门项目--XEN领取、挖矿教程
    • ♻️Bitlayer生态挖矿节
      • ☑️如何快速跨链Bitlayer资产
      • ☑️如何参与AVALON
      • ☑️如何参与PELL
  • 🔔English Course
    • 💠Base Mainnet & Onchain Summer
      • 01--Onchain Summer
      • 02--Onchain Summer
    • ✈️Airdrops
      • ✅Check your eligibility for Dymension (DYM) airdrop.
      • ✅Join the ZKFair Gas Fee Airdrop
      • ✅Blast Airdrop Participation Details Process
      • ✅TipCoin Airdrop Tutorial
      • ✅TipCoin Airdrop Tutorial
      • ✅SPACE ID Airdrop Token Claiming Tutorial
      • ✅Arbitrum to Airdrop New Token and Transition to DAO
      • ✅Blur Airdrop 3 Participation Tutorial
      • ✅How to Claim Uniswap NFT Airdrop on TP Wallet
      • ✅How to Mint BAB Token through TokenPocket
      • ✅A Guide to Claiming Optimism Airdrop
      • ✅ApeCoin Token Airdrop Rules and Claim Tutorial ApeCoin
      • ✅How to Claim $SOS?
      • ✅How to mint the Meelon?
    • 👩‍💻DAO
      • ✅The execution model, advantages, and disadvantages of Permit2.
      • ✅How to Participate in the DAO project donation on the Juicebox
    • 🎮GameFi
      • ✅TinyWorld GameFi First Experience
      • ✅Elfin Kingdom game demo
      • ✅Sunflower Farmers Game Demo
      • ✅Dream Card Demo
      • ✅StarMon Tutorial—Game
      • ✅How to register and log in Monaco(beta)?
      • ✅Game Test Series: Worldwide Webb
      • ✅INBOX Is an End-to-end Encrypted Communication Application Between Wallets
    • ⚠️TokenPocket Security Tips
      • 💖Transit Hacked Assets Claiming Tutorial
      • ❤️Token Contract Security Detection Tool Online
      • ❤️How to use Ethereum Token Approval Checker
      • ❤️Beefy Approval Management Tutorial(for PC)
      • ❤️Beefy Approval Management Tutorial(for mobile)
      • ❗Be wary of new ways of stealing tokens
      • ❗Quickly spot scams in blockchain
      • ❗How to prevent malicious approval
      • ❗Be careful! phishing wallet scam on TRON chain
      • ❗Beware of the Fishing SCAM!
      • ❗Be aware of the call smart contract SCAM!
      • ❤️Let’s Report Fake TokenPocket Links in Google Search Together
    • 🔁Deposit/Withdraw Crypto on Exchange
      • 🔱Binance
        • ✅ETH(zkSync Era )Token Deposit
        • ✅ETH(zkSync Era)Token Withdrawal
        • ✅APT (Aptos) Token Deposit
        • ✅APT (Aptos) Token Withdrawal
        • ✅Withdrawal of WAX (WAXP) ERC20 tokens
        • ✅Deposit of WAX (WAXP) ERC20 tokens
      • 🔱Bitfinex
        • ✅How to Deposit Crypto on Bitfinex​​
        • ✅How to Withdraw Crypto on Bitfinex​​
      • 🔱Coinbase
        • ✅How to Withdraw Crypto on Coinbase​​
      • ✅How to deposit to OKX through TokenPocket wallet
      • ✅How to deposit to Binance through TokenPocket wallet
    • 📱TokenPocket Tutorial
      • ✅Unichain Cross-Chain Guide
      • ✅LNFI Usage Guide
      • ✅Using TokenPocket to Add World Chain
      • ✅Connect token WCT airdrop registration
      • ✅BiHelix Market User Guide
      • ✅Sun Pump User Guide
      • ✅Cross-chain Tutorial Using Meson
      • ✅Using the Owlto Finance Cross-Chain Tutorial
      • ✅Scallop (sui) User Guide
      • ✅Birdeye User Guide
      • ✅Orca User Guide
      • ✅jito User Guide
      • ✅ZKF Token Staking Tutorial
      • ✅Marginfi User Guide
      • ✅Raydium Usage Guide
      • ✅Jupiter Tutorial (TokenPocket)
      • ✅PSBTS Rune Minting Tutorial
      • ✅Deposit and Withdrawal Tutorial for Nostr Assets
      • ✅Using FacetSwap in TokenPocket
      • ✅Forging TRON inscriptions using TokenPocket.
      • ✅Using the TP Wallet to trade cryptographic assets on Magic Eden.
      • ✅Using the TP Wallet to trade cryptographic assets on iDclub
      • ✅Trading encrypted assets in Element using TP Wallet
      • ✅Give encouragement and feedback to TP Wallet on the App Store.
      • ✅Friend.Tech User Guide (WEB Version)
      • ✅Friend.Tech User Manual
      • ✅TokenPocket data backup tutorial (iOS)
      • ✅How to claim $Core on TokenPocket?
      • ✅MM Finance User Guide (Polygon)
      • ✅Use Transit Swap to Bridge HECO chain tokens
      • ✅How to Participate in ETH 2.0 Nodes
      • ✅How to quickly transfer the tokens on SOL chain to TokenPocket
      • ✅How to use MojitoSwap
      • ✅How to turn on “Dark Mode” in TP wallet
      • ✅Be careful! phishing wallet scam on TRON chain
      • ✅Exchange & Stake TPT on Biswap DEX
      • ✅Notes for Exchanges Withdrawal
      • ✅How to use Dapp List in TP wallet
      • ✅Quavo's First Metaverse Concert
      • ✅How to transfer NFT assets in TP wallet
      • ✅Mint the First Skin NFT Competition Works in TP wallet
      • ✅Manage approval with Cointool
      • ✅Transit's First Aggregate Trading Carnival (going on)
      • ✅Guide to X2Y2-NFT Marketplace
      • ✅TP wallet NFT skin for Chinese New Year, come to Mint
      • ✅TokenPocket Wallet Skin Free Mint
      • ✅How to place an order of the Meelon on Opensea?
      • ✅How to Claim $RADAR Airdrop by Using TokenPocket?
      • ✅How to Create/Import Optimism Wallet Using TokenPocket?
      • ✅How to Identify the Authenticity of TokenPocket on App Store?
      • ✅How to Get A Dungeons Using TokenPocket?
    • 🔝Inscription and BRC-20 Tutorial
      • ✅How to participate in NOSTR Fair Mint
      • ✅IOST Inscription (Mint) Tutorial
    • 🖱️Usage experience sharing
      • ✅Earn points on Zetahub.
      • ✅How to use BscScan Approval Checker
      • ✅Syndicate Operation Tutorial (Airdrop likely)
      • ✅ClaimSwap Operation Guide
      • ✅Game Play Experience: The Crypto You
      • ✅Usage Experience - Mirror: Writing as usual. Publishing like never before
    • 🪃Transit Swap
      • Page
      • ✅Exchange of assets between the EOS mainnet and EOS-EVM.
      • ✅Buy SHIT through Transit Swap
      • ✅Trade OP on Transit Swap
    • 📶Introduction of new features on TokenPocket
      • ✅Introduction to fixed gas fee function
    • ♨️Popular Projects Tutorial
      • ✅Popular items - XEN pickup, mining tutorials
    • ♻️Bitlayer Mining Gala
      • ✅How to quickly cross-chain Bitlayer assets
      • ✅AVALON Use Guide
      • ✅Pell Use Guide
  • 🇰🇷KOREAN COURSE
    • 💬타이니 월드 GameFi 첫 경험
  • 🇮🇳INDIAN COURSE
    • Page 1
由 GitBook 提供支持
在本页
  • About Permit2
  • Traditional authorization model
  • Permit (EIP-2612) mode
  • Permit2 Authorization Model
  • Possible Risks of Permit2
  1. English Course
  2. DAO

The execution model, advantages, and disadvantages of Permit2.

上一页DAO下一页How to Participate in the DAO project donation on the Juicebox

最后更新于2年前

About Permit2

Uniswap has just released a new token authorization standard, Permit2, which differs from the traditional ERC20 and EIP-2612. Permit2 allows users to avoid the need for a chain-level "approve" operation before interacting with different DApps, allowing the DApp protocol to first acquire your token authorization. According to the description, the new Permit2 protocol has the advantages of saving gas, allowing for batch operations of authorization/transfers and being more flexible than traditional ERC20 approve, and supports one-stop authorization management.

Uniswap initially conceived Permit2 and Universal Router to improve its own product, optimize gas costs, simplify the user transaction process, and enhance security. During the conceptual process, Uniswap felt that other applications could greatly benefit from integrating these contracts. Uniswap itself is dedicated to building public infrastructure, so it designed these contracts to be available for use by the entire developer ecosystem, including extensive documentation and SDKs.

To illustrate how revolutionary Permit2 is, let's review the previous solutions by taking the example of a contract that needs to move tokens held by Alice.

Traditional authorization model

The traditional way of execution is as shown in the following diagram.

  1. Alice calls the approve() function on the ERC20 to grant the contract a controlling limit.

  2. Alice calls an interaction function on the contract, which in turn calls transferFrom() on the ERC20 token contract to move her tokens. It is evident that this model is feasible (as it is widely existent) and can ultimately be very flexible, as the protocol can continually access the user's tokens for an extended period of time.

The authorization contract is granted the authority to control the maximum amount of tokens by default, without any time limitations. Each DApp requires a one-time authorization for the first execution, which poses significant risks.

But it faces two well-known real-world problems:

1、Poor user experience: Users must grant authorization for each new protocol they intend to use on each token, which is almost always a separate transaction (for example, executing a token authorization in Uniswap, but still having to reapprove if using Transit).

2、Poor security: Contracts usually require an unlimited authorization limit, and an approve must be executed every time a swap or other contract is used. This means that if the protocol is exploited, every user who has authorized the protocol to consume their tokens could have all of their authorized tokens transferred. (For example, we often encounter token usage authorization, such as authorization to operate DeFi, authorization to exchange, and authorization for first-time use of different DApps)

Permit (EIP-2612) mode

EIP-2612 iterates on token authorization. Users can interact with the application contract by attaching an authorization signature (Permit) information in their transaction, without having to pre-authorize.

Let's take a look at the methods enabled by the EIP-2612 extension of ERC20, which is usually like this:

  1. Alice signs an "permit" message off-chain, indicating that she wishes to grant a contract the right to use a (EIP-2612) token.

  2. Alice submits the signed message as part of her interaction with the said contract.

  3. The contract calls the "permit()" method on the token, which uses the signature authorization information and signature to grant the contract a permission.

  4. The contract now has permission, so it can call transferFrom() on the token, transferring tokens held by Alice.

Due to the requirement of EIP-2612 (Permit) to have the related methods written inside the ERC20 token contract, existing deployed ERC20 contracts cannot be supported.

This resolves two problems with the typical ERC20 authorization method:

1、The user does not need to submit an additional approve() transaction on-chain.

2、Since one on-chain operation is omitted, a typically more reasonable authorization amount can be chosen instead of unlimited, and more importantly, an expiration time can be set when signing the authorization message.

While EIP-2612 makes token authorization more secure, tokens released before EIP-2612 do not support signature authorization and not all newer tokens have adopted this feature. Therefore, the protocol is not widely used.

Permit2 Authorization Model

Permit2 combines both models, extending the user experience and security advantages of EIP-2612 to also cover standard ERC20 tokens。

  1. Alice calls approve() on an ERC20, in the typical way, giving Permit2 contract a limitless authorization.

  2. Alice signs a Permit2 message off-chain, indicating that the protocol contract is allowed to transfer tokens on her behalf.

  3. Alice calls an interaction function on the protocol contract, passing in the signed Permit2 message as an argument.

  4. The protocol contract calls permitTransferFrom() on the Permit2 contract, and Permit2 contract uses its authorization (granted in 1) to call "transferFrom()" on the ERC20 contract, transferring tokens held by Alice.

By granting authorization to Permit2, DApps that use the Permit2 protocol only need to perform a 712 local signature once, eliminating the need for additional chain-level approve and reducing Gas fees, while increasing usability and security. The authorization is time-limited, for example if granted for a month, then after the month expires, it only requires one 712 signature to be used again.

The protocol will not directly call the transferFrom() on the ERC20 token to execute the transfer, but instead will call the standard Permit2 contract's permitTransferFrom(). Permit2 sits between the protocol and the ERC20 token, tracking and validating the permit2 message, and then ultimately using its authorization to directly execute the transferFrom() call on the ERC20. This indirectness allows Permit2 to extend the benefits similar to EIP-2612 to every existing ERC20 token.

Possible Risks of Permit2

Permit2 is derived from EIP 2612 and is an extension of the EIP 20 protocol, so ultimately, Permit2 is just a supplement to ERC20, not a replacement. After all, Permit2 doesn't inherit all existing ERC20 data, and the so-called one-stop management still requires calling the approve function of the ERC20 contract to complete some initial operations.

The complete process of Permit2 should be:

  1. The user grants the maximum authorization of ERC20 tokens to the Permit2 contract.

  2. The user manages specific authorizations through the permit function in the Permit2 contract.

  3. Third-party protocols and users can transfer tokens through the Permit2 contract as an intermediary based on the authorization information already available in Permit2.

Advantages of the Permit2 protocol:

  1. Unified token management

  2. Controllable authorization time

  3. No need to send a transaction for authorization every time

Possible risks of the Permit2 protocol:

  1. Although it claims to solve the infinity approval problem, it only transfers the authorization object from the interacting DApp to the Permit2 contract, and the security of the Permit2 contract requires higher standards for centralized management of authorizations.

  2. Although the token authorization has an expiration time, this time can still be unlimited, and Dapps still need to set reasonable expiration times.

  3. Because the permit function call process can be performed without sending a transaction, just providing a signature to a third party for forwarding, it can be more concealed if it is used for phishing. The cost of checking the signature message increases, and some third-party wallets may not decode and display the signature information, increasing the risk of user attack.

Advantages and risks exist at the same time, which requires us to have certain discernment ability. Specifically, the wallet also needs to have a prior prevention for the possible large-scale support of Permit2 in the future (TokenPocket does not yet support the parsing of Permit2, but will soon). For example, TokenPocket's current authorization risk warning pop-up windows can display the risk content well, thus avoiding risks such as phishing or malicious authorization from third parties.

Do not open unknown websites and execute them recklessly. Be sure to use regular DApps and control the amount of tokens granted to contracts as much as possible. Regularly use authorization check tools for inspection.

🔔
👩‍💻
✅