Cointime

Download App
iOS & Android

Creating, Destroying, and Restoring On-Chain Artwork

From Etherscan Blog by Takens Theorem

This post is about an amazing NFT project on Ethereum called “Rothko on Pennies” and the events surrounding it — including my own participation. This project and its provocations illustrate that the artistic character of a project goes well beyond just the instant glimpse of its visual form. On public blockchain, where code is (or, might be) “law,” artwork can solicit interventions, extensions, hacking. A work’s meaning evolves sometimes in surprising ways even to the original creator. And on blockchain that meaning takes technically curious forms, even using tools typically reserved for more malicious intents but deployed for better purposes: hacking art, hacking as art.

“Rothko on Pennies”

The artist Yigit Duman recently created “Rothko on Pennies” (RoP). It is a clever, playful hack of a sort: RoP encodes a rendition of Mark Rothko’s “Composition (1959)” by storing a PNG on tiny balances across almost 1,000 contracts (981 to be precise).

Rothko on Pennies by Yigit Duman, original (unaltered) version

There’s something beautiful in Yigit’s exercise. It’s most certainly a kind of exploit itself. RoP uses a clever trick to get around the strict computational limits of Ethereum mainnet. For one, Yigit exploits the precision of balances to store data (each wei is 1/10¹⁸ ether). He also uses simple balance calls across these 1,000 contracts to reconstruct the image. The balances cost mere pennies, and deploying the contracts cost less than 0.1 ETH in total (about $250 at the time of writing). Yigit’s beautiful NFT project loops through an array of contract addresses, gets their balances, and assembles a base64-encoded payload that shows the Rothko on the token’s metadata.

Yigit Duman encoded data across tiny balances on about a thousand contracts. From Etherscan.

Yigit Duman’s announcement about RoP sparked a lot of attention. Many recognized striking cleverness of the approach: a beautiful rendering of influential abstract artwork stored entirely on-chain across the dust of a thousand contracts. RoP was auctioned for 1.256 ETH, won by Serc.

But there’s a problem. Several recognized the issue right away: Contract balances can be updated, changed.

Yigit observed this issue himself. Indeed, it was by design. You change the balances (the image data!), you change the piece. He playfully taunted his audience to vandalize the artwork. The artist beckons for another performance.

Vandalizing a Rothko

I decided to vandalize the Rothko. At least, to try.

How? You can’t just send ether to Yigit’s contracts to change the balance. It’ll generate an error because these thousand little contracts don’t have a way to handle value sent to them. But there’s a trick. It’s a known vulnerability of Ethereum contracts sometimes called “force feeding.” Basically, you deploy a contract, give it some wei, then trigger that contract to selfdestruct¹ — and instruct it to send its wei to another address, the “victim.” The victim here can be any of the RoP contracts. And by disrupting RoP’s little contract balances, you disrupt the whole piece.

Fun history: This vulnerability was one of a bunch discussed in the “Mastering Ethereum” book by Antonopoulos and Wood years ago. It was fun to revisit these passages in the book, which I own and love, and see early discussion about how this is typically perceived as a potential attack surface for a hack:

You can check out this classic book’s contents here

So I could change the balances, but I didn’t want to destroy the piece. That would be easy. The vast majority of alterations to the balances would just destroy it. Instead I wanted to modify it and leave a visible alteration. To do this I found just a single byte change in the PNG that would render the image asset with a scratch. I used Etherscan’s list of Yigit’s contracts (along with some test code) to determine where and how I needed to target it.

Locationof byte change in the PNG’s encoding.

I could calculate the exact wei needed to change that one contract’s balance and how it expressed that one particular byte: a scratch from a byte. I deployed my contracts, sent the wei using force feeding, and refreshed. Rothko was scratched.

OpenSea’s listing for the RoP.

Destroying a Rothko

I’ll confess being quite proud of this little endeavor. Most of my time was spent choosing a viable target in the bytes expressed by RoP’s balances — like a viable genetic mutation introduced in some long stretch of DNA.

But before long, just hours later, an artist with a penchant for destruction descended upon the RoP. The great destroyer, Bushi, sent a single wei (1/10¹⁸ ether) to another contract and destroyed the entire piece. Obliterated. Bushi sent a message along with the selfdestruct transaction: “all good things must come to an end.”

From Bushi’s 1 wei selfdestruct transaction. From Etherscan.

It was a suitable event. The piece seemed designed with a playful destruction in mind. And Bushi was the best culprit, known for artworks that are at once innovative and destructive in their nature.

From Yigit Duman’s beautiful RoP summary site.

Artist Yigit Duman seemed to celebrate this, and wondered if it could be restored. Another challenge. I’ll confess spending several hours fiddling with possibilities. I imagined updating balances to simply alter the artwork again and recover some of it. I succeeded in part. I tried to send another transaction, to overcome Bushi’s destructive 1 wei. It didn’t work: Other vandals had already modified some of the other 1,000 contracts.

Fully Restoring a Rothko

