主流用户都能用的加密钱包长啥样?一文详解新钱包标准ERC-4337

A&T CapitalPublicado em 2022-09-20Última atualização em 2022-09-20

Resumo

幸运的是,我们已经很接近通行的智能合约标准,而这意味着用户很快就能拥有 100 倍的以太坊钱包体验!

我们需要更智能、更简便的钱包,而不是加密原生应用。

主流用户都能用的加密钱包长啥样?一文详解新钱包标准ERC-4337

作者:Todd

01目录

- 引子

- 释义:智能合约钱包、账户抽象和 ERC-4337

- 框架层面对比:EOA钱包、当前主流智能合约钱包 和 ERC-4337钱包

- 我们离普及智能合约钱包还有多远?

- EVM环境下/非EVM环境下

- 产品形态 & 价值捕获

- 尾声

02正文

引子

当前主流以太坊钱包(指EOA钱包)的用户体验很有限,以下便捷性功能都只能通过智能合约钱包来完成(一些链外辅助方案可以提供便利,但会引入不必要的外部风险,故不在本文讨论范围内)

- 无私钥&助记词体验,社交找回(e.g. Argent,Unipass)

- 批量交易(e.g. Gnosis Safe)

- 纯链上游戏中,无需多次签名(Session Key)

幸运的是,我们已经很接近通行的智能合约标准,而这意味着用户很快就能拥有 100 倍的以太坊钱包体验!

释义:智能合约钱包、账户抽象和 ERC-4337

智能合约钱包 (Smart Contract Wallet)是当前以太坊支持的两种钱包形态之一,而另一种是大众所常用的EOA钱包(e.g Metamask)。

顾名思义,前述的一切美好价值都得益于智能合约:

- 智能合约账户由其代码控制:通过对代码的编写,可以实现任意逻辑。

- 相比之下,EOA 钱包是由私钥控制的区块链上的地址,即通过私钥,用户可以从所述地址签发交易。

- 但“私钥即账户”的特性面对的限制也很明显:用户不能授权另一个密钥来为给定地址签名,也不能在其上编写自定义逻辑。

- 重要补充:智能合约钱包可以被编译成与 EOA 完全一样的体验(只有一个签名密钥,不可升级等),但反之则不行。

账户抽象(Account Abstraction)是通过省略以太坊账户体系中不必要细节,来减少复杂性并提高有效性有效地(消除了对 EOA 的需求和对智能合约钱包的特殊处理),最终为前述的有价值功能提供基础!(可参照Abstraction在Computer Science里的解释【1】)

ERC-4337是实现账户抽象效用的设计之一:

- 在不修改区块链底层核心协议的情况下实现。(ERC-4337,近期将有望跑通)

- 对区块链底层核心协议进行修改来实现。(EIP-3074,EVM 内将是中长期计划/ Starkware/ zksync 上已近乎完成)

框架层面对比:EOA钱包、当前主流智能合约钱包 和 ERC-4337 钱包

(如果对技术细节没有兴趣,可直接跳至“ERC-4337 的优势,相较于目前主流智能合约钱包”)

辅助阅读tips:

上图中,分割线将每个框架分成了三个部分:用户签名阶段,中继阶段(在交易被出块打包前),最终执行阶段(在交易被出块打包后)。希望这样的分割能让你更好的理解 。

EOA

- 一笔交易,由用户用其私钥进行标准的ECDSA签名,随后将其发送到以太坊Mempool,矿工将其打包至下一个区块内。

目前智能合约钱包

- 与EOA最大的区别:出于网络安全以及更好UX的考虑,目前的主流智能合约钱包需要建立&运营一个replayer来将用户的信息发送至最终的智能合约钱包。

- 考虑到以太坊目前主流智能合约钱包(e.g. Safe, Argent, Loopring)之中并不存在一个通行的开发标准,每个项目都必须开发&维护自己的relayer和相关的费用模块,并独立审计其采用的智能合约功能。

