Sidecar NFTs

A very simple “n of 1” contract formulation to add new value to existing tokens

Takens Theorem
9 min readJan 23, 2022

Projects in the NFT space often introduce ways to create new value for collectors. One prominent theme in 2021 was a kind of “membership” model, especially with PFPs. Ownership of a Bored Ape Yacht Club NFT, for example, secured entry to a party during the NFT.NYC conference this past November. Other mechanisms for creating value include gift drops and exclusive mint access and more.

This post describes a very simple, experimental approach to provide new value to an NFT holder. For the purpose of this post, I’m calling the approach “sidecar NFTs.” I suspect most readers will know what a “sidecar” is — a smaller vehicle attached to the side a motorcycle. It is fastened to the motorcycle, and moves with it.

Image credit: The Moto Channel

The idea of a sidecar NFT is analogous to this (and this). A sidecar NFT cannot move on its own; it is attached to a designated “root” NFT. But once it is attached, it moves with the root NFT, like the sidecar that slings along with the motorcycle. If you are an artist, you can “couple” a sidecar NFT to one of your other works. Now your collector can benefit from both tokens at the same time by holding or selling the original root NFT.

Some other projects use a similar strategy. For example, in 2021 Loot Character developed an “associative NFT” with technical ingredients similar to what I describe below. Characters are game pieces that go with Loot NFTs, rendering loot items as a cute pixelated adventurer. More generally, ERC-998 is a more recent standard that has an NFT serve as a kind of portfolio. Under ERC-998, a token could hold a variety of other tokens inside it (ERC-20s, other NFTs, etc.). This standard is not yet widely supported. This may change in 2022, and maybe Mooncats will lead the way.

Loot Character
“Associative NFT” approach of Loot Character

The idea presented here is very simple. The technical details are straightforward, and the use cases of a sidecar NFT are easy to describe. This post illustrates sidecar NFTs with a bit of technical detail and an implemented illustration. A second main message in this post is that any new software feature is an expanded attack surface. Sidecar NFTs may be a fun idea, but they open up new opportunities for exploitation.

n-of-1 Model

In the NFT space, especially cryptoart, a certain nomenclature is used for the uniqueness of a token. A single, unique work of art is known as a “1 of 1” — one token of one single creation. Contracts using standards like ERC-1155 (and flexible use of ERC-721) allow creators to issue many editions of a given original piece — a “1 of n.” For example, the famed Adidas release began as precisely the same media content for each issued NFT (on an ERC-1155 contract). It can be said that to own an Adidas NFT is to own “1 of 30,000.” In other words, when you own 1, it is just 1 of 30,000 of exactly the same underlying token media. Collectors can have preferences for different distribution models:

Fun illustration from @Artnome the Great

The concept of a “sidecar NFT” can be expressed in these terms. Sidecar NFTs are an “n of 1” model — when you own 1 NFT, you immediately secure ownership of n – 1 others that “travel” alongside it. It’s an odd rendering of the nomenclature, but it describes the provenance. n tokens, 1 provenance.

Specific Example

Let’s frame a specific example. I released a new NFT on my Indivisuals contract, token #14. It is called “Doubling,” and is inspired by the underlying structure of secp256k1 and ECDSA. Here’s the work (I describe it further below).

Doubling,” the “root NFT”

I decided to use token #14 as the originating token that will have a sidecar NFT attached to it. Let’s call this #14 token the “root NFT” on the original contract.

I created a new NFT that will be assigned automatically to the owner of #14. This new contract — the “sidecar” contract — mints new content and each new token requires an assignment of a contract address and token ID for its root NFT. For this new contract to know who owns it, it will call the ownerOf() function of the original “root” NFT (2021 Loot Character takes this approach, too). To make this work automatically, you override the ownerOf() function of the new “sidecar” contract, like this:

Modified ownerOf() for sidecar NFT

