Creating the Deed with Quentin Merabet

Today marks the 1-year anniversary of LVCIDIA Staking. Stars that you all created and named shine brightly in the Lvcidia sky, and soon, at the end of Era 2—a new planet will take shape. Our Staking team has strived to deliver you an unforgettable experience, one that remains without comparison in the space. To celebrate their incredible technological innovations this past year, we sat down with Engineer Quentin Merabet to discuss how he, in collaboration with the team at Manifold, designed an exciting new system for ownership on the blockchain. 

For a more general overview of the Deed and its uses, be sure to explore our previous article “The Deed NFT: A Complete Guide”. You can also view the smart contract for the Deed here

“I quickly realized one thing when Lvcidia contacted me – they don’t like to do things the way other people do.” 

Quentin Merabet, a longtime coder, discovered Fvckrender’s work at the start of his journey into Web3. Interested in what was being built at Lvcidia, he jumped at the opportunity to contribute to Fvckrender’s vision. “[That first meeting with the Lvcidia team] was full of creativity, because it was so open,” says Merabet. “I felt like everything was possible. And I just suggested that maybe these Deeds could be dynamic, and upgradable in some ways. They were like, oh wow, cool, okay, is that even possible? And I was like, yeah, it’s going to be some work, but it’s possible.”

Going into that meeting, the general vision for the Deed had already been laid out. The goal of Era 2 is for the Lvcidia community to craft a Planet through their collective contributions. Once the Era reaches its end, those who participated were to receive an NFT that served as proof of their individual contribution. This claimable ‘Deed’ would also represent the collector’s share of ownership over the Planet. 

While the foundation of the idea was solid, Quentin and the team still felt it was missing something. Lvcidia aims to offer a completely singular experience, one that no other project could easily replicate. The Deed had to be special. “Two crazy ideas—which would end up being our two biggest technical challenges—emerged,” Merabet explains.

“[It was] the kind of rare moment that’s both hyper-stimulating and exciting. The kind of moment that reminds me why I love my job.”

The first idea centered around making the Deeds visually differentiated. Rather than just being a static artwork—a sort of passport for participating—the team was attracted to the possibility that Deeds would take on different appearances depending on the type of resources a user contributed and the ownership percentage the Deed holds. The second major idea naturally erupted from the first. If Deeds can evolve to take on different appearances, why not provide the tools so they can be continually altered? By designing a dynamic Deed NFT that can be split or merged, planetary contributors can continue to engage with their Deed, and grow their ownership, for long after the Era’s end. Subsequently, this would also create a real market for Deeds.

“Deeds were supposed to be the end of the Era, but now… it almost feels like it’s a new beginning.”

Generating ideas is one skill, but executing them is another. After that meeting of the minds, Merabet got to work. He was confident creating an NFT of this caliber was possible; he just had to find the path. “Well, now at least it’s clear—we’re going for a dynamic NFT,” Merabet recalls. “And now I find myself with the challenging task of taking the work already done by Manifold, and integrating these [ambitious] new ideas.” Unsure where to begin, he broke down what he’d need to accomplish step-by-step. 

 

  1. Retrieve planetary contribution data from each user; who contributed, what resources did they contribute, and in what quantities? 
  2. Allow users to claim their Deed, with proper metadata corresponding to the information retrieved in Step 1. 
  3. Add the ability to Merge and Split Deeds at any time, while generating new metadata for the updated NFT.
  4. Generate the proper appearance of the Deed at the moment of its creation; update appearance automatically after Merge or Split. 
  5. Design an interface for managing Deeds.

STEP 1: Collecting the Data

As Deeds are generated based upon individual collector’s contributions, Merabet needed an efficient method of collecting this data on a user-by-user basis. The difficulty here is that he knew planetary contributions in Era 2 would likely be broken up into separate transactions, with varying resources and quantities each time.

So rather then identifying a single core transaction for every user—and constructing the Deed from that—all relevant transactions would need to be accumulated, organized, and added together. Only then would he have the prerequisite data to construct a Deed. 

While Merabet initially feared that he’d have to build this function from scratch, the problem ended up resolving rather quickly. “When I joined Lvcidia, a huge part of the world’s ecosystem was already done and worked on by Manifold,” says Merabet. “I learned so much just going through the code they did… I discovered that actually there was a [basic] version of the Deed that had been written already.”