I inspected Yigit Duman’s rendering code closely. This is the code that takes the balance values (expressed as large integers of how much wei is in each balance) and assembles the image. It occurred to me that he was using a smaller integer type (uint40) when rendering the balances.

From Etherscan: Yigit Duman’s RoP rendering code.

Integer typing is subject to another very well-known vulnerability, often used as an attack surface too: I can overflow this integer type and force Yigit’s rendering contracts to “think” it’s back to the same original number. The idea can be visualized like this:

When the integer reaches its max, it “loops back” onto 0. Visual from here.

This attack vector has history too. Early in Ethereum’s history, it was used as an exploit on some ERC-20 token projects, which you can read about here. (Wood and Antonopoulos also discussed over- and underflow issues in their list of vulnerabilities.)

Anyway, I needed to take several steps before making this happen. (I share lots of detail in this elaborate thread here.) First, I assembled some test contracts replicating Yigit’s contract environment to make sure it would work. Also key was using Etherscan’s API to scan for both the addresses and the balances of RoP’s contracts. By detecting which of the RoP contracts had “internal transactions” (those selfdestruct events) I could tell that several had been sent some wei:

Data extracted from Etherscan’s API using internal transaction type.

But it was doable. Using data and these tools I calculated for each contract how much wei I’d need to overflow the uint40 operation and “loop back” onto the original values. I did it for all the attacks on RoP except for one: I did not reverse my scratch.

I sent the transactions. A few moments later, I refreshed the amazing On-Chain Checker platform that calls data from the contract directly. The pixelated on-chain rendering of Rothko’s red glowed on the screen, the scratch still there. A moment of sheer delight.

Visit the current RoP state here.

(Collective) Hacking (as) (Performance) Art

There are many amazing things about Yigit’s RoP project. From a very concrete perspective, working with the puzzle Yigit set required a dizzying combo of various tools and techniques — the Etherscan-derived data about contracts and their balances, the byte-level definition of images, Solidity hacks to manipulate a project under the rules the project sets for itself. Yigit’s project is technically impressive right away — ether dust encodes a Rothko. But that’s only the surface — RoP sets a challenge to the familiar and inclined and the project itself proliferates into new and fun complications.

But the semantic qualities of Yigit’s work go well beyond the technically impressive feature of RoP’s initial trick. It is emblematic of cryptoart, especially on-chain cryptoart. On a public blockchain, those who can are invited to engage, to interact, to code and hack and participate and alter the meaning of a piece.² Yigit, Bushi and I (and possibly some other vandals) converged on a decentralized ledger and wrangled a work of art. We acted remotely in space and time engaging in computable, permissionless, unstoppable play.

Epilogue

I corresponded with Yigit Duman about RoP, and he shared some final remarks about the project and what inspired it:

Rothko on Pennies was an incredibly rewarding exploration of Ethereum as an artistic canvas. Takens Theorem’s work, along with the element of ‘vandalization,’ elevated the entire narrative, showcasing the potential of multiplayer interactive art on Ethereum. I’ve long been inspired by the pioneering artists in the on-chain art space, and with this project, I hope to have sparked some inspiration in others.

Though the official performance is complete, RoP remains forever open for engagement. Indeed it was vandalized again, several times, to the point of destruction. So I repaired it again (this time, by devising a generic solution). The chain is forever and often daunting in its latent potential.

Endnotes

  1. This use of selfdestruct may be retired in the near future, as Yigit discussed in another thread during these escapades.
  2. There are various stationed art traditions that have this quality too. There are many well-known examples of participatory conceptual art, computer art, etc. I do not review these here for simplicity, but you can consult an interesting review here of some ideas.

Disclosure

I sometimes own or create projects I mention. I was not paid for this post. I wrote it for fun. Thanks to Etherscan for letting me contribute. You can find me on X with links to projects here:

https://www.takens.eth.limo

Comments

All Comments

