Dialogue with the LooksRare team: In-depth discussion on underlying technology, user experience, and team building
Source: Odaily Planet Daily
On the afternoon of March 28, 2022, the LooksRare team held an AMA on Discord to discuss technical issues related to LooksRare and answer questions from community users regarding technology. The project members participating in the AMA included: Development Lead Shisui, Backend Lead Hex, Frontend Lead Nirato, and Product Manager Gizmo.
Underlying Technology:
Modular smart contracts allow for timely deployment of new features, and the security of user assets is the team's top priority.
1. Can you compare LooksRare's contracts with OpenSea's and what optimizations LooksRare has made?
JurassicPunk: Wyvern (the protocol used by OpenSea) has been one of the most widely used smart contracts on Ethereum, and it undoubtedly helped lay the foundation for the development of the NFT industry.
LooksRare is also built on a similar architecture, with an off-chain/on-chain system, but the other parts of the architecture are very different. We are highly focused on user security, so we adopted a modular system for smart contracts, using EIP-712 signatures (a signature method that is easy for humans to understand), and innovative tools like one-click cancellation of all listings.
This modular contract provides several benefits, such as adding new trading matching methods and allowing for future changes in business logic. The protocol also focuses on creators, with the innovation of supporting ERC2981, providing on-chain royalty registration for projects, and instant payment of royalty fees with each transaction.
2. Why do you deploy so many contracts independently, such as using royalty contracts to deploy FeeSetter, FeeManager, FeeRegistry?
Basically, more modularity means the system is easier to audit and understand (a classic divide-and-conquer paradigm often found in software development), and it will be easier to add new features or fix bugs in the future.
3. What evidence can you provide that you built from scratch and did not use OpenSea's backend?
Gizmo: You can see that LooksRare uses EIP712 for signatures (which users can clearly understand), and at the time of our launch, OpenSea did not support this signature. So our entire system is incompatible with OpenSea. Our backend for trading, indexing, and everything related to trading is completely independent of OpenSea. We built our trading system from scratch, which is why LooksRare can continue trading when OpenSea goes down. Next time OpenSea crashes, you can come and try it out.
4. From a technical perspective, what was the most challenging aspect of building this NFT marketplace? How did you solve this problem?
Shisui: Synchronizing events that occur on-chain with those outside of LooksRare is a big issue. For example, if you transfer an NFT to a different wallet but it is still listed on LR, we need to catch that. You may know that expired orders are a big problem after launch. Overall, synchronizing on-chain and off-chain data is always a significant challenge. We need robust and fast scripts for indexing.
Nirato: From the frontend perspective: managing the state between the frontend, backend, and blockchain. We are not sure if we will solve this problem, but we are always looking for ways to indicate to users the most accurate current state of the NFT.
Card grid performance: There are issues with card displays such as gifs, videos, images, images not loading, images being too large, images being too small, and images only loading well on Chrome, etc. We have recently made significant improvements in this area by updating our image provider and utilizing technologies like lazy loading.
Security: We rely on many third-party APIs and services, which do not always respond to security issues. They have their own timelines for fixing/supporting issues, which is not something we can control, and it is really frustrating for us (look at your Trezor). It is an endless tug-of-war between security and functionality. How do we solve this problem? We try to reach out to any other development teams willing to communicate with us.
5. What backend and frontend technical features are each team member most proud of?
Shisui: For me, it should be the series bidding feature. Adding liquidity to NFTs is a very exciting feature. The series bidding feature greatly increases the liquidity of a series of NFTs. I have different answers from others!
JurassicPunk: For me, I am quite pleased with the comprehensive push for the adoption of EIP-712 signatures in the industry!
6. What technology do you use to index NFT data, and how do you handle failed API calls and limits on a series of NFTs?
Hex: We have built our own indexer in Java, parsing blocks and relevant events for ERC721/ERC1155 (also the marketplace), which includes using tokenURI() and other standards to parse their metadata; we have a failure and retry strategy for each transfer event.
Regarding rate limits, if we notice them, we will contact the project team; otherwise, we will adjust our strategy when fetching their metadata/images; we also have our own IPFS gateway, which helps prevent rate limiting on this side (arweave will also be online soon).
7. You know there are many hacking cases involving wallets based on private keys. What are your thoughts on collaborating with non-private key-oriented wallet projects like Argent?
JurassicPunk: Smart contract wallets are already supported in smart contract exchanges, but they have not been implemented on the frontend. This is something the team will consider supporting in the future.
8. How scalable is your infrastructure, and can you sustain a 10x user growth in the next 12 months? Or 100x or 1000x?
Hex: We use third-party hosting services, allowing for almost all scalability (cost is the only "barrier"), so we are very confident about it; since our launch, we have been able to maintain up to 6 times the daily average traffic; so we are confident about 10 times, not sure about 1000 times, but we will strive for it, especially in the next 12 months.
We hired an SRE a few weeks ago, which will help with this work.
9. Will there be a native minting feature, or will Manifold become the solution in the future?
JurassicPunk: Yes, there will be in the future. The team is still discussing the specific specifications, but it may be released in multiple product iterations.
10. Will you develop an API for accessing historical and current NFT data?
Hex: Yes, like the "historical activity" of NFTs; you will be able to query all information about any series or NFT through a public API, including minting/transfers/bids/listings/cancellations/…; regarding historical metadata, this is something we have not considered yet, but if there is demand, we may provide this as well.
11. How do you catch bugs early in the development process? (Unit tests? Automated tests? Manual testing? Bug reports? etc.)
JurassicPunk: For the smart contract/Solidity part, all contracts are thoroughly tested, with over 95% branch/function coverage on deployed contracts. We use unit tests and scenario tests, employing multiple frameworks like Hardhat (with Waffle) and Forge (with DS-test). We also rely on security tools like Slither.
We also collaborate with external security companies/individuals to help review Solidity code.
Nirato: From the frontend perspective, we are currently writing unit tests and have a team of manual testers. This is not enough, and it is currently a pain point for us. We definitely need to do better and are actively looking for QA engineers (know anyone? Feel free to recommend talent). Finding QA engineers with blockchain/web3 experience is a challenge, and we are doing our best to address it. We all agree 1000% that we need to conduct E2E and integration testing as soon as possible.
A valuable asset is community testers (not boasting). Without them, we would have thousands of bugs.
12. Will LooksRare support multi-chain in the future like Polygon or Solana? Or some second-layer solutions like Starkware?
JurassicPunk: Yes, the team has been investigating support for all second-layer solutions, but as @Shisui (Chief Developer) wrote, it depends on user demand.
Additionally, it is currently uncertain whether the demand comes from NFT bridging (e.g., transferring BAYC to Arbitrum and trading on L2) or from lower transaction fees for native layer-2 NFTs, where there is more demand (or both!).
Currently, the team stays updated and monitors the development of the NFT space on L2, including EVM-compatible second-layer networks like Arbitrum/Optimistic and non-EVM-compatible second layers (like Starkware).
User Experience:
Striving for a comfortable user experience in every product.
1. When will the public API be available to the public?
Hex: The public API has been released to the first batch of users, including third parties and users, to ensure everything goes smoothly; our goal is to release the public API this week or next week.
2. Is the WETH reinvestment feature optional? Can I turn it off after enabling it?
JurassicPunk: The automatic reinvestment feature (selling WETH --> LOOKS) will be an additional layer of contracts on the current WETH/LOOKS staking contract. Users can choose to use either of these two contracts based on their preferences.
3. Are you actively working to improve frontend performance?
Nirato: Short answer… yes! The development team releases multiple updates/features/fixes every day. The team tries to focus primarily on new features/improvements, but there is still technical debt, and we allocate a significant portion of our time to these efforts.
4. I am a loyal fan of yours, but the frontend makes my laptop sound like a jet taking off. It is not a very swift experience either. Loading things can take a while.
Nirato: We are very proud of the frontend and its speed, and we hope every user can experience that (well, at least we are trying hard). We have recently updated our image provider, and the loading speed of images has significantly improved. We have also made real improvements in loading gifs and videos, but it is still a challenge for mobile users and older computers. It is an ongoing struggle, but stability and performance are top priorities.
We are continuously exploring new ways to reduce latency and bottlenecks.
If there are any other performance issues, please feel free to post them in our ?│bug channel or contact a mod for more specific issues.
Team Building:
Technical personnel make up the majority of the team, with decentralized work.
1. How many frontend and backend engineers (API Focus) are you hiring? Does work communication require voice meetings? Or is document transfer sufficient?
Shisui: We currently have 3 frontend, 4 backend (including DB), 1 developer, 1 Solidity developer, and me. We use Discord as our primary communication tool (we have meetings every day).
2. How do the members of the development team communicate? Do you work in the same office or work from home?
Shisui: We use Discord as our primary communication tool. Everyone works remotely; we have no office and no plans to set up an office because we do not want to be tied to a specific country. Our members are currently distributed across the US, Europe, and Asia. Decentralization is in LooksRare's DNA.
3. How does the LooksRare team respond to emergencies? Is there an incident response manual?
Shisui: We have many monitoring tools and several different ways to contact each other, depending on the severity. Usually, when something happens, we can respond within minutes. We have a dedicated conversation channel internally where we summarize all events afterward.
Nirato: Gizmo has us all working on pagers, directly hitting us through the Do Not Disturb settings on our phones. No escaping! We have people online in almost every time zone, which is also our advantage.
Others:
Calculation method for LOOKS token airdrop.
1. Hello everyone, I would like to know how you determine the number of tokens and the levels of the token airdrop? Additionally, how is eligibility calculated (e.g., based on OpenSea's API?)
JurassicPunk: The planner behind the airdrop levels and quantities is Guts, our co-founder. He is very experienced in this area and has gone through many rounds of rigorous calculations to arrive at the current levels.
For collecting trading volume, we use subgraphs of TheGraph protocol to gather on-chain data from the OpenSea marketplace. The subgraph indexes calls to the Wyvern protocol and uses Uniswap to handle the conversion of non-ETH trading volumes to ETH. This is quite complex, as we have to integrate multiple currencies like MANA, GALA, etc.