Merabet found that user contributions, and all the data associated with them, was happening directly inside the Deed’s smart contract. Manifold’s previous work on the contract had ensured the data was kept close. With it, Merabet had just what he needed to move onto the next step. 

“It was an amazing experience to collaborate with Wilkins, who’s co-founder of Manifold. He’s not nobody, he’s an amazing engineer. I learned so much from him.” 

STEP 2: Claiming a Deed 

Once the contribution information is collected, users need to be able to claim a Deed that possesses the accurate metadata. From the user side, this is as simple as clicking a “claim” button; behind the scenes, the process is much more complex.

Metadata refers to the descriptive information tied to an NFT, and is used to populate the “traits” of that NFT.

For Deeds, the metadata will reflect the type of resources contributed, the ownership percentage, and other relevant information. “Metadata is [stored in] JSON files, as a kind of multi-dimensional array, like an Excel file,” explains Merabet. “But [the metadata] is not on the Ethereum blockchain. They’re stored on a decentralized service called IPFS the vast majority of the time, and they’re pre-generated.” 

When Merabet says metadata is typically “pre-generated”, he’s referring to the fact that with something like a 10k PFP (profile picture) collection, the art and its metadata usually is not being generated spontaneously at the time of purchase.

The buyer is just being randomly assigned one of the already existing 10k randomly generated artworks, that were approved and uploaded by the collection creator prior to the sale.

There’s nothing inherently wrong with this method, but Merabet knew it wouldn’t work for the Deeds: “Every Deed is unique, and every Deed fits a user based on what they contributed. So those [contribution] values can’t be written on files, and stored somewhere [in advance]. We have to generate them on the fly.” Unlike most other projects, Deeds and their metadata are generated upon mint to ensure that they’re fully personalized to the individual user’s contributions.

When claiming a Deed, you’re not just receiving an NFT—you’re creating it.

STEP 3: Merge and Split 

To ensure Deeds could have a lifespan far beyond the end of the Era, they needed to be playable in some way. Beyond just being used to vote on issues related to the Community Planet, it was essential that holders be able to combine Deeds. Anyone looking to grow their ownership stake in the Community Planet should be able to purchase Deeds on the secondary market, Merge them with their own, and have all of their ownership stored within a single token. Conversely, if a user wanted to sell off some of their ownership, it seemed restrictive to require them to sell their entire stake at once. The Split feature was developed to allow users to split their ownership among separate Deeds at any time. 

“I started this feature from scratch. At the time, I had nothing in mind which could compare to what we wanted to do.”

Developing Merge and Split was one of the greatest challenges Merabet had to overcome. His initial idea for the Merge function was that it would add up the metadata values of the inputs (Deeds), update the metadata of one of the existing Deeds to reflect the combined value, and burn the other Deed(s) that were no longer needed. There is no way to literally ‘fuse’ two tokens together on the blockchain, so the process was always going to involve burning leftover Deeds.

That being said, it was still not an ideal solution. For one, how would the function choose which Deed was going to be preserved (as the updated, Merged version)? Additionally—and this was the more substantial point of concern—some marketplaces don’t refresh metadata on NFTs automatically. This means that some users may not even realize their NFTs have been properly merged, because the marketplace is reading the cached (old) metadata and not the newly updated metadata. On a large scale, you can imagine how this may cause issues with people buying and selling NFTs that are, effectively, mislabeled.

The natural conclusion of this line of reasoning was that both Merge and Split would have to produce newly minted NFTs. This would be the only way to ensure that they had the proper metadata being read, no matter where/when they were being viewed. “If we have two different Deeds, with two different token IDs, we can add their [metadata] amounts and create a new [Deed], mint [it], and burn the initial Deeds.”

All of these steps are contained within the single Merge function. It scans the inputted Deeds, adds together their metadata values, burns them, and mints an entirely new NFT with the combined metadata. For the user, it’s like magic; for the engineer, it’s the product of much blood, sweat, and digitized tears.

Split works functionally the same way, but in reverse. The original NFT is burnt, while new Split Deed NFTs are minted. Instead of choosing which Deed NFTs you want to Merge, the Split function will prompt you to choose how the ownership value will be divided between the newly created Deeds. You can split a single Deed into two, and provide each one an equal 50/50 ownership share, or you can keep the majority of the ownership in one of the Deeds. There is a minimum amount of ownership a Deed needs to exist—1 Deed Unit—so it’s not as if a Deed could be split infinitely into smaller and smaller fragments of itself.

