SIP-21: Retroactive funding 2.0
Last updated
Last updated
This proposal suggests for the protocol’s governance to adopt and enact a retroactive funding initiative. Retroactive funding is a mechanism that provides financial support to previously executed activities, decisions or initiatives after they have taken place. This is arguably an advantageous approach compared to the more traditional, forward-looking funding approaches, structures and initiatives employed by other protocols and DAOs, which typically request support for initiatives prior to their execution and deployment.
The adoption and enforcement of this funding model has been previously approved and its various benefits and advantages have been extensively covered in an earlier governance proposal: https://snapshot.org/#/samuraifi.eth/proposal/0x616f07009ef74ba67f174705bf9dd28efb35a03c2b90838bfd5222e5684f0100
The outlined advantages have included but are not limited to:
Encouraging participation
Supporting experimentation
Increasing efficiency
Enhancing accountability
Promoting transparency
Since the adoption and enforcement of the last funding proposal, the retroactive approach towards funding has been increasingly utilised and further validated and solidified by the industry’s notable players such as Gitcoin, Rocket Pool, Polkadot or the RetroPGF initiatives by Optimism.
Furthermore, overall the industry appears to have shifted and gravitated towards increasingly utilising and relying upon the retroactive model (https://a16zcrypto.com/posts/article/governance-faq/#section--7). This is also visible from the recent TGE (token generation events) conducted via airdrops that are retroactively determined and allocated to users in accordance to their activity and engagement such as the Pyth or Jito Networks. These events further accentuate the merit, viability and suitability of employing a retroactive approach towards protocol-related initiatives.
This proposal details and outlines the efforts, initiatives and integral features that the core team and its companies have designed, executed and delivered to the protocol over the last 10 months and proposes a retribution to the core team and its companies in the form of retroactive funding. The retributed amount shall be 600k USDT and the source of funding to facilitate the proposed retroactive funding shall be the Samurai Governance Vault.
The retroactively retributed activities and initiatives include but are not limited to:
Besides continuous protocol contributions, maintenance and refinement, among the most notable areas of development and focus of the last 10 months belong:
Among the biggest updates was successfully deploying to the decentralised application (dApp), which received a complete rewrite and overhaul of its architecture. The Samurai dApp is composed of multiple smaller dApps, which are each deployed on their own subdomain (such as app.samurai.financial or chat.samurai.financial, etc.). This is due to the fact, that each of the Samurai dApps is pinned to IPFS, which can only store a static HTML. Hence, in the past, each of the developed dApps had its own separate repository, and its own separate components, and as a result there was a substantial amount of code duplication and its maintenance became increasingly more complex.
Everything was therefore consolidated into one mono repository. The technological stack chosen for this is TurboRepo in combination with NextJS and TailwindCSS. This allowed the creation of Samurai’s very first reusable component library, the Samurai UI (@samurai/UI). The complete overhaul, rewrite, and refactoring of the codebase allowed Samurai to create a powerful suite of internal tooling and reusable, composable UI, that further accelerated the development process and drastically enhanced the development experience. All of these changes have also improved the UI and UX for the users, and despite the fact that the changes were major, the users were not impacted by any of these major migration steps. As a result, the experience across all the smaller dApps within the Samurai ecosystem has become smoother and more coherent. As for the engineering side, it was ensured, that the application is more robust, maintainable, and can scale considerably more easily to keep up with the ever-growing, fast-paced industry.
An example of this maintainability and flexibility was showcased in this year's redesign. Instead of having to update each of these dApps individually, which would be inefficient, only the Samurai UI library had to be updated, which propagated all the changes into the Samurai dApps simultaneously on deployment. Hence, this further reinforces that the frontend overhaul has delivered a significantly positive experience as a result of applying the best software engineering practices and applying correct co-location, separation of concerns, splitting the service logic from the UI components, and using composability over inheritance wherever it has been possible and applicable.
The Samurai backend API has been rewritten and redesigned in order to help the client-facing dApp scale more easily. Similarly, for the backend, this year has been notable in fixing many issues by streamlining the codebase and refactoring. As a result, the Samurai protocol picked up battle-tested architecture patterns and had its entire codebase rewritten to primarily make use of Dependency Injection. This has allowed service layers to be rewritten, which were now more reusable and cohesive.
The PostgreSQL schemas have been improved and certain queries have been optimised to accommodate the large volume of trading data, which has been required for post-processing in certain dApps, such as Samurai Release. This has further enabled the protocol to improve atomicity and data consistency across the board, as each service layer can implement its own wrapped functions to include database transaction rollbacks in case an application exception arises.
Part of the backend rewrite has also been the consolidation of the separate micro-service, which has been responsible for Node RPCs. The logic has now been consolidated under one repository and has made the maintenance and upgradeability of the backend functions significantly easier and more cohesive to engage with. New RPC providers have also been selected for integration purposes in order to diversify from working with just one provider and in order to increase the decentralisation aspect of RPC usage, as well as to facilitate the addition of Arbitrum RPCs.
Since the very first migration of Node NFTs, the protocol has been utilising IPFS as its backbone technology for hosting all of its metadata files. As of now, there are over 226 000 metadata files, which are stored and pinned on IPFS. However, as part of the Node RPC upgrade, the metadata has been updated and the pin manager has been migrated to NFTStorage. This migration has been one of the protocol’s biggest migrations to date, and in order to seamlessly migrate over 226 000 JSON metadata files, essential solutions were developed to efficiently pack all the files. This required engagement with Content Addressed Archives (CARs) and NFTStorage is one of the few providers, which support CARs and chunking of CARs for seamless uploading to IPFS.
Another benefit of using NFTStorage over proprietary SaaS-like pinning services is the further decentralisation of bandwidth and better trust due to the open-sourced nature of the codebase from NFTStorage.
The development of Samurai Chat was primarily composed of frontend engineering and smart contracts engineering in order to achieve a SaaS-like subscription-based product that many users are accustomed to. The frontend solution is statically exported, much like Samurai’s other dApps, and therefore the entirety of the code is client-side and decentralised over IPFS. As the Samurai dApp communicates with OpenAI's API, it was essential to facilitate and develop a solution, which minimises the centralisation component, as the users' private OpenAI API keys are never sent to any other servers and devices besides OpenAI for key authorisation.
Furthermore, the SamuraiSubscription contract written in Solidity guards the frontend application from being accessed by users who have not purchased a subscription. A decision was made to base the subscription length on block time instead of block number, as it was found to be more consistent and fair to the user, as the time between each passed block on Fantom may change should the chain's throughput be upgraded in the future.
Samurai Release required substantial development across many fronts due to the large number of possible edge cases which had to be accounted for. Firstly, a large volume of historical trading data and holder snapshots had to be recovered and post-processed in order to create a database of eligible wallets. The collected data was then applied to a specific database schema and used as a migration seed for the backend service to further process the multi-stepped enrolment procedure.
Another obstacle which had to be resolved was regarding the location determination of the enrolled users. Hence, external parties and services were integrated in order to detect VPN usage and real-user location with high precision and accuracy.
Simultaneously, a smart contract was developed in order to facilitate the actual release process in accordance with the collected data and the eligibility determination conducted by the backend service. The SamuraiRelease contract, once it has been approved by the user, carries the obligation of carrying out the process of retaining the Node NFTs from the user, while also ensuring that the correct amount of tokens is released back to the user.
All parts of the Samurai Release work in tandem to ensure that at each step, from enrolment to the actual release, is correctly recorded, validated, consistent, idempotent, and atomic. This has ensured, that users who have gone through the enrolment have a clear user experience and a linear flow of actions.
Since the release of Samurai Levels V1, the popularity of this particular product has been prominent. Hence, many solutions for continual evolvement and refinement of the product have been considered. These advancements were concerning product feature scalability, security, and player retention.
The original Samurai Levels V1 contract had fewer avenues for adjusting the contract parameters. For instance, the V1 requirement to access the feature consisted of just a minimum of 1 HNR Node NFT. As a result, it was observed that several players have split their wallets and moved their nodes in order to spam and abuse the product. Therefore, Levels V2 has set out to improve its internal mechanisms and provide the governance with increased contract parameters configurability, such as minimum NFT threshold requirements, fee requirements, daily streak cap limits, and more.
Product-wise, the frontend was adjusted to allow for easier extension of different categories for questions. The improved architecture allows the product to arbitrarily scale its number of categories, which should help with extending player retention. Furthermore, the validation logic has been consolidated under one backend micro-service for improved security. As a result of this, the Levels V2 players are no longer required to pay gas fees, as the contract call has been delegated to a designated Levels Manager EOA wallet on Fantom.
Another milestone for the protocol has been the development and rollout of Samurai 2.0. This initiative represents a transformative leap in Samurai’s brand identity and user interface/user experience (UI/UX), marking a new era in the protocol's evolution. Samurai 2.0 was crafted and developed in order to attempt to match and reflect the maturity and robustness that the protocol has attained. The frontend user interface revamp went beyond mere cosmetic changes, as at the core of Samurai 2.0 lies a reimagined user experience. Each and every aspect of user interaction has been re-evaluated in order to create an intuitive, seamless, and engaging experience for both seasoned crypto-natives and newcomers alike.
One of the critical aspects of the new fronted user interface was to effectively showcase the range of products, services and features the protocol offers. The new design layout provides clear pathways for users to discover and interact with its various offerings, from Samurai Chat to Samurai Levels. This clarity in presentation not only enhances user experience but also highlights the diversity and breadth of the Samurai ecosystem.
Samurai 2.0 also introduced a refreshed and revamped brand identity that aligns with the protocol’s evolved vision and ecosystem of products, services, tools and features. The new brand identity prioritised not only aesthetic pleasure but also the communication of the protocol’s core values and its sophisticated, yet user-friendly nature. The new logo, colour scheme, and design elements were all designed to function in harmony to convey the focus on innovation and user-centricity.
One of the more significant, transformative and notable steps undertaken in the last 10 months has been onboarding and engaging with a new legal counsel with extensive expertise in the field. This strategic move was initiated with a clear vision: to navigate the continuously evolving regulatory landscape of decentralised finance with profound efficiency, safety and compliance.
The DeFi and crypto spaces overall are known for their rapid innovation and dynamic changes, which often tread into uncharted regulatory territory. Recognising this, the Samurai protocol engaged proactively with legal experts who specialise in this domain. This engagement was not a mere formality but a deeply integrated part of the protocol’s operational strategy, especially in the development and implementation of initiatives such as Samurai Release. The legal counsel, equipped with expertise in emerging and continuously evolving crypto-related regulations, played a pivotal role in steering the protocol through complex legal frameworks.
One of the critical aspects of this collaboration has been the ability to adapt swiftly to regulatory shifts. The legal counsel ensured that the protocol remained ahead of the curve, interpreting new laws and regulations and advising on the best compliance strategies available to the Samurai protocol. This approach was not just about adhering to the rules but also about understanding the spirit of these regulations, ensuring that the Samurai protocol operates carefully and responsibly.
This engagement with legal counsel has been instrumental in ensuring the longevity and safety of the Samurai protocol. As the protocol moves forward, the lessons learned and the strategies implemented in collaboration with the legal counsel shall continue to guide its journey.
The risk-related and safety-related operations, particularly pertaining to the custody and handling of assets have undergone significant and considerable improvements since the inception of the protocol. The continuously attained knowledge, skills and experience through engagement with numerous consultants and experts in this field, have garnered particularly positive results for the protocol this year.
Leveraging cryptocurrency mixers for the purposes of operational security, centralized exchanges for the purposes of custodying and exchanging assets, storing assets on the Ethereum blockchain, in addition to implementing the use of multi-signature solutions have proven to be an optimal strategy in numerous regards. It allowed the protocol and the assets to remain safely guarded and not susceptible and exposed to any significant exploits, attacks or other events that would lead to its theft or loss of value.
The occurrence of high-risk, highly value destructive events across the entire industry in the past 10 months have been significant. From USDC and DAI stablecoins temporarily de-pegging across all blockchains (https://decrypt.co/123211/usdc-stablecoin-depegs-90-cents-circle-exposure-silicon-valley-bank), numerous centralized exchanges entering bankruptcy, extensive exploits of DeFi protocols and bridges (https://cointelegraph.com/news/euler-finance-attack-how-it-happened-and-what-can-be-learned), to some unprecedented events taking place on the very chain that the Samurai protocol operates on.
The Fantom blockchain has been exposed to a major adverse event - the Multichain exploit - that has led to the de-pegging of numerous stablecoin assets issued by the bridge and led to many users, protocols and enterprises operating on the chain being exposed to major value destruction (https://cointelegraph.com/news/multichain-victims-search-for-answers-in-billion-dollar-exploit-as-new-evidence-emerges). This particular event has been devastating for many of the protocols operating on the chain, as well as the Fantom Foundation. It has resulted in many protocols, DAOs and projects being exposed to major losses and either migrating to different blockchains or completely ceasing operations. The Samurai protocol is a rare anomaly in the landscape of the Fantom ecosystem, that has managed to avoid any disruptions to its service and functionality, and that remained completely, directly unaffected by the exploit. This is a result of the strategic decisions and measures outlined above, that enabled the protocol to be positioned in a manner that allowed it to withstand the extreme turbulences and downturns experienced in the last 10 months. This goes to show the importance and success of the proactively adopted and enforced security practices and risk management approaches.
Enact the initiative Transfer assets
Votes