<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Peteris Erins on Medium]]></title>
        <description><![CDATA[Stories by Peteris Erins on Medium]]></description>
        <link>https://medium.com/@p-e?source=rss-7cf660fff514------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*HeIyK8Xi_LMSxv0_8WCRBg.jpeg</url>
            <title>Stories by Peteris Erins on Medium</title>
            <link>https://medium.com/@p-e?source=rss-7cf660fff514------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 05 Apr 2026 17:52:56 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@p-e/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com" rel="hub"/>
        <item>
            <title><![CDATA[Unichain: Behind the Scenes]]></title>
            <link>https://medium.com/auditless/unichain-behind-the-scenes-22389173f922?source=rss-7cf660fff514------2</link>
            <guid isPermaLink="false">https://medium.com/p/22389173f922</guid>
            <category><![CDATA[unichain]]></category>
            <category><![CDATA[uniswap-v4]]></category>
            <category><![CDATA[crypto]]></category>
            <category><![CDATA[auditless]]></category>
            <dc:creator><![CDATA[Peteris Erins]]></dc:creator>
            <pubDate>Thu, 24 Jul 2025 12:59:24 GMT</pubDate>
            <atom:updated>2025-07-24T12:59:24.586Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*S0ykd0W8q4jo6tOiIawwHw.png" /></figure><blockquote>With Uniswap v4, the Uniswap protocol expanded from supporting liquidity providers and swappers to providing a powerful and permissionless liquidity platform for DeFi developers. The Uniswap Foundation was responsible for ecosystem support in this transition and was looking for a grantee to provide technical and strategic input leading up to the launch of Uniswap v4 and the exploration of a new L2 (Unichain).</blockquote><p><strong>✨ Looking for help building your protocol? Just DM “Protocol” on </strong><a href="https://www.twitter.com/p_e"><strong>Twitter</strong></a><strong>.</strong></p><h3>Brief</h3><p>In June 2023 we wrote a small piece about the brilliance of Uniswap v4’s design.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Ejh2nV-wTJCPyUbt.png" /><figcaption>Source: <a href="https://research.auditless.com/p/al-011-how-to-compete-with-uniswap">How to Compete With Uniswap V4</a></figcaption></figure><p>Less than a year later, in April of 2024, the Uniswap Foundation selected Auditless to create the Protocol grants category. From the <a href="https://uniswapfoundation.mirror.xyz/dnBQyMP813Yugq9HT1EfstVe8jyf6YW89vOLwD-dDSM">Announcement</a> post:</p><blockquote>As we discussed in our <a href="https://uniswapfoundation.mirror.xyz/BhTpJ1mh4mnaXOCl3T-ZY79kyFHOwhqaBt4IhTEIhHo">blog post last week</a>, the Uniswap Foundation’s new <strong>Protocol grants funding category</strong> will support continued Uniswap Protocol innovation, and facilitate stronger feedback loops between our stakeholders and protocol development. With this new funding category we aim to improve the experience for our swappers, LPs, developers, and more for years to come.</blockquote><blockquote>However, funding future protocol innovation comes with a specific set of challenges: this work is highly consequential, and requires significant context and product vision to execute well. To implement successfully and to provide the best outcomes for the ecosystem, the Uniswap Foundation sought out a strategic advisor to lead protocol and market research initiatives, design a holistic roadmap, and collaborate with and guide our grantees.</blockquote><p>The grant started off exploratory in its scope but the Unichain opportunity was validated pretty quickly and soon became the primary focus of Protocol grants due to its large potential.</p><p>The Auditless team produced over <strong>70+ different deliverables</strong> in preparation for launch in February 2025 and while we can&#39;t feature them all (especially sensitive long-form memos), here are some of our favorites across the 4 pillars of the project.</p><ol><li>Exploration</li><li>Program Management</li><li>Grants</li><li>Growth</li></ol><h3><strong>1. Exploration</strong></h3><p>One of the earliest things we worked on was formulating a view on the evolution of liquidity <a href="https://research.auditless.com/p/al-024-where-is-erc4626-headed-in">using Wardley mapping</a>. The analyses focused on the swapping and issuance landscapes, two crucial themes for DeFi.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_WJaF8azi8Pe9PEpD-LVIw.png" /><figcaption>DEX Landscape analysis, presented in UniDay</figcaption></figure><p>It&#39;s great to see how many of these (then emergent) areas are now covered either by the L2 or various hook designs on Uniswap v4.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j_UQ28SEe-igMx5qM2L1NQ.png" /><figcaption>Issuance Landscape Analysis</figcaption></figure><p><strong>Other selected work</strong>:</p><ul><li>Developed a strategy memo for Unichain + Uniswap v4</li><li>Completed various strategic analysis (competitive, value chain mapping, basis for competition, job map analysis)</li><li>Developed a routing strategy for Uniswap v4</li><li>Provided feedback on rollup stack evaluation</li><li>Ran a workshop on rollup internals for the entire Uniswap Foundation team</li></ul><h3>2. Program Management</h3><p>Auditless handled the initial program management for Unichain culminating in a dedicated offsite in Brussels organized by our team in parallel to UniDay. We also helped hire a Unichain lead who took over the work stream.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SI53E4ubH8lMxf7hjyD3cQ.jpeg" /><figcaption>Auditless UniDay presentation</figcaption></figure><p><strong>Other selected work</strong>:</p><ul><li>Built several cross-work stream, CRM trackers and an initial roadmap</li><li>Ran project planning &amp; check-in motions</li><li>Recommended <a href="https://www.unichain.org">unichain.org</a> and <a href="https://www.uniscan.xyz">uniscan.xyz</a> domains 🙂</li></ul><h3>3. Grants</h3><p>While identifying how best to support Unichain developers, we gathered comprehensive data on major grant/growth programs for 6 leading chains and evaluated them for efficiency.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/990/1*SM9j1QFNJMUlurB6ps-B6w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/982/1*qZvzj_32Xedf9oOFJ5riCA.png" /><figcaption>Study of Superchain grant program impact (Base spotlight)</figcaption></figure><p>From there, we discarded anything that didn&#39;t maximize impact per $ invested and developed a set of initiatives targeted at helping builders along their journey from inception to scale.</p><p>We built an initial system for triaging, tagging and tracking incoming applications and ran the process directly during the initial burst period, then handed over to the Uniswap Foundation&#39;s internal ops team.</p><p>To facilitate the allocation of builder grants, we developed a custom UI for individual committee members to evaluate grantees in an unbiased and easy way.</p><p>The entire process is up and running and funding the most innovative new teams building on Unichain.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UTMkG9YoFTkhjCyIuYaodg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*ETL9sn7q479ruYgDP68cDQ.jpeg" /><figcaption>Source: Current Unichain Growth Grants + Infinite Hackathon bounties at EdgeCity Lanna</figcaption></figure><p><strong>Other selected work</strong>:</p><ul><li>Helped prepare a Uniswap v4 routing RFP resulting in this <a href="https://arxiv.org/abs/2502.02059">whitepaper</a> showing that universal routing is possible</li><li>Built a prioritized partners tracker with 200+ tracked companies</li><li>Developed an RFP for community management</li></ul><h3>4. Growth</h3><p>We formulated 8 key verticals for DeFi growth and analyzed/prioritized viable candidate partners (both in DeFi and developer infrastructure) to guide pre-launch BD conversations.</p><p>We helped structure the incentives campaign and set its strategic, quantitative objectives. From our research, it was evident that many teams overspend on incentives or realize very low ROI so we discarded several incentive structures that were proven ineffective in practice.</p><p>Similarly, we identified assets to target for initial liquidity and designed the Unichain/L2 tracking dashboards developed by Allium to monitor the chain&#39;s growth.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/972/1*CitmZdaTh4xg7GXPXRJYiQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/957/1*Njxdqy0np3vdTooZ4BJWkg.png" /><figcaption>Allium&#39;s Unichain/L2 Dashboards (designed by Auditless)</figcaption></figure><p><strong>Other selected work</strong>:</p><ul><li>Developed an RFP for the Unichain incentives program</li><li>Researched special situations (e.g., Uniswap market share increase, stablecoin volume changes on other rollups, transaction volume drivers on other rollups)</li><li>Built several Dune queries &amp; dashboards</li><li>Developed detailed growth projections and scenario analyses for Unichain</li><li>Published theses on key Unichain/Uniswap v4 opportunities for builders:</li><li><a href="https://research.auditless.com/p/al-78-uniswap-v4-is-the-sanctum-of">Uniswap v4 is the Sanctum of Restaking</a></li><li><a href="https://research.auditless.com/p/al-80-uniswap-v4-and-onchain-investment">Uniswap v4 and Onchain Investment Banking</a></li><li><a href="https://research.auditless.com/p/al-85-why-you-should-build-on-unichain">Why You Should Build on Unichain Now</a></li><li><a href="https://research.auditless.com/p/bunni-how-to-build-a-leading-uniswap">Bunni: How To Build a Leading Uniswap v4 Hook</a></li></ul><p>It was a privilege to support the launch of a top OP Stack/Superchain rollup and to work with the talented and professional Uniswap Foundation team and other grantees/partners during this pivotal year.</p><p>We&#39;re excited to see Unichain &amp; Uniswap v4 house the next generation of DeFi innovations.</p><p><strong>📬 Want more research from Auditless? Subscribe to the </strong><a href="https://research.auditless.com"><strong>Newsletter</strong></a><strong>.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=22389173f922" width="1" height="1" alt=""><hr><p><a href="https://medium.com/auditless/unichain-behind-the-scenes-22389173f922">Unichain: Behind the Scenes</a> was originally published in <a href="https://medium.com/auditless">Auditless</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Unichain Reaches $1B in TVL]]></title>
            <link>https://medium.com/auditless/unichain-reaches-1b-in-tvl-c189c97ec724?source=rss-7cf660fff514------2</link>
            <guid isPermaLink="false">https://medium.com/p/c189c97ec724</guid>
            <category><![CDATA[uniswap]]></category>
            <category><![CDATA[strategy]]></category>
            <category><![CDATA[crypto]]></category>
            <category><![CDATA[auditless]]></category>
            <dc:creator><![CDATA[Peteris Erins]]></dc:creator>
            <pubDate>Thu, 10 Jul 2025 14:32:36 GMT</pubDate>
            <atom:updated>2025-07-10T14:32:36.764Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*d-kiQZP9nNshAo-e5KA57g.png" /></figure><blockquote>With Uniswap v4, the Uniswap protocol expanded from supporting liquidity providers and swappers to providing a powerful and permissionless liquidity platform for DeFi developers. The Uniswap Foundation was responsible for ecosystem support in this transition and was looking for a grantee to provide technical and strategic input leading up to the launch of Uniswap v4 and the exploration of a new L2 (Unichain).</blockquote><p><strong>✨ Looking for help building your protocol? Just DM “Protocol” on </strong><a href="https://www.twitter.com/p_e"><strong>Twitter</strong></a><strong>.</strong></p><h3>Challenge</h3><p>In late 2023, we were approached by the Uniswap Foundation to contribute to two major initiatives, a next-generation liquidity layer (Uniswap v4) and a DeFi focused L2 (now known as Unichain). To facilitate the exploration and launch of these initiatives, they needed a grantee to conduct technical and strategic research, planning and program management.</p><p>The Uniswap Foundation is the leading grant maker in the Uniswap Ecosystem, <a href="https://gov.uniswap.org/t/governance-proposal-uniswap-unleashed/25251">expecting to allocate over $130M</a> in grants &amp; incentives into 2026. As Uniswap reaches platform-scale, the Foundation has been instrumental in growing and empowering Uniswap developers as well as supporting governance and financial planning.</p><h3>Solution</h3><p>Auditless worked hand-in-hand with the Uniswap Foundation team, external stakeholders &amp; advisors as well as other grantees to:</p><ul><li><strong>Conduct research and provide technical input</strong> on topics such as rollup architecture, routing and help inform strategic/grant priorities;</li><li><strong>Run initial program management </strong>for Unichain, help evaluate product talent to support the transition to an internal team;</li><li>Support the development of a <strong>growth strategy for Unichain</strong>;</li><li>Design and help <strong>launch several grant initiatives</strong> for Unichain developers.</li></ul><h3>Results</h3><p>Five months from launch, Unichain is now a top rollup with several flagship deployments such as Uniswap v4 (and various hook teams), Euler, Morpho, Venus, Velodrome and Compound. It is powered by the OP Stack and <a href="https://docs.unichain.org/whitepaper.pdf">brings various improvements</a> through partnerships with Uniswap Labs and Flashbots.</p><h4>+$1B in TVL (+$1.2B in TVS)</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/752/1*zMEUhcTVIs6t61_zPksidg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/884/1*EUYiFSV5No5mqEUcppEchw.png" /><figcaption>Source: DeFiLlama &amp; L2Beat</figcaption></figure><p>Auditless developed the initial RFP for Unichain’s liquidity incentives campaign and provided input on incentive targets, assets to incentivize as well as campaign strategic and quantitative objectives.</p><p>The campaign has already exceeded expectations and catapulted Unichain to the top of the L2 leaderboard in TVL, creating a strong foundation to attract further developers, users and liquidity to the chain.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WOX6WhDmVOMZpIuay3Y-pw.png" /><figcaption>Source: L2Beat</figcaption></figure><p>The superposition of Unichain and Uniswap v4 also provides clear differentiation for Unichain as a DeFi-focused liquidity hub chain in a crowded rollup market.</p><iframe src="https://cdn.embedly.com/widgets/media.html?type=text%2Fhtml&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;schema=twitter&amp;url=https%3A//x.com/devinawalsh/status/1940752888932061272&amp;image=" width="500" height="281" frameborder="0" scrolling="no"><a href="https://medium.com/media/1a23d1c8929fb8a98375cc1e87f1bd2b/href">https://medium.com/media/1a23d1c8929fb8a98375cc1e87f1bd2b/href</a></iframe><h4>+765 Unichain builder submissions pre launch</h4><p>Auditless helped shape the Builder Open Call Grants, Infinite Hackathon Grants and Retro Hackathon Grants, which were carefully designed to help identify and back grassroots builders.</p><iframe src="https://cdn.embedly.com/widgets/media.html?type=text%2Fhtml&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;schema=twitter&amp;url=https%3A//x.com/UniswapFND/status/1845878197851934756&amp;image=" width="500" height="281" frameborder="0" scrolling="no"><a href="https://medium.com/media/ae5dd2819c5323fab91471496c23c479/href">https://medium.com/media/ae5dd2819c5323fab91471496c23c479/href</a></iframe><p>These grants reached over 700 submissions before the chain was launched. The programs are now fully operationalized and grants are being rewarded and announced to teams on an ongoing basis with a goal to identify and accelerate the next-generation of DeFi builders.</p><p><strong>📬 Want more research from Auditless? Subscribe to the </strong><a href="https://research.auditless.com"><strong>Newsletter</strong></a><strong>.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c189c97ec724" width="1" height="1" alt=""><hr><p><a href="https://medium.com/auditless/unichain-reaches-1b-in-tvl-c189c97ec724">Unichain Reaches $1B in TVL</a> was originally published in <a href="https://medium.com/auditless">Auditless</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Work on Aera and help shape the future of treasury management]]></title>
            <link>https://medium.com/auditless/work-on-aera-and-help-shape-the-future-of-treasury-management-aedd3a4863de?source=rss-7cf660fff514------2</link>
            <guid isPermaLink="false">https://medium.com/p/aedd3a4863de</guid>
            <category><![CDATA[crypto]]></category>
            <category><![CDATA[treasury-management]]></category>
            <category><![CDATA[jobs]]></category>
            <category><![CDATA[aera]]></category>
            <category><![CDATA[auditless]]></category>
            <dc:creator><![CDATA[Peteris Erins]]></dc:creator>
            <pubDate>Thu, 21 Dec 2023 14:23:11 GMT</pubDate>
            <atom:updated>2023-12-21T14:23:11.744Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*9WIK6Ftce31xfDsP-tnzgw.png" /></figure><blockquote><a href="https://www.aera.finance">Aera</a> is the world’s first autonomous, data-driven treasury management protocol. It allows treasuries and crypto institutions to achieve highly personalized objectives using a trust-minimized execution mechanism that taps into the best onchain opportunities.</blockquote><blockquote><a href="https://www.auditless.com">Auditless</a> is a web3-native protocol studio focused on protocol strategy, design &amp; development. We help crypto protocols improve their performance through strategic advisory and protocol development.</blockquote><p>As <a href="https://medium.com/auditless/aera-finance-raises-8-million-to-scale-dao-treasury-management-039508f6faed">we recently announced</a>, Auditless has been tasked with supporting the Aera Foundation in developing future versions of the protocol.</p><p>✨ To than end, we are hiring several protocol engineers at different seniorities. If you&#39;re interested in the opportunity, please <a href="https://auditless.notion.site/Work-at-Auditless-1d30a9d6e15d425383e4685cc074ac68">check out the Jobs page</a> and apply.</p><p>If you&#39;re wondering if this is the right opportunity for the next stage in your career, allow me to share some context.</p><h3>Aera is solving a real and unique problem</h3><p>Existing protocol treasuries form a large and underserved market. Due to friction in governance processes, regulatory burdens and the communication challenges associated with decentralized organisations, the majority of capital in these treasuries is sitting idle.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*k2wWDmxoUKumiHi3sw2-Lg.png" /><figcaption>DeFi Llama <a href="https://defillama.com/treasuries">treasuries</a></figcaption></figure><p>As <a href="https://blockworks.co/news/crypto-wall-street-treasury-management">Matthew Liu articulated for Blockworks</a>:</p><blockquote>The evolving crypto landscape cannot survive without crypto-native firms taking a more proactive approach toward treasury management. By blending traditional financial wisdom with crypto’s unique dynamics, firms can build a solid treasury framework that will help them navigate uncertainty and capitalize on opportunities.</blockquote><p>So if the market is substantial and the appetite to act is there, why haven&#39;t existing solutions worked?</p><p>For one, nobody has figured out how to do treasury management in a decentralized or trustless way while preserving the dynamics of what is needed to respond to a rapidly evolving crypto market.</p><p>Most existing treasury management solutions effectively fall into one of three buckets:</p><ul><li><strong>One-time treasury diversification</strong>. These approaches are explicit about what yield farms they prefer and usually allocate capital into a set of vaults. This is your grandfather&#39;s retirement fund but applied to crypto treasuries. Principled but hopelessly static.</li><li><strong>Centralized treasury management</strong>. The DAO elects a treasury manager who is somewhat restricted by smart contracts and effectively has a very broad remit around asset class choices and investment strategies. Breaks a lot of the properties that DAOs seek to achieve like credible neutrality, limiting points of failure and others.</li><li><strong>Inaction by democracy</strong>. The DAO only makes large reallocation decisions based on voting. Usually these decisions are driven by point-in-time proposals from DAO service providers who have their own incentive sets and don&#39;t lead to comprehensive objective-driven strategies.</li></ul><p>Note that these three pillars form a perceived treasury management trilemma between Decentralization, Principled allocation and Effective allocation.</p><p>Faced with three choices that are fundamentally unappealing DAOs choose to keep their capital largely unallocated.</p><h3>Aera breaks the treasury management trilemma</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yUvYJ5CKGvZS0dMKPB2Hgg.png" /></figure><p>Aera is a solution that achieves all three desirable properties: trustless, principled &amp; responsive treasury management. Here&#39;s how that works:</p><ul><li><strong>Aera achieves responsiveness and efficacy by using off-chain guardians</strong>. Guardians are able to build complicated data pipelines and strategies to ensure that treasuries are managed using best available market instruments, are risk-aware, liquidity-aware and otherwise responsive to market conditions.</li><li><strong>Aera achieves trustlessness by limiting what guardians can do at the protocol level</strong>. A comprehensive hooks contract is used in each vault that limits the types of actions that a guardian can take and how they can impact the vault, bounding possible loss. Every action a guardian takes happens with assets that are approved, with actions that are whitelisted and with consequences that are within the approved parameters of the treasury owner. Safety first. Trustlessness will further improve as the initial permissioned model will evolve to a permissionless implementation with progressive decentralization.</li><li><strong>Aera achieves principled strategies through the use of a custom objective function for each treasury</strong>. The stated objective function serves as a point of alignment between the DAOs objectives and the guardians&#39; actions. Guardians are incentivized to act only in ways that improve the objective function of the vault and not limited to simple strategies like seeking yield without consideration of insolvency.</li></ul><h3>Aera is built on a modular and extensible stack</h3><p>Treasury management is a highly complex and easily obfuscated problem domain.</p><p>The “obvious” solution to a problem is can easily be convoluted and led to an accumulation of custom features, points of centralization and other forms of tech debt.</p><p>The entire Aera team fought against complexity, carefully evaluating what should exist onchain vs. off-chain and how Aera could serve a very wide array of institutions while being easy to reason about from a security perspective.</p><p>The result was a simple and modular protocol:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uWMUIPchZy2mo-hfNuvDpA.png" /><figcaption>Aera protocol architecture</figcaption></figure><p>➡️ For more detail on how that works, you can read the <a href="https://medium.com/auditless/aera-protocol-behind-the-scenes-a8aadea10603">behind the scenes</a>.</p><p>🖥️ If you are just curious about the codebase, here’s the <a href="https://github.com/aera-finance/aera-contracts-public">GitHub of the first two versions</a> including audits.</p><h3>Aera has traction</h3><p>Perhaps most importantly, a <a href="https://app.aera.finance/">growing number of DAOs</a> are already running parts of their treasuries on Aera, lending credibility to the overall value proposition and our ability to deliver on it with a protocol.</p><p>One of the contributing factors to this is that Aera has a non-parasitic nature. It&#39;s a protocol that can happily exist to operate a tactical subset of a larger treasury and is additive and collaborative to existing treasury management offerings in the market.</p><p>For parts of treasuries that need to be responsive, principled and trustless, Aera can be used, sized and tuned appropriately.</p><p>The friction of deploying an Aera vault is already smaller than most alternative treasury management approaches today.</p><p>The <a href="https://docs.aera.finance/guides/treasury">Aera documentation</a> transparently explains what&#39;s involved in vault operations today.</p><h3>What&#39;s next?</h3><p>Aera&#39;s successful start begets the question of the future.</p><p>There are clear vectors along which Aera will expand both vertically and horizontally.</p><p><strong>On the vertical front</strong>, <a href="https://assets-global.website-files.com/62cd150e5e9efc960319c44d/6346c4525380f8fa6435c2b5_Aera_Whitepaper.pdf">Aera&#39;s whitepaper</a> outlines the vision behind decentralized treasury management driven by off-chain intelligence. There are many exciting problems to solve and translate into elegant protocol solutions in what is a category-defining protocol.</p><p><strong>On the horizontal front</strong>, the Aera protocol has the privilege of being able to experiment with and use some of the latest tools in DeFi. A treasury needs to generate yield, trade tokens, borrow, provide liquidity and do many other functions that necessarily interact with a large surface area of DeFi.</p><p>It&#39;s the responsibility of the Aera core team to continuously and safely incorporate newly emerging protocols and ERC standards on the market to keep improving vault performance for clients. We are early adopters of ERC4626 for instance and are looking at many other standards.</p><p>As a protocol engineer for Aera, you will think about and write code that solves problems which other teams haven&#39;t even attempted to solve. You will do so in a highly collaborative way, working closely with the <a href="https://www.gauntlet.xyz">Gauntlet</a> team and our external partners.</p><p>You will also help evolve our systems around shipping secure smart contracts. We have explored and adopted many modern practices like executable specifications, invariant testing, internal security reviews, extensive inline protocol documentation, explicit trust models and will continue to add to this list.</p><p>Simply put — you won’t be building the 20th DEX or lending protocol with a slightly different trading or interest rate curve.</p><p>If you&#39;re excited by solving challenges in unknown territory, you should definitely consider applying.</p><p>The best way to start a conversation is via the <a href="https://auditless.notion.site/Work-at-Auditless-1d30a9d6e15d425383e4685cc074ac68?pvs=4">Jobs page</a>.</p><h3>Why the future is exciting</h3><p>Ultimately, progress at Aera means progress in treasury management across crypto.</p><p>Improving the reliability and speed at which treasuries can fund and achieve their objectives means more progress, more public goods and a more stable and competitive crypto industry.</p><p>It&#39;s a worthy mission that will benefit long-term crypto-aligned token holders and not just drum up the next wave of speculation.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aedd3a4863de" width="1" height="1" alt=""><hr><p><a href="https://medium.com/auditless/work-on-aera-and-help-shape-the-future-of-treasury-management-aedd3a4863de">Work on Aera and help shape the future of treasury management</a> was originally published in <a href="https://medium.com/auditless">Auditless</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[5 Years Bootstrapping in Crypto]]></title>
            <link>https://p-e.medium.com/5-years-bootstrapping-in-crypto-85352f0cba77?source=rss-7cf660fff514------2</link>
            <guid isPermaLink="false">https://medium.com/p/85352f0cba77</guid>
            <category><![CDATA[auditless]]></category>
            <category><![CDATA[crypto]]></category>
            <category><![CDATA[bootstrapping]]></category>
            <dc:creator><![CDATA[Peteris Erins]]></dc:creator>
            <pubDate>Mon, 18 Dec 2023 22:57:04 GMT</pubDate>
            <atom:updated>2025-05-07T15:55:41.110Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*u54R0UcBfG0Ak93JNbyvSg.png" /></figure><blockquote>Auditless is a web3-native protocol studio focused on protocol strategy, design &amp; development. We help crypto protocols improve their performance through strategic advisory and protocol development.</blockquote><p>Five years ago (in December 2018), I left my job at McKinsey to start Auditless and build crypto developer tools focused on security.</p><p>I kept exploring various product ideas while consulting crypto companies, building developer tools and smart contracts.</p><p>It was easily the hardest and most rewarding part of my professional career.</p><p>Today feels like Day 1 again.</p><p>We are working on what we think will be some of the highest impact <a href="https://medium.com/auditless/aera-finance-raises-8-million-to-scale-dao-treasury-management-039508f6faed">projects</a> in the space, onboarding and accepting <a href="https://www.auditless.com">new clients</a> and <a href="https://auditless.notion.site/Work-at-Auditless-1d30a9d6e15d425383e4685cc074ac68?pvs=4">hiring for a bunch of exciting roles</a> across strategy &amp; development.</p><p><strong>✨ Interested in working at Auditless? Please check out the </strong><a href="https://auditless.notion.site/Work-at-Auditless-1d30a9d6e15d425383e4685cc074ac68?pvs=4"><strong>Jobs page</strong></a><strong>!</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/431/0*PrSzkdrgMxYGWZ9Q.png" /><figcaption>It doesn&#39;t get more Day 1 than Pallet Town.</figcaption></figure><p>But the path to get here has been painful and slow at times.</p><p>And while I wouldn&#39;t change anything, there are a few things I would tell my older self to get here faster.</p><p>It&#39;s also a good time to revisit whether I&#39;d choose bootstrapping again if I got started today.</p><p>Let&#39;s rewind to 2018…</p><p><strong>Finding vulnerabilities in smart contracts</strong></p><p>It all started with trying to find vulnerabilities in smart contracts.</p><p>I spun up <a href="https://web3py.readthedocs.io/en/stable/">web3.py</a>, wrote some simple smart contracts using <a href="https://trufflesuite.com/">Truffle</a> and built a simple reinforcement learning agent using <a href="https://github.com/openai/gym">OpenAI Gym</a> and <a href="https://simpy.readthedocs.io/en/latest/">SimPy</a>.</p><p>The audit industry was just emerging and I (as many people) had the mistimed (or misguided?) view that AI could entirely automate vulnerability finding.</p><p>LLMs weren&#39;t really viable then but neither was reinforcement learning.</p><p>The problem with reinforcement learning is that it&#39;s really good at optimizing values rather than finding inflection points in functions.</p><p>Vulnerabilities were a step function — finding one is more important than optimizing the exploit for maximum impact…</p><p>So it was back to the drawing board.</p><p><strong>Trying formal verification</strong></p><p>The next idea was to use a solver like Z3 to identify vulnerabilities in smart contracts.</p><p>So I started tinkering with Bounded Model Checking (a technique that a formal verification tool like <a href="https://github.com/a16z/halmos">Halmos</a> uses).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/804/0*qG-4JVWC7Tqga9PC.png" /><figcaption>Custom debugging UI for the formal verifier</figcaption></figure><p>It quickly became clear that encoding vulnerabilities without access to specs is a lost cause.</p><p>So instead of trying to find vulnerabilities — what if we helped users generate test cases instead?</p><p>I repurposed the solver to find gaps in byte code coverage and then generate valid test cases for smart contracts.</p><p>Unfortunately in the course of doing this I learned a lot about the limits of <a href="https://medium.com/gauntlet-networks/formal-verification-and-incentive-simulation-as-necessary-complements-in-smart-contract-security-67a571ebcce8">solver performance</a>.</p><p>In short — smart contracts that contain even a normal amount of “hard to model” functions like divisional or modular arithmetic cannot be subjected to black box analysis.</p><p>It became clear that formal verification would be a game of helping users create annotations and specs and then verifying them.</p><p>(Note: I think <a href="https://www.certora.com/">Certora</a> have built exactly the right kind of company to help smart contract developers with this.)</p><p>My goal, however, was to find a SaaS product that could help a broader set of users.</p><p><strong>Smart contract debugging</strong></p><p>If the goal was to help people with understanding smart contracts, perhaps there was a better way to do this?</p><p>Having built a low-level debugger for the formal verifier that came in handy, I was looking for something similar for Solidity.</p><p>But debugging Solidity transactions was notoriously difficult (compared to, for instance, debugging a Rust program).</p><p>This didn&#39;t make sense as smart contracts feature no non-determinism and are pretty well-behaved state machines.</p><p>So we set out to build the best possible time traveling debugger for Solidity.</p><p>Here&#39;s a preview of what it looked like:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*404HrhcVGx2hZ-7sNnwBTA.png" /><figcaption>The best Solidity debugger that never was</figcaption></figure><p>It encapsulated in one interface many breakthrough ideas that debuggers still don&#39;t support:</p><ul><li>Fast interaction</li><li>Instant breakpoints</li><li>State change overviews</li><li>Low-level debugging (gas &amp; opcodes)</li></ul><p>The UI got great feedback from some of the best Solidity developers in the space but was never remotely bug free.</p><p>Debugging is actually a significant back-end challenge.</p><p>Not only do you essentially have to build your own VM hook, you have to keep up with network, library and compiler upgrades constantly.</p><p>I still think we discovered a better interface for smart contract debugging but for several reasons it doesn&#39;t lead to a great business:</p><ul><li>Smart contract developers are usually pretty advanced and have their own workflows that help them avoid debugging rather than rely on it</li><li>Most people develop locally and it&#39;s really hard to create a seamless user experience for local debugging with a UI (it still hasn&#39;t been done in 2023)</li><li>Existing pricing schemes for tools like Tenderly reflect that users don&#39;t really value debugging instead opting to pay for security related features like monitoring</li><li>Crypto has an open source ethos and many people felt that the debugger should be developed for free.</li></ul><p>We wanted to build the best debugger and charge for it to warrant building a team, not a monitoring service in order to subsidize a debugger.</p><p>And we had more ambitious ideas than for what would have been possible with an open source tool.</p><p>To do it as a bootstrapped company just didn&#39;t make sense anymore.</p><p>Having said that, it was pretty tough to stop working on a product you know “should” exist and that users want to use.</p><p><strong>Why bootstrap</strong></p><p>Many people (including investors) ask me why Auditless is bootstrapped when there is so much capital available.</p><p>To be honest, I didn&#39;t think I would.</p><p>In fact, I was interviewed by YCombinator in 2018 (they weren&#39;t convinced developer tools in crypto was a big enough market).</p><p>The only decision I made at that point was to postpone investing until I find product-market fit with a product.</p><p>I had seen too many highly skilled Founders raise pre-product market fit and end up downsizing the company.</p><p>This was a failure mode I wanted to avoid at all costs.</p><p>So I bootstrapped.</p><p>As time went on, I also realized I&#39;m not the right person to try and build a public company.</p><p>I realized I want to chip away at this for decades rather than push for a liquidity event.</p><p>Without that mindset of fighting the best possible exit for a company, I couldn&#39;t possibly responsibly take on capital.</p><p><strong>The one thing that worked</strong></p><p>Throughout all of the product experimentation, I still carried on doing consulting.</p><p>None of it was supported by any kind of sales our outreach process, instead I was responding to referrals and requests from people I already knew.</p><p>These were projects in developer tools, smart contract design, smart contract development, periphery tools, market maker tooling, even doing product strategy work for a fund.</p><p>One one hand I still had the desire to develop a product (these are so much easier to scale).</p><p>On the other, consulting allowed me work on products together with companies that were better capitalized and could exploit these opportunities.</p><p>And it worked well.</p><p>So earlier in 2023, I finally decided to double down on consulting full-time, focusing on strategic product advisory and development for high-performing crypto companies and startups.</p><p><strong>What changed</strong></p><p>I&#39;m finally convinced that we could build a large and fast growing company built around these service lines.</p><p>This realization didn&#39;t come overnight.</p><p>In fact, my experience of consulting had been tainted by blue chip management consulting in McKinsey and I was very aware that it had taken a 100 years to build that business.</p><p>(It&#39;s a great business but I don&#39;t have 100 years.)</p><p>It came from figuring out two things that management consulting Firms never figured out (or didn&#39;t have to):</p><ul><li>How to scale distribution;</li><li>How to scale delivery.</li></ul><p>To be fair, some of these opportunities are highly contingent on the technologies and networks available today and the specific nature of the crypto industry.</p><p>And that&#39;s why I&#39;m particularly excited to exploit them.</p><p><strong>What did I learn</strong></p><p>There are too many takeaways to list but here are five:</p><ul><li><strong>Make sure you know what kind of company you are building</strong> (venture funded or bootstrapped) and vet opportunities accordingly. Both models are great but they each have ideas that are not compatible with the model.</li><li><strong>Bias on doing more in public rather than in private</strong>. People love to see half-baked products and your thinking. Lean on oversharing to get more feedback faster.</li><li><strong>Don&#39;t pattern match with other companies</strong>. Instead focus on what works and eliminating bottlenecks to scale that. Unique and iconic businesses are only built this way. Learn to be unbiased and to enjoy the things that are working rather than to only work on the things you are enjoying.</li><li><strong>Pick the right market and stick to it</strong>. I honestly think that one of the biggest reasons Auditless is still around and thriving (other than stubbornness) was the choice to start with crypto. Every failure we&#39;ve had along the way has given us a level of experience and process knowledge that is highly useful to companies in 2023.</li><li>Most importantly<strong> — Have integrity</strong>. I&#39;ve probably lost a significant amount of money by not making certain trades or recommending certain products. That has bought me the right to keep working with other high integrity people on meaningful long-term work.</li></ul><p>I will make THAT trade any day.</p><p>On that note, I&#39;m incredibly appreciative of everyone who has been or continues to be a part of this journey but there are two people who helped define the trajectory: <a href="https://medium.com/u/40c4641af2ed">Tarun Chitra</a> and <a href="https://medium.com/u/75af669250b5">Jesse Beyroutey</a>. You shouldn&#39;t hesitate to work with them if you get the chance.</p><p><strong>📬 Want more research from Auditless? Subscribe to the </strong><a href="https://research.auditless.com"><strong>Newsletter</strong></a><strong>.</strong></p><p><strong>✨ Interested in helping us develop historic crypto projects? See </strong><a href="https://auditless.notion.site/Work-at-Auditless-1d30a9d6e15d425383e4685cc074ac68?pvs=4"><strong>Jobs</strong></a><strong>!</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=85352f0cba77" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Aera Protocol: Behind the Scenes]]></title>
            <link>https://medium.com/auditless/aera-protocol-behind-the-scenes-a8aadea10603?source=rss-7cf660fff514------2</link>
            <guid isPermaLink="false">https://medium.com/p/a8aadea10603</guid>
            <category><![CDATA[aera]]></category>
            <category><![CDATA[treasury-management]]></category>
            <category><![CDATA[gauntlet]]></category>
            <category><![CDATA[smart-contracts]]></category>
            <category><![CDATA[crypto]]></category>
            <dc:creator><![CDATA[Peteris Erins]]></dc:creator>
            <pubDate>Tue, 28 Nov 2023 15:08:32 GMT</pubDate>
            <atom:updated>2025-05-07T15:57:18.384Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*9mi4H2ZWerFX4z-31TE-uA.png" /></figure><blockquote>As the leading DeFi-native economic research firm, Gauntlet have pioneered ways off-chain intelligence can enhance onchain protocols through optimal control. To help DAOs make better capital allocation decisions in their treasuries, they set out to build a novel protocol and were looking for an R&amp;D partner to help design and implement it.</blockquote><p><strong>🏦 Interested in using Aera for your treasury? </strong><a href="https://www.aera.finance/contact"><strong>Contact the team</strong></a><strong>.</strong></p><p><strong>✨ Looking for help building your protocol? Just DM “Protocol” on </strong><a href="https://www.twitter.com/p_e"><strong>Twitter</strong></a><strong>.</strong></p><h3>Brief</h3><p>With Aera, Gauntlet sought to develop a comprehensive treasury management solution.</p><p>The protocol needed to:</p><ol><li><strong>Implement a highly pragmatic and current treasury management vehicle</strong> that would allow us to immediately start adding value to clients;</li><li><strong>Scale to support a wide variety of assets, treasury objectives and strategies</strong>;</li><li><strong>Provide a noncustodial implementation</strong> with strong onchain protections;</li><li><strong>Pave a clear path towards decentralization</strong> in accordance with the vision laid out in the <a href="https://uploads-ssl.webflow.com/62cd150e5e9efc960319c44d/6346c4525380f8fa6435c2b5_Aera_Whitepaper.pdf">Aera Whitepaper</a>.</li></ol><p>Here is the process we used behind-the-scenes to deliver on these concerns together with our security partners <a href="https://spearbit.com/">Spearbit</a> and ship two major versions of the Aera protocol.</p><h3>Design</h3><h4>A modular treasury management solution</h4><p>The protocol consists of three primary components:</p><ul><li><strong>The Vault </strong>— a non-custodial contract that holds the treasury assets, handles interactions from the guardian and treasury.</li><li><strong>Asset Registry</strong> — a whitelist of supported assets and their pricing logic.</li><li><strong>Hooks </strong>— a set of hooks around common vault operations. Most importantly they constrain which guardian submissions are valid.</li></ul><p>The protocol provides a generic interface and default implementation for each module which can evolve independently for future deployments.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uWMUIPchZy2mo-hfNuvDpA.png" /><figcaption>Aera V2 Modular Architecture</figcaption></figure><p>Every module clearly isolates its own concerns with vault focusing on custody, the asset registry focusing on asset selection and pricing and the hooks module focusing on vault protection.</p><p>All modules act in support of the objective function defined by the treasury.</p><h4>Trust model that prioritizes safety and availability of treasury funds</h4><p>From the beginning, we sought to mitigate the risks of centralized treasury management solutions. Our approach was to limit the actions guardians can take in several ways:</p><ul><li>They can only call whitelisted contracts and whitelisted functions on these contracts</li><li>They cannot reduce the vault value in excess of a pre-defined threshold during each 24-hour period</li><li>They cannot create open allowances for ERC20 tokens.</li></ul><p>In combination with only supporting highly-trusted guardians at the moment and using off-chain safeguards, this aims to achieve a multi-layer approach to security.</p><p>Equally we wanted to empower the treasury to take arbitrary actions through their funds and they can do so through the execute function.</p><h4>Spec-first mindset</h4><p>The Aera protocol was developed with a spec-first mindset. Throughout the course of development we used several types of specifications to build alignment, support the security process and explore variations on our ideas.</p><ol><li><strong>Executional spec</strong></li></ol><p>The earliest Aera specification was a fully working Python prototype used to simulate and explore different execution methodologies.</p><p>This was a natural approach, given Gauntlet&#39;s expertise in economic simulation.</p><p>We used an Ethereum inspired mini-DSL to define smart contract like objects and develop targeted simulations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/605/1*Ut46v_sSy0mRPGt5KVnHOA.png" /><figcaption>Excerpt from the Python library</figcaption></figure><p><strong>2. Written spec &amp; user documentation</strong></p><p>Next, we developed a written specification for the different module interfaces and implementations in Aera. After that, we added user documentation from the treasury point of view ahead of developing the protocol in order to achieve our stated goal of low-friction interactions.</p><p>We used Notion for this purpose, which helped us with collaboration and supported an easy export feature to share the spec with auditors.</p><p>A version of these guides is now published in the <a href="https://docs.aera.finance/\">Aera Docs</a>.</p><p><strong>3. Invariants</strong></p><p>Finally, we developed a basic trust model and a set of invariants for each module.</p><p>We are continuing to explore &amp; expand on invariant testing starting with Foundry invariants.</p><h4>Building an internal security capability</h4><p>We approached security audits as an opportunity not just to solidify the contracts but to <a href="https://newsletter.auditless.com/p/al-002-you-should-run-an-internal">train the team on security practices</a>. We followed the Auditless Codex playbook for internal security reviews.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nT9cG56HA-_8QYfuWRxL4w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1tWerq9ELB_-ydpyU8kTlw.png" /><figcaption>Auditless Codex “How to Do a Security Review” playbook</figcaption></figure><p>Even non-Solidity engineers participated in our internal audit and despite its heavily time-bound nature discovered critical issues as well as deepened their understanding of the protocol.</p><p>As a result, our latest audit by the world class Spearbit team had no critical issues and just 1 High Severity issue, which enabled the Spearbit team to add value in additional ways such as streamlining deployment, helping us plan future iterations of the asset registry and more.</p><p>Our goal is to continue developing our internal security capabilities.</p><h4>A path to decentralization</h4><p>The use of objective functions and guardians is intentionally included as an enabler for decentralization. The current architecture is future-proof: it can support an evolution of the guardian in a smart contract and we have completed several streams of investigative work in this direction.</p><p>Some of the most important contributions that the Aera protocol will introduce will likely come from these efforts.</p><h4>Collaborative process</h4><p>The most distinctive feature of our process has been the cross-functional nature of the solution. The Aera guardian logic, monitoring stack and strategies were all developed in conjunction with the protocol with many feedback loops.</p><p>Every member of the broader Aera team has contributed to both the protocol and the off-chain infrastructure that uses it in some form (and necessarily so).</p><p>The collaboration was oriented around a <a href="https://www.svpg.com/product-discovery/">Product Discovery</a> loop that resulted in a sequence of AEPs (Aera Enhancement Proposals) with prioritization derived from overall Aera product objectives.</p><p>We look forward to continuing to evolve these operating procedures to support the growth of the protocol and explore more of the treasury management idea maze.</p><p><strong>💻 Are you interested in learning more about these contracts? You can check the source code on </strong><a href="https://github.com/aera-finance/aera-contracts-public"><strong>GitHub</strong></a><strong> or the </strong><a href="https://docs.aera.finance/"><strong>documentation</strong></a><strong>.</strong></p><p><strong>📬 Want more research from Auditless? Subscribe to the </strong><a href="https://research.auditless.com"><strong>Newsletter</strong></a><strong>.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a8aadea10603" width="1" height="1" alt=""><hr><p><a href="https://medium.com/auditless/aera-protocol-behind-the-scenes-a8aadea10603">Aera Protocol: Behind the Scenes</a> was originally published in <a href="https://medium.com/auditless">Auditless</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Aera Finance Raises $8 Million To Scale DAO Treasury Management]]></title>
            <link>https://medium.com/auditless/aera-finance-raises-8-million-to-scale-dao-treasury-management-039508f6faed?source=rss-7cf660fff514------2</link>
            <guid isPermaLink="false">https://medium.com/p/039508f6faed</guid>
            <category><![CDATA[smart-contracts]]></category>
            <category><![CDATA[gauntlet]]></category>
            <category><![CDATA[crypto]]></category>
            <category><![CDATA[aera]]></category>
            <category><![CDATA[treasury-management]]></category>
            <dc:creator><![CDATA[Peteris Erins]]></dc:creator>
            <pubDate>Tue, 21 Nov 2023 15:27:41 GMT</pubDate>
            <atom:updated>2025-05-07T15:57:42.158Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*EuvUCBGCWiSirriZBknsaA.png" /></figure><blockquote>As the leading DeFi-native economic research firm, Gauntlet have pioneered ways off-chain intelligence can enhance onchain protocols through optimal control. To help DAOs make better capital allocation decisions in their treasuries, they set out to build a novel protocol and were looking for an R&amp;D partner to help design and implement it.</blockquote><p><strong>🏦 Interested in using Aera for your treasury? </strong><a href="https://www.aera.finance/contact"><strong>Contact the team</strong></a><strong>.</strong></p><p><strong>✨ Looking for help building your protocol? Just DM “Protocol” on </strong><a href="https://www.twitter.com/p_e"><strong>Twitter</strong></a><strong>.</strong></p><h3>Challenge</h3><p>Protecting over $9 billion in client assets, <a href="https://www.gauntlet.xyz/">Gauntlet</a> is the leading DeFi-native economic research firm used by market leaders like Uniswap, AAVE, Maker, Compound and others. When they set out to improve treasury management, it became clear that a non-custodial onchain protocol would be the best vehicle to do so. Having already conducted foundational research on what a decentralized treasury management mechanism could look like (some of these ideas can be seen in the <a href="https://assets-global.website-files.com/62cd150e5e9efc960319c44d/6346c4525380f8fa6435c2b5_Aera_Whitepaper.pdf">Whitepaper</a>), they needed an R&amp;D partner to develop these concepts into a category-shaping protocol.</p><h3>Solution</h3><p>Auditless worked closely with the Product, Engineering, Leadership and Business Development teams at Gauntlet as well as with our security partners <a href="https://spearbit.com/">Spearbit</a> to shape &amp; develop a trust-minimized treasury management protocol which uses current DeFi instruments and off-chain guardians to satisfy a variety of custom treasury objectives.</p><p>The live <a href="https://www.aera.finance/">Aera protocol</a> is pioneering custom treasury objectives for each client, a frictionless deployment process and a path to decentralization through the use of a guardian role.</p><h3>Results</h3><p>The Aera Foundation has now raised $8M from Jump Crypto and Bain Capital Crypto to continue scaling the protocol while protocols and institutions already manage $4.3M of their treasuries using Aera.</p><h4><strong>+$4.3M since inception</strong></h4><p>Auditless helped develop two major versions of the Aera protocol (V1 and V2), which had led to several active treasury deployments. The flexibility of the underlying smart contracts allows Aera to address distinct needs with each deployment, varying from volatility targeting, deepening liquidity, generating yield on idle holdings and diversifying treasury assets.</p><p>Clients are drawn to the trust model that Aera provides, where guardian actions are highly limited and guarded by a variety of pre and post-execution hooks that include action whitelisting, allowance checks and limits on vault value changes — all enforced onchain.</p><p>On the flipside, Aera clients have full and immediate control over their funds and are free to utilize their Aera vault as a wallet.</p><h4>+$8M raised for Aera</h4><p>The ideas and traction behind the Aera treasury management solution have led to partnerships with world leading crypto investors (<em>Source: </em><a href="https://www.prnewswire.com/news-releases/aera-protocol-opens-to-general-availability-with-8-million-token-sale-led-by-bain-capital-crypto-301967722.html"><em>PR Newswire</em></a><em>)</em>:</p><blockquote>“The Aera team has developed a much-needed solution perfect for crypto-native organizations looking to responsibly manage their treasuries,” said Stefan Cohen, partner at Bain Capital Crypto. “Aera is the first solution of its kind for DAO treasury management and was built by a team that’s amazingly well equipped to usher in a new era of responsible decentralized finance growth.”</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Wv6m_-6WG5bxj6_Oe2vX6A.png" /><figcaption>Live Aera vault example</figcaption></figure><p><strong>📬 Want more research from Auditless? Subscribe to the </strong><a href="https://research.auditless.com"><strong>Newsletter</strong></a><strong>.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=039508f6faed" width="1" height="1" alt=""><hr><p><a href="https://medium.com/auditless/aera-finance-raises-8-million-to-scale-dao-treasury-management-039508f6faed">Aera Finance Raises $8 Million To Scale DAO Treasury Management</a> was originally published in <a href="https://medium.com/auditless">Auditless</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Reading Sierra: Starknet's secret sauce for Cairo 1.0]]></title>
            <link>https://medium.com/yagi-fi/reading-sierra-starknets-secret-sauce-for-cairo-1-0-5bc73409e43c?source=rss-7cf660fff514------2</link>
            <guid isPermaLink="false">https://medium.com/p/5bc73409e43c</guid>
            <category><![CDATA[cairo]]></category>
            <category><![CDATA[starknet]]></category>
            <category><![CDATA[sierra]]></category>
            <dc:creator><![CDATA[Peteris Erins]]></dc:creator>
            <pubDate>Tue, 07 Mar 2023 13:59:41 GMT</pubDate>
            <atom:updated>2023-03-07T13:59:41.991Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KIHzJdhIYmTmEe7c7S9k9Q.png" /></figure><p>The best Solidity developers can program in Yul (an intermediate language used in Solidity code compilation) and understand the EVM. They do this because it helps them understand security vulnerabilities and optimize their code to make it efficient. They also do this because it&#39;s fun. At an extreme, <a href="https://opensea.io/blog/articles/introducing-seaport-protocol">OpenSea&#39;s Seaport protocol</a> was written with significant amounts of assembly code.</p><p>Starknet also has an intermediate language called Sierra, built as a stable layer to allow for rapid iteration and innovation at the Cairo 1.0 language level. While not absolutely essential to write efficient programs (Starknet contracts written in high-level Cairo will be orders of magnitude more efficient than hand-optimized Solidity contracts), reading Sierra code can help us get a deeper understanding of the underlying type system, security risks and improving efficiency where it matters (e.g., reducing the storage footprint or execution steps in highly recursive functions).</p><p>For Cairo 0.x programmers, Sierra is the bridge between our past and the future, a familiar blueprint guiding our craft. Let&#39;s take a look.</p><p>If you&#39;d like to follow along, you can generate readable Sierra output for your contracts by using the make sierra command in the <a href="https://github.com/auditless/cairo-template">Minimal Cairo 1.0 Template</a>. This effectively runs cairo-compile . -r on your code. While Sierra is reported as stabilized, the present examples are accurate as of March 2023.</p><h4>Starting from the bottom</h4><p>The natural place to start is with a function that does nothing:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BAbXfYQcfd9MQZy-c0_Hvg.png" /><figcaption>A minimal Cairo function</figcaption></figure><p>The Sierra output is organized into 4 separate sections always presented in the same order. First come the type declarations. Next, declarations of built-in library functions that will be used. Then the sequence of statements and finally the declared Cairo functions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_-WtK8u3S9aFlVN28lQBHg.png" /><figcaption>Sierra output for do_nothing</figcaption></figure><p>A couple of observations:</p><ul><li>The Unit type () is a special case of an empty struct and is used as a default return type for procedures (functions without a declared return type)</li><li>New temporary variables are created and indexed using square brackets ( [0] and [1] )</li><li>Statements have the following form &lt;libfunc&gt;(&lt;inputs&gt;) -&gt; (&lt;outputs&gt;); , i.e., we don&#39;t see the more traditional [0] = struct_construct&lt;Unit&gt;();</li><li>Code blocks are separate from Cairo function declarations. A function is tied to a specific block of code by starting at a dedicated statement index location (note the do_nothing@0 which indicates that the function begins at the first statement).</li></ul><h4>Types &amp; Code generation</h4><p>Sierra output can be used to understand how built-in types are used in compilation. Consider this simple function to add two felt values:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/786/1*_qNy-UZcyAmIa489Kvu2rw.png" /><figcaption>A function that adds two felts</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*w2cqLSJoKp1hD7c1YUfCEA.png" /><figcaption>Sierra output for add</figcaption></figure><p>The output above is simple enough, showing us how function arguments become unnamed variables in statements.</p><p>Let&#39;s try a more complex type like u128 :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/844/1*tZBfRlc6MmsqcChtHmBFLA.png" /><figcaption>A function that adds two u128 values</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8xvHuUlBiOXmUyQj4LGY6Q.png" /><figcaption>Truncated Sierra output for add_128</figcaption></figure><p>In this case, the output is much larger given that u128 is not a primitive type. This is reflected well in the function declarations:</p><ul><li>Our add function now has a phantom argument with a type of RangeCheck . This is a note to include the ZK circuit to help with felt comparisons, which is needed to perform addition. A welcome change from Cairo 0.x where built-ins had to be explicitly provided</li><li>We see that some additional functions were generated in this case. These functions were included based on traits defined in the Cairo core library ( corelib). In short, any Cairo code needed for compilation will be present in the final Sierra output.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lhW7wPP1_CrBSBemBQ1N-w.png" /><figcaption>U128Add implementation in corelib</figcaption></figure><h4>Control Flow</h4><p>To study how control flow is represented, we can use a recursive function to compute the factorial:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ppcowWWRB8nP4wn6zzFY9Q.png" /><figcaption>A recursive function computing n!</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uCR8nWRXcuAkXp96P7Zldg.png" /><figcaption>Sierra statements and function declarations for factorial function</figcaption></figure><p>In line 22, a function_call libfunc is used to make the recursive call. We also see the jump construct in line 13. The jump label is the index of the statement so jump() { 28() }; would take execution to row 29.</p><h4>Learning more</h4><p>I hope that this has been a useful teaser on how to read Sierra. Cairo smart contract developers and auditors alike shouldn&#39;t hesitate to jump down into Sierra to understand how their contracts work. There is a lot more going on behind the scenes, but Sierra strikes a good balance between readability and insight.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5bc73409e43c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/yagi-fi/reading-sierra-starknets-secret-sauce-for-cairo-1-0-5bc73409e43c">Reading Sierra: Starknet&#39;s secret sauce for Cairo 1.0</a> was originally published in <a href="https://medium.com/yagi-fi">Yagi Finance</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The first structured product on StarkNet: earn JediSwap liquidity fees in 1-click]]></title>
            <link>https://medium.com/yagi-fi/the-first-structured-product-on-starknet-earn-jediswap-liquidity-fees-in-1-click-cc2157f4f217?source=rss-7cf660fff514------2</link>
            <guid isPermaLink="false">https://medium.com/p/cc2157f4f217</guid>
            <category><![CDATA[yagi-finance]]></category>
            <category><![CDATA[starknet]]></category>
            <category><![CDATA[jediswap]]></category>
            <category><![CDATA[ethereum]]></category>
            <dc:creator><![CDATA[Peteris Erins]]></dc:creator>
            <pubDate>Tue, 26 Jul 2022 11:14:25 GMT</pubDate>
            <atom:updated>2022-07-26T11:14:25.833Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Hdh6M0v6a6ZIIdiJLu1Q5g.png" /></figure><p>Yagi is a <a href="https://www.yagi.fi/vaults">yield aggregator</a> and <a href="https://www.yagi.fi/automation">keeper network</a> on StarkNet. After announcing <a href="https://medium.com/yagi-fi/trustless-l2-native-yield-has-arrived-on-starknet-33370ab555b2">our first vault</a> and being humbled by the interest from early depositors, the focus shifted to build more and better vaults on top of foundational yield opportunities in the StarkNet ecosystem.</p><p>After building a vault on top of a lending protocol, the next goal was to build on top of an AMM (automated market maker). I had the pleasure of meeting Rohit from JediSwap in the Amsterdam hackathon and we started to explore what we can do together. It became clear that the JediSwap community represented a healthy combination of grassroots energy and a deep understanding of DeFi as we brainstormed the needs of different market participants. It also became clear that we could start addressing those needs by developing a joint liquidity product.</p><p>Today, I&#39;m pleased to announce that the DAI-ETH vault is available for testing on StarkNet Goerli.</p><h3>The naive joint liquidity vault</h3><p>JediSwap is an automated market maker that allows liquidity providers to provide liquidity for traders who can use different pools to trade between pairs of assets. Liquidity providers need to provide both assets in a pool in a specific ratio in exchange for liquidity fees (0.3% on trades distributed in proportion to liquidity provided).</p><p>To provide liquidity, a user must obtain and provide liquidity in both assets. For example, a user with only ETH needs to first trade to get DAI and then provide both ETH and DAI to provide liquidity in the pool. Our joint liquidity vaults simplify this process by only requiring one asset (either ETH or DAI) to start earning fees on JediSwap.</p><p>We are launching two different vaults, an ETH vault and a DAI vault whose positions are combined to provide liquidity on JediSwap.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PURuRypyPsmJZd1dqLb6Ig.png" /><figcaption>ETH Vault</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1015/1*eBF6u4kwnyXXHoyQFGGDdw.png" /><figcaption>DAI Vault</figcaption></figure><p>You can go ahead and interact with these vaults right now at <a href="https://www.yagi.fi/vaults">https://www.yagi.fi/vaults</a>.</p><h3>Are the vaults fair?</h3><p>The magic of the vaults lies in their ability to account for how much of the liquidity share is owned by the ETH depositors and DAI depositors. In practice, this is done by simply returning the corresponding ETH and DAI in the liquidity share with no additional trading.</p><p>This works because JediSwap is a constant product market maker with a 50–50% weight distribution. This means that the reserves of both assets are valued equally in the pool.</p><p>To illustrate, consider that the current ETH price is $1500 and depositors are depositing 1 ETH and 1500 DAI in the vault respectively. The value of both parts is equal to $1500. Now consider an ETH price movement to $2000. In this case, the vault now holds 1732 DAI and 0.866 ETH after arbitrage. Why?</p><p>Note that the product is retained: 1732 x 0.866 ~ 1500 x 1.</p><p>And the spot price is now: 1732 / 0.866 = 2000.</p><p>The dollar value of both positions, however, is still equal to $1732.</p><p>In short, this means that each depositor is effectively holding an instrument that behaves like a liquidity share and follows the general equation of returns equals fees less impermanent loss as discussed <a href="https://docs.uniswap.org/protocol/V2/concepts/advanced-topics/understanding-returns">here</a>. Note: this is only true if the pool is effectively arbitraged. If the pool spot price deviates from the market price, then one side could be more valuable than the other.</p><h3>Issues with the experimental vault</h3><p>The current vault has a known griefing issue. In particular, vault shares are minted on every deposit meaning that users could trigger deposits maliciously when the spot price is not in agreement with the market price. Furthermore, they could do this while directly manipulating the spot price themselves.</p><p>We will address this vulnerability in upcoming versions but feel like an intermediate release on testnet is useful to improve our understanding of how to safely integrate with JediSwap and begin to educate our community on liquidity provision.</p><p>Future iterations of the vault will involve an exciting use of the <a href="https://empiric.network/">Empiric oracle</a>, <a href="http://yagi.fi/automation">Yagi keepers</a> and other aspects we discussed at length in the <a href="https://twitter.com/StarknetHouse/status/1549786835215208449">StarkNet House talk</a>.</p><h3>Dive into L2 yield with us</h3><p>Interested in L2-native and trustless yield opportunities on StarkNet whether as a developer, investor or user? Join our <a href="https://discord.gg/49TYpjfkUn">Discord</a>.</p><h3>Thanks</h3><p>This launch would not have been possible without the following individuals:</p><ul><li>Thanks to <a href="https://twitter.com/imrgoyal">Rohit Goyal</a> from <a href="https://twitter.com/jediswap">JediSwap</a> for help in developing the vault concept</li><li>Thanks to <a href="https://twitter.com/princearora111">Prince Arora</a> from <a href="https://twitter.com/jediswap">JediSwap</a> for help in reviewing the vault implementation and providing detailed technical information.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cc2157f4f217" width="1" height="1" alt=""><hr><p><a href="https://medium.com/yagi-fi/the-first-structured-product-on-starknet-earn-jediswap-liquidity-fees-in-1-click-cc2157f4f217">The first structured product on StarkNet: earn JediSwap liquidity fees in 1-click</a> was originally published in <a href="https://medium.com/yagi-fi">Yagi Finance</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Trustless L2-native yield has arrived on StarkNet]]></title>
            <link>https://medium.com/yagi-fi/trustless-l2-native-yield-has-arrived-on-starknet-33370ab555b2?source=rss-7cf660fff514------2</link>
            <guid isPermaLink="false">https://medium.com/p/33370ab555b2</guid>
            <category><![CDATA[yield]]></category>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[vault]]></category>
            <category><![CDATA[yagis]]></category>
            <category><![CDATA[starknet]]></category>
            <dc:creator><![CDATA[Peteris Erins]]></dc:creator>
            <pubDate>Sun, 15 May 2022 17:09:13 GMT</pubDate>
            <atom:updated>2022-05-15T17:09:13.127Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JEcqLIpm5kN-6FbGwWT3bg.png" /></figure><p>Earlier this year, <a href="http://yagi.fi">Yagi</a> launched as the first keeper network on StarkNet. On the way, we&#39;ve hit several milestones such as powering innovative applications (e.g., <a href="https://topology.gg/">Topology</a>&#39;s Isaac game), building a community and collaborating with many teams in the space.</p><p>In terms of verticals, there is promising early adoption of Yagi Automation in Gamefi but we are only scratching the surface in terms of DeFi use cases.</p><h3>Vaults as a major use case for keeper networks</h3><p>Keepers thrive when automation can add value in an economically sustainable way and one of the most common applications is the re-balancing and management of automated vaults.</p><p>As we started thinking about how to spur more innovation on the vault side, we met with other great teams that are building yield solutions on StarkNet: Yearn (bringing L1 yield to StarkNet), Magnety (building managed vaults) and Sandclock (building multi-chain vaults). These products are fantastic and we expect to be passionate early adopters, however, these teams are not yet using keepers at the scale we would expect given their importance.</p><p>We think that keeper networks on StarkNet will enable a fourth use case that so far has been neglected: <strong>trustless L2 native yield</strong>.</p><h3>What do we mean by Trustless L2-native yield?</h3><p><strong>L2-native yield</strong> comes from economic activity on L2 protocols like AMMs, lending markets and other primitives rather than from mainnet. We see StarkNet as more than just a cheap way to interact with existing protocols on mainnet — it will become a thriving financial ecosystem in its own right.</p><p>To be <strong>trustless</strong>, assets need to be managed by smart contracts and economic systems rather than individuals. Any intervention by individuals or concentration of power should be limited through strict incentives (e.g., such as those managed by a keeper network).</p><p>We think the recently launched ERC4626 vault standard will be an enabler for the development of more trustless vaults. ERC4626 facilitates composability of yield sources and vaults by enforcing clear patterns and guidelines. Earlier this year we built a reference implementation of the <a href="https://github.com/auditless/cairo-erc4626">ERC4626 vault standard</a> in Cairo.</p><p>The above ideas led to a hackathon project in StarkNet&#39;s DevConnect event in Amsterdam which we are now happy to release…</p><h3>Introducing Yagi Vaults</h3><p>Yagi Vaults is an aggregator for ERC4626 vaults that complements Yagi Automation, our keeper network. As a demonstration, we developed an xBank lending vault that you can use to lend ETH to xBank&#39;s algorithmic money market (detailed in a future post). At this time, it&#39;s one of the earliest fully-functional ERC4626 vaults on StarkNet and you can interact with it starting <a href="https://www.yagi.fi/vaults">today</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*C-Ss6HTRLcA7qrw07rRY6Q.png" /><figcaption>xBank lending vault on Yagi Vaults</figcaption></figure><p>Existing vault users may wonder why this interface is so simple.</p><p>We didn&#39;t hesitate to take advantage of StarkNet&#39;s architecture. For example, StarkNet account abstraction supports native multi-calls so deposits only require 1 transaction. We don&#39;t need to issue a separate approve transaction anymore.</p><p>For now, this is still an experimental testnet release which will more than likely to contain bugs. Our goal is to create more opportunities for our community to interact with StarkNet and fix issues to make the product more robust. As always, you can get in touch with us on <a href="http://www.twitter.com/yagi_fi">Twitter</a> or <a href="http://discord.gg/49TYpjfkUn">Discord</a> to report any issues.</p><h3>What&#39;s next?</h3><p>We have plans to improve the interface while developing more yield sources directly with other early partners and pave ways to integrate our keeper network at the heart of these vaults.</p><p>We are particularly excited to work with teams building new types of primitive financial markets such as exchanges, stable coins, derivatives, lending products or other vaults we could build on top of. We also hope that this inspires other teams building vaults to use the ERC4626 standard and Yagi Automation and we would be happy to help there as well.</p><h3>Dive into L2 yield with us</h3><p>Interested in L2-native and trustless yield opportunities on StarkNet whether as a developer, investor or user? Join our <a href="https://discord.gg/49TYpjfkUn">Discord</a>.</p><h3>Thanks</h3><p>This launch would not have been possible without the following individuals:</p><ul><li>Thanks to <a href="https://twitter.com/nickeof7">Nick Chikovani</a> from <a href="https://twitter.com/altzoneio">Altzone</a> for help in exploring XBank&#39;s contracts and building a lending vault prototype</li><li>Thanks to <a href="https://twitter.com/TimothyXbank">Timothy Arslan</a> from <a href="https://twitter.com/xBankFinance">xBank</a> for kindly answering questions about the integration</li><li>Thanks to <a href="https://twitter.com/0xjanek">Janek</a> from <a href="https://twitter.com/argentHQ">Argent</a> and <a href="https://starkware.co/">StarkWare</a> team for debugging help during the hackathon</li><li>Thanks to <a href="https://twitter.com/ceccon_me">Francesco Ceccon</a> from <a href="https://twitter.com/apibara_nft">Apibara</a> for help in leveraging his excellent <a href="https://github.com/apibara/starknet-react">hooks library</a></li><li>Last but not least, thanks to <a href="https://mobile.twitter.com/guthl">Louis Guthmann</a>, <a href="https://twitter.com/ukolodny">Uri Kolodny</a> and the rest of the StarkWare team for relentless help and support.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=33370ab555b2" width="1" height="1" alt=""><hr><p><a href="https://medium.com/yagi-fi/trustless-l2-native-yield-has-arrived-on-starknet-33370ab555b2">Trustless L2-native yield has arrived on StarkNet</a> was originally published in <a href="https://medium.com/yagi-fi">Yagi Finance</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Provable vs. Composable Computation or why Cairo will supersede Solidity]]></title>
            <link>https://medium.com/yagi-fi/provable-vs-composable-computation-or-why-cairo-will-supersede-solidity-6b00e69bfc9e?source=rss-7cf660fff514------2</link>
            <guid isPermaLink="false">https://medium.com/p/6b00e69bfc9e</guid>
            <category><![CDATA[starknet]]></category>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[solidity]]></category>
            <category><![CDATA[keepers]]></category>
            <category><![CDATA[cairo-lang]]></category>
            <dc:creator><![CDATA[Peteris Erins]]></dc:creator>
            <pubDate>Sun, 23 Jan 2022 14:24:45 GMT</pubDate>
            <atom:updated>2022-01-23T14:24:45.725Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f7naMaF-zzfl2FGdPHDRLw.png" /></figure><p><strong><em>Summary</em></strong><em>. In this post, I will argue that Cairo can effect the coming wave of provable computation in the same way that Solidity has enabled composable computation. Cairo is the native programming language of StarkNet, a Layer 2 network designed to scale Ethereum.</em></p><p>—</p><p>It&#39;s regrettable when we see smart contracts merely as an extension of finance (DeFi) or a generalization of the web (web3). Smart contract networks are really platforms for composable computation.</p><p>Ethereum embeds certain standards that allow its computer programs to interoperate:</p><ul><li>Transparent byte code (no hidden web APIs)</li><li>Standardized API structure (called the ABI)</li><li>Guaranteed uptime (each app is hosted on multiple machines, per-app Denial of Service is uneconomical)</li><li>Built-in payment infrastructure (no reliance on 3rd parties like Stripe)</li><li>Full deployment and transaction lineage</li><li>Friction-less contracting between different application layers (governance, ownership, etc.).</li></ul><p>These constraints can impair developer productivity (see critiques of web3) but has also incentivize composition and re-use of stateful applications at an unprecedented scale.</p><h3><strong>Solidity was the first mainstream language for composable computation</strong></h3><p>Solidity was created as a simple language that is compatible with the above standards. It provided:</p><ul><li>Basic state machine functionality (state, access, updates, etc.)</li><li>No access to non-composable primitives (e.g., external data feeds)</li><li>Interfaces for contract-to-contract interaction (means of composition)</li><li>Built-in gas metering for transaction fees</li><li>Performant access to the underlying virtual machine (assembly).</li></ul><p>While existing programming languages can be adapted to service composable computation, they need a combination of extension (adding interfaces for composition) and restriction (removing all forms of non-determinism and external access) that is difficult to incorporate. Moreover, the compilers of these languages were defined to optimize a completely different performance metric (execution footprint) than is required to optimize Solidity code (gas costs).</p><h3>Introducing Provable Computation</h3><p>StarkNet&#39;s scalability tool, ZK Roll-ups, enable a new paradigm called Provable Computation. In this paradigm, we retain all the benefits of composable computation but also allow programs to prove they have been executed without having to be re-run.</p><p>This simple idea allows us to move from a network (Ethereum) where validating a transaction requires re-running it to a better network (StarkNet) where transactions are validated by validating the proof that they have been executed with a certain outcome, a much more economical operation.</p><p>Because this paradigm is so different, it also requires a different computing model, effectively turning programs into number theoretical equations rather than executing them on a machine.</p><p>What programming language could we use possibly use for this?</p><h3>Solidity vs. Cairo</h3><p>It&#39;s natural to consider Solidity. For one, it already supports composition (calling other smart contracts) and is widely adopted. Two, there are a range of applications that are deployed on Solidity that can be easily migrated to other Layer 2 solutions (including zkSync which supports Provable Computation). Three, Solidity has a well-maintained multi-layer compiler that can be adapted to serve different use cases.</p><p>But Solidity is not native to provable computation. Any compiler that takes idiomatic Solidity code and translates it into proofs will struggle with the following issues among others:</p><ul><li>Reliance on inefficient data structures like uint256 and operations on them</li><li>Mutability at the language level</li><li>Lack of efficient built-ins</li><li>No low-level access.</li></ul><p><strong>Technical detail</strong>. In practice, there are 2 different technologies for proving general programs (SNARKs and STARKs). Instruction sets favored by SNARKs are better suited as a compilation target for languages like Solidity. STARKs offer more scalability while having a less natural instruction-set. So when we say “Solidity is not an efficient language for provable computation, we really mean two things: 1) Solidity can be efficiently encoded to SNARKs, but they are not as scalable as STARKs 2) Solidity is not the optimal language to compile to STARKs since constructs that are common in Solidity are “costly” for STARKs. [1]</p><p>Cairo has solutions for all the above:</p><ul><li>A low-level field integer data type called felt is available (alongside a uint256 type)</li><li>The Cairo language is idiomatically write-once (like a functional programming language)</li><li>A growing list of built-in non-deterministic hints is being developed for common computations</li><li>Cairo provides full low level access to underlying primitives. [1]</li></ul><p>Yes, programming in Cairo is also more challenging and ecosystem tools are still maturing. But the whole point of scaling Ethereum is to transcend existing limitations and build better composable applications. If so, why stop at Solidity?</p><h3>Surf the paradigm with us</h3><p>Interested in the potential of provable computation on StarkNet whether as a developer, investor or user? Join our <a href="https://discord.gg/49TYpjfkUn">Discord</a>.</p><p>—</p><p>[1] Cairo Whitepaper, <a href="https://www.cairo-lang.org/cairo-whitepaper/">https://www.cairo-lang.org/cairo-whitepaper/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6b00e69bfc9e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/yagi-fi/provable-vs-composable-computation-or-why-cairo-will-supersede-solidity-6b00e69bfc9e">Provable vs. Composable Computation or why Cairo will supersede Solidity</a> was originally published in <a href="https://medium.com/yagi-fi">Yagi Finance</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>