# Microgrant for Fabrizio: Smart Notary Protocol ### Context as of 2023/3/14 Following the launch of the FEVM, a promising opportunity has arisen for the Fil+ team to harness smart contract technology in order to streamline and automate the issuance of datacap. Fabrizio Gianni, a talented software engineer, has been working with the Fil+ team for the past few years. With a keen interest in smart contract technology, Fabrizio is eager to develop a smart contract that functions as an "automated" notary. He has already participated in the Space Warp Hackathon, where he built a prototype of the Smart Notary Protocol: [repo here](https://github.com/fabriziogianni7/Smart-Notary-Protocol#readme), [demo video here](https://youtu.be/CYYsoPYDCes), [website here ](https://smart-notary-protocol.com/). By utilizing this microgrant, we, the Fil+ team, aim to work with Fabrizio to refine the smart contract and work towards a version that meets the requirements of the Fil+ community while enhancing the user experience for all Fil+ stakeholders, including notaries, clients, and root key holders. ### Deliverable The Microgrant's 10-week timeline aims to develop a smart notary protocol that effectively manages the issuance of datacap based on a predefined logic in a smart contract. Essentially, the smart contract will enable notaries to endorse clients by staking FIL. Deliverables will include: - Smart-Notary Actor deployed on hyperspace - Documentation on Smart Notary actor flow - Front-end to interact with Smart Notary and github ### Milestones and Timeline Note: everything passed the second milestone is subject to change, depending on how the Fil+ community reacts to our initial design 1. Research, planning, and community engagement (week 1): - Conduct internal research on potential designs considering FVM smart contract capabilities - Determine the best design within given constraints - Publish documentation for public review (targeting Fil+, FVM, and Cryptoeconlab groups) with proposed details on: - Smart contract workflow - Function descriptions - Frontend mockup - Variable values (e.g., staking amounts) - Project's alignment with the broader Fil+ ecosystem 2. testing of the basic smart contract for datacap issuance - Hyperspace (week 1-3): - Work on this milestone concurrently with the one above, allowing extra time for stakeholder feedback - Deploy a minimal smart contract that replicates basic LDN multisig functionality - Involve a subset of root key holders for datacap issuance - Develop a new frontend UI and share it with participating stakeholders - Create a smart contract with basic functionality to send, receive, and allocate datacap to client addresses (similar to a multisig) - Establish a proxy contract for future upgrades (where the datacap is going to be located in between deployments) - Write a application to be a notary for the multisig - Test the proxy, smart contract, and frontend on Hyperspace 3. Smart contract upgrade to smart notary - Hyperspace (week 3 - 7): - Collect stakeholder feedback and finalize the plan within the Fil+ governance team (week 3) - Implement the upgraded smart contract with new logic(subject to stakeholder feedback, weeks 4-5): - allows clients to apply for datacap (new smart contract deployed) - allows notaries to present a client (new smart contract deployed) - allows notaries to vouch for a client by staking FIL - allows admin to approve of a notary <> client deal - allows admin to add FIL to the smart contract for a reward pool - allows notaries to be rewarded for staking FIL according to implemented logic - allows admin to "slash" FIL from notaries collateral (possibly returning the FIL, depending on legal implications) - Update frontend UI to reflect smart contract changes and add links to Fil+ registry and [filplus.storage](https://filplus.storage/apply) (weeks 4-5) - Modify the proxy contract to point to the new smart contract (week 4-5) 4. Testing phase - Hyperspace (week 7-9) - Beta test the software with a subset of stakeholders and collect feedback - Implement final changes to the smart contract and perform another upgrade 5. Deployment and community engagement phase - mainnet(week 10 onwards) - Deploy on mainnet (subject to feedback from FVM team and Fil+ team) - Release a post-development document detailing changes made due to implementation and testing issues - Announce the product to both FVM and Fil+ stakeholders - Develop tutorials for using the new software ### Budgeting and resources - Over $5000 for Fabrizio's microgrant - Support from the FVM team - FIL for deploying and testing smart contracts ### Out of scope This is a collection of ideas and open discussion topics that can be further developed if initial phases of this project prove to be successful with the community. These are however out of scope for this microgrant given the budget and expected timeline: - Developing an oracle to gather data pertinent to determining whether to penalize a notary or client (e.g., SP/Client/notary reputation data). For now, the governance team and notaries will do manual work to do due diligence on clients before datacap allocation. - Developing an oracle to bring deal data on chain. For now, we'll just manually send data onchain through a front end (centalized methog) - Establishing a structured governance system for the smart contract, in which changes are implemented through improvement proposals - Creating a completely permissionless smart contract that allows anyone to become a notary, provided they stake a sufficient amount of FIL - Developing a marketplace where clients and service providers (SPs) can bid for datacap - Designing a market where notaries can place bets against one another