Cointime

Download App
iOS & Android

What Is Sleepminting And Will It Ruin NFT Provenance?

published 2021-04-22 by timdaub

Today, while browsing /r/ethereum, I stumbled upon an impersonation attack using NFTs called "sleepminting." I ended up taking a closer look as I wanted to understand the idea of the attack. Here's how it works.

The Bait

Oh, look, it's beeple's multi-million dollar piece "the first 5000 days" for sale on rarible. Check the screenshot, It clearly says "Creator: beeple." Wow, Metakovan must have gotten badly rekt having to sell that $69M combo-breaker for a handful of WEIs.

Please don't fall for it! It's a scam. Or shall I saw an art piece? That's right! Its creator, Monsieur Personne, that also goes by the self-proclaimed alter ego The Banksy of NFTs, deliberately minted the piece under beeple's name using a technique he calls sleepminting. Why? Because Monsieur is disappointed in NFTs. So how did he do it?

The Basics

NFTs are created using ERC-721 smart contracts. They the ownership record of NFTs as a list of pairs. One address and a piece's serial number make up a pair. Like this (I replaced "Bob" with "Booble"):

  • Alice: 1
  • Booble: 2
  • Malory: 3

Upon a sale, Alice can transfer her piece to Boople by:

  • transfer 1: Alice ==> Booble

Now, the list of pairs is updated as follows:

  • Alice:
  • Booble: 2, 1
  • Malory: 3

In Ethereum, we don't use clear names for identification but addresses. And we need to sign transfers to authorize them. But in the examples provided in this post I'll use clear names to simplify explaining.

Now, usually developers implement ERC-721 contracts in a reasonable way. As we expect Alice can then only transfer a piece if she owns it and can deliver a valid signature. But what happens if a developer doesn't respect this convention?

See, the ERC-721 standard is just a social contract that defines a interface to allow art platforms to interoperate. There's no criteria for what's a good and what's a bad implementation. As long as a contract's interface matches that of an ERC-721 contract, any machine is considering it as valid.

But, as we've now seen, that can lead to safety issues with NFTs' provenance on Ethereum. It can be tampered with!

The Attack

As I said, any reasonable ERC-721 contract would allow a minter only to mint to themselves and to only transfer the pieces they own.

But say we customize our ERC-721 contract such that we can mint to other accounts. And say that we adjust the transfer function so that our account can, in a minor exception, also transfer another person's pieces. Well then, we can build a contract that allows us to sleepmint pieces. So as the attacker Malory, we'd do the following: We'd mint a piece with the serial number 1 to Booble:

  • mint 1: address(0) => Booble (executed by Malory)

Now our pairs look as follows:

  • Alice:
  • Booble: 1
  • Malory:

Then, since Malory has adjusted the contract to transfer the piece with serial number 1 from Booble's account to any other account, she can offer it for sale on an NFT platform like rarible.

As she minted from address(0) to Booble as "Creator: Booble" is displayed.

Once Malory successfully deceived a buyer, she receives her Ethers and transfers the piece to the buyer:

  • transfer 1: Booble => Buyer (executed by Malory)

The updated ownership record now reads:

  • Alice:
  • Booble:
  • Malory:
  • Buyer: 1

And with that, Malory has successfully tampered with the NFT's provenance record to sell her piece for more than it's worth.

The Specifics

So is this attack breaking NFTs? Should you panic sell your collection of crypto punks? What about poor Metakovan. He rekt now?

I'd say no. Sure, rarible and Etherscan state wrongly that beeple has minted a piece that genuinely he didn't. However, that's more of an interface issue than it is a security vulnerability. Nobody ever had access to beeple's account.

Also, the impersonater can be spotted when taking a closer look at the origin transactions:

Let's take a closer look at these transactions.

For the mint transaction, we can see that Etherscan displays two "From" fields: One for which msg.sender sent the transaction and another one to state the NFT's sender.

For the transaction's from field, the msg.sender, it cannot be manipulated as it requires a valid signature from the sender's private key. The authorization of the "From" field for the NFT's sender is, however, subject to the smart contract's implementation and, hence, may not display authenticated information.

Simply put, the NFT's sender field could display any data an attacker picks.

Hence, to spot a sleepminted piece from an original, one has to check if both the mint transaction's sender and the NFT's sender match beeple's correct address. If not, it's a fake.

Conclusion

I love this attack. It's similar to rug pulling in that it also plays with the user's trust towards an online identity. We think, now that we use blockchain, all our web2 problems are gone. Every piece of data is authenticated and checked for authorization. But the truth is that these problems aren't gone. They've just shifted somewhere else.

We humans cannot reproduce cryptographic verification in our brains. Sure, we can be extra careful and only trust green checkmarks and lock symbols in user interfaces. But can we recompute hashes of files or the validity of a digital signature? No.

