白话解读Web3签名钓鱼的底层逻辑:授权钓鱼、Permit与Permit2的区别

Odaily星球日报Опубліковано о 2024-04-22Востаннє оновлено о 2024-04-22

Анотація

「签名钓鱼」目前正成为了Web3的黑客们最喜欢的钓鱼方式。

原文作者:菠菜菠菜|bocaibocai(X:@wzxznl

明明只是签了个名,我的钱怎么没了呢??“签名钓鱼”目前正成为了Web3的黑客们最喜欢的钓鱼方式,最近看余弦大佬@evilcos和各大钱包和安全公司都在不断宣传科普钓鱼签名的知识,但是每天还是有好多人被钓鱼。

菠菜认为其中一个原因就是大部分人对钱包交互的底层逻辑并不了解,并且对于不懂技术的人来说学习门槛过高,所以菠菜决定出一个图解版科普签名钓鱼的底层逻辑,并且尝试用最大白话的形式让不懂技术的人也能看明白。

首先我们要知道我们使用钱包一共只有两种操作:“签名”和“交互”。最简单直接的理解就是:签名是发生在区块链之外的(链下),不需要花 Gas 费的;交互是发生在区块链上面的(链上),是需要花 Gas 费的。

白话解读Web3签名钓鱼的底层逻辑:授权钓鱼、Permit与Permit2的区别

一般签名的使用场景是为了验证你是你,比如登入钱包,就像你如果要去 Uniswap 换 Token 的话,你需要先链接你的钱包,那么这个时候你就需要签一个名告诉网站“我是这个钱包的拥有者”,然后你就可以使用 Uniswap 了,这个步骤对区块链不会有任何数据或者状态上的变化,所以不需要花钱。 而交互的话就是当你要真正在 Uniswap 上换 Token 的时候,你需要先花一笔钱告诉 USDT 的合约:“我要用 100 USDT 换一个菠菜币,我批准你可以挪动我的 100 USDT”,这个步骤就叫做授权(approve),然后你还要再花一笔钱告诉 Uniswap 的智能合约:“我现在要用 100 USDT 换一个菠菜币了,你现在可以进行操作了”,然后你就完成了用 100 USDT 换一个菠菜币的操作。

白话解读Web3签名钓鱼的底层逻辑:授权钓鱼、Permit与Permit2的区别

简单理解签名和交互的区别之后,我们就来介绍一下钓鱼的原理,菠菜会列举三个不同的方式:授权钓鱼、Permit 签名钓鱼和 Permit 2 签名钓鱼,这三个是非常常见的钓鱼方式。

咱们先讲授权钓鱼,这是以前Web3最经典的钓鱼手法之一,顾名思义就是利用授权(approve)这个机制,之前 Uniswap 的例子告诉我们,授权就是告诉智能合约“我批准你挪动我多少 xxx 的 Token”,那么黑客就可以做一个假的钓鱼网站,有着精美的前端伪装成一个 NFT 项目,网站中间是一个漂亮的大按钮“领取你的空投”,实际上你点了之后钱包弹出来的界面实际上是让你授权你的 Token 给黑客的地址,那么这时候如果你点了确认,那么就恭喜黑客成功完成一个 KPI 了。

但是授权钓鱼有一个问题:因为要花 Gas 费,现在很多人在涉及到花钱的操作上会有所警惕,在陌生网站点击之后稍微一看就会发现不对劲,还是比较好防范的。

那么接下来就来到了今天的主角:Permit 和 Permit 2 签名钓鱼啦,是Web3资产安全领域的重灾区,为什么这么难防呢?因为每次你要使用一个 Dapp 之前一定要签名登入你的钱包,在许多人脑子里可能已经形成了一种惯性思维:”这个操作是安全的”,再加上不需要花钱和大多数人不知道每个签名背后意味着什么。

我们先来看 Permit 机制,Permit 是针对 ERC-20 标准下授权的一个扩展功能,像我们平常用的 USDT 就是 ERC-20 ,简单来说就是你可以签名批准其他人来挪动你的 Token,我们知道授权(Approve)是你花钱告诉智能合约:“你可以挪动我 xxx 数量的 Token”,那么 Permit 就是你在一张“条子”上签了个名给某一个人,这个纸上写着:“我允许某某某可以挪动我 xxx 数量的 Token”,然后这个人拿着这个“条子”给智能合约并花一笔 Gas 费告诉智能合约:“他允许我挪动他 xxx 数量的 Token”,然后你的钱就可以被其他人挪走了,在这个过程中你只是签了一个名,而背后却意味着你允许其他人去调用授权(Approve)并转走你的 Token,黑客可以做一个钓鱼网站,把登入钱包的按钮替换成 Permit 钓鱼,那么就可以轻轻松松把你的资产钓走啦。

白话解读Web3签名钓鱼的底层逻辑:授权钓鱼、Permit与Permit2的区别

那么 Permit 2 又是什么呢?Permit 2 其实并不是 ERC-20 的一个功能,而是 Uniswap 为了方便用户推出的一个功能,之前的例子讲了你要在 Uniswap 上用 USDT 换菠菜币你需要先授权(Approve)一次,然后再进行兑换,这需要花两笔 Gas 费,所以 Uniswap 就想了个办法:“你一次性把额度全部授权给我好了,每次兑换你签个名我就给你处理了”,这个功能帮助 Uniswap 用户使用的时候只需要支付一次 Gas 费即可,并且这个步骤是签名,所以 Gas 费其实不是你付的,而是 Permit 2 合约代付了,但是会从你最终兑换的 Token 里扣除掉。

但是中 Permit 2 钓鱼的条件是你曾经使用过 Uniswap,并且你还授权了无限额度给 Permit 2 智能合约,由于目前 Uniswap 默认的操作就是无限额度授权,所以其实满足该条件的用户数量还是蛮大的,同样黑客只要骗你把名签了就可以把你的 Token 转走(仅限给过授权的)。

总结一下,授权钓鱼的本质是你花一笔钱告诉智能合约:“我批准你挪用我的 Token 给黑客”,签名钓鱼的本质是你签了一张允许别人去挪动你资产的“条子”给到黑客,黑客花钱告诉智能合约:“我要挪用他的 Token 转给我”。Permit 和 Permit 2 是目前钓鱼签名的重灾区,Permit 是 ERC-20 的一个授权扩展功能,Permit 2 是 Uniswap 推出的一个新功能。

那么理解了原理,怎么防范呢? 

1.首先最最重要的就是培养你的安全意识,每一次钱包的操作都要去检查一下你在做的操作到底是什么? 

2.大资金和玩链上的钱包分离,一旦被钓鱼了可以把损失降到最低 

3.学会识别 Permit 和 Permit 2 的签名格式,只要你看到以下签名格式,那你就要警惕起来了:

Interactive:交互网址 

Owner:授权方地址 

Spender:被授权方地址 

Value:授权数量 

Nonce:随机数 

Deadline:过期时间

白话解读Web3签名钓鱼的底层逻辑:授权钓鱼、Permit与Permit2的区别

原文链接


Пов'язані матеріали

Foundation Steps Back, Ethlabs Steps Forward: Ethereum Undergoes Its Largest Restructuring in History

On June 23rd, the Ethereum ecosystem witnessed two major shifts, signaling a significant governance realignment. First, former Ethereum Foundation researchers established Ethlabs, a new independent non-profit. Backed by major ETH holders like Bitmine and SharpLink, Ethlabs aims to address practical needs for institutional adoption, including faster settlement, native asset issuance, cross-chain transactions, and mainnet scaling. Secondly, the Ethereum Foundation announced a major restructuring, laying off 54 employees (20% of its staff) to become a leaner entity focused on protocol governance and maintenance rather than being the primary builder. This move represents a pivotal correction. Criticisms had mounted over the Foundation's perceived slowness, lack of clear strategy, and over-reliance on Vitalik Buterin's influence. Ethlabs emerges as a more execution-oriented, "industrialized" layer focused on market adoption—bridging the gap between research and real-world use. Notably, Vitalik Buterin is absent from its list of supporters, interpreted as an intentional step to avoid excessive personal endorsement and allow the organization to build independent credibility. The Ethereum Foundation's downsizing and redefinition mark a retreat from its former central coordinating role. It now aims to share the "privilege of stewarding Ethereum" with other emerging groups like Ethlabs, the Ethereum Applications Guild, and The Ethereum Economic Zone. Analysts frame this dual shift as the Foundation ensuring Ethereum remains "correct" (credibly neutral), while Ethlabs must prove it remains "effective" (competitive and attractive for capital and adoption). This addresses community "shareholder-like anxiety" about ETH's market performance. While risks exist—such as concerns over shifting from Foundation centrality to large-holder influence—the consensus is that the greater risk for Ethereum was inaction, caught between technical idealism and organizational inertia. These steps aim to create a more multi-stakeholder, execution-driven future for the network.

链捕手4 год тому

Foundation Steps Back, Ethlabs Steps Forward: Ethereum Undergoes Its Largest Restructuring in History

链捕手4 год тому

Second Half of U.S. Crypto Policy: The Clarity Act Aims for 60 Votes, CFTC's "One-Person Commission" Becomes Biggest Variable

In a pivotal year for US crypto policy, the "CLARITY Act" is advancing in the Senate but faces a high hurdle, needing 60 votes to pass. Key challenges include bridging partisan divides on ethics and swaying undecided Republican senators within a tight legislative calendar of only about 40 working days. The policy "second half" involves intense negotiations on a broader framework for Web3 and DeFi, including crypto tax reforms and the Blockchain Regulatory Certainty Act. A significant uncertainty is the understaffed CFTC, operating with four commissioner vacancies, which complicates regulatory clarity. Meanwhile, the departure of key "crypto champions"—SEC Commissioner Hester Peirce and Senator Cynthia Lummis—will impact ongoing policy efforts. Industry experts are cautiously optimistic but realistic. Sara K. Weed notes that while progress is being made, CLARITY is unlikely to pass this Congress, pushing agencies like the SEC and CFTC to provide more guidance. Sulolit Mukherjee suggests meaningful crypto tax legislation is more likely to be attached to larger must-pass bills. Rashan Colbert discusses the jurisdictional debate over prediction markets, emphasizing the need for a regulatory framework that fosters their development as financial tools rather than treating them broadly as gambling. The clock is ticking, but opportunities remain for substantive progress through continued bipartisan dialogue and pragmatic efforts.

marsbit7 год тому

Second Half of U.S. Crypto Policy: The Clarity Act Aims for 60 Votes, CFTC's "One-Person Commission" Becomes Biggest Variable

marsbit7 год тому

Dan Koe's New Essay: Escaping the Fate of the Wage Slave, How to Survive the AI Replacement Wave?

Dan Koe argues that the true threat in the AI era isn't technology itself, but a reliance on others for one's livelihood and happiness. The core problem is "wage slavery"—spending life on unfulfilling work. To survive and thrive, one must escape this by building their own enterprise. The key is developing five elements: Agency (initiative), Taste (discernment), Persuasion, Persistence, and Iteration. These boil down to problem-solving skills and experiential knowledge, which cannot be learned passively but only through doing your own projects. The solution is to become "unemployable" by shifting your identity. This requires: 1) Radically changing your environment to force growth, 2) Choosing a medium (like content creation) that provides real feedback through trial and error, and 3) Mastering either code or, preferably, media (content). Content creation is more valuable because its subjective nature and need for human perspective create a durable advantage over generic AI output. To start, define your life's work by answering foundational questions about your innate knowledge, unique abilities, and contrarian beliefs. Then, immediately act by publishing your first piece of content. The cycle of creating, receiving feedback, and iterating is the essential path to developing the skills needed for an independent, meaningful career and financial resilience.

