A Testament to Attesting

Brooks Boyd
MoonCatRescue
Published in
5 min readFeb 24, 2024

--

The MoonCatRescue ChainStation application is adding integration to the Ethereum Attestation Service (EAS) for some upcoming features. But what is EAS and why is it helpful for creating this new functionality in the MoonCatRescue ecosystem? Read on to learn more, then join us on Discord and let us know your thoughts!

Off-chain Messages

Storing data on a blockchain is a way to make sure it stays permanently stored, and accessible (any node in the blockchain network can be queried for the data). That’s a good benefit, but comes with a cost (gas) to store it. So, users generally only want to take an action on-chain when they’re certain they want the action to happen. For actions that are lesser-impact, or only setup actions for future actions, it’s a better user experience to store that as off-chain data.

For example, Alice making an offer to buy an NFT from Bob, Carol, and Dave. Alice’s offer might get ignored by any or all of the recipients, and so if Alice has to make an on-chain transaction for each offer (gas cost to her), that discourages her from making many offers, and slows down the velocity of trades that will happen. A better option would be for Alice to only have an on-chain cost when a trading partner agrees. Hence why many NFT marketplaces have offers to buy be off-chain messages, and only become on-chain when the other party accepts.

In the Ethereum ecosystem, it includes the ability to “sign a message” with the message being anything you want (ERC191). This was augmented to add structure to the message (“typed data” ERC712), making it easier for smart contracts and wallet software to parse what the message was trying to represent. The EAS project is a platform built on top of ERC712 messages, defining a public set of schemas (specific arrangements of typed data) that allow ERC712 messages to be used broadly instead of for just one smart contract.

As the EAS platform adds a better user experience on top of ERC712 messages, the MoonCatRescue ChainStation app is integrating with it, to make off-chain data more accessible and allow other projects to interact with off-chain MoonCatRescue data if they wish.

What should be off-chain?

There’s several features that could be part of the long-term development plans, using off-chain data for better user experience:

  • Wishlists for Accessories: The MoonCatAccessories contract is designed to prevent MoonCats being spammed by being “gifted” Accessories the owner doesn’t want. If the owner could create a wishlist of Accessories they did enjoy and would be happy to receive, that would pave the way for the possibility of gifting Accessories to others.
  • Popular items: Having a way to indicate a “like” or “thumbs-up” for an individual item in a collection would allow interfaces to sort by popularity. Having the “likes” be off-chain for no cost would encourage more users to actually take the action of liking items and get a more representative idea of what items actually are popular.
  • Curated lists: For users with large collections, being able to designate which assets to highlight is good for portfolio viewing tools to

The MoonCatRescue project has always valued on-chain records as the gold standard for keeping that information safe for the long-term future, and will continue to do so. But for some user interaction data, being able to broadcast rapidly and make changes easily are more valued, so make more sense to be created as off-chain data.

Is it safe?

Signing anything with your wallet’s private key is something that should be done with care and consideration. Signing a message that is shaped as an on-chain transaction clearly deserves scrutiny before agreeing, but what about Attestations? Is there a risk to losing assets if you sign one? Overall, an Attestation is not shaped as a transaction, so cannot be used nefariously on-chain by itself.

However, if paired with a smart contract, there’s a potential risk that signers should be aware of before signing. Contracts like NFT marketplace contracts accept signed ERC712 messages as proof that the owner wishes to sell their asset. If you’ve given a particular smart contract “approval” to your assets, and that smart contract uses structured data messages as keys/proofs for others to submit transactions on your behalf, then signing a message can result in someone using that message to unlock the keyed action. Savvy MoonCat Owners can avoid that by not granting “approval” to smart contracts you don’t understand, and don’t take structured data messages as proofs. If you’re using Metamask as your Ethereum wallet, you can also help analyze the risk further by installing the EAS Snap, which for on-chain Attestations will give you more information about what you’re signing, before you sign it.

Next Steps?

As mentioned above, there’s several types of data and features that could be built around off-chain Attestations. But to get there, first some initial functionality needs to be laid in place, to give it a good foundation. The first step is being able to sign an Attestation from the ChainStation web application at all. The first example of this is launching as a fun way to verify you’ve said “gm” to the community each day.

EAS GM tool on ChainStation

If you head on over to ChainStation, you can give this a try today! Go ahead and kick the tires, to see if it works with your wallet. We’ll be expanding on that foundation over the coming months to work toward those long-term ideas, starting with the Curated Lists, as that’s been a much-requested feature.

What am I signing?

When you press the “GM” button on ChainStation, your wallet will prompt you to sign the structured data for that Attestation. If you’re using MetaMask as a wallet, it will look like the below prompt. You can verify the signature is a “GM” request from ChainStation by looking at these details about the request:

You can see at the top of the message details, the message is an “Attest” message, and if you click the “Verify third-party details” link, you’ll see the target contract that defines the action is the EAS Registry on Arbitrum. The MoonCatTraits contract on Arbitrum is used as a Recipient to indicate it’s a GM to the whole MoonCatRescue community.

If all that matches what you’re being prompted to sign, then the request is genuine. Give it a signature and you’ll be able to see your own proof-of-GM generated! If you follow the link to view it in the EAS interface, you can get a link to share with anyone that you did indeed send a GM today. Share yours with us on X and spread the good vibes around!

--

--

Brooks Boyd
MoonCatRescue

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