“If you have a Deed with 1000 Deed Units, you can [split to] create 1000 Deeds with 1 Deed Unit within each. This is your limit”. 

Since both the Merge and Split functions have so many steps to carry out, including minting new NFTs, they run the risk of being very gas intensive without proper optimization. “We had to use some tricks to make it [work] in this area. Wilkins and Manifold were very helpful… obviously they have a lot of experience regarding the way the blockchain works, what consumes gas, what doesn’t.” This is still the early days of the blockchain, and finding the best path forward is often just a process of trial and error. “We made a lot of tests because the blockchain [as a whole], it’s so new… even an amazing engineer like Wilkins, who co-founded Manifold, sometimes is just wondering, ‘is this solution more gas efficient, or is it this one?’” Merabet claims the current smart contract excelled in testing, Merging hundreds of Deeds at once in only a single transaction and with relatively low gas fees.

STEP 4: The Deed Visual 

In the same way that Deed metadata had to be generated on the fly directly inside the smart contract—allowing for infinite possibilities—the visual image of the Deed also needed to be created spontaneously. “On the visual of the Deeds, we show the percentage of ownership of the community Planet, and we highlight the resources you used to generate this Deed,” states Merabet. “We’re not going to create a bunch of deeds [in advance] with all the millions of different possibilities.” One user might have 0.019% ownership, while another has 0.514%, and so on, with endless unique combinations of resources donated. To make the Deeds truly personalized, the artwork would have to be created at the moment of minting. 

The design of the Deed, therefore, had to be broken down into its composite parts. “Manny, who designed the Deeds, sent me the different elements. And I had to create an API, basically a tool that compiled all those elements, and put them in place based on the Deed’s metadata”.

“We had to create a dynamic PNG. So every time you’re going to claim your Deed, or merge deeds, our tool is going to generate the right PNG, at that second, for your Deed. [This also ensures] marketplaces are going to have the right visual fitting for your metadata.”

When a user claims their Deed, their contribution history is scanned, turned into metadata, and then from that metadata: an accurate visual is generated. The metadata generation occurs through the smart contract, while the image is generated off-chain (i.e. not on the Ethereum blockchain). Finally, a fully-formed Deed is delivered to the user’s wallet. 

STEP 5: The Interface

After users have created their Deeds, they need a way to manage them. That interface is still being designed at the time of writing, though great progress is being made. Merabet was able to share that Deed NFTs will be managed through an entirely new website, separate from staking.lvcidia.xyz. Where the staking website was built around the process of staking your NFTs, this new site will cover everything that comes after you’ve claimed your Deed. The unique features of the Deed, such as merging, dividing, and voting, will inform the UX (user interface) design and overall direction. At launch, Deed holders will have access to Merge and Split, while the voting tool will be delivered in a later phase. 

“I love to say that a lot of smart contracts are not so smart….but this one is solid. It has value not just because of its tech, but because it’s fun to play with “ 

When reflecting upon his efforts in creating the Deed, Merabet is immensely grateful he was invited to participate in such an ambitious undertaking. Previously an outsider to the world of Lvcidia, he has now—with guidance from Manifold—played a crucial role in developing one of our most innovative offerings to date. “It could have just been a [static] NFT rewarding everybody for contributing for the collective planet,” says Merabet. “But it ended up being a project we spent three, four months working on. [This idea] to make Deeds dynamic and playable… this seed we collectively planted… this is the thing I’m most proud of.”

Ryan's Handmade Fvck Avatar
Ryan McCue

Ryan is an LA-based writer and filmmaker. He began as a Lvcidia community member in early 2021, drawn to the cinematic beauty of Fvckrender’s virtual creations. His engagement with the community led to him becoming a moderator for the Discord, and in 2022 he was brought on officially to create Lvcidia’s newsletter. He now assists in writing articles for the Lvcidia journal, conducting interviews, and moderating the occasional live Q&A.

June FLUX Artist: 0xMinimalism

June FLUX Artist: 0xMinimalism

Read the article
May FLUX Artist: Mehmet Karafilm

May FLUX Artist: Mehmet Karafilm

Read the article
April FLUX Artist: Anz

April FLUX Artist: Anz

Read the article