How ‘On-Chain’ is Art Blocks?

Druid
The Link — Art Blocks
6 min readAug 18, 2021

--

SpiroFlakes #0 — Alexander Reben

If you’re buying any NFT, I’m sure you’re assuming the NFT will always be available whenever you want to access it. Every week or so, there are conversations in Discord asking if Art Blocks project outputs are decentralized. In the current landscape, many NFTs are hosted on centralized servers, and the token simply points to the server that hosts a file. At best, projects use IPFS or Arweave, decentralized forms of file storage. But with Art Blocks, artists create on-chain art that is decentralized, immutable, and establishes its provenance on the Ethereum Blockchain.

The Basics of Every Art Blocks Project

Generative artists automate the creation process using code. They create rules and parameters for the computer to execute within and cannot themselves know what the final set of minted outputs will look like until the project is complete. In order to create the piece, collectors mint a project token on Art Blocks, and a pseudorandom deterministic hash from that transaction is used as an input for the generative script. In this way, minters get to participate in the actual creation of their art pieces and “unlock the magic” as an Art Blocks token is the product of a) code that a generative artist has written and b) a token hash that the person minting helps create at the time of purchase.

When you click “Live View” on a piece in your collection on the Art Blocks website, you’re not seeing a saved PNG or MP4 file hosted on a server. Instead, you’re running a script that lives on the Ethereum blockchain and giving it to the browser to render in real-time. This is why your GPU starts to heat up when you watch the Rinascita live view.

While the Art Blocks API — which is not permissionlessly decentralized and lives on servers within Art Blocks the company’s infrastructure — does provide this generative script and token hash information for convenience, this same information is permissionlessly available directly from the Ethereum blockchain itself and can be used to recreate any Art Blocks piece, regardless of the existence of Art Blocks’ API or even Art Blocks itself.

Okay, but where is it really?

Good question. Every project on Art Blocks has the script loaded directly to Ethereum by the artist at the time of project creation and this information can be read off of the Art Blocks contract (https://etherscan.io/address/0xa7d8d9ef8d8ce8992df33d8b8cf4aebabd5bd270#code) at any time.

For example for the ​​70s Pop Series One piece, which is https://artblocks.io/project/46, this can be read from the Art Blocks contract with the `projectScriptByIndex` function (note that some very long source-code projects may span across multiple “index”s).

But that’s only one-half of what’s needed to display your art. When you buy a piece on Art Blocks, you get a token (your NFT) that acts as an input for the on-chain script. The other piece is the token hash, which is assumed to be an available variable in the script above. This also can be read from contract data, using the `tokenIdToHash` function for a given token. For example, for the #0 mint in the above project, this would be done by looking up the token hash for 46000000.

Any previews you see on other websites like OpenSea or when you click “View Image” on the Art Blocks’ site are simply rendering a snapshot of the live code. However, the real magic happens in “Live View,” where Art Blocks UI renders a copy of the on-chain script (which is provided by the Art Blocks API for convenience but could be read from on-chain data all the same) and your token to show the actual code running live in your browser.

This isn’t a simple image loading; this is a real-time rendering of a generative piece of art that is immutably preserved on the Ethereum blockchain.

So in the future, if Art Blocks doesn’t exist to serve your art, you can recreate it in any resolution with a browser, a simple HTML template, the token hash (your NFT), and the code. Nothing about an Art Blocks’ NFT requires Art Blocks to exist to recreate in the future. We simply provide a UI that finds the info on Etherscan and makes it easy to enjoy.

Last-minute edit:

The morning before this article was published, pxlq — Art Blocks artists, mod, and all-around awesome person — announced the community-driven open-source effort to make it easier for anyone to recreate Art Blocks projects from on-chain data. You can check out the GitHub repo here: https://github.com/ArtBlocks/node-artblocks

Dependencies

Projects that use vanilla JavaScript, CSS, HTML, or WebGL can be fully loaded on-chain and 100% decentralized, but what about external libraries? Yes, some Art Blocks projects use external libraries like p5js and threejs. However, we are very particular about the external library dependencies we allow on the platform. Here is a full list from Art Blocks’ GitHub:

Each project can have zero or one library dependency. The approved dependencies are currently the following:

No Library at all (Vanilla JS, CSS, HTML, WebGL), p5js, processing, a-frame, there's, vox, megavox, js, SVG, custom, regl, tonejs

On-chain purists might have an issue with Art Blocks allowing some dependencies on the platform, and that is totally understandable. But from our point of view, the allowed libraries are so widely distributed that as long as we have a functioning internet and electrical grid, they will be reproducible — and if not, well, we have much bigger issues to worry about.

For example, p5js is a highly distributed open-source project stored in the GitHub arctic cold vault. For some perspective on how durable this is, here is a brief description of the Arctic Code Vault:

On 02/02/2020 GitHub captured a snapshot of every active public repository. Those millions of repos were then archived to hardened film designed to last for 1,000 years, and stored in the GitHub Arctic Code Vault in a decommissioned coal mine deep beneath an Arctic mountain in Svalbard, Norway.

Could that be compromised? Sure, there is a greater-than-zero chance. But again, it’s reasonable to expect p5js will be around.

Final Word

The mission of Art Blocks goes far beyond our platform, and we aim to have that mission reflected in work deployed on our platform. We love generative art, and we want it to live in the public record as long as we have computers with access to the internet. Artists that release a project on Art Blocks load their script directly on the Ethereum Blockchain with either 0 or 1 dependency, the token our collectors purchase is also on the blockchain, and the project’s outputs do not require Art Blocks to be reproduced. All of the data needed to recreate the art is available for anyone to access and will live on Ethereum as long as computers have access to the network.

Disclaimer:

I want to give a special thank you to Jake Rockland for helping me write this article. I am not a developer, so his input was extremely valuable in making sure the information outlined above is correct.

However, the information in this article is not comprehensive and is not intended to be. Its goal is to address the basic concerns of people that hear about Art Blocks for the first time. If you have a more technical question, we encourage you to join our Discord’s #tech-talk channel. We have plenty of developers that are more than happy to talk through your concerns about Art Blocks’ durability. Ultimately, immutability is a core tenant of Art Blocks and is built into our entire process.

--

--