Vanity Gone Rogue: The Rise of Exploits Targeting Custom Blockchain Addresses

Daniel Liebau, Affiliate Faculty Member Singapore Management University and Roland Schwinn, Adviser
作者: Daniel Liebau, Affiliate Faculty Member Singapore Management University and Roland Schwinn, Adviser
发表日期: 2024年4月19日

新的区块链地址是如何生成的? 个人提供私钥, 只有他们熟悉的字符串, 剩下的就是哈希算法了. It creates a public key as a derivative from the private key. A distinct feature of the algorithm is that it uses randomness in the creation process. This randomness is critical as it ensures nobody else can guess the private key from the public key. 与此形成鲜明对比的是, 生成具有预先指定属性的公钥, 比如一个不同的字符序列(比如MOON), 应该很有挑战性. 我们喜欢这样. 随机性意味着安全性! 这就是理论. 但在实践中, freeware tools are available designed to help you do exactly that – create so-called vanity addresses.

例如, Vanity-ETH’s website states: “Vanity-ETH is an open-source tool that uses your web browser to generate Ethereum vanity addresses. Enter a short prefix and suffix of your choice and click 生成 开始.“等等,那是怎么回事?? 进一步下降, the website states: “Your browser will generate lots of random addresses until it finds one that matches your input. Once an address is found, you can choose to reveal the private key or click the 保存 按钮下载密码加密的密钥存储库文件.” Isn't this nice; now we can create addresses that look cool and are easier to memorize. It’s like requesting a specific number plate for our new car. But rogue actors can also figure out how to try to fool or even defraud regular users, which is what the remainder of this blog post will explore.

探索一个场景

现在是2024年初. 比特币去年上涨了100%以上. The Decentralized Finance (DeFi) ecosystem is gaining momentum again. 空投, 发行者分发的免费代币, drop into users’ wallets across all kinds of ecosystems. An active DeFi user is busy wiring funds across different Ethereum wallets when she notices a new transaction in her wallet software that makes little sense to her. She intuitively checks the first seven characters of the sending address and immediately recognizes it. 当然, she also confirms the last five characters of that wallet address, 他们符合她的期望.

All should be well – the address looks like one of her wallets. 但她真的创造了这笔交易吗? The transaction amount makes no sense; only a tiny fraction of ETH, 所谓的尘埃, 存入她的主钱包. 在回顾了以太扫描的更多细节之后.io, she established that the sending address in question was not hers. 怎么这么? It does look like hers; at least, the first five and seven last characters do. 通过查看整个地址, she realizes that the characters eight to thirty-seven are entirely different to hers. The first seven and last five characters are precisely what Metamask shows its users, 而不是介于两者之间的. 也许这不是巧合, 但一些无赖演员企图迷惑她, 知道她会在钱包里看到什么软件.

虚地址攻击(VAA)

The Vanity Address Attack, or VAA, is an automation to confuse regular blockchain users.

An attacker can generate seemingly similar addresses automatically, 类似于虚荣eth, 但是通过使用机器人. 除此之外, he can also automate spotting actors currently submitting transactions to the blockchain for processing just by looking at the blockchain's mempool. The mempool is a buffer that blockchains use to queue transactions before they store them immutably in the ledger later.

Identifying prey and presenting them with something familiar-looking, like an address with identical first five and last seven characters, 能在几秒钟内完成吗, 假设有足够的计算能力. 一旦攻击者识别出目标用户, 他们会向猎物的钱包发送少量ETH, and the associated transaction shows on top of the user’s transaction history. 接下来要做的就是, 由于粗心大意, a user copies the vanity address to execute their next transaction, not noticing that they are about to send a potentially large amount to a wallet she does not own.

关键
We could not find a name for this type of attack, so we can now call it the 虚地址攻击(VAA). Blockchain users today cannot rely on only checking the sequence of initial characters and the few last ones when submitting blockchain transactions. One is better off checking the entire address; this would lower the risks of attackers trying to confuse and eventually defraud users who only superficially check their addresses when transacting.

额外的资源