tr8-protocol / tr8-contracts

contracts for TR8 protocol
MIT License
1 stars 1 forks source link

TR8 Protocol

TR8 protocol is a permissionless public good protocol, on the Superchain, for traits (TR8s) of many types, including event attendance, credentials, in-game assets, badges, and more. TR8 protocol uses Ethereum Attestion Searvice (EAS) as a base layer, providing customization, onchain, structured data for issuers of all types of credentials. NFT metadata is store onchain in attestations.

Live Demo: Try it Now

A basic example front end for creating event-based TR8s can be found at https://tr8.me

Other Repos

Some code for TR8 protocol lives in other repos under the tr8-protocol organisation on Github:

Permissionless

TR8 Protocol is permissionless. Anyone can create a drop/collection on any topic with any content. TR8 drops do NOT have to be vetted nor approved by a committee or company or organization or DAO. A side-effect of this permissionless nature is that content-filtering becomes the responsibility of front-ends, each of which can apply their own standards for curating content. TR8 Protocol envisions many different front-ends, some general in nature and others focused on specific applications like events, educational credentials, in-game assets, etc.

Composabilty

TR8 is composable through the structured data in the source attestations, and well as via optional hook contracts that issuers can deploy to tightly integrate TR8s into their own protocols and control who can claim their TR8s and what extras happen when they do.

OP Stack Superchain

The Superchain of OP Stack chains is the home for TR8 Protocol, currently deployed to Optimism, Base, and Zora (testnets).

Cross-chain

All TR8 NFTs are cross-chain by nature and can currently be moved between Optimism, Base, and Zora, with more to follow. Cross-chain transportation provided by LayerZero general message passing (GMP).

How it was built

At its core, TR8 protocol use EAS attestations as the base layer. There are two kinds of attestations that TR8 issuers and claimers make:

  1. "New Drop" Attestations. This is an attestation to create a new drop or collection, whether it be a badge for event attendance, an educational certificate, or something else. The attestation includes the structured data for the drop as well as lists of who can issue and/or claim the TR8s. When a new drop attestation is made, a dedicated NFT contract/collection is deployed for the drop. The collection is owned by the issuer enabling them to customize the collection's appearance on OpenSea and other marketplaces and directories. A drop can have an expiry date, a deadline for minting the TR8s in the drop. Drops can be configured as soulbound (non-transferable), or trade-able.
  2. Mint/Claim Attestations. These attestion can be made either by an issuer (admin) or a claimer. In both cases the recipient of the attestation is the one who will receive the TR8, if eligible. Configured issuers for a drop can issue (mint) a TR8 to any address. Configured claimers can claim a TR8 for themselves (they are both the attester and the recipient in these claim attestations). When these attestation are made, hooks are called if configured, enabling limitless composability and providing flexibility on gating who can and cannot claim TR8s in the drop (more on hooks below). Eligible recipients will receive a TR8 NFT for the Drop, adding to their onchain identity.

Namespaces

TR8 drops feature optional reserved namespaces, enabling issuing organizations to group their drops under a single namespace that is reserved for them.

TR8 Protocol Contracts

TR8 Contracts

While TR8 users interact primarily through making attestations to the EAS contract, there are several contracts deployed as part of TR8 protocol.

Optional TR8 Hook contracts

TR8 Protocol is composable, and issuers can create their own TR8Hook contracts that get called each time a minting/claiming attestation is made. Hooks can add logic to allow/deny minting, integrate with third party protocols, and thousands of other things. Four example hook contracts were created and deployed:

Deployed Contracts Addresses

Note all equivalent contracts are deployed to the same address on each chain.

Example hook contracts were deployed only to the "home chain", Optimism:

SuperHack 2023 Hackathon

TR8 Protocol was built during the ETHGlobal Superhack hackathon. The follow sponsor technology was used: