On-Chain Keys with Off-Chain Locks

Brooks Boyd
MoonCatRescue
Published in
3 min readOct 17, 2023

--

The data stored on blockchains are open and public. That works well for making smart contracts that are composable and able to build off each other’s logic. However, it means that blockchains are not great for storing secret data. Even if a given property in a smart contract is marked as “private”, that only keeps it private from other smart contracts. A human inspecting the blockchain data flow can pick out “private” smart contract logic (I did this as a part of quantifying all the lootprint metadata in the past) fairly easily.

Additionally, storing data on a blockchain is expensive. To ensure the ecosystem supports global needs, blockchains incentivize developers to use as little storage as possible. Similar to how game developers needed to fit games into a single disc or game cartridge, developers use clever optimizations to keep the data stored on the chain for their project low. That means if they want to include an image, video, or other large document into their project in a way that on-chain processes can verify it, rather than putting the entire image data on-chain, they put an identifier for the file (a hash) on-chain, which is much smaller than the image itself. That means the end-user needs to obtain the image some other way, but once they do, they can verify it’s correct by comparing to the on-chain data.

Moments are Mementos and Keys

The MoonCatMoments collection is a series of tokens that act as postcards that are mementos from events along the MoonCat​Rescue project rediscovery timeline. Each Moment has a visual that looks like a postcard, which is public information everyone can see.

“Fright Night” Moment; celebrating MoonCats in costumes for Halloween 2021

But as a fun extra for those who actually held a MoonCat​Moment token, the MoonCat​Rescue team wanted to give an extra gift of an animated version of the Moment. But how to make it so the general public couldn’t see the animated version, but the token-holders could?

There’s several digital tokens that have this sort of need. Many “Art NFT” tokens give a higher-resolution version or making-of process visuals of the piece to the token owner. Because they need to be private data, it’s not stored directly on the blockchain, and instead are shared with token-holders through more traditional, centralized Web2-style servers.

For the Moments project, that logic was originally baked into the Purrse website, but now that the MoonCat​Rescue ecosystem tools are harmonizing under the ChainStation site, that “gatekeeping of private data” needed to be re-implemented on ChainStation as a prerequisite.

MoonCatRescue Treasures

In setting up that prerequisite logic, the MoonCat​Rescue team realized the logic didn’t have to be specific to MoonCat​Moments. And so, the Treasures area of user profiles on ChainStation have been set up to fulfill the logic of “If you own token A, you’re allowed access to document B”, for any token in the MoonCat​Rescue ecosystem.

The ChainStation application already knows who owns which MoonCat, so on initial launch, it’s able to gift things to specific MoonCats or groups of MoonCats within the collection. If you have a prize document that should be accessible by specific MoonCats, and it’s not data that fits well in the public hosting environment of the blockchain, we can now support it! MoonCatMoments will be moving into the ChainStation site by the end of 2023, using this framework. And this framework opens up the possibility of doing similar things for addresses that hold POAPs from past MoonCat events, or different combinations of multiple MoonCat​Rescue ecosystem tokens.

--

--

Brooks Boyd
MoonCatRescue

Teaching computers / to make art with just some code. / It is what I do.