Categories
Crypto

glTF ERC-721 NFTs

What is it?

3D rare digital art made by minting ERC-721 NFT tokens that represent 3D models rather than 2D images.

(Building on https://twitter.com/cryptovoxels/status/1240056056778092545 by simplifying the approach.)

How does it work?

Add a “model” field to the metadata for an NFT that is a uri pointing to a .gltf model, using only standard (non-extension) glTF features.

Then allow these models to be placed in blockchain virtual worlds. The in-world position of placing the entity representing the token for that model is the origin at which that model is rendered inline.

VR World platforms should enforce that if the owner of a parcel of land or an avatar wishes to attach the model represented by the ERC-721 token they must own, via the same address, both the item that the model will be attached to and the model that will be attached to it.

If you are concerned that this allows the owner of a token to use the same item in different virtual worlds then use an ownership proxy or extend the contract to register its current “location”. But we don’t worry about that for image art NFTs, not yet at least, so I suggest waiting to see if anyone really cares about this for 3D art NFTs.

Why glTF?

It’s a modern standard with reasonable features that is well-supported by the kind of web technologies used to make blockchain virtual worlds.

How do I implement this?

Add the following field to the ERC721 Metadata JSON at the uri returned by tokenURI() for the token:

"model": {
  "type": "string",
  "description": "A URI pointing to a resource with mime type model/* representing the asset to which this NFT represents."
}

Then set it to a .gltf file.

For the image field of the file, either include an image preview of the model or use the glTF logo. When the image is the glFT logo, a preview must be created from the model file. How can you tell if the image is the glTF logo? If the filename is gltf.(png|svg|jpg), it’s the glTF logo.

But what about…?

Do not worry about anything else.

The token metadata should not include a bounding box, because that can be calculated from the model file and could be incorrectly specified.

Voxel vs. mesh vs. primitive vs. metaball virtual worlds should all inline the same model, and there should be one model per glTF file. That model’s aesthetic is more important than the world’s, that’s part of true digital ownership. If a virtual world wants to voxelize or LOD it, that’s the world’s problem.

Support for proprietary or single-world formats should be frowned on but someone is going to try to embrace, extend and extinguish this at some point. Just ignore them, we don’t need to legislate against that here.