And so the rise of new attacks on web3 is inevitable. I for one am looking forward to learning from them.

NFT
Comments

All Comments

Recommended for you

  • BTC Surpasses $78,000

    Market data shows that BTC has surpassed $78,000, currently priced at $78,042.78, with a 24-hour increase of 0.69%. The market is experiencing significant volatility, so please ensure proper risk management.

  • Trump: Does Not Believe Shooting Incident is Related to Iran Conflict

    On April 26, U.S. President Trump stated (when asked if the shooting incident was related to the Iran conflict) that he does not believe so. (Jinshi)

  • Latest Progress on DeFi United Ecological Rescue Initiative: Over 100,000 ETH Raised at Designated Donation Address

    On April 26, the DeFi United ecological rescue initiative, led by Aave, continues to advance. The Arbitrum DAO has released 30,765 ETH that was frozen after the rsETH incident on April 18. Currently, the designated donation address has raised a total of 100,360 ETH to address the collateral asset gap caused by the rsETH incident. The plan aims to restore the backing assets of rsETH through multi-party collaboration, stabilize the market, and prevent the spread of bad debts across protocols. The funds will be used to support the restoration of collateral rates and to gradually normalize the market in conjunction with relevant protocols. Key contributors or participants currently include: Arbitrum DAO releasing 30,765 ETH frozen after the rsETH incident, Mantle proposing to contribute 30,000 ETH, Aave DAO proposing to contribute 25,000 ETH, Aave founder Stani Kulechov confirming a contribution of 5,000 ETH, EtherFi proposing to provide 5,000 ETH, Lido proposing to provide 2,500 stETH, and the Golem Foundation and related projects contributing a total of 1,000 ETH, among others. Additionally, LayerZero, Ethena, Frax Finance, and Ink Foundation have also confirmed their participation, although the specific amounts have not yet been disclosed. It is important to note that the progress of this rescue initiative still relies on several external key conditions, including KelpDAO's restoration of rsETH redemptions and the Arbitrum Security Council's release of frozen assets, resulting in uncertainty regarding the overall recovery time and effectiveness.

  • Trump Evacuated from White House Correspondents' Dinner Due to Security Incident

    On April 26, local time April 25, U.S. President Trump was urgently evacuated from the White House Correspondents' Dinner due to a security incident. (CCTV News)

  • Shooting Incident at White House Correspondents' Dinner; Gunman Dead

    On April 26, local time on April 25, a shooting incident occurred in the hall of the White House Correspondents' Dinner, and the gunman is now deceased. (CCTV News)

  • Trump States He Will Not Allow Banks to Undermine Cryptocurrency Market Legislation

    On April 26, CoinDesk reported, citing attendees at a Trump cryptocurrency event, that Trump stated he would not allow banks to undermine cryptocurrency market legislation.

  • Iranian Officials to Depart Pakistan Without Meeting U.S. Representatives

    On April 25, according to a reporter from the New York Post: The Iranian delegation is set to leave Islamabad, the capital of Pakistan, and has consistently emphasized that they did not meet with U.S. officials during their brief visit.

  • Foreign Media: Second Round of Iran-U.S. Talks Scheduled for April 27

    On April 25, according to New Delhi Television: The second round of talks between Iran and the United States is scheduled to take place on April 27.

  • Iranian Lawmaker: Comprehensive Plan for Managing the Strait of Hormuz Formed

    On April 25, according to a report by Iran's Mehr News Agency, Iranian Islamic Parliament member Behnam Saidi stated that Iran has developed a comprehensive plan for managing the Strait of Hormuz. In an interview with Mehr News Agency, Saidi mentioned that an important aspect of this plan is the exclusive recognition of the name 'Persian Gulf' in all correspondence and commercial documents, rejecting any other names. Vessels and ships navigating in the region must obtain permission from Iran. Sovereignty over the Strait of Hormuz will be entirely under Iran's control. He also stated that vessels identified as hostile by the Supreme National Security Council or the General Staff of the Armed Forces of Iran are not allowed to pass through the Strait of Hormuz, and Israeli vessels are absolutely prohibited from entering the area. Ships passing through the region must pay relevant fees concerning safety, environmental protection, shipping management, and licensing, with priority given to payments in rials.

  • DeepSeek Plans to Raise $1.8 Billion with a Valuation of Approximately $20 Billion

    Sources reveal that the main reason for DeepSeek's current fundraising effort is the significant recent talent loss. Several core researchers have left the company to join ByteDance, Tencent, Xiaomi, and autonomous driving company Yuanrong Qihang. Meanwhile, competitors Zhiyu Technology and MiniMax have listed on the Hong Kong Stock Exchange, and the company Dark Side of the Moon has completed three rounds of financing in the first three months of this year, with a valuation more than quadrupling since the end of last year.