marsbit7 год тому

Dan Koe's New Essay: Escaping the Fate of the Wage Slave, How to Survive the AI Replacement Wave?

marsbit7 год тому

Research Report Analysis: Morgan Stanley Details SanDisk SNDK, The Truth About Cloud Data Center Pricing Power and AI Inference Benefits

Morgan Stanley raised its price target for SanDisk (SNDK) from $1100 to $1750 on June 22, maintaining an Overweight rating. The upgrade is driven by AI inference demand reshaping the NAND market, particularly for KV Cache and context window storage in cloud data centers. These cloud clients exhibit price inelasticity and sign long-term contracts, granting SanDisk significant pricing power. SanDisk's New Business Model (NBM) agreements, covering over one-third of FY27 bit shipments with 3-5 year terms and fixed price/price collar structures, are crucial. They are projected to sustain gross margins around 80% even at floor prices, providing a buffer against cyclical downturns. Morgan Stanley forecasts gross margins to surge from 30.3% in FY25 to 86.7% in FY27e. With NAND supply expected to remain tight into 2026/2027 and cloud/data centers becoming the largest end-market, SanDisk holds supply-side pricing power. The company targets 15-19% bit growth via technology transitions, not capacity expansion. Revenue is projected to grow ~6.6x from FY25 to FY27, with EPS rising from $2.74 to $14.73, driven by high-margin cloud business. Key upside catalysts include faster enterprise SSD adoption and edge AI growth. Downside risks involve slower industry growth, competitor capex increases, market share loss, and competition from Chinese players like YMTC. The investment thesis rests on AI-driven structural demand, NBM's margin protection, and sustained supply tightness. The $1750 target implies ~28x FY27e P/E.

marsbit8 год тому

Research Report Analysis: Morgan Stanley Details SanDisk SNDK, The Truth About Cloud Data Center Pricing Power and AI Inference Benefits

marsbit8 год тому

Торгівля

Спот
Ф'ючерси
活动图片