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

  • Zuckerberg Directs Meta to Develop Prediction Market Application

    On June 24, The New York Times reported that Zuckerberg has instructed Meta to develop a prediction market application. The internal name for the application is 'Arena', which is similar to Polymarket or Kalshi.

  • U.S. Senate Passes Resolution Aiming to Limit Trump's War Powers Against Iran

    On June 24, the U.S. Senate passed a resolution regarding war powers related to Iran, with 50 votes in favor and 48 against, following a similar approval by the House of Representatives. This marks the first time such a resolution has been approved by both chambers of Congress. The resolution calls for the president to end military actions against Iran without a declaration of war or authorization of force from Congress. However, since this resolution is a joint resolution of Congress, it is not legally binding and does not require the president's signature, thus serving mainly a symbolic purpose.

  • AI Smart Terminals Experience Full Explosion

    On June 23, according to CCTV Finance, at the fourth Chain Expo, the original "Digital Technology Chain" was upgraded to the "Smart Technology Chain." This change in wording reflects that artificial intelligence is becoming the main character in the industrial chain. A newly established AI zone at the event gathered leading AI companies from both domestic and international markets, showcasing the entire chain from data and computing power to applications. Various AI products were on display, including AI glasses, smart cars with digital chassis, and humanoid robots that can play soccer. CCTV Finance reporters observed that the integration of artificial intelligence into the physical world is transitioning from mobile phones and computers to various new smart terminals. This year, the application of AI agents has also experienced a full explosion. Qian Kun, Senior Vice President of Qualcomm, stated that the empowerment of AI agents is leading to a significant upgrade cycle for existing terminal devices. China's industrial chain is very complete, and through continuous collaboration with Chinese partners, their products can quickly reach the market and gain global acceptance. Liu Xiangwen, Vice President of Alibaba Cloud Intelligence Group, noted that AI has evolved from mere chatting to becoming a productive force. The development of all stacks, whether GPU cloud or CPU, is progressing rapidly, and there is still greater potential ahead.

  • U.S. Stock Indices Experience Short-Term Rally

    On June 23, the Dow Jones Industrial Average rose by 0.07%; the S&P 500 index narrowed its decline to 0.77%, having previously fallen over 1.5%; the Nasdaq Composite index also reduced its drop to 1.17%, after having been down more than 2.3% at one point.

  • Vitalik: Ethereum Foundation Budget Cut by 40%, Shifting to Long-term Fund Model

    On June 23, Vitalik Buterin revealed that the Ethereum Foundation (EF) will reduce its budget by approximately 40% this year. According to its previously announced financial management plan, EF is transitioning from a model where it spends about 15% of its remaining funds annually to a model where it will spend about 5% annually after 2030, moving towards a long-term donation-oriented organization. To this end, EF will adjust its multi-client model, relying more on AI-assisted formal verification. The PSE privacy and scalability exploration team will shift from 'exploration' to a focus on building around zero-knowledge proofs. The scale and losses of Devcon events will be reduced, and large projects beyond Ethereum itself will also decrease. EF's institutional work will focus on smaller-scale, replicable CROPS-friendly deployment cases.

  • Huo Qigang: In the AI Era, Our Own Judgment is Key

    On June 23, according to CCTV Finance, Huo Qigang stated that over the past year, the topic of AI has been overwhelming, shifting from 'not using AI' to 'having to use AI,' making him acutely aware that 'not participating will lead to elimination.' As a father, Huo Qigang candidly expressed the dilemma of whether parents should 'control' or 'assist' when their children use AI. He mentioned that he has already begun to assist with AI in his work, but emphasized that using AI does not mean bypassing the thinking process; one must rely on their own experience, thought, and logical judgment, and cannot simply replicate AI outputs.

  • NVIDIA's Market Value Falls Below $500 Billion

    On June 23, NVIDIA (NVDA.O) saw its market value drop below $500 billion, with a latest decline of 2.6%.

  • U.S. Manufacturing Activity Surges Beyond Expectations, But Factory Employment Falls to Six-Year Low

    Driven by companies placing orders in advance to prevent shortages and price increases, U.S. manufacturing activity expanded again in June. However, factory employment fell to a six-year low, primarily due to rising operational costs influenced by conflicts in the Middle East. The preliminary S&P Global Manufacturing PMI for June rose to 55.7 from 55.1 in May, marking the highest level since May 2022, while economists surveyed by Reuters had previously expected the index to drop to 54.8. The increase in the manufacturing PMI, combined with a rise in the services PMI from 50.7 in May to 51.3, contributed to a composite PMI output index increase from 51.5 last month to 52.2. The rebound in the services PMI is partially attributed to the World Cup events jointly hosted by the U.S., Canada, and Mexico.

  • Microsoft Completes Data Center Construction in Wisconsin

    Microsoft (MSFT.O) announced the completion of its first data center construction in Mount Pleasant, Wisconsin, USA.

  • Goldman Sachs: Brazilian Central Bank Expected to Alternate Between Rate Cuts and Holding Steady

    On June 23, Goldman Sachs' Alberto Ramos stated that the Brazilian Central Bank may alternate between pausing rate cuts and lowering its benchmark Selic rate. Last week, the Brazilian Central Bank reduced the Selic rate from 14.5% to 14.25%, and its next steps remain unclear. Amid sticky inflation and risks of economic slowdown, the meeting minutes provided some insight into the central bank's thinking. Ramos noted that intermittent rate cuts 'will lead to milder output fluctuations, with inflation converging to target levels by the first quarter of 2028.' He added, 'Overall, in the short-term trade-off between growth and inflation, Copom is more inclined to protect economic activity rather than adopt a more aggressive inflation-focused strategy.'