ERC-4337

- 与目前主流智能合约钱包最大的区别在于:

- 建立通用模块 Useroperation Mempool & Bundler 来替代每个项目独立开发的relayer模块;

- 引入Entry Point智能合约来优化用户创建新钱包体验以及智能合约钱包验证user-operation可行性等流程

- 具体流程是这样的,不同于transaction,用户发出的User Operation会汇集到User Operation Mempool,并由Bundler对数笔User Operation进行打包(并附上gas fee)后发给以太坊的transaction mempool,随后由出块节点包含至下一个区块。

- 上述打包的User Operation将由Entry Point智能合约处理,包括初次部署智能合约账户以及验证用户User Operation对象。

- 最终,用户User Operation由用户选择的智能合约钱包处理。

ERC-4337 的优势,相较于目前主流智能合约钱包

- 每个智能合约钱包无需单独运营一个relayer;

- 便捷性极强的智能合约功能模块是通用的,大量节约重新造轮子的成本;

- 通过Bundler打包后,交易的固定成本得以被摊销,最终降低用户的交易成本。

我们离普及智能合约钱包还有多远?

100% EVM 链(感谢https://hackmd.io/@erc4337 【2】)的巨大帮助)

答案是很快了。核心合约基本准备就绪,数个优秀团队即将发布生产级的ERC-4337原生客户端钱包!

要部署 ERC-4337——整个 EVM 生态系统的通用标准,需要开发几个主要模块(如上图红点所示):

① 生产级ERC-4337 源生客户端钱包

虽然 ERC-4337 没有指定签名方案,但依赖 MetaMask 为 UserOperation 使用 ERC-191 或 ERC-712 签名的 dapp 并不是最佳的用户体验。Market 需要客户端钱包通过专用的标准签名方案原生支持代理钱包地址及其 UserOperation 交易。

开发进展:

② UserOperation Block Builder Bundler

ERC-4337 网络的主要操作模式至少需要一定部分的网络块构建结构(e.g. 矿工、验证器、排序器等)才能在其公共 P2P 内存池中原生支持 UserOps,并使用这些 UserOps 创建捆绑包并包含Entry Point交易在block中。

开发进展:

③ Entry Point智能合约

ERC-4337的核心部分。

开发进展:

④ 生产级 ERC-4337 ECDSA 代理钱包智能合约

ERC-4337 的主要操作模式假设每个用户都将获得由代理钱包代表的身份。这意味着为此类钱包提供安全实施至关重要。这也意味着我们必须保证用户的代理钱包地址在整个网络中是确定性和一致的,就像 EOA 一样。

开发进展:

⑤ ERC-4337 客户端 SDK

这部分旨在使 ERC-4337 集成到各种钱包和 dapp 中尽可能简单,例如继续使用 MetaMask,同时能体验到 ERC-4337的功能。

开发情况:

⑥⑦⑧⑨...社交找回、Paymaster 以及你想要的便捷性功能

虽然这些功能不是 ERC-4337 钱包的必备部分,但 ERC-4337 钱包的价值必将建立在其之上。

开发进度:

非100% EVM L2 (e.g.Starknet)

答案是比 EVM 环境更早。目前,开发人员已经可以在测试网中使用它进行编码,并且许多强大的功能已经进入生产级。

作为非 EVM 等价区块链,Starkware 可以通过在协议级别上进行一些修改来更轻松地实现帐户抽象(与以太坊和 100% EVM 环境相比)。

StarkNet 上 Account Abstraction 的基本流程

目前,帐户抽象的进展几乎已达到可大规模推广的生产级别,且Starkware 已发布了涵盖帐户抽象改进的 StarkNet Alpha 0.10.0(受ERC-4337启发)

[DevConnect StarkNet 黑客马拉松] 期间已经出现了一些很有趣的东西:

- Session Key:通过创建存储在浏览器中的一次性签名密钥,用户只需在游戏一段时间内签一次名。这消除了玩家签署重复交易的需要。(Briq & Realms【3】)

- Dead Man's Switch:在一定的长时间内,若账户未使用,该设计允许受信任的帐户访问你钱包中的资产,并将账户所有权转交给既定人选,以此解决如果原持有人消失后的账户资产转交问题。(deadman【4】)

- 游戏工会多签系统:允许token持有者在保有所有权的情况下,在工会内开放其NFT的使用权限。(Guildly【5】)

产品形态和价值捕获

产品形态:最终可能会与当前见过的都不太一样

回想一下前述的内容,账户抽象的主要合约甚至钱包客户端SDK都会是开源的,这意味着在基于账户抽象框架来推出一个基础钱包(不含各种花样功能)是非常容易的。随后,开源社区已经有很多很棒的便捷性功能,并且可以期待还会有更多。最重要的是,这些基础钱包和便捷性功能都在同一个标准下!

- 那么,产品形式大概会是这样:任何人都可以构建一个标准化的前端,并加载一个便捷性功能的插件市场,让用户可以他们想要使用的插件,并展示当前正在使用的插件(我不是 PM 或美工,如果下图很难看,还请谅解 :)

价值捕获:我们需要再次直面公共物品的收入模式

参考前述理论,如果基础界面会沉淀为底层基础设施,而大部分的便捷性功能也都将开源,那如何做价值捕获?

- 当然,钱包可以继续通过swap功能来实现流量变现。

- 但对这些极具价值的便捷性功能而言,目前的市场缺乏针对这类公共物品的适当的激励机制,那谁来负责丰富更多的便捷性功能呢?毕竟这是智能合约钱包最重要的价值所在。

- 大众用户能习惯对公共物品的按次付费吗?

尾声

正如Vitalik多次公开对账户抽象的阐述那样:账户抽象是区块链网络进行主流人群的必经之路! 希望这篇文章能让你对它有更好的理解。

尽管仍然存在许多实际限制(e.g. 许多不支持 EIP-1271 的 dapp >>> 智能合约钱包无法与这些 dapp 进行交互),并且它不适合多链场景。但就像 L2 是以太坊的未来一样,我相信 账户抽象是以太坊钱包的未来!

当然,我也鼓励大家在多链用例中尝试 MPC 钱包,它应该是近期最好的钱包解决方案了。如果你对多链体系下的账户抽象钱包有任何想法,请联系我!

感谢 @沙漏时间@cejay@kristofgazso的帮助!

参考内容:

https://hackmd.io/@s0lness/BJUb16Yo9

https://medium.com/nethermind-eth/ethereum-wallets-today-and-tomorrow-eip-3074-vs-erc-4337-a7732b81efc8

【1】https://en.wikipedia.org/wiki/Abstraction_(computer_science)

【2】https://hackmd.io/@erc4337

【3】https://twitter.com/lordOfAFew/status/1519057227834818561

【4】https://deadman.me/

【5】https ://www.notion.so/33c8008e033d4040b9438edf5225c580

【6】https://www.stackup.sh

【7】https://www.candidewallet.com

【8】https://twitter.com/soulwallet_eth

【9】https://nethermind.io/

【10】https://github.com/NethermindEth/nethermind/tree/master/src/Nethermind/Nethermind.AccountAbstraction

【11】https://github.com/NethermindEth/mev-aa-geth

【12】https://twitter.com/infinitism8

【13】https://github.com/eth-infinitism/account-abstraction

【14】https://github.com/stackupfinance/stackup/blob/main/apps/contracts/contracts/entrypoint/EntryPoint.sol

【15】https://www.biconomy.io/

【16】https://github.com/eth-infinitism/account-abstraction

Leituras Relacionadas

Interview with NDV Founder Jason Huang: Piercing the AI Bubble and the MicroStrategy Myth, Seeking the Ultimate Edge in the Crypto Market

In a podcast with WuBlockchain, NDV founder Jason Huang discusses recent market dynamics, expressing a bearish outlook on crypto in the near term. He attributes Bitcoin's recent decline to a combination of cyclical selling pressure, the start of a US stock market correction, and liquidity tightening. A key catalyst is the emerging financial strain on MicroStrategy (MSTR). Huang explains that MSTR's model of borrowing to buy Bitcoin created a positive "flywheel" in a bull market. However, with falling BTC prices turning its stock premium into a discount, the model is now under severe stress. While MSTR only sold 32 BTC recently, the market is "front-running" the fear of its massive 80,000+ BTC holdings potentially being liquidated to meet debt obligations. He believes a true market bottom requires a major, capitulation-level event similar to the FTX collapse. Regarding investments, Huang states his fund is up over 20% this year, outperforming Bitcoin by 50-60%. The strategy involves crypto assets and commodities like oil, gold, and silver, but avoids AI stocks due to a perceived lack of trading edge. He is cautious of crowded trades in semiconductors and sees bubbles in the broader market, citing the hype around a potential SpaceX IPO. Despite short-term pessimism, Huang remains long-term bullish on one crypto innovation: stablecoins. He views them as the clearest example of a "faster, better" financial tool with significant room for global adoption. For the future, he is very bearish on Ethereum. For Bitcoin, he anticipates potential for a significant drop below $48,000 before a eventual rebound, but stresses the need to wait for a true panic-driven bottom marked by widespread despair and disinterest in the market.

marsbitHá 21m

Interview with NDV Founder Jason Huang: Piercing the AI Bubble and the MicroStrategy Myth, Seeking the Ultimate Edge in the Crypto Market

marsbitHá 21m

Conversation with Jason Huang, Founder of NDV: Puncturing the AI Bubble and the MicroStrategy Myth, Searching for the Ultimate Trump Card in the Crypto Market

In a podcast interview, NDV founder Jason Huang discusses the recent crypto market downturn, attributing the initial phase to typical Bitcoin cycle selling pressure, now compounded by a US stock market correction, tightening liquidity, and MicroStrategy's financial strain. He argues the market hasn't bottomed yet, noting true bear market lows often require a major, despair-inducing event like FTX's collapse. Huang details MicroStrategy's precarious position: its debt-and-equity fueled Bitcoin buying model has reversed into a negative cycle as prices fell. He interprets its sale of just 32 BTC as a signal prioritizing creditors over shareholders, sparking market "front-running" of its larger potential sell-off. A true bottom may arrive only after MicroStrategy resolves its looming debt payments, possibly via a large, private Bitcoin sale. His fund is up ~20% this year, outperforming Bitcoin by 50-60%, by shorting crypto and trading commodities like oil and gold. He avoided AI stocks despite being a heavy user, citing a lack of trading edge in the crowded semiconductor hardware trade, which he views as ripe for a significant correction. Long-term, Huang remains bullish on stablecoins as crypto's clearest, most practical innovation with high growth potential. He is very bearish on Ethereum and skeptical that Bitcoin has found its floor, suggesting $48,000 may not hold. He expects a sharp decline followed by a strong recovery within a year, but only after a major panic event leads to widespread capitulation and despair—the true hallmark of a market bottom.

链捕手Há 27m

Conversation with Jason Huang, Founder of NDV: Puncturing the AI Bubble and the MicroStrategy Myth, Searching for the Ultimate Trump Card in the Crypto Market

链捕手Há 27m

U.S. Stocks Trend (June 24): Korean Stock Plunge Ripples Global Chip Sector, Micron Tumbles Over 10%, Long-Term Supply Certainty Faces a 'Hard Test'

US Stock Market Trend (June 24): South Korean Market Plunge Disrupts Global Chips, Micron Drops Over 10%, Long-Term Supply Certainty Faces Hard Test On Monday, the South Korean KOSPI index plunged 10%, with SK Hynix and Samsung dropping over 12%, triggered by rumors that SK Hynix might slow its HBM4 production expansion. This shock quickly spread to the U.S. semiconductor sector. Micron plummeted 13.18% to $1,051.77, SanDisk fell 13.64%, and Marvell declined 8%. The Philadelphia Semiconductor Index closed down 7.87%, while the Nasdaq fell 2.21% to 25,587.04 points. The sell-off particularly hit memory chip stocks. Defensive sectors showed relative resilience, with gains in stocks like IBM and Johnson & Johnson. Market volatility spiked, with the VIX index jumping 12.79%. Commodities weakened, with WTI crude oil hitting a near three-month low and gold falling below $4,100. The core issue is not a challenge to AI demand itself, but a market reassessment of overly optimistic capacity expectations for memory chips, especially HBM. The rumor about SK Hynix undermined perceived certainty in the AI infrastructure cycle. Key upcoming events include Thursday's PCE inflation data, which will influence Fed rate expectations, and Micron's earnings report. The market will focus on Micron's HBM gross margins and its long-term capacity guidance. The shift indicates the AI investment cycle is moving from euphoria to rational pricing. Large institutions are questioning the sustainability of AI-related capital expenditure growth. Micron's repricing from an "AI infrastructure staple" to a more cyclical stock highlights this change. Thursday's data and earnings represent a critical juncture for assessing long-term supply certainty, which has now significantly decreased.

marsbitHá 35m

U.S. Stocks Trend (June 24): Korean Stock Plunge Ripples Global Chip Sector, Micron Tumbles Over 10%, Long-Term Supply Certainty Faces a 'Hard Test'

marsbitHá 35m

Preferred Stock Is Not the Trigger for Corporate Bankruptcy, MicroStrategy's Dollar Reserves Can Cover Dividend and Interest Payments Until February 2027

Preferred Shares Are Not the Catalyst for Corporate Bankruptcy; MicroStrategy's Dollar Reserves Can Cover Dividend and Interest Payments Until February 2027. This article analyzes the nature of preferred shares used by MicroStrategy (MSTR). Legally equity but economically similar to debt, these shares, including its Bitcoin-linked STR convertible preferred notes (STRC), offer fixed or floating dividends. Crucially, MicroStrategy's preferred shares lack rigid redemption clauses, meaning they are not classified as traditional debt. This eliminates principal repayment pressure and means missed dividends do not constitute default or trigger bankruptcy, creating a "self-contradictory virtuous cycle." The article clarifies that if funds are short, MicroStrategy can defer or suspend preferred share dividends (except for non-cumulative types like STRD) without immediate risk. The real potential crisis point lies with its convertible bonds. If a prolonged bear market prevents conversion, MicroStrategy might need to sell Bitcoin to repay these bonds starting from the earliest maturity in September 2027, potentially creating a downward spiral. Preferred dividend suspensions would only exacerbate market panic in such a scenario. Recent financial activity shows MicroStrategy strengthened its position through four weeks of common stock (MSTR) issuances, raising over $851 million without issuing new preferred shares. It increased its dollar reserves to approximately $1.4 billion, which is sufficient to cover all preferred share dividends and interest until around March 2027. While Bitcoin purchases slowed recently, this prioritization of cash reserves enhances the company's near-term financial safety. The analysis concludes that if the Bitcoin bear market ends by early 2025 as anticipated, MicroStrategy can resume issuing MSTR stock in a rising market to replenish reserves and manage future dividend obligations, thereby reducing the long-term pressure from its preferred share structure.

marsbitHá 1h

Preferred Stock Is Not the Trigger for Corporate Bankruptcy, MicroStrategy's Dollar Reserves Can Cover Dividend and Interest Payments Until February 2027

marsbitHá 1h

Trading

Spot
Futuros
活动图片