Decoder Crystal

From wizzypedia
Jump to navigation Jump to search
The Decoder Crystal
The Decoder Crystal

The Decoder Crystal is an ERC-721 token on the Ethereum blockchain and is a critical aspect of the Forgotten Runes provenance.

10,000 Encoded On-Chain Wizards

ASCII Art of the Traditional Forgotten Runes Purple Hat Wizard Included In the Wizards' Ethereum Smart Contract
ASCII Art of the Traditional Forgotten Runes Purple Hat Wizard Included In the Wizards' Ethereum Smart Contract

To understand the Decoder Crystal, it is first crucial to understand the on-chain encoding of Forgotten Runes Wizard's Cult. Unlike many other NFTs, Wizards are truly stored on the Ethereum blockchain. However, the specific images of these 10,000 individual Wizard permutations are not stored on-chain. Rather, the parts (or traits) of the Wizards — the heads, bodies, props, runes , and familiars that make up each character — are contained in a single image grid on the blockchain.

10,000 Decoded Wizards

ASCII Art of the Illuminatus In the Wizards Ethereum Contract
ASCII Art of the Illuminatus In the Decoder Crystal Ethereum Contract

Along with the on-chain, encoded, image grid of the 341 total parts that serve as the base of the Forgotten Runes Wizards, there exists a pairing of wizard attributes necessary to decode it. This is the Decoder Crystal.

While it exists as its own token, the Decoder Crystal contains the code to call every Wizard in the collection from the Ethereum blockchain. This means that the characters of Forgotten Runes are not dependent on outside or centralized entities to exist. As long as there is Ethereum, there are Wizards.


The InterPlanetary File System is a peer-to-peer network used for hosting and sharing data. IPFS is popular among NFT project developers for hosting project-related images. If a token's image is stored solely on IPFS, the owner actually only owns a pointer to that image. This means that the image must have a host, or it will disappear.

One of the benefits of IPFS use for NFT project leaders is visibility and compatibility with off-chain organizations, such as OpenSea.

Forgotten Runes and IPFS

While all of the Wizards' data is stored on Ethereum and is completely reproducible, Magic Machine also includes an IPFS URL of the token image in the tokenURI

This exists solely for convenience and off-chain interoperability, rather than out of necessity for the persistence of Wizards.

Shortcomings of The Decoding Method

The main shortcoming for this method is that the traits are not accessible to other smart contracts. This could potentially create obstacles during integration with other on-chain projects (such as web3 games).

The Lost Grimoire

Community member Meph1587 has created code to remedy this issue in The Lost Grimoire, which has been deployed on Rinkeby, though it is not yet on Ethereum Mainnet.


The transactions used to store this data are available at the following hashes:

img: "0xbb6413bd70bae87b724c30ba9e46224fa63629709e7ccfe60a39cc14aa41013e",
traits: [
affinities: "0x1be4aa782c9dc164ecbf2cd155537e7250b344f405dff03b5c33fdd63261c80e"

This data itself is also stored within the Decoder Crystal.

How to Re-create Any Wizard

To re-create a Wizard(s) entirely from on-chain data, run the following commands:

curl -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_getTransactionByHash","params":["0x0b8eb29d7a592023b5330fd9a93299bca2a9604aaa2494c87333fc56da50ec9e"],"id":67}' | jq -r '.result.input' | cut -c 139- | xxd --plain --reverse | head -n 297 > decoder.ts
npm init -y
npm install ethers@5.0.26 yargs@16.1.0 chalk@4.1.0 ora@5.3.0 ts-node@9.0.0 typescript@4.0.5 bson@4.4.0 sharp@0.28.3 parse-numeric-range@1.2.0 mkdirp@1.0.4 @types/yargs @types/node
./node_modules/.bin/ts-node ./decoder.ts --wizards "0-9,13,123"

It will look like this.