Recommended for you

  • Signals of Easing in the Strait of Hormuz as Brent Oil Continues Historic Weekly Decline

    On November 9, as diplomatic efforts to end the Middle East conflict continue, an unverified report suggested that Iran has made concessions regarding the Strait of Hormuz, leading to a drop in oil prices. The international benchmark Brent crude oil price fell by over 3%, nearing $95 per barrel, extending its largest weekly decline since April 2020. Previously, U.S. President Trump stated over the weekend that he was 'extremely unlikely' to order a large-scale strike against Iran, but he told CNN that it depends on whether Iran signs a 'very strong agreement,' which subsequently caused oil prices to retreat. Following this, Israeli media reported an unverified claim that Iran seems to have abandoned its demand to control the Strait of Hormuz and charge passing ships for passage, causing oil prices to hit a new daily low. The Democratic Party's comprehensive victory in the midterm elections eased market concerns about a severe escalation of conflict, and crude oil prices have significantly retreated from a six-month high reached at the end of October. However, it remains unclear whether these signs of easing tensions can translate into substantive progress in negotiations. Iranian state television (IRIB) reported that the U.S. again attacked Iran's Qeshm Island in the Strait of Hormuz overnight, while U.S. Secretary of State Rubio downplayed the likelihood of a breakthrough in negotiations.

  • Iran Appears to Abandon Demand for Control of Strait of Hormuz

    On November 9, according to Israel's 'The Times of Israel', Iran seems to have abandoned its demand for control over the Strait of Hormuz, as well as its claim to charge tolls for ships passing through this strategic waterway.

  • U.S. Stock Futures Rise, Dow Futures Up Over 1%

    U.S. stock futures rose, with Dow futures increasing by over 1%. S&P 500 futures climbed by 0.7%, and Nasdaq 100 futures were up by 0.5%.

  • WTI Crude Oil Falls Below $89 per Barrel

    Both WTI and Brent crude oil prices declined, with WTI crude falling below $89 per barrel, a daily drop of 1.65%. Brent crude oil experienced a decline of over 2% during the day, currently reported at $95.92 per barrel.

  • Iranian President: Supreme Leader Has Directed to End 'Neither War Nor Peace' Status

    According to Saudi media Alhadath, the Iranian President stated that Supreme Leader Mujtaba has issued instructions to end the status of 'neither war nor peace.' We can negotiate and reach an agreement while maintaining our dignity. We have no right to ignore Iran's future, nor do we have the right to destroy it.

  • Sources: U.S. Proposes New Plan to Iran - Trading Money and Sanctions for Nuclear Agreement

    According to UAE media 'Eram News', diplomatic sources familiar with the U.S.-Iran mediation process stated on Monday that the Americans proposed a phased agreement to partially lift sanctions in a document attached to a proposal from Qatar, starting with the reopening of the Strait of Hormuz. The next phase would involve gradual negotiations on nuclear issues, including the lifting of sanctions and the phased unfreezing of Iran's frozen assets. After the signing of a comprehensive nuclear agreement, the unfreezing ratio could reach 30%. The sources also indicated that Tehran has yet to respond to the U.S. proposal and is waiting for what it deems necessary commitments before agreeing to discuss navigation arrangements in the Strait of Hormuz, linking this to the lifting of sanctions and the progress of asset unfreezing. The sources noted that Tehran demands Washington first make clear commitments within the framework of 'Strait for Sanctions' before turning to discuss other topics. Iran currently avoids specifying the exact nature of these other topics and is reluctant to include them in the negotiation framework. Meanwhile, the U.S. has refused to make explicit commitments to include the lifting of sanctions in any agreement limited to the reopening of the Strait of Hormuz. This complicates the prospects for direct negotiations with Tehran. Iran also insists on the withdrawal of U.S. forces from waters near the Arabian Sea and the Gulf of Oman.

  • Former Head of Iranian Commercial Bank: Fiscal Deficit and Monetary Supply Expansion are the Roots of Iran's High Inflation

    In an interview with the Iranian Students' News Agency (ISNA), the former head of the Iranian Commercial Bank stated that the fundamental causes of inflation in Iran are the persistent growth of the fiscal deficit and the monetary supply. Over the past 30 years, Iran's monetary supply has increased by 30% to 40% annually, sometimes even exceeding 50%, yet economic growth has not matched this level. As long as the government fails to achieve fiscal discipline, it will be impossible to curb inflation.

  • US Chip Manufacturers' Stocks Decline Pre-Market, Intel (INTC.O) Down 1.4%

    US chip manufacturers' stocks fell in pre-market trading, with Intel (INTC.O) down 1.4%, Marvell Technology (MRVL.O) down 1.7%, Qualcomm (QCOM.O) down 1.1%, Micron Technology (MU.O) down 0.9%, and Arm (ARM.O) down 1.4%.

  • Trump Claims to Know Nothing About Foreign Investment in World Liberty Financial

    On November 9, The Block reported that U.S. President Trump, during an interview with 60 Minutes, was questioned about foreign investments and potential conflicts of interest related to his co-owned cryptocurrency company, World Liberty Financial. He stated that he knows nothing about it and mentioned that the company is run by his sons. When asked why he cannot sell his shares while allowing his sons to continue managing the company, Trump countered by asking how one could divest from cash and noted that most of his wealth is held in large Wall Street institutions and invested in index funds. The report cited previous information from The Wall Street Journal, which stated that an investment vehicle supported by UAE National Security Advisor Sheikh Tahnoon had acquired a 49% stake in World Liberty Financial for $500 million before Trump took office.

  • Coinbase Receives Official Trust Bank Charter from U.S. OCC

    On November 9, CoinDesk reported that Coinbase announced the U.S. Office of the Comptroller of the Currency (OCC) has officially approved the national trust bank charter for Coinbase National Trust, which was previously under conditional approval. Coinbase National Trust received preliminary approval in April of this year to provide federally regulated custody and payment services, but it will not operate as a full-service bank accepting deposits or issuing loans. Coinbase stated that after establishing a compliance system, hiring necessary personnel, and undergoing regulatory review over the past few months, the OCC approved the formal charter.