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

  • Hong Kong's financial industry may study launching stablecoin trading desks and institutional custody services

    Hong Kong Monetary Authority recently announced the list of participants in the stablecoin issuer sandbox, including JD Coin Chain, Circle Coin Innovation, Standard Chartered Bank, Anni Group, Hong Kong Telecom and other institutions. Research reports released by Zeng Shengjun, a researcher at the Greater Bay Area Financial Research Institute of the Shenzhen Branch of Bank of China, and Guan Zhenqiu, a researcher at the Hong Kong Financial Research Institute of Bank of China, analyzed that the Hong Kong dollar stablecoin can improve the efficiency and inclusiveness of the Hong Kong financial system. Its stability, free convertibility, high security, high open source and cross-border mobility can provide support for a wider range of financial innovations.

  • Bitcoin scaling network Mezo completes $7.5 million in financing, led by Ledger Cathay Fund

    Bitcoin scaling network Mezo has completed a $7.5 million financing round, with Ledger Cathay Fund leading the investment and Mantle EcoFund ecosystem projects from ArkStream Capital, Aquarius Fund, Flowdesk, GSR, Origin Protocol, and Bybit participating. This round of financing brings its total funding to $30 million.The new funds will be used for Mezo's plan to expand the adoption of its network, including integrating more products into its network, such as its Bitcoin staking platform Acre.

  • As of July 25, BlackRock IBIT held more than 338,000 bitcoins, an increase of more than 1,092 bitcoins from the previous day.

    BlackRock's official update on the Bitcoin ETF shows that as of July 25th, the market value of IBIT has reached $21,890,121,436.41, and the position has increased to 338,128.5551 BTC, an increase of 1,092.7881 BTC from the previous trading day.

  • The U.S. core PCE price index rose 0.2% in June, compared with expectations of 0.1% and the previous value of 0.10%.

    The US core PCE price index for June was 0.2%, exceeding expectations of 0.1% and the previous value of 0.10%; the US core PCE price index for June recorded a year-on-year increase of 2.6%, higher than expected. The US core PCE price index for June recorded a monthly rate of 0.1%, unchanged from the previous month and in line with expectations.

  • LayerPixel Completes $2 Million Seed Round Led by Kenetic Capital

    LayerPixel, a DeFi solution based on TON, announced the completion of a $2 million seed round of financing, led by Kenetic Capital, with participation from Foresight Ventures, Waterdrip Capital, VentureSouq, Web3 Port Foundation, Microcosm Research, TMM Club, and dozens of angel investors. It is reported that this funding will help LayerPixel accelerate the development and integration of its DeFi solution suite in the Telegram Mini App ecosystem, fundamentally changing the way users interact with decentralized finance in the Telegram environment.

  • Grayscale GBTC holdings are approximately 271,200 BTC, and the number of ETHE shares in circulation has fallen below 300 million

    Official data from Grayscale shows that as of July 25th, Grayscale GBTC holds 271,212.2467 BTC, a decrease of 410.3257 BTC from the previous trading day, with an asset management scale (non-GAAP) of $17,542,084,056.48 and a circulation share of 306,180,100 shares; Grayscale ETHE holds 2,391,684.2607 ETH, a decrease of 97,390.7166 ETH from the previous trading day, with an asset management scale (non-GAAP) of $7,468,775,526.14 and a circulation share of 282,168,500 shares; Grayscale ETH holds 310,308.0733 ETH, an increase of 13,663.3797 ETH from the previous trading day, with an asset management scale (non-GAAP) of $969,033,154.46 and a circulation share of 329,308,500 shares.

  • US Senator Withdraws Support for Elizabeth Warren's Anti-Crypto Bill

    On July 24th local time, Republican Senator Roger Marshall withdrew his support for the "Digital Asset Anti-Money Laundering Act," which he and Democratic Senator Elizabeth Warren jointly formulated for 2022, aimed at regulating the cryptocurrency industry under existing anti-money laundering and anti-terrorism financing frameworks. Currently, according to the official congressional record on the bill, there are still 18 senators supporting the bill.

  • Web3 startups raised $3.7 billion in funding in the first half of 2024, showing signs of recovery

    According to the latest report from Crunchbase, Web3 startups raised $3.7 billion in the first half of 2024. Although this number decreased by 18% compared to the first half of 2023, it increased by 42% compared to the second half of last year. Quarterly, Web3 startups raised over $2 billion in the second quarter of 2024, slightly higher than the $1.8 billion raised in the first quarter, but down 18% from the $2.2 billion raised in the same period last year. However, after eight consecutive quarters of decline, Web3 startups have seen two consecutive quarters of funding increases. In addition, although the total amount of funding has increased, there have been few large financing rounds, with only seven rounds raising over $50 million.

  • Cointime July 7th News Express

    1, Ethereum L2 TVL rebounds slightly to above $39 billion

  • nftperp: All funds lost due to the vulnerability have been successfully recovered

    nftperp, an NFT perpetual contract trading platform, announced on X platform that all funds lost due to a vulnerability have been successfully recovered. The developers are currently prioritizing the restoration of contracts to ensure that trading and withdrawals can proceed normally. Due to some differences in marked prices and index prices, methods for securely restoring trading are being sought. For clarity, we will soon release details of what happened in the past 20 hours. Previously, nftperp stated that a serious error was found in one of its contracts (clearingHouse), and all vulnerable contracts have been suspended until further notice.