{"signature": "0x74be60b501a9721ba245b438b1e14b9345f929f7571ec2eeb284931491aac0e1260a7e5cde857b66adc3cc6059e58ea976fac36047f6b56e0d0382c9483f451d1c", "application": {"round": "0x5b95acf46c73fd116f0fedadcbedf453530e35d0", "answers": [{"type": "email", "hidden": true, "question": "Email Address", "questionId": 0, "encryptedAnswer": {"ciphertext": "pXvpsDrDdfvuNCuACxNh6oPFW8gqhuP04n+rWMX5kbpvmDM1hXCERiEo+WjCyb//", "encryptedSymmetricKey": "891200c91b05a5186ff5028b290c66721beab4213f5047bde153165d4b0f81da4b932aea47a71f497176db1730fc37144d25cfcfff1e1c462ef765057eef593f7db4790cd1a2c0b09659e7e2567ebe4e2a9052b96212e5e61b79f37966291c83cfabe271fb1c552827515e986cab3a7f6ea86b8c1ab60e55deac14c171bf0be400000000000000202a6dd75c398941453bf982017473114c056d09bcd8a4cf4402a6cf630706143278d37e04ebcb5cb762d88933b3042ba8"}}, {"type": "short-answer", "answer": "none by now", "hidden": false, "question": "Funding Sources", "questionId": 1}, {"type": "number", "answer": "3", "hidden": false, "question": "Total team size", "questionId": 2}, {"type": "paragraph", "answer": "## Team\n\n### Valerio Fichera\n\n- Twitter:\u00a0[@valerio_eth](https://twitter.com/valerio_eth)\n- Email:\u00a0[valerio1fichera@gmail.com](mailto:valerio1fichera@gmail.com)\n- Telegram handle: @nft_valerio\n- Github: [valeriofichera](https://github.com/valeriofichera)\n\n### Philipp Keinberger\n\n- Twitter:\u00a0[@phil10013](https://twitter.com/phil10013)\n- Email:\u00a0[philipp.keinberger@gmail.com](mailto:philipp.keinberger@gmail.com)\n- Telegram handle: @keinberger\n- Github: [keinberger](https://github.com/keinberger)\n\n### Vincent Daubry\n\n- Twitter:\u00a0[@vdaubry](https://twitter.com/vdaubry)\n- Email:\u00a0[vdaubry@gmail.com](mailto:philipp.keinberger@gmail.com)\n- Telegram handle: @vdaubry\n- Github: [vdaubry](https://github.com/vdaubry)", "hidden": true, "question": "Profiles or socials of other main team members publicly associated with project", "questionId": 3}, {"type": "paragraph", "answer": "## Our Roadmap\n\n### **Phase 1: Research & Proof-of-Concept**\n\n- **Estimated Duration:** 1 Month\n- **Estimated delivery date:** 30th August 2023\n\nThis phase will focus on in-depth research and the creation of proof-of-concepts demonstrating how tailored firewall can enhance the security and functionality of protocols.\n\n### Milestone 2: Prototyping & Production (subject to change)\n\n- **Estimated Duration:** 2 Months\n- **Estimated delivery date:** 30th October 2023\n\nThe second phase will concentrate on the development and testing of firewall prototypes based on the findings of the first phase. The prototypes will showcase the practicality and benefits of integrating on-chain firewalls into DeFi Protocols.\n\n### Milestone 3: Testnet Deployment (subject to change)\n\n- **Estimated Duration:** 1 Month\n- **Estimated delivery date:** 30th November 2023\n\n## The final phase will involve the testnet deployment of all firewall components, followed by rigorous testing and refinement to ensure the system is ready for potential mainnet audits and protocol implementations.\n\n## **Our Goals**\n\n- Reliability\n- Inexpensive in gas terms. The overhead must remain negligible.\n- Not adding complexity to the protected contract(s): Implementing the Firewall must not require more than a few lines of Solidity code.\n- It must scale", "hidden": true, "question": "What are you planning to continue building for your project after Zuzalu? ", "questionId": 4}, {"type": "paragraph", "answer": "As per Zuzalu's mission with this QF round, we are a Project that arose from a Hackathon Project and turned to become a public goods initiative for making web3 a safer place and preparing it for mass adoption.\n\nWe decided to structure our project as a non-profit public good, as we see the net positive impact being the highest by doing so", "hidden": true, "question": "How does your project and future plan align with the Zuzalu mission? ", "questionId": 5}, {"type": "short-answer", "answer": "no", "hidden": true, "question": "Did you win a hackathon prize at Zuzalu?", "questionId": 6}, {"type": "paragraph", "answer": "no funding so far", "hidden": true, "question": "How much funding have you received and does your project have any other funding sources?", "questionId": 7}], "project": {"id": "10:0x8e1bD5Da87C14dd8e08F7ecc2aBf9D1d558ea174:713", "title": "TurtleShell", "logoImg": "bafkreibzi5dxefrn7jnmimoug6bxg5sqfvg6zn4vmxkvq6hkv4b6di5xju", "metaPtr": {"pointer": "bafkreifmjmlmvhxbimtazzygwdhnl5kel7e3twnw7a6f3u5irlm6qwal6e", "protocol": "1"}, "website": "https://turtleshell.xyz", "bannerImg": "bafkreibj2ptooeyozw6c6p4p74gex455a2svy63z5ivyk4epfyutprtgla", "createdAt": 1691590823499, "userGithub": "valeriofichera", "credentials": {"github": {"type": ["VerifiableCredential"], "proof": {"jws": "eyJhbGciOiJFZERTQSIsImNyaXQiOlsiYjY0Il0sImI2NCI6ZmFsc2V9..G_1Cb5cEgu64v1TDuyWO46hXAha_UXHAaR4eI1BWtCk9WGTPFUZ4FFGu_ROavg12quS3l_APlPM2Unh_cvQSDw", "type": "Ed25519Signature2018", "created": "2023-08-09T14:19:21.840Z", "proofPurpose": "assertionMethod", "verificationMethod": "did:key:z6MkghvGHLobLEdj1bgRLhS4LPGJAvbMA1tn2zcRyqmYU5LC#z6MkghvGHLobLEdj1bgRLhS4LPGJAvbMA1tn2zcRyqmYU5LC"}, "issuer": "did:key:z6MkghvGHLobLEdj1bgRLhS4LPGJAvbMA1tn2zcRyqmYU5LC", "@context": ["https://www.w3.org/2018/credentials/v1"], "issuanceDate": "2023-08-09T14:19:21.840Z", "expirationDate": "2023-11-07T14:19:21.840Z", "credentialSubject": {"id": "did:pkh:eip155:1:0xA7e9DBB781A18f67d115Ff8a7b5512A182ddd9a9", "hash": "v0.0.0:HaCU3RrwlhOqwh0H0R2uKFlpGuhlFxfBQFkt0N8PMAE=", "@context": [{"hash": "https://schema.org/Text", "provider": "https://schema.org/Text"}], "provider": "ClearTextGithubOrg#ikigai-labs-xyz#78494380"}}, "twitter": {"type": ["VerifiableCredential"], "proof": {"jws": "eyJhbGciOiJFZERTQSIsImNyaXQiOlsiYjY0Il0sImI2NCI6ZmFsc2V9..I1I-3-gCVfAYDlKhdby7IsOFjyjEDS6y-cdqpSjXpvxwBgaSpXRVwifxaBFND9q9Qc4I6Hc84pljh8QCX_JTAQ", "type": "Ed25519Signature2018", "created": "2023-08-09T14:16:36.690Z", "proofPurpose": "assertionMethod", "verificationMethod": "did:key:z6MkghvGHLobLEdj1bgRLhS4LPGJAvbMA1tn2zcRyqmYU5LC#z6MkghvGHLobLEdj1bgRLhS4LPGJAvbMA1tn2zcRyqmYU5LC"}, "issuer": "did:key:z6MkghvGHLobLEdj1bgRLhS4LPGJAvbMA1tn2zcRyqmYU5LC", "@context": ["https://www.w3.org/2018/credentials/v1"], "issuanceDate": "2023-08-09T14:16:36.690Z", "expirationDate": "2023-11-07T14:16:36.690Z", "credentialSubject": {"id": "did:pkh:eip155:1:0xA7e9DBB781A18f67d115Ff8a7b5512A182ddd9a9", "hash": "v0.0.0:oz0KwaLR0jBRUP1XEFRf0DE1c2AIJYKfY9Vq+fIUgWU=", "@context": [{"hash": "https://schema.org/Text", "provider": "https://schema.org/Text"}], "provider": "ClearTextTwitter#TurtleShell_xyz"}}}, "description": "# on-chain realtime hack prevention\n\n### we are building on-chain firewalls\n\n---\n\n## What is an On-Chain Smart Contract Firewall?\n\nSmart contract hacks have been plaguing DeFi protocols, bridges, and more.\n\nToday, in order to defend themselves, protocols perform audits, open bug bounties, and implement monitoring.\n\nAll of these steps are absolutely crucial. Nevertheless, whenever a vulnerability is discovered by an attacker, most exploits can drain funds in a very short period of time, sometimes even within a single transaction. To prevent these hacks from happening, we need an on-chain tool.\n\nYou can think of the Smart Contract Firewall as an additional layer of security for DeFi protocols.\n\nOur Firewall is a set of Solidity Smart Contracts that allow you to:\n\n- Define critical parameters for your protocol (e.g., TVL) and track these parameters over time.\n- Detect that a transaction (or multiple) is causing the protocol to operate outside its normal activity (e.g., unusual liquidity outflow, indicative of a potential hack happening).\n- Implement a set of protective measures, including transaction blocking, protocol pausing, fund freezing, or controlled fund withdrawal, before the transaction is committed and funds exit the protocol.\n\nThe Firewall provides a way to detect abnormal changes in your protocol directly on-chain, that could be indicative of a hack. That means that you can act upon abnormal activity, whenever it occurs, directly on the blockchain.\n\n---\n\n## Our Roadmap\n\n### **Phase 1: Research & Proof-of-Concept**\n\n- **Estimated Duration:** 1 Month\n- **Estimated delivery date:** 30th August 2023\n\nThis phase will focus on in-depth research and the creation of proof-of-concepts demonstrating how tailored firewall can enhance the security and functionality of protocols.\n\n### Milestone 2: Prototyping & Production\n\n- **Estimated Duration:** 2 Months\n- **Estimated delivery date:** 30th October 2023\n\nThe second phase will concentrate on the development and testing of firewall prototypes based on the findings of the first phase. The prototypes will showcase the practicality and benefits of integrating on-chain firewalls into DeFi Protocols.\n\n### Milestone 3: Testnet Deployment\n- **Estimated Duration:** 1 Month\n- **Estimated delivery date:** 30th November 2023\n\n## The final phase will involve the testnet deployment of all firewall components, followed by rigorous testing and refinement to ensure the system is ready for potential mainnet audits and protocol implementations.\n\n## **Our Goals**\n\n- Reliability\n- Inexpensive in gas terms. The overhead must remain negligible.\n- Not adding complexity to the protected contract(s): Implementing the Firewall must not require more than a few lines of Solidity code.\n- It must scale\n\n---\n\n# TL;DR \u2935\ufe0f\n\n## **How Does It Work?**\n\n**You can track any critical metric that could be indicative of an exploit happening for your protocol.**\n\n### Let's take the example of TVL:\n\nEvery time there is an inflow or outflow of liquidity, you add a call to the Firewall contract to track the TVL at this point in time within your protocol. The Firewall will keep a history of your TVL over time.\nThis allows you to define a threshold so that if more than X% of the TVL exits the protocol in less than Y number of blocks, the Firewall triggers.\nWhen this happens, the Firewall status is updated before the transaction is committed, which allows you to implement a set of defensive strategies to prevent the transaction from going through, such as rejecting the transaction or freezing the funds.\n\nAll of this happens synchronously, at the contract level in Solidity. This means that exploits are prevented from happening automatically, and directly on-chain.\n\nYou can find a more detailed explanation of the Firewall [here](https://turtleshell.gitbook.io/introduction/how-it-works).\n\n### **Protective Measures**\n\nOnce the Firewall gets triggered, protocols can use it in various ways to protect their assets. Here are some of the protective measures that can be taken:\n\n![](https://file.notion.so/f/s/56e03ba6-c890-4df6-8063-6b922adce341/firewall_triggered.svg?id=0df407f8-b92c-40bd-bbb0-27c2d94cb8f2&table=block&spaceId=549a06fc-7073-4a4a-a8f1-3206b15135b8&expirationTimestamp=1691712000000&signature=4DUMvFXQlMfGejNNjJNO3gfV2P985i2wzAOK2NnxRic&downloadName=firewall_triggered.svg)\n___\n## **Implementation and Integration**\n\n1. **Setup configuration**: Define the parameter you want to track (e.g: TVL) and a maximum threshold that should not be reached within a custom time period.\n2. **Identify Entry Points**: This step consists of listing functions that affect your parameter. For TVL, that would be functions that increase or decrease liquidity (e.g., deposit & withdraw).\n3. **Integrate the Firewall**: For each entry point, you must add a single line of code to call the Firewall to track this parameter.\n4. **Choose and Implement a Defensive Strategy**: Every time you call the firewall, it returns its status. If the firewall triggers, you implement one of our strategies: reject transaction, freeze funds, pause protocol, etc.\n5. **Monitor and Adjust**: After integration, you can monitor the operation of the firewall and adjust the parameters as needed. This allows you to fine-tune the system to better protect your protocol.\n\nRemember, the key to effective use of the Firewall is understanding your protocol's specific needs and adjusting the parameters accordingly. With the right configuration, the Firewall can provide a robust line of defence against potential hacks and unauthorized fund withdrawals.\n\n### What does a Solidity integration look like?\n\n```solidity\nfunction withdraw(uint256 withdrawAmount) external override {\n\t[...]\n\t// Firewall implementation\n\tbool firewallTriggered = IFirewall(firewall).decreaseParameter(withdrawAmount);\n\tif (firewallTriggered) return;\n\t[...]\n}\n```\n\n---\n\n# Why it is important what we build\n\nMost established exploit prevention procedures like performing security audits are important, yet, we must understand that these have limitations and cannot asses risks beyond code produced by the engineering team. External dependencies as potential attack vectors are frequently being disregarded or *assumed* to be safe, as they lies outside a single protocol\u2019s spectrum of actionable security measures. Given the example of the most recent curve exploit: Auditing legacy versions of the Vyper compiler, was undoubtably out of the protocol\u2019s security scope.\n\n![](https://file.notion.so/f/s/85dbe180-0f88-43d0-b684-3f5ddc7ee6d7/no_firewall.svg?id=2fd27862-22c1-449b-81bf-c117ffccb8d1&table=block&spaceId=549a06fc-7073-4a4a-a8f1-3206b15135b8&expirationTimestamp=1691683200000&signature=PS-S6gi09av2Uy1msnYxh3AwuDbYIgL69Ki0CaGgYks&downloadName=no_firewall.svg)\n\nEven when exploring hypothetical scenarios, e.g.: All protocols using Vyper coming together beforehand and collectively sourcing audits for Vyper versions 0.2.15, 0.2.16, and 0.3.0, it still would not have solved the underlying problem: The *unknown (un)knowns* of vulnerable external dependencies. Given the infinite amount of unknowns, it is merely impossible to effectively draw the line between where to start and stop security audits.\n\n![](https://file.notion.so/f/s/abea7062-fba8-4f89-a092-2bd3acc966a9/no_firewall_cycle.svg?id=7c4d140d-5252-4bdb-9b52-87f9d0b3d111&table=block&spaceId=549a06fc-7073-4a4a-a8f1-3206b15135b8&expirationTimestamp=1691683200000&signature=AsCb8siZEWEKliqMvSBaoxR5475sCUusyNiHfVYeEHk&downloadName=no_firewall_cycle.svg)\n\nThis is why protocols have to hope for the best while keeping their fingers crossed\ud83e\udd1eonce deploying code to production. In essence: Hoping they won\u2019t have to face any *unknown (un)knowns* in production, but if so, hopefully only through bug bounties programs and whitehats. Usually, the financial incentives for blackhat hackers largely outweigh bug bounty initiatives, leading to exploits of undiscovered attack vectors. Furthermore, in accordance to Murphy\u2019s Law, the above strategy would lead to a hack in any case, sooner or later.\n\n---\n\n## Actionable opportunities to protect the protocol\n\n### Adding Firewalls to the protocols production deployments\n\nAs an additional layer of protection to the protocol Firewalls can be added to mitigate in-production risks.\n\n![](https://file.notion.so/f/s/d657a457-f1ff-466e-9fda-834e5e2b6960/firewall_cycle.svg?id=d1fea3f9-a839-40f7-8e72-4dcc0498d5e8&table=block&spaceId=549a06fc-7073-4a4a-a8f1-3206b15135b8&expirationTimestamp=1691683200000&signature=Y4vDfcAEbwx3fLlS0yTAleP-XeC7qrADIJVLCKWOn8I&downloadName=firewall_cycle.svg)\n\n***Even tough, the way the protocol gets exploited relies on an unknown (un)known, the target of the exploit always is a KNOWN KNOWN, being liquidity.***\n\n![](https://file.notion.so/f/s/cd611ba0-e6e6-44e4-a1c4-092a1877ed5a/unknown.svg?id=d9fd796b-f684-407b-a9ab-785bf935a8fc&table=block&spaceId=549a06fc-7073-4a4a-a8f1-3206b15135b8&expirationTimestamp=1691683200000&signature=Rs29pxwyQ4EgZG8_SRs_YACvA148i-9veTuyPF15XMY&downloadName=unknown.svg)\n\n**\u2192 Therefore, we can work with the known characteristics of every exploit happening, instead of trying to solve what we cannot know.**\n\n![](https://file.notion.so/f/s/9718190a-5d8d-4a1a-8247-bf489d4d1dc8/known.svg?id=ac678746-28bf-476b-a468-33cfd9666b0d&table=block&spaceId=549a06fc-7073-4a4a-a8f1-3206b15135b8&expirationTimestamp=1691683200000&signature=qYYMfTnH_9NG-nOIhB7OW1KUd9pdzw-cqtipj4sHQxM&downloadName=known.svg)\n\nWe are aware of the attackers target: extracting Liquidity.\n\nWe are aware of external dependencies, will most likely lead the attacker to his target.\n\n***\u2192 knowing and understanding these two crucial pieces of information, we can design a security system around these two vectors.***\n\n![](https://file.notion.so/f/s/a001b4cf-e63b-4571-a210-9aa9c2f0014b/firewall.svg?id=28da97a7-5a30-4082-a7fb-3614752aa556&table=block&spaceId=549a06fc-7073-4a4a-a8f1-3206b15135b8&expirationTimestamp=1691683200000&signature=0wuyiOSBTjiTbHH2yNWtAeakYUduNI0-zZumI-bavD0&downloadName=firewall.svg)\n\nAs a wrapped layer of security around the protocol, the attacker will not be able to reach his intended target: *extracting liquidity*, with *external dependencies* as his attack vector. Even when vulnerabilities occur (e.g. faulty compilers), an attacker will not reach his target, as the Firewall system operates as an independent layer of security for the protocol.\n\nWhenever abnormal activity occurs, on-chain Firewall\u2019s offer a range of protective measures, including blocking of transactions, pausing the protocol, freezing of funds, or controlled fund withdrawal, thereby providing a robust on-chain defence against potential hacks.\n\n## Resources:\n\n- [Twitter](https://twitter.com/turtleshell_xyz)\n- [Team\u2019s Website](https://turtleshell.xyz/)\n- [Docs](https://turtleshell.gitbook.io/)\n- [Team\u2019s Github Organization](https://github.com/ikigai-labs-xyz/turtleshell-core)\n- [Demo Repository](https://github.com/ikigai-labs-xyz/turtleshell-core)\n- [relevant Firewall Demo of a L&B Market](https://www.loom.com/share/f6981c21abd54afc8b29565de1d3ea3a?t=2)", "lastUpdated": 0, "projectGithub": "ikigai-labs-xyz", "projectTwitter": "turtleshell_xyz"}, "recipient": "0xc1EDd32AD70De1A1D55299FDa37A78ad5540b2f5"}}