Registering NFTs allow them to be used as reactions in RARA's protocol.
To create Reactions, NFT owners ("Makers") must register NFTs with RARA. Registration is simply proving ownership of the NFT to the protocol contracts by the owner’s wallet. It does NOT involve sending the NFT to a different address, wrapping the NFT into another contract, or allowing any other contract to move the NFT on the owner's behalf. This allows the user to maintain control over the NFT with their highest security, but still use the NFT in the RARA protocol.
When a wallet registers an NFT, they interact with the MakerRegistrar Contract. The address that owns the NFT calls the “registerNFT()” function and passes the relevant information, such as the NFT address and NFT ID. The contracts will then verify that the calling address owns the NFT, and if so, register it in the protocol. From then on, the owner of the NFT can sell Reactions or claim any accrued Taker rewards.
Since the RARA protocol runs on the Polygon L2 and most really valuable NFTs live on Ethereum L1, RARA has built a way to bridge registration from L1 to L2. To do this, the owner of the L1 NFT can interact with the RootRegistrar Contract and call the “registerNFT” function. This logic will perform the same ownership checks on L1 as would occur on L2, and then send a message up to the contracts on L2 that will allow the NFT to be registered. Internally, the contracts keep track of the “chain ID” that each NFT lives on in order to distinguish L1 and L2 NFTs. Once the register transaction is confirmed on L1, it will take about 15 minutes for the message to be relayed up to L2 before the NFT is fully registered in the protocol.
When an NFT is registered in the system, it is assigned a Source ID. This is a unique ID derived from hashing the chain ID, NFT Address, and NFT ID. See “_deriveSourceId()” in the MakerRegistrar Contract. This ID is used to identify the NFT for any future references across contract calls. The Source ID is a 1-to-1 mapping of ID to NFT.
When an NFT is registered in the system, the caller can optionally specify Option Bits. This input parameter signals intent of the caller to transform the original NFT in some way to be used as a Reaction. This could be adding a border to the image, resizing it, or cropping it.
Transform ID In order to reference NFTs used as Reactions, a Transform ID is used to combine the 1-to-1 Source ID and Options Bits combination. Since an NFT can be registered multiple times with different Option Bits, this unique ID will be a 1-to-1 mapping between the “transformed” Reaction NFT and the ID. The Transform ID is a hash of the Source ID plus the Option Bits.