Now the root NFT (#14 on the original Indivisuals contract) is a “2 of 1” piece — two unique NFTs travel as one. In order to ensure that the sidecar NFT cannot be decoupled from the root NFT (by being transferred or sold) we can override relevant transfer functions in the ERC-721 contract:

Modified transfer functions on sidecar NFT

These calls now revert, informing the user of the status of the token.

We need one final part to this setup. Exchanges often make use of events on contracts to track various states — including NFT ownership. OpenSea appears to track the Transfer() event on an ERC-721 to know who currently owns a token. Suppose someone buys #14 on the Indivisuals contract. It has a new owner. But the sidecar NFT does not itself have a state change — the ownerOf() function simply changes its output. To help owners “secure” their sidecar NFTs, I added an updateOwner() function that simply emits this event and can be called to force an update on an exchange:

Updating by emitting Transfer() event

This costs about 36,000 gas to run. If gas price were 50 gwei, this transaction would cost about 0.002 ETH.

The Sidecar NFT: “Hidden Landscapes”

The prior section describes most technical details — sidecar NFTs are very simple. So I spun up a demonstration in some of my own creations. My Indivisuals contract was designed as a good ol’ vintage setup: JPEGs on IPFS, with metadata fully on chain. My past projects include 100% on-chain visuals, and encrypted PDFs on IPFS in my Ethstory project. Indivisuals was designed as a more open-ended issuance, to share various visual explorations of technical or data-driven concepts using the classic NFT model.

Indivisuals token #14 is called “Doubling” because it illustrates a local moment of elliptic curve arithmetic (using secp256k1 without modulo). It is rendered explicitly from this cryptographic function. The line is a doubling path. The function is crossing from a tangent to reach a point on the curve elsewhere. (To those unfamiliar, this is a beautiful introduction to these ideas.) However the depiction here is local to a specific region or “zoom”— the viewer can see a moment of cryptographic encoding, concealing a signature, but it is simply on a path of many such operations — a trapdoor process lost to any easy recovery (the probability of recovery is, of course, extremely negligible).

I paired a depiction of this function itself as the first token #1 on the sidecar NFT contract. It is the secp256k1 function but generates variability using more values of a ≠ 0 (see here). The elements here gain some size variation by their extent along the x-axis. This is a stylized but unannotated map for the owner of #14, playfully sharing the landscapes over which such paths are concealed: hidden landscapes.

Sidecar NFT: “Hidden Landscapes”

These depictions illustrate only the basics of the underlying mechanics of the ECDSA algorithm, and they are part of a wider series of such cryptographic depictions. I have two blog posts illustrating some bare rudiments here and here.

Now whoever owns token #14 on Indivisuals owns a kind of playful, taunting “map” of the hidden information as a sidecar NFT. This “2 of 1” duo is a cryptographic primitive expressed visually at two resolutions, with two subtly different connotations. An important element here is a creative decision — these tokens cannot be separated; they travel together as a “2 of 1.”

Benefits

Simplicity. This sidecar NFT approach is so simple I’m almost embarrassed by this entire blog post devoted to it. A benefit of this simplicity is that it straightforwardly capitalizes on the widely supported ERC-721. While we await wider deployment and codification of ERC-998 (or other approaches), we can take advantage of composability in a way that is easy to understand and assemble.

Gas. There is a gas-related benefit to this little approach. For one, you can transfer two NFTs and spend gas only on one. So when a collector sells an NFT, the new owner of this piece gains assignment of the sidecar NFT without any gas involved at all (unless, of course, they force the transfer event on the contract, which is not necessary and can be done later anyway).

Composability. The strategy described above is very simple, using the ownerOf() function of the root NFT. But these sidecar NFTs could use other properties or functions of root contracts. For example, my Gaussian Timepieces project updates NFTs based on what their owners have in their wallet; the pieces update automatically as owners update their collection. This sort of strategy could be used on sidecar NFTs to create dynamic experiences coupled to a root NFT (again, see Loot Character for a great example).

A Gaussian Timepiece with notches reflecting ownership.

Gifts, Completeness, Expansion. I began this post imagining a creator seeking value for their collectors by attaching a sidecar NFT to an existing token. This can be used to express appreciation for one’s collectors. But there are other benefits related to this. For example, the very popular OpenSea OPENSTORE ERC-1155 token stores a lot of content that is often not on chain or on IPFS. A creator may wish to improve their pieces on the OPENSTORE contract by creating sidecar NFTs that point to IPFS or other content. A sidecar NFT could be designed with on-chain storage, like the recently stored CryptoPunks data. This would be akin to “completing” their project’s on-chain status. Finally, a sidecar NFT can be part of a more elaborate, creative process — a series of NFTs, one created at the root contract, but then expanded according to some schedule or wider narrative (for example, sidecar NFTs can be recursive, referring back to their own contract). If planned in advance, the incredible set of tools by @dievardump called “NiftyForge” permits modular setup, and tokens could have a single front-facing contract.

Issues

Bug? There are obvious issues here. As this departs from the ERC-721 standard, there is no agreed-upon way for exchanges to interface with these NFTs. While setting up the example above, I had to test and retest OpenSea to assess how the sidecar NFT would behave. A more cynical take here is that it is a “buggy” NFT contract which may or may not work as planned in the future. (Moreover, this little study assumes we’re adding value on a new contract after the first root tokens; an elegant approach may be to use modular design to combine them on the same contract, as noted above.)

Attack Vector. Maybe more significantly, it is possible to use this sidecar NFT strategy to dump NFTs to wallets without their permission. For example, an attacker could attach a sidecar NFT to some other root contract — like CryptoPunks or BAYC. Now the sidecar NFT will appear in any new owner’s wallet. Moreover, if the owner sees this anomalous NFT and hides it, it will reappear for the next owner of that CryptoPunk who buys it (because it is a new wallet that has yet to hide it). If coupled to an on-chain tactic (such as further modifying the sidecar NFT information or functions for malicious purposes), this would allow the sidecar to attack new owners forever. And so exchanges may wish to find ways of identifying these travelers that do not belong.

Conclusion

There remains much untapped composability of NFTs, linking NFT contracts or assets, promising future creativity and plain fun. Sidecar NFTs are a very simple mechanism for coupling NFTs together. They have limitations and concerns, as noted above. They are just a glimmer of other explorations of composability (like amazing Async Art and Avastars). But as simple as they are, they hint of more fun for the future.

Takens Theorem is on Twitter.

--

--

Takens Theorem
Takens Theorem

Written by Takens Theorem

Dynamic distributed data displays. Intermittent. Friendly.

No responses yet