<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
    <channel>
        <title>Adam</title>
        <link>https://paragraph.com/@adam-33</link>
        <description>devrel building high impact developer ecosystems on the frontiers of web3 👨🏾‍💻</description>
        <lastBuildDate>Mon, 31 Aug 2026 08:20:54 GMT</lastBuildDate>
        <docs>https://validator.w3.org/feed/docs/rss2.html</docs>
        <generator>https://github.com/jpmonette/feed</generator>
        <language>en</language>
        <image>
            <title>Adam</title>
            <url>https://storage.googleapis.com/papyrus_images/0651d25c1a9d285432c63a8b1afd2791e2f83c93333180d8e5ac88e6449cc6df.png</url>
            <link>https://paragraph.com/@adam-33</link>
        </image>
        <copyright>All rights reserved</copyright>
        <item>
            <title><![CDATA[How Uniswap V4 Hooks & EigenLayer AVS's will Accelerate Intent based Defi protocols]]></title>
            <link>https://paragraph.com/@adam-33/how-uniswap-v4-hooks-eigenlayer-avs-s-will-accelerate-intent-based-defi-protocols</link>
            <guid>EoiogXxspUK449h71Gsg</guid>
            <pubDate>Wed, 19 Jun 2024 21:57:48 GMT</pubDate>
            <description><![CDATA[tl;dr: All you need to do is lock-in anon.For the past few years, developing an entirely new protocol has been brutal for developers. Forking the Uniswap codebase, either V2 or V3, make your customizations, spend another 50k getting said codebase re-audited, attracting new liquidity to your protocol, etc. This was a feat most teams could not push through, with most forks either not making it to prod, and the ones that did make it to proud reach nowhere near the levels volume of Uniswap. Below...]]></description>
            <content:encoded><![CDATA[<h2 id="h-tldr-all-you-need-to-do-is-lock-in-anon" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>tl;dr: All you need to do is lock-in anon.</strong></h2><p>For the past few years, developing an entirely new protocol has been brutal for developers. Forking the Uniswap codebase, either V2 or V3, make your customizations, spend another 50k getting said codebase <em>re-audited,</em> attracting new liquidity to your protocol, etc. This was a feat most teams could not push through, with most forks either not making it to prod, and the ones that did make it to proud reach nowhere near the levels volume of Uniswap. Below you can see that Uniswap V2 has been forked over half a thousand times and V3 over 70 times, and that’s just what actually made it mainnet.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/532023ae54e301daebfb16d456050e6860787c19c2121c01af889cf11fb43088.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>Not only have DeFi protocols been an absolute PITA to bootstrap, but moreover botostrapping your own decentralized networks were hard too. Building the underlying trust networks for these systems to <em>years.</em> Getting validators to sign up to your network, going through the 7 hells of game theory to figure out a proper system, etc.</p><p>But, this year, all of that is changing with the coming mainnet release of Uniswap V4 Hooks &amp; Eigen Layer’s AVS system.</p><p>There’s already plenty of content on what Uniswap V4 is, but if you don’t know, here’s a quick sypnopsis on uniswap there’s essentially about 2 main core functionaities: swapping and modifiying your LP positions. Throughout you doing these actions, hooks are smart contract functions that can essentially write their own custom functionality that happen at different stages of your transaction to essentially overwrite or enhance what ‘s happening on a Uniswap transaction.</p><ul><li><p>beforeSwap</p></li><li><p>afterSwap</p></li><li><p>beforeModifyLiquidity</p></li><li><p>afterModifyLiquidity</p></li><li><p>etc(there’s a few more, you can see them here on the Uniswap V4 Core codebase)</p></li></ul><p>Hooks allow developers to build their <em>own</em> dexes without having to fork the Uniswap protocol. And depending on the implementation of your protocol, it can significantly drop the costs of getting your protocol audited, as you’ll only pay for the hook functions and not the underlying protocol. So essentially, there may be many ETH &lt;&gt; USDC pools in the future all using uniswap hooks. Some may do something like let you swap eth on mainnet for a token on Base, others may have a lending protocol built in that pursues yield on “dead“ liquidity ticks, etc. This makes the Uniswap protocol not just an AMM protocol(which is already a feat), but also it makes the Uniswap protocol a developer platform for the next generation of DeFi dexes.</p><p>So tl;dr on this 👇</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/5662c2af662e42f43590a548072d4dc6f67d25c26b9658dc8ca3dbea1e62a249.jpg" alt="Literally....just lock tf in." blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">Literally....just lock tf in.</figcaption></figure><p>Ok, now on to <strong>EigenLayer.</strong> I’m going to greatly shorten this part but essentially, EigenLayer revolutionizes the way decentralized networks are bootstrapped by leveraging the security and trust of Ethereum&apos;s existing staker ecosystem. With EigenLayer, devs can deploy arbitrary node software across a network that inherently trusts and secures these operations, eliminating the need to build and secure a new network from scratch.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/178fc4b0481b5e1ba774f920b363ec6be73b80b977727c247a5baebf2f3ebc6e.jpg" alt="I&apos;m literally telling you! Just lock in!" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">I&apos;m literally telling you! Just lock in!</figcaption></figure><p>Ok so, intents are a huge subject that and DeFi intent based protocols take many different shapes and sizes, from bridging to orderbooks. The goal here is to make DeFi a significantly more better experience than CEXs buy providing better prices and liquidity. I will not cover too much about intents but its <em>kinda sorta</em> this meme below(mostly inspired form how CoW Swap works)</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/dd51e4936f3472276d9fd57516cd4625ff342a5da0e614ab2fb7b597811e58c5.jpg" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><ul><li><p>Basically a user sends an “intent“. I have x eth and want y meme coins.</p></li><li><p>My off chain solver takes that order and the other orders happening and attempts to find the best prices for these orders across different DEXs/Aggregators</p></li><li><p>My solver sorts out who gets what.</p></li><li><p>I get my tokens, then solver takes a little bit off the top.</p></li><li><p>I get my money, no questions asked!</p></li></ul><p>Intent based protocols are the next generation of DeFi protocols and will bring more users on-chain as DEXs eat into CEXs like Binance and Coinbase.</p><h3 id="h-ok-so-how-does-all-of-this-come-together" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Ok so, how does all of this come together?</h3><p>Alright, let&apos;s incorporate the idea of using relayers within the EigenLayer&apos;s AVS network to assist the Uniswap V4 Hooks, creating a unique and innovative intents-based protocol. Here’s an entirely new approach, focusing on enhancing transaction efficiency and reducing slippage through strategic use of relayers.</p><p>Protocol Concept: Cross Chain Swapping Protocol(Similar to Across Protocol)</p><p><strong>Overview:</strong> This protocol is a defi protocol that enables secure and efficient cross-chain token swaps by utilizing Uniswap V4 Hooks for on-chain actions and EigenLayer’s AVS network to manage off-chain operations and cross-chain communication.</p><ol><li><p><strong>Core Features:</strong></p><ol><li><p><strong>Cross-Chain Swap Facilitation:</strong> Streamlines the process of swapping tokens across various blockchains, integrating multiple blockchains into a single interface.</p></li><li><p><strong>Relayer Networks for Efficiency:</strong> Uses relayers within the EigenLayer network to validate and relay transaction data between chains, ensuring timely and secure transfers.</p></li><li><p><strong>Transaction Cost Optimization:</strong> Leverages Uniswap V4 Hooks to dynamically adjust the swapping process based on the current gas fees and exchange rates, aiming to minimize user costs.</p></li><li><p><strong>Enhanced Security Protocols:</strong> Implements advanced security measures, including multi-signature confirmations and smart contract audits, to protect against common cross-chain vulnerabilities like replay attacks.</p></li></ol><p><strong>How It Works:</strong></p><ol><li><p><strong>Setting Up Swap Intents:</strong> Users specify the details of the swap, including the asset and amount they wish to swap and the target blockchain. This intent is processed by ChainBridge and set up using a <code>beforeSwap</code> hook.</p></li><li><p><strong>Cross-Chain Communication:</strong> EigenLayer relayers facilitate the communication between blockchains. They verify the user&apos;s assets on the source chain, lock or burn these assets, and instruct the target chain to mint or unlock the corresponding amount of the target asset.</p></li><li><p><strong>Optimizing the Swap:</strong> During the swap execution, Uniswap V4’s <code>beforeSwap</code> hook is used to check for the best exchange rates and lowest transaction fees, adjusting the swap parameters in real time. After the execution, the <code>afterSwap</code> hook finalizes the transaction details, ensuring everything aligns with the initial user intent and current market conditions.</p></li><li><p><strong>Completing the Transaction:</strong> Once the transaction is verified on the target blockchain, the relayers update the transaction status on both chains. The user receives the swapped asset in their wallet on the target blockchain, and the transaction is completed with final confirmations.</p></li></ol></li></ol>]]></content:encoded>
            <author>adam-33@newsletter.paragraph.com (Adam)</author>
            <enclosure url="https://storage.googleapis.com/papyrus_images/21b80fbb042fc8865ddb9d78d356eb4f1f1cd4991ef7504bf8fcfc78a8eb5d07.jpg" length="0" type="image/jpg"/>
        </item>
        <item>
            <title><![CDATA[Enabling NFTFi with Uniswap V4 Hooks]]></title>
            <link>https://paragraph.com/@adam-33/enabling-nftfi-with-uniswap-v4-hooks</link>
            <guid>RjaHdSAPKF3XSUe5tuQw</guid>
            <pubDate>Tue, 18 Jun 2024 23:46:00 GMT</pubDate>
            <description><![CDATA[As the NFT space has risen in value as an asset class in the crypto world, there have been more protocols and products built to attempt to make these assets more liquid, through borrow/lending, providing fractional ownership, etc. Bringing the rise of something called "NFTFi". We&apos;ve seen several of these apps be successful across different chains, from Tensor & Magic Eden on Solana, Blur on Ethereum, Sudoswap etc. From borrowing and lending, but most interesting, NFT AMMs.What are the ad...]]></description>
            <content:encoded><![CDATA[<p>As the NFT space has risen in value as an asset class in the crypto world, there have been more protocols and products built to attempt to make these assets more liquid, through borrow/lending, providing fractional ownership, etc. Bringing the rise of something called <em>&quot;NFTFi&quot;</em>. We&apos;ve seen several of these apps be successful across different chains, from Tensor &amp; Magic Eden on Solana, Blur on Ethereum, Sudoswap etc. From borrowing and lending, but most interesting, NFT AMMs.</p><h3 id="h-what-are-the-advantages-of-an-nft-amm-and-how-does-an-nft-amm-work" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">What are the advantages of an NFT AMM &amp; How does an NFT AMM work?</h3><p>The advantages of NFT AMMs are quite clear, you&apos;re able to create instant liquidity on the NFT collection instead of traders waiting on someone to bid for their NFT. This is helpful for traders who need instant liquidity on their NFTs. There are many different designs of NFT AMMs, but the most compelling one is by the team at Tensor on Solana (tensor.trade). What they incentivize is for traders to create &quot;market-making orders&quot; on an entire NFT collection. This market-making order is two-sided, one being a &quot;buy side,&quot; where the trader deposits a certain amount of SOL to purchase a certain amount of NFTs, and on the other side being the &quot;sell side,&quot; where they can list some of their NFTs in this collection for purchase. The trader makes money on the spread here as the purchase and selling side moves the price along the bonding curve, literally allowing the trader to buy low and sell high.</p><p>Tensor&apos;s NFT AMM utilizes the concept of bonding curves to determine the pricing of NFTs within the market-making orders. When a trader creates a market-making order on Tensor, they specify a starting price and a &quot;change by&quot; or delta value, which determines how much the price changes after each trade. This delta value can be set as a fixed amount in SOL or as a percentage of the current price. As traders buy or sell NFTs from the market-making order, the price moves along the bonding curve, adjusting according to the delta value. For example, if the starting price is 10 SOL and the delta is set to 1 SOL, each buy will increase the price by 1 SOL, and each sell will decrease the price by 1 SOL. This bonding curve mechanism ensures a dynamic and fair price discovery process within the Tensor NFT AMM, allowing traders to automate their &quot;buy low, sell high&quot; strategy while providing liquidity to the NFT market.</p><h3 id="h-lets-implement-a-tensor-like-nft-amm-as-a-uniswap-v4-hook" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0"><strong>Let’s Implement A Tensor-Like NFT AMM As A Uniswap V4 Hook</strong></h3><p>The core innovation of Uniswap V4 is hooks, functions that we can trigger at different stages in a pool’s lifecycle/activity. Hooks allow us to tailor the Uniswap AMM to our specific use cases, the design space is unlimited. By leveraging Uniswap V4 hooks, we can build NFTFi protocols that provide liquidity, price discovery, and unique financial mechanisms for NFT collections.</p><p><strong>Implementing Our NFTAMMHook</strong></p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/adam0x7/nft-amm-hook/tree/refactoring">Code Here</a></p><p><strong>A. Market Making Functionality</strong></p><p>The <code>NFTAMMHook</code> contract allows market makers to create orders by specifying the desired price range and quantity of NFTs they wish to trade. The <code>marketMake</code> function is the core of the market making functionality, enabling market makers to create orders and deposit NFTs into the AMM.</p><p>When a market maker creates an order, they specify the following parameters:</p><ul><li><p><code>_nftAddress</code>: The address of the NFT collection.</p></li><li><p><code>startingBuyTick</code>: The starting tick for buying NFTs.</p></li><li><p><code>startingSellTick</code>: The starting tick for selling NFTs.</p></li><li><p><code>tokenIds</code>: The token IDs of the NFTs being sold.</p></li><li><p><code>delta</code>: The percentage change for each order on the bonding curve.</p></li><li><p><code>fee</code>: The swap fee for buying or selling into the order.</p></li><li><p><code>maxNumOfNFTs</code>: The maximum number of NFTs the order is willing to purchase.</p></li></ul><p>The market maker also sends Ether (<code>msg.value</code>) along with the function call to cover the cost of buying NFTs.</p><p>Inside the <code>marketMake</code> function, the hook performs the following steps:</p><ol><li><p>It validates the input parameters to ensure the NFT address matches the collection, the sell tick is greater than the buy tick, and there is enough Ether to cover the maximum number of NFTs to buy.</p></li><li><p>It creates a new <code>MMOrder</code> struct to store the order details, including the starting buy and sell ticks, the current tick, the Ether balance, the maximum number of NFTs, the delta, the fee, and the NFT address.</p></li><li><p>It calculates the square root price ratio (<code>sqrtPriceX96</code>) for each NFT being sold using the <code>createSqrtPriceForSingleToken</code> function, which takes into account the starting sell tick and the delta.</p></li><li><p>It transfers the NFTs from the market maker to the hook contract using the <code>safeTransferFrom</code> function of the ERC721 contract.</p></li><li><p>It determines the wrapped token share for the deposited NFTs using the <code>determineWrappedTokenShare</code> function, which calculates the total value of the NFTs in terms of the wrapped token based on the bonding curve.</p></li></ol><p>The <code>determineWrappedTokenShare</code> function calculates the wrapped token share by:</p><ol><li><p>Converting the square root price ratio to a price ratio.</p></li><li><p>Iterating over the token IDs and calculating the current price for each NFT based on the bonding curve.</p></li><li><p>Summing up the total value of the NFTs in terms of the wrapped token.</p></li><li><p>Converting the total value to Ether and updating the market maker&apos;s balance in the <code>makerBalances</code> mapping.</p></li></ol><p>The bonding curve is defined by the starting sell tick and the delta, which determines how the price changes for each order. The <code>createSqrtPriceForSingleToken</code> function calculates the square root price ratio for a single NFT based on the starting tick, delta, and the index of the NFT in the array of token IDs.</p><p><strong>B. Wrapped Token and Balance Tracking</strong></p><p>The <code>NFTAMMHook</code> contract itself represents the wrapped NFT token and tracks the balances of the market makers&apos; orders. The hook contract inherits from the <code>ERC20</code> contract, allowing it to mint and manage the wrapped tokens.</p><p>When a market maker creates an order and deposits NFTs, the hook mints wrapped tokens equivalent to the total value of the deposited NFTs. The <code>makerBalances</code> mapping keeps track of each market maker&apos;s balance in terms of the wrapped token.</p><p><strong>C. Buying NFTs (Swap Functionality)</strong></p><p>When a trader wants to buy an NFT using Ether, they interact with the frontend, which in turn calls the <code>createBuyBidOrder</code> function on the hook contract. This function creates a buy bid order, specifying the market maker&apos;s order ID, the desired NFT ID, and the amount of Ether the trader is willing to pay.</p><p>The <code>createBuyBidOrder</code> function performs the following steps:</p><ol><li><p>It validates that the deposit amount is greater than zero and that the deposit amount is equal to or greater than the current price of the NFT based on the current tick.</p></li><li><p>It creates a <code>BidOrder</code> struct with the relevant information, including the market maker&apos;s address, the immediate flag (set to true), the Ether value, the NFT ID, the current tick, and the order ID.</p></li><li><p>It stores the bid order in the <code>bidsToBuyers</code> mapping, associating the bid ID with the trader&apos;s address.</p></li><li><p>It returns the encoded bid order data.</p></li></ol><p>The frontend then calls the <code>swap</code> function on the <code>swapRouter</code> contract, passing the pool key, swap parameters, test settings, and the encoded bid order data.</p><p>Inside the <code>swap</code> function, the <code>afterSwap</code> hook is called, which handles the logic to transfer the NFT from the hook to the trader. The <code>afterSwap</code> function performs the following steps:</p><ol><li><p>It decodes the bid order data to retrieve the relevant information.</p></li><li><p>If the swap is a &quot;zero for one&quot; swap (Ether for NFT), it transfers the NFT from the hook contract to the trader using the <code>safeTransferFrom</code> function of the ERC721 contract.</p></li><li><p>It sends the Ether payment to the market maker using the <code>call</code> function with the <code>bidOrder.ethValue</code>.</p></li><li><p>It updates the market maker&apos;s order by calculating the new starting sell tick based on the current square root price ratio and the delta.</p></li></ol><p>After the swap is complete, the trader receives the NFT instead of the wrapped tokens.</p><p><strong>D. Selling NFTs</strong></p><p>The selling functionality allows traders to sell their NFTs to the market maker&apos;s order. The process is similar to buying NFTs, but in reverse.</p><p>The trader calls the <code>createSellOrder</code> function on the hook contract, specifying the market maker&apos;s order ID, the NFT ID they want to sell, and the market maker&apos;s address.</p><p>The <code>createSellOrder</code> function performs the following steps:</p><ol><li><p>It retrieves the market maker&apos;s order using the order ID.</p></li><li><p>It transfers the NFT from the trader to the hook contract using the <code>safeTransferFrom</code> function of the ERC721 contract.</p></li><li><p>It creates a <code>BidOrder</code> struct with the relevant information, including the market maker&apos;s address, the immediate flag (set to true), the current price of the NFT based on the current tick, the NFT ID, the current tick, and the order ID.</p></li><li><p>It stores the bid order in the <code>bidsToBuyers</code> mapping, associating the bid ID with the trader&apos;s address.</p></li><li><p>It returns the encoded bid order data.</p></li></ol><p>The frontend then calls the <code>swap</code> function on the <code>swapRouter</code> contract, passing the pool key, swap parameters, test settings, and the encoded bid order data.</p><p>Inside the <code>swap</code> function, the <code>afterSwap</code> hook is called, which handles the logic to transfer the NFT from the hook to the market maker and send the Ether payment to the trader. The <code>afterSwap</code> function performs the following steps:</p><ol><li><p>It decodes the bid order data to retrieve the relevant information.</p></li><li><p>If the swap is a &quot;one for zero&quot; swap (NFT for Ether), it transfers the NFT from the hook contract to the market maker using the <code>safeTransferFrom</code> function of the ERC721 contract.</p></li><li><p>It updates the market maker&apos;s order by calculating the new starting buy tick based on the current square root price ratio and the delta.</p></li><li><p>It subtracts the Ether value from the market maker&apos;s Ether balance in the order.</p></li></ol><p>After the swap is complete, the market maker receives the NFT, and the trader receives the Ether payment.</p><p>Our NFTAMMHook shows how Uniswap V4&apos;s hook system can work well with the new world of NFTFi, helping to create active markets for NFTs and opening up new chances for market makers and traders. As the NFT market keeps growing, developers have the chance to use Uniswap V4 hooks as a way of creating new NFTFi systems amongst the myriad of other design spaces.</p><p>You can see the code for the NFTAMMHook below!</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/adam0x7/nft-amm-hook">https://github.com/adam0x7/nft-amm-hook</a></p>]]></content:encoded>
            <author>adam-33@newsletter.paragraph.com (Adam)</author>
            <enclosure url="https://storage.googleapis.com/papyrus_images/b797eab71795a19b79747928929dc78641ddb7ac794bd28dc635a145160f7868.png" length="0" type="image/png"/>
        </item>
        <item>
            <title><![CDATA[What Is EIP-7702? Vitalik's newest EIP proposal]]></title>
            <link>https://paragraph.com/@adam-33/what-is-eip-7702-vitalik-s-newest-eip-proposal</link>
            <guid>jFTYHN5bwLqoaBbTt0ef</guid>
            <pubDate>Tue, 07 May 2024 21:23:19 GMT</pubDate>
            <description><![CDATA[The Ethereum ecosystem has witnessed a growing interest in enhancing the functionality of Externally Owned Accounts (EOAs) to enable more complex operations and interactions. While EOAs can initiate transactions, they currently lack the ability to perform stateful computations and maintain persistent storage, capabilities that are inherent to Contract Accounts. Efforts to bridge this gap have led to proposals such as EIP-3074, which introduces new opcodes, AUTH and AUTHCALL, to allow EOAs to ...]]></description>
            <content:encoded><![CDATA[<p>The Ethereum ecosystem has witnessed a growing interest in enhancing the functionality of Externally Owned Accounts (EOAs) to enable more complex operations and interactions. While EOAs can initiate transactions, they currently lack the ability to perform stateful computations and maintain persistent storage, capabilities that are inherent to Contract Accounts.</p><p>Efforts to bridge this gap have led to proposals such as EIP-3074, which introduces new opcodes, AUTH and AUTHCALL, to allow EOAs to delegate control to smart contracts for specific operations . However, concerns have been raised regarding the forward-compatibility of EIP-3074 with future account abstraction efforts, particularly in light of the anticipated transition to a pure-smart-contract-wallet world.</p><p>EIP-7702 emerges as a novel proposal aimed at addressing these concerns while providing functionality similar to EIP-3074. This EIP introduces a new transaction type that empowers EOAs to temporarily set their code to a smart contract for the duration of a single transaction. By enabling EOAs to execute smart contract logic on a per-transaction basis, EIP-7702 opens up a myriad of possibilities for complex interactions and advanced use cases.</p><p>The primary motivation behind EIP-7702 lies in its potential to enable key functionalities such as batching, sponsorship, and privilege de-escalation, while ensuring forward-compatibility with future account abstraction efforts. By allowing EOAs to temporarily assume smart contract capabilities, EIP-7702 aims to bridge the gap between the current limitations of EOAs and the envisioned future of Ethereum account abstraction .</p><p>In the following sections, we will delve into the technical specifications of EIP-7702, exploring its implementation details and potential implications for the Ethereum ecosystem. We will also examine the advantages of EIP-7702 over alternative proposals and discuss the security considerations and challenges associated with its adoption.</p><h2 id="h-motivation-behind-eip-7702" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Motivation behind EIP-7702</h2><p>EIP-7702 aims to address the growing demand for enhanced functionality in EOAs by enabling them to temporarily assume smart contract capabilities. The primary motivations behind this proposal are:</p><p>1. Enabling key use cases such as batching, sponsorship, and privilege de-escalation, which are currently limited or require complex workarounds.</p><p>2. Addressing the forward-compatibility concerns associated with EIP-3074, particularly in the context of future account abstraction efforts.</p><p>3. Facilitating a more seamless transition towards a pure-smart-contract-wallet world, where EOAs are eventually phased out in favor of smart contract accounts.</p><p>While EIP-3074 provides a solution for delegating control to smart contracts, it introduces new opcodes (AUTH and AUTHCALL) that may become obsolete in a future account abstraction landscape. EIP-7702 seeks to provide similar functionality without introducing new opcodes, thereby ensuring better compatibility with future Ethereum upgrades.</p><h2 id="h-how-eip-7702-works" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">How EIP-7702 works</h2><p>EIP-7702 introduces a new EIP-2718 transaction type with the <code>TransactionType</code> set to <code>TX_TYPE(TBD)</code>. The <code>TransactionPayload</code> for this new transaction includes the following fields:</p><pre data-type="codeBlock" text="rlp([chain_id, nonce, max_priority_fee_per_gas, max_fee_per_gas, gas_limit, destination, data, access_list, [[contract_code, y_parity, r, s], ...], signature_y_parity, signature_r, signature_s])
"><code><span class="hljs-built_in">rlp</span>([chain_id, nonce, max_priority_fee_per_gas, max_fee_per_gas, gas_limit, destination, data, access_list, [[contract_code, y_parity, r, s], ...], signature_y_parity, signature_r, signature_s])
</code></pre><p>The key feature of this new transaction type is the <code>contract_code</code> field, which allows EOAs to temporarily set their code to a smart contract for the duration of the transaction. The intrinsic cost of the transaction is inherited from EIP-2930, with additional costs for the <code>contract_code</code> field.</p><p>The execution process for EIP-7702 transactions involves the following steps:</p><p>1. For each <code>[contract_code, y_parity, r, s]</code> tuple, verify the signature and set the contract code of the signer&apos;s account to <code>contract_code</code>.</p><p>2. Execute the transaction as a regular transaction.</p><p>3. At the end of the transaction, reset the contract code of each signer&apos;s account back to empty.</p><p>This approach allows EOAs to temporarily assume smart contract capabilities without permanently altering their account state, enabling a wide range of complex interactions and use cases.</p><h2 id="h-advantages-of-eip-7702" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Advantages of EIP-7702</h2><p>EIP-7702 offers several advantages over existing proposals and the current EOA functionality:</p><p>1. Compatibility with EIP-3074 use cases: EIP-7702 can be used to implement the same use cases as EIP-3074, such as batching, sponsorship, and privilege de-escalation. This can be achieved by replacing the AUTH and AUTHCALL opcodes with calls to the temporary contract code set by EIP-7702 transactions.</p><p>2. Forward-compatibility with future account abstraction: Unlike EIP-3074, which introduces new opcodes that may become obsolete in a future account abstraction landscape, EIP-7702 leverages existing transaction types and mechanisms. This approach ensures better compatibility with future Ethereum upgrades and reduces the risk of creating redundant or deprecated features.</p><p>3. Seamless integration with existing smart contract wallets: The temporary contract code set by EIP-7702 transactions can be based on existing smart contract wallet implementations, such as those used in ERC-4337. This allows for a more unified ecosystem and reduces the fragmentation of efforts between EOA-based solutions and smart contract wallets.</p><p>4. Simplified path to full account abstraction: EIP-7702 can be seen as an intermediate step towards full account abstraction, where all accounts are eventually replaced by smart contract accounts. By enabling EOAs to temporarily assume smart contract capabilities, EIP-7702 facilitates a gradual transition towards a pure-smart-contract-wallet world, reducing the need for abrupt and disruptive changes to the Ethereum ecosystem.</p><p>5. Reduced complexity and gas costs compared to EIP-3074: EIP-7702 achieves similar functionality to EIP-3074 without introducing new opcodes, which can lead to reduced complexity in the Ethereum protocol and potentially lower gas costs for users.</p><h2 id="h-potential-challenges-and-considerations" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Potential Challenges &amp; Considerations</h2><p>These are all discussed in the current discussion on EIP-7702 on the Ethereum Magicians Forum as of 05/07/24</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://ethereum-magicians.org/t/eip-set-eoa-account-code-for-one-transaction/19923">https://ethereum-magicians.org/t/eip-set-eoa-account-code-for-one-transaction/19923</a></p><ul><li><p>Nonce management: There is an ongoing debate about whether the <code>contract_code</code> signature should sign over the account&apos;s nonce. Some argue that signing over the nonce would invalidate popular use cases of account abstraction, such as alternative signers and transaction delegation. Others propose signing over a user-picked <code>maxNonce</code> or delegating nonce control to an external <code>nonceManager</code> contract.</p></li><li><p>Signature invalidation: The <code>contract_code</code> signature could potentially be made invalid by introducing a &quot;code assumption nonce&quot; distinct from the transaction nonce. This would allow EOAs to revoke existing signatures over code and prevent the &quot;perpetual signature&quot; risk identified with EIP-3074.</p></li><li><p>Compatibility with existing contracts: There may be compatibility issues with existing contracts that use anti-patterns like <code>&lt;address&gt;.transfer()</code> or <code>erc721.safeTransferFrom()</code>. If the recipient has signed a <code>contract_code</code> that does not have a <code>receive()</code> or <code>onERC721Received()</code> function, these transfers might fail.</p></li><li><p>Standardization of contracts: If EIP-7702 is implemented, there may be a need for standardization around which contracts are used, similar to ERC-4337 entry points and EIP-3074 invokers, to ensure safety and verifiability.</p></li><li><p>Gas costs: The intrinsic cost of the new transaction type should account for the <code>contract_code</code> size and the cost of jump destination validation (EIP-3860).</p></li><li><p>Quantum computer concerns: The argument that quantum computers will eventually break ECDSA, necessitating a move away from EOAs, may not be sound. If ECDSA breaks, the entire Ethereum ecosystem would be at risk, and a plan for moving towards quantum-safe curves would be needed.</p></li></ul>]]></content:encoded>
            <author>adam-33@newsletter.paragraph.com (Adam)</author>
        </item>
        <item>
            <title><![CDATA[How Solana's new DePin Project, Nosana 🟩, Can Potentially Enable More Cost-Effective Mixture of Experts Inference]]></title>
            <link>https://paragraph.com/@adam-33/how-solana-s-new-depin-project-nosana-can-potentially-enable-more-cost-effective-mixture-of-experts-inference</link>
            <guid>yzPy6iR1OrWhkcQlWNxo</guid>
            <pubDate>Fri, 08 Mar 2024 04:51:59 GMT</pubDate>
            <description><![CDATA[Why Solana is the Home of DePinIn the evolving landscape of decentralized technology, Solana emerges as a cornerstone for projects dedicated to decentralized physical infrastructure (DePin), championing a vision where decentralized networks harness collective computational resources for tomorrow’s groundbreaking applications. Most recently, the team at Nosana stands out with a new approach leveraging the Solana blockchain to orchestrate a distributed network of GPUs. Nosana&apos;s mission is ...]]></description>
            <content:encoded><![CDATA[<h3 id="h-why-solana-is-the-home-of-depin" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Why Solana is the Home of DePin</h3><p>In the evolving landscape of decentralized technology, Solana emerges as a cornerstone for projects dedicated to decentralized physical infrastructure (DePin), championing a vision where decentralized networks harness collective computational resources for tomorrow’s groundbreaking applications. Most recently, the team at Nosana stands out with a new approach leveraging the Solana blockchain to orchestrate a distributed network of GPUs. Nosana&apos;s mission is to democratize access to high-performance computing, specifically addressing the urgent needs of AI and machine learning developers who face the dual challenges of computational resource scarcity and the high costs associated with centralized cloud services. By providing a decentralized, extremely cost-effective alternative, Nosana not only aims to solve these issues but also posits a long-term transformation in the development and deployment of AI models. As open-source models continue to match and even surpass the capabilities of proprietary systems, the demand for an open, scalable, and efficient computational platform grows. Nosana, with its permissionless, non-vendor lock-in infrastructure, is perfectly positioned to be a beacon of light for the Open Source AI community and helping developers across the globe have equitable access to the computational power necessary to drive AI forward.</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://nosana.io/">https://nosana.io/</a></p><h3 id="h-what-is-a-mixture-of-expert-model-and-how-does-it-defer-from-gpt-4" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">What is a Mixture of Expert Model &amp; How does it Defer from GPT-4?</h3><p><strong>Mixture of Experts (MoE)</strong> models and architectures like GPT-4 represent are two very distinct approaches within the realm of LLMs. While GPT-4 is a large-scale, generative pre-trained transformer model designed for a wide range of tasks, MoE models employ a different strategy. MoE models consist of multiple specialized sub-models or &quot;experts,&quot; each adept at handling different types of data or tasks, and a gating mechanism that decides which expert to use for a given input. This architecture allows MoE models to leverage the strengths of diverse experts, potentially offering more adaptable and efficient solutions for specific problems compared to a single, monolithic model like GPT-4, known for its tendency to hallucinate.</p><div data-type="youtube" videoId="PYZIOMvkUF8">
      <div class="youtube-player" data-id="PYZIOMvkUF8" style="background-image: url('https://i.ytimg.com/vi/PYZIOMvkUF8/hqdefault.jpg'); background-size: cover; background-position: center">
        <a href="https://www.youtube.com/watch?v=PYZIOMvkUF8">
          <img src="{{DOMAIN}}/editor/youtube/play.png" class="play"/>
        </a>
      </div></div><h3 id="h-drawbacks-of-moe-models-in-production" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0"><strong>Drawbacks of MoE Models in Production</strong></h3><p>While MoE models are interesting, implementing Mixture of Experts models in production environments presents several challenges, which can impact their feasibility and efficiency for creating applications:</p><ol><li><p><strong>Resource Intensity</strong>: MoE models can be resource-intensive, both in terms of computational power and memory usage. As each expert within the model could be a complex model itself, running multiple experts in parallel for inference requires significant GPU resources, which can escalate operational costs.</p></li><li><p><strong>Model Complexity</strong>: The architecture of MoE models adds a layer of complexity in terms of design, implementation, and maintenance. Training involves not only optimizing the individual experts but also the gating mechanism that routes inputs to the appropriate experts. This complexity can make it challenging to debug, update, or iterate on MoE models compared to simpler architectures.</p></li><li><p><strong>Latency Issues</strong>: For real-time applications, the increased computational overhead of selecting and utilizing the appropriate experts can introduce latency. This is especially problematic when low response times are critical, such as in user-facing applications or when processing streaming data.</p></li><li><p><strong>Data Routing and Scaling</strong>: Efficiently routing data to the correct experts and scaling the model to handle increasing volumes of data or additional problem domains require sophisticated mechanisms. This can involve dynamic load balancing and potentially retraining the model to incorporate new experts as the types of inputs or tasks evolve.</p></li><li><p><strong>Overfitting Risk</strong>: There&apos;s a risk that individual experts might overfit to their specific subsets of the training data, especially if the data is not diverse enough or if the experts are too specialized. This overfitting can degrade the model&apos;s performance on unseen data.</p></li><li><p><strong>Deployment and Operational Complexity</strong>: Deploying and managing MoE models in production can be operationally complex. It requires advanced infrastructure for load balancing, monitoring, and dynamically allocating resources to different experts based on demand.</p></li></ol><h3 id="h-how-nosana-could-address-moe-model-challenges" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0"><strong>How Nosana Could Address MoE Model Challenges:</strong></h3><p>In the midst of the ongoing chip shortage that has significantly hindered the AI industry, developers and researchers find themselves in a challenging position. The shortage has led to a scarcity of available GPUs, making it difficult for many to access the computational resources necessary for training and deploying sophisticated AI models, including Mixture of Experts (MoE) models. These models, which require substantial computational power due to their complexity and the need to run multiple specialized sub-models in parallel, are particularly bottlenecked by current hardware limitations. However, decentralized computing platforms like Nosana, can perhaps present a promising solution to these challenges over coming years as the network expands to the have enough of the necessary hardware to support these models.</p><ol><li><p><strong>Expanding Access to Computational Resources</strong>: Nosana&apos;s decentralized network harnesses the idle GPU power from a vast array of devices across the globe. By aggregating these resources, Nosana can potentially provide the extensive computational capacity necessary for running MoE models, circumventing the limitations posed by the chip shortage.</p></li><li><p><strong>Cost-Effectiveness</strong>: One of the primary advantages of a decentralized approach like Nosana&apos;s is the potential for more cost-effective access to computational resources. Rather than competing for scarce and expensive GPUs on the open market or incurring high costs from cloud providers, developers can tap into Nosana&apos;s distributed network at potentially lower prices, potentially making MoE models more financially viable.</p></li><li><p><strong>Scalability and Flexibility</strong>: Nosana&apos;s distributed nature allows for dynamic scaling. As the demand for computational power increases, the network can theoretically scale to include more nodes, providing additional resources without the need for centralized infrastructure expansion. This flexibility is crucial for MoE models, which may require varying amounts of compute depending on the task and the number of experts involved.</p></li><li><p><strong>Reducing Latency and Increasing Efficiency</strong>: By distributing computation across multiple nodes, Nosana can help reduce the latency associated with running complex MoE models. Computational tasks can be processed closer to the data source, and load balancing across the network can ensure that no single node becomes a bottleneck, improving overall efficiency.</p></li><li><p><strong>Enabling More Innovation</strong>: With easier and more affordable access to computational resources, researchers and developers can experiment more freely with MoE architectures, optimizing their models and exploring new applications. This democratization of access could lead to significant advancements in AI, driving innovation in fields that were previously hampered by resource constraints.</p></li></ol><p>The potential of the Nosana network to democratize access to the computational power necessary for Mixture of Experts (MoE) models could mark a pivotal moment in the promise of intersection of AI &amp; crypto. Given the inherently high hardware requirements of MoE models, the success of Nosana hinges on its ability to aggregate and provide access to hardware that meets these demands. If Nosana can ensure the availability of adequate computational resources, it can be a leader for the open-source community, challenging the dominance of entities like OpenAI by helping to level the computational playing field.</p><p>This democratization of AI infrastructure is not just about technological innovation; it&apos;s also critical countermeasure against the potential for regulatory capture by corporate AI giants. As global regulators craft legal frameworks for AI, there&apos;s a real risk that well-resourced companies could influence these regulations to favor proprietary models, stifling open-source innovation. By decentralizing AI infrastructure, Nosana empowers a broader range of developers to contribute to and shape the future of AI, ensuring that the evolution of artificial intelligence is driven by a diverse, global community rather than a select few. In this context, Nosana doesn&apos;t just offer a technical solution; it represents a strategic move towards maintaining the openness and collaborative spirit that has always been at the heart of AI&apos;s most groundbreaking advancements.</p><p>Some useful resources for understanding more about Nosana and Mixture of Experts</p><div data-type="youtube" videoId="p_hxFsNkHa0">
      <div class="youtube-player" data-id="p_hxFsNkHa0" style="background-image: url('https://i.ytimg.com/vi/p_hxFsNkHa0/hqdefault.jpg'); background-size: cover; background-position: center">
        <a href="https://www.youtube.com/watch?v=p_hxFsNkHa0">
          <img src="{{DOMAIN}}/editor/youtube/play.png" class="play"/>
        </a>
      </div></div><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://nosana.io/">https://nosana.io/</a></p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://mistral.ai/news/mixtral-of-experts/">https://mistral.ai/news/mixtral-of-experts/</a></p>]]></content:encoded>
            <author>adam-33@newsletter.paragraph.com (Adam)</author>
            <enclosure url="https://storage.googleapis.com/papyrus_images/df97c3b463b0c05b524c65a40b5667b46e44e9551a42c8ca9a97e0031c91a67a.png" length="0" type="image/png"/>
        </item>
        <item>
            <title><![CDATA[The Ethereum Virtual Machine vs. The Solana Virtual Machine: Who Wins?]]></title>
            <link>https://paragraph.com/@adam-33/the-ethereum-virtual-machine-vs-the-solana-virtual-machine-who-wins</link>
            <guid>DUo2FmmnzudrAcT8LkS6</guid>
            <pubDate>Fri, 26 Jan 2024 16:33:44 GMT</pubDate>
            <description><![CDATA[If you&apos;re like me, with a mild addiction to crypto Twitter, you&apos;ve probably noticed the ongoing intellectual tug-of-war between the Ethereum and Solana camps in the most recent months. These debates have been heating up for a while, focusing on transaction speeds, costs, and the monolith versus modular frameworks. It&apos;s undeniably a hot topic. Personally, I&apos;m not in the business of picking winners; I view the blockchain industry as a collection of billion-dollar experiments...]]></description>
            <content:encoded><![CDATA[<p>If you&apos;re like me, with a mild addiction to crypto Twitter, you&apos;ve probably noticed the ongoing intellectual tug-of-war between the Ethereum and Solana camps in the most recent months. These debates have been heating up for a while, focusing on transaction speeds, costs, and the monolith versus modular frameworks. It&apos;s undeniably a hot topic. Personally, I&apos;m not in the business of picking winners; I view the blockchain industry as a collection of billion-dollar experiments running simultaneously, with room for multiple successes. Yet, I firmly believe that no matter your allegiance, a fundamental understanding of the differences between these Virtual Machines (VMs) is crucial, especially for those in technical roles within the web3 sphere.</p><p>This article is geared towards developers rooted in EVM-based chains, and aims to provide a detailed, side-by-side comparison of the Ethereum Virtual Machine (EVM) and its counterpart in Solana. According to the Electric Capital Developer Report 2023, the blockchain developer workforce is swiftly moving towards a multi-chain paradigm. As the Solana ecosystem continues to expand, its influence will become undeniable and there will be a demand for more Solana Developers. I predict that knowing Ethereum and Solana will soon be as essential for blockchain developers as JavaScript and Python are for traditional developers. So, let&apos;s dive in and explore what sets these two influential technologies apart.</p><p><strong>First, lets define what a <em>“Virtual Machine“</em> is in the context of blockchains</strong></p><p>In the context of blockchain technology, a virtual machine (VM) is an execution environment that processes transactions and smart contracts/programs on a blockchain. It serves as a sandboxed environment for running code, ensuring the security and integrity of the blockchain network. For example, the Ethereum Virtual Machine (EVM) is a well-known VM that processes smart contracts on the Ethereum blockchain. Similarly, the Solana Virtual Machine (SVM) is the execution environment that processes transactions and smart contracts/programs on the Solana blockchain. Unlike traditional virtual machines, which run on a physical computer, a blockchain VM is a decentralized and distributed system that runs on multiple nodes across the network, ensuring consensus and immutability of the executed code.</p><p><strong>What are the key components to a virtual machine?</strong></p><ol><li><p><strong>Transaction Speed and Throughput</strong>: This refers to how fast transactions are processed and how many transactions the network can handle per second. Higher throughput and faster processing times are desired for scalability and user experience.</p></li><li><p><strong>Transaction Cost</strong>: This is about the fees associated with executing transactions. Lower costs are preferable, especially for applications requiring high transaction volumes.</p></li><li><p><strong>Consensus Mechanism</strong>: The underlying consensus mechanism (like Proof of Work, Proof of Stake, etc.) impacts network security, energy consumption, and the ability to scale. Different mechanisms have their own strengths and weaknesses.</p></li><li><p><strong>Client Diversity</strong>: This pertains to the variety of software clients that can operate on the network. Greater client diversity can enhance network resilience and security.</p></li><li><p><strong>Blockspace Management</strong>: This involves how efficiently the network manages the space in each block. Efficient blockspace management can lead to improved scalability and throughput.</p></li><li><p><strong>Smart Contract Capabilities</strong>: The flexibility, complexity, and efficiency of smart contract execution are critical. This includes how well the VM supports various programming languages and smart contract standards.</p></li><li><p><strong>Decentralization</strong>: The degree to which the network is decentralized affects its resilience, security, and trustlessness. Greater decentralization is generally seen as a strength.</p></li><li><p><strong>Security and Robustness</strong>: This encompasses the overall security of the network and its resistance to attacks. It includes considerations like the security model of the VM and the track record of the platform in handling vulnerabilities.</p></li><li><p><strong>Interoperability</strong>: The ability to interact with other blockchains and external systems is increasingly important for wider adoption and utility.</p></li><li><p><strong>Scalability Solutions</strong>: Includes layer 2 solutions, sharding, and other technologies designed to increase the network&apos;s capacity to handle more transactions and complex operations.</p></li><li><p><strong>Energy Efficiency</strong>: Particularly relevant in the context of environmental impact, this involves how much energy the network consumes for its operations.</p></li></ol><p>The debate between the Ethereum Virtual Machine (EVM) and Solana&apos;s Virtual Machine (SVM) is so captivating due to the contrast in their architectural philosophies and the trade-offs they represent across key performance criteria. Ethereum, with its EVM, has embraced a modular approach. This framework allows for flexibility, scalability, and diverse applications by integrating various layer 2 solutions and other modular components, albeit sometimes at the cost of transaction speed and efficiency. Solana&apos;s SVM, in contrast, adopts a monolithic approach, wherein its core functionalities are tightly integrated to provide high throughput and low transaction costs, but with potential trade-offs in aspects like decentralization and client diversity(though will be fixed when Firedancer comes out). This divergence in strategies between Ethereum and Solana is not just a technical discussion; it symbolizes the broader debate in the blockchain community about the optimal path towards achieving a balance between speed, security, scalability, and decentralization. Each approach reflects a different set of priorities and visions for the future of blockchain technology, underscoring the rich diversity and innovation within this field.</p><h2 id="h-evaluating-the-evm" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Evaluating The EVM</h2><p>Here&apos;s how the EVM stacks up against these components, with notes on tradeoffs versus optimizations:</p><p><em>Also a quick note, this is an evaluation of the EVM with the full 2.0 roadmap implemented and not its current state as of this writing(Jan. 2024)</em></p><h3 id="h-transaction-speed-and-throughput" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Transaction Speed and Throughput</h3><p>Ethereum 2.0 aims to improve transaction speed and throughput significantly. The introduction of sharding is expected to increase network capacity and reduce congestion, which should lead to faster transaction processing and higher throughput. This is an optimization, although the full benefits will be realized once all phases of Ethereum 2.0 are implemented.</p><h3 id="h-transaction-cost" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Transaction Cost</h3><p>The shift to PoS and the introduction of sharding are expected to lower transaction costs by reducing the energy required for transaction validation and increasing network capacity. However, during periods of high demand, transaction fees can still be significant, which is a tradeoff.</p><h3 id="h-consensus-mechanism" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Consensus Mechanism</h3><p>Ethereum&apos;s transition from Proof of Work (PoW) to Proof of Stake (PoS) reduces energy consumption and potentially allows for faster transaction confirmation. This is an optimization in terms of energy efficiency and scalability, but it may introduce different security considerations compared to PoW.</p><h3 id="h-client-diversity" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Client Diversity</h3><p>Ethereum 2.0 encourages client diversity by supporting multiple software clients, which can enhance network resilience and security. This is an optimization, as a diverse client ecosystem can help prevent single points of failure. However, its important to note that a large amount of the clients on lean towards Geth.</p><h3 id="h-blockspace-management" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Blockspace Management</h3><p>Efficient blockspace management is crucial for scalability. Ethereum 2.0&apos;s sharding mechanism is designed to optimize the use of block space across multiple shards. This is an optimization that aims to improve scalability and throughput.</p><h3 id="h-smart-contract-capabilities" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Smart Contract Capabilities</h3><p>The EVM supports a wide range of smart contract capabilities and is compatible with Solidity, a popular smart contract programming language. This allows for complex and flexible smart contract execution, which is an optimization for developers building on Ethereum.</p><h3 id="h-decentralization" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Decentralization</h3><p>Ethereum 2.0 maintains a high degree of decentralization through its PoS consensus mechanism and distributed network of validators. This is an optimization that aims to preserve the security and trustlessness of the network.</p><h3 id="h-security-and-robustness" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Security and Robustness</h3><p>The security and robustness of the EVM are critical. Ethereum&apos;s track record and ongoing updates aim to address vulnerabilities and enhance security. This is an optimization, although security is an ongoing challenge for all blockchain platforms.</p><h3 id="h-interoperability" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Interoperability</h3><p>Ethereum is working towards better interoperability with other blockchains and external systems, which is important for broader adoption. This is an optimization that can increase the utility of the Ethereum network.</p><h3 id="h-scalability-solutions" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Scalability Solutions</h3><p>Ethereum 2.0 includes scalability solutions like sharding and layer 2 chains which are designed to increase the network&apos;s capacity. These are optimizations that address the scalability challenges faced by the network.</p><h3 id="h-energy-efficiency" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Energy Efficiency</h3><p>The switch to PoS significantly reduces Ethereum&apos;s energy consumption compared to PoW, making it more environmentally friendly. This is an optimization in response to growing concerns about the environmental impact of blockchain technology.</p><h2 id="h-evaluating-the-svm" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Evaluating The SVM</h2><h3 id="h-transaction-speed-and-throughput" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Transaction Speed and Throughput</h3><p>Solana is renowned for its high transaction speed and throughput, thanks to its unique Proof of History (PoH) consensus combined with Proof of Stake (PoS). This design allows the network to process thousands of transactions per second, optimizing for performance and scalability. However, this high throughput can come with tradeoffs in terms of network centralization and hardware requirements.</p><h3 id="h-transaction-cost" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Transaction Cost</h3><p>Solana offers significantly lower transaction costs compared to many other blockchains. This is a major optimization as it enables more micro-transactions and encourages broader use of the network for various applications, from DeFi to NFTs. The low cost is partly due to the efficient throughput of the network.</p><h3 id="h-consensus-mechanism" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Consensus Mechanism</h3><p>Solana&apos;s hybrid PoH and PoS consensus mechanism is a distinctive feature that enables rapid transaction processing and timestamping. This is an optimization for speed and efficiency, though it differs from the more traditional PoW and PoS mechanisms, leading to unique security and decentralization considerations.</p><h3 id="h-client-diversity" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Client Diversity</h3><p>As of this writing, Solana&apos;s network is predominantly run on a single client. However, the upcoming release of Firedancer aims to diversify the client ecosystem, enhancing network resilience and security. This is a step towards optimization, addressing previous concerns about client centralization.</p><h3 id="h-blockspace-management" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Blockspace Management</h3><p>Solana&apos;s blockspace management is highly efficient due to its high-speed infrastructure, allowing for large numbers of transactions to be included in each block. This is an optimization for scalability and user experience, although it may impose certain hardware requirements on validators.</p><h3 id="h-smart-contract-capabilities" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Smart Contract Capabilities</h3><p>The SVM supports a variety of programming languages, including Rust and C, which offer high performance and flexibility for developers. This is an optimization for developer engagement and complex application development.</p><h3 id="h-decentralization" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Decentralization</h3><p>Solana&apos;s decentralization is a topic of debate. While it operates a distributed network of validators, the high performance requirements for running a node can lead to a degree of centralization. This is a tradeoff in its design, balancing speed and inclusivity.</p><h3 id="h-security-and-robustness" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Security and Robustness</h3><p>Solana focuses on maintaining high security and robustness, although it has faced challenges, including network congestions and outages. Ongoing improvements aim to address these issues, making it an area of continuous optimization and vigilance.</p><h3 id="h-interoperability" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Interoperability</h3><p>Solana is actively working towards better interoperability with other blockchains, recognizing the importance of cross-chain communication in the blockchain ecosystem. This is an optimization to enhance the network&apos;s utility and accessibility.</p><h3 id="h-scalability-solutions" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Scalability Solutions</h3><p>Solana&apos;s architecture itself is a scalability solution, designed to handle a high volume of transactions. Continuous improvements aim to further enhance this capability, addressing the network&apos;s growing demand.</p><h3 id="h-energy-efficiency" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Energy Efficiency</h3><p>Solana&apos;s PoH and PoS mechanisms are more energy-efficient compared to traditional PoW systems, positioning it as a more environmentally friendly option. This is an optimization in line with increasing environmental consciousness.</p><p>In summary, Solana&apos;s VM is optimized for high throughput, low transaction costs, and energy efficiency, with a focus on enhancing developer capabilities and network scalability. While it faces challenges in decentralization and network robustness, ongoing developments like Firedancer indicate a commitment to addressing these issues.</p><h3 id="h-why-it-doesnt-really-matter-which-vm-is-better" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Why it doesn’t really matter which VM is better</h3><p>In essence, the EVM vs. SVM debate is less about picking a clear winner and more about appreciating the varied approaches in blockchain development. Both Ethereum and Solana offer unique solutions and perspectives, reflecting the diverse and experimental nature of the industry. For developers and enthusiasts alike, the key is not to be tethered to one ecosystem but to remain adaptable and open to the array of ideas and innovations across platforms. This diversity is what fuels the dynamic growth of blockchain technology, and embracing it is crucial for anyone looking to navigate and contribute to this ever-evolving space.</p><p>If you want to learn more, here are papers and podcasts that I’ve listened to over the last couple of months to help inform how I created this article</p><div data-type="youtube" videoId="WZg02kaKyUw">
      <div class="youtube-player" data-id="WZg02kaKyUw" style="background-image: url('https://i.ytimg.com/vi/WZg02kaKyUw/hqdefault.jpg'); background-size: cover; background-position: center">
        <a href="https://www.youtube.com/watch?v=WZg02kaKyUw">
          <img src="{{DOMAIN}}/editor/youtube/play.png" class="play"/>
        </a>
      </div></div><div data-type="youtube" videoId="PZ9S75eKjuM">
      <div class="youtube-player" data-id="PZ9S75eKjuM" style="background-image: url('https://i.ytimg.com/vi/PZ9S75eKjuM/hqdefault.jpg'); background-size: cover; background-position: center">
        <a href="https://www.youtube.com/watch?v=PZ9S75eKjuM">
          <img src="{{DOMAIN}}/editor/youtube/play.png" class="play"/>
        </a>
      </div></div><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://x.com/VitalikButerin/status/1741190491578810445?s=20">https://x.com/VitalikButerin/status/1741190491578810445?s=20</a></p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://squads.so/blog/solana-svm-sealevel-virtual-machine">https://squads.so/blog/solana-svm-sealevel-virtual-machine</a></p><div data-type="youtube" videoId="kCswGz9naZg">
      <div class="youtube-player" data-id="kCswGz9naZg" style="background-image: url('https://i.ytimg.com/vi/kCswGz9naZg/hqdefault.jpg'); background-size: cover; background-position: center">
        <a href="https://www.youtube.com/watch?v=kCswGz9naZg">
          <img src="{{DOMAIN}}/editor/youtube/play.png" class="play"/>
        </a>
      </div></div><div data-type="youtube" videoId="vzgNqO_obH4">
      <div class="youtube-player" data-id="vzgNqO_obH4" style="background-image: url('https://i.ytimg.com/vi/vzgNqO_obH4/hqdefault.jpg'); background-size: cover; background-position: center">
        <a href="https://www.youtube.com/watch?v=vzgNqO_obH4">
          <img src="{{DOMAIN}}/editor/youtube/play.png" class="play"/>
        </a>
      </div></div><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://solana.com/news/proof-of-history">https://solana.com/news/proof-of-history</a></p>]]></content:encoded>
            <author>adam-33@newsletter.paragraph.com (Adam)</author>
            <enclosure url="https://storage.googleapis.com/papyrus_images/7b7a06810ce8de8cae064261a49987893a2250dd82c93a3b8080abd1c0180f25.png" length="0" type="image/png"/>
        </item>
        <item>
            <title><![CDATA[Getting Started with Gnosis's Hashi Protocol: The New Approach To Building More Secure Bridges 🟢🦉🌉]]></title>
            <link>https://paragraph.com/@adam-33/getting-started-with-gnosis-s-hashi-protocol-the-new-approach-to-building-more-secure-bridges</link>
            <guid>tBIaGKKXKkSkAZvBtmyH</guid>
            <pubDate>Sat, 30 Dec 2023 20:10:12 GMT</pubDate>
            <description><![CDATA[In the dynamic archipelago of blockchains, each island (or blockchain network) is self-sufficient, boasting its own protocols and tokens. These islands are formidable in isolation, but their true potential is untapped due to a glaring absence: sturdy & safe bridges to connect them. As many of us know, interoperability is extremely important in the coming multi-chain world. But the current state of security & reliability around bridges presents a multi-faceted problem:Security Shortfalls in Ex...]]></description>
            <content:encoded><![CDATA[<p>In the dynamic archipelago of blockchains, each island (or blockchain network) is self-sufficient, boasting its own protocols and tokens. These islands are formidable in isolation, but their true potential is untapped due to a glaring absence: sturdy &amp; safe bridges to connect them.</p><p>As many of us know, interoperability is extremely important in the coming multi-chain world. But the current state of security &amp; reliability around bridges presents a multi-faceted problem:</p><ul><li><p><strong>Security Shortfalls in Existing Bridges</strong>: Attempts to construct bridges have been made, but these are often complex and fraught with risk. Like precarious rope bridges swaying over a chasm, they present vulnerabilities that could lead to catastrophic security breaches, leaving users and developers wary of crossing.</p></li><li><p><strong>Operational Inefficiencies</strong>: The absence of seamless interaction forces users to navigate a labyrinth of convoluted processes. This inefficiency is reminiscent of having to take a roundabout maritime route, cumbersome and time-consuming, just to trade simple goods.</p></li><li><p><strong>Trust Issues</strong>: In the current bridge landscape, trust is a scarce commodity. Sending valuable assets across these rudimentary bridges carries the risk of loss or tampering, much like sending a treasure without a convoy.</p></li></ul><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/b349d4b9a5cb376b27d7f5035db2de16cd8d173dcaa1a91f3da25aee3448051a.png" alt="Bridge hacks costed the industry $2 billion dollars in 2022" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">Bridge hacks costed the industry $2 billion dollars in 2022</figcaption></figure><h3 id="h-the-solution" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">The Solution</h3><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://ethresear.ch/t/hashi-a-principled-approach-to-bridges/14725">In early 2023, a team at Gnosis introduced <strong>Hashi</strong></a>. Hashi emerges as a sophisticated and principled approach to bridging. It serves as a protocol that not only connects blockchain networks but also increases the sanctity and security of cross-chain communication through redundancy.</p><p>Hashi is akin to an international airport built on blockchain territory. Just as airports enable people from different countries, speaking different languages, to traverse borders safely and efficiently, Hashi facilitates a similar function for blockchain networks. Here are the key solutions Hashi provides:</p><ul><li><p><strong>Interoperability with Integrity</strong>: Hashi creates a framework where messages and transactions are not just passed along but are assured for integrity. This is comparable to having a multi-layered security check at an airport, ensuring every individual crossing borders is authenticated.</p></li><li><p><strong>Streamlined Cross-Chain Communication</strong>: Hashi offers a streamlined approach to cross-chain transactions, removing the need for complex and often convoluted bridging solutions that were once the norm. It&apos;s like replacing connecting flights with a direct route, reducing the time and points of failure in a journey.</p></li><li><p><strong>Scalable and Secure Architecture</strong>: Hashi&apos;s architecture is designed to be both scalable and secure, addressing the needs of growing blockchain ecosystems without compromising on security. This is akin to an airport expanding its capacity while maintaining rigorous safety protocols.</p></li><li><p><strong>Enhanced User Experience</strong>: For the blockchain-savvy user, Hashi provides a transparent and intuitive experience for cross-chain interactions. It&apos;s similar to having a clear and concise airport sign system, guiding passengers through a seamless transit process.</p></li><li><p><strong>Trust Ensured by Design</strong>: With Hashi, trust is engineered into the protocol. Users and developers can have confidence that the assets and data transmitted across chains are preserved without alteration, akin to a bank&apos;s guarantee during a wire transfer.</p></li></ul><p>Hashi stands not as a makeshift bridge but as a comprehensive transport system that brings robustness, efficiency, and confidence to the cross-chain communication space.</p><h3 id="h-the-different-components-to-the-hashi-protocol" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0"><strong>The Different Components To The Hashi Protocol</strong></h3><h4 id="h-hashi" class="text-xl font-header !mt-6 !mb-3 first:!mt-0 first:!mb-0">Hashi (橋)</h4><ul><li><p><strong>Custom Oracle Adapters</strong>: Users have the flexibility to construct custom oracle adapters. These adapters serve as specialized contracts that connect to external data sources, or oracles, to retrieve verifiable data, such as block hashes, which are crucial for ensuring the integrity and origin of blockchain data.</p></li><li><p><strong>Domain-Specific Hash Queries</strong>: Hashi allows querying an oracle for the hash of a particular ID within a given domain (e.g., the block hash from a specific chain ID). A block hash is a unique identifier that represents the state of a blockchain at a particular point in time, akin to a fingerprint for a set of transactions.</p></li><li><p><strong>Consensus Mechanism</strong>: It enables users to seek consensus from a set of oracles for a given ID in a domain. This is similar to getting multiple expert opinions to reach a high-confidence conclusion.</p></li><li><p><strong>Unanimous Agreement</strong>: Users can also query for a block hash that has been unanimously agreed upon by a set of oracles. This feature strengthens security by ensuring that only when all oracles are in absolute agreement is the hash accepted, reducing the risk of false or tampered data.</p></li></ul><h4 id="h-shoyubashi" class="text-xl font-header !mt-6 !mb-3 first:!mt-0 first:!mb-0">ShoyuBashi (所有橋)</h4><ul><li><p><strong>Owner Controls</strong>: The owner account has the power to set and modify the instance of Hashi to query, define oracle sets for each domain, and set thresholds for oracle consensus. This is akin to an administrator setting rules for data validation.</p></li><li><p><strong>Public Queries</strong>: Any user can query for an agreed-upon hash by a threshold of oracles. This threshold mechanism acts as a layer of democratic validation to determine the authenticity of a block hash.</p></li></ul><h4 id="h-girigiribashi" class="text-xl font-header !mt-6 !mb-3 first:!mt-0 first:!mb-0">GiriGiriBashi (ギリギリ橋)</h4><ul><li><p><strong>Initial Setup</strong>: An owner can initialize oracle sets and thresholds, similar to setting up initial security parameters.</p></li><li><p><strong>Adaptation and Security</strong>: Owners can replace underperforming or compromised oracles, ensuring the bridge&apos;s integrity is maintained.</p></li><li><p><strong>Dispute Resolution</strong>: Users have the ability to challenge an oracle’s report. Challenges can lead to the oracle being quarantined if found at fault, ensuring only reliable oracles participate.</p></li><li><p><strong>Re-establishing Trust</strong>: In case of widespread issues, a no-confidence state can be declared, prompting a reset in the domain by the owner, much like a system reboot after a critical error.</p></li></ul><h4 id="h-yaho" class="text-xl font-header !mt-6 !mb-3 first:!mt-0 first:!mb-0">Yaho (ヤッホー)</h4><ul><li><p><strong>Message Dispatching</strong>: Users can dispatch messages across chains via Hashi. Yaho records these messages and emits their hashes as events, essentially announcing the successful send-off of a message.</p></li><li><p><strong>Message Relaying</strong>: It also provides functionality to relay stored messages to different message adapters, broadening communication capabilities.</p></li><li><p><strong>Combined Operations</strong>: For efficiency, Yaho can dispatch messages and relay them in a single transaction, streamlining cross-chain communication.</p></li></ul><h4 id="h-yaru" class="text-xl font-header !mt-6 !mb-3 first:!mt-0 first:!mb-0">Yaru (やる)</h4><ul><li><p><strong>Message Execution</strong>: Yaru acts on the receiving end of the bridge, executing messages that come from Yaho, similar to a recipient acting on a received letter.</p></li></ul><h4 id="h-hashi-zodiac-module" class="text-xl font-header !mt-6 !mb-3 first:!mt-0 first:!mb-0">Hashi Zodiac Module</h4><ul><li><p><strong>Control Across Chains</strong>: Users can control an avatar (like a multi-signature wallet, or &apos;Safe&apos;) on one chain from an address on another, enabling cross-chain command and control of assets or contracts.</p></li><li><p><strong>Message Passing</strong>: It defines instances for Yaho to pass messages and specifies chain IDs and foreign controller addresses, creating a comprehensive cross-chain command structure.</p></li></ul><p>By incorporating redundancy and a high threshold for oracle consensus, Hashi prioritizes security, even at the expense of higher gas costs and potentially slower operations. This trade-off is deemed necessary to mitigate the risks that have plagued previous bridge protocols, providing a robust solution in a landscape where security incidents can be incredibly costly.</p><h3 id="h-a-quick-note-before-we-proceed-on-about-hashi-understanding-arbitrary-message-bridges-amb" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0"><strong>A quick note before we proceed on about Hashi: Understanding Arbitrary Message Bridges (AMB)</strong></h3><p>Before we delve into the specifics of how Hashi operates across chains, it&apos;s essential to understand the concept of <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://docs.gnosischain.com/bridges/tokenbridge/amb-bridge">Arbitrary Message Bridges (AMB)</a>. An AMB is a protocol that enables the transmission of messages between two distinct blockchain networks. These messages can carry various types of information, such as function calls, transaction requests, or simple data transfers. In essence, an AMB acts like a courier service that connects two separate communities, allowing them to communicate and interact securely and reliably.</p><p>AMBs are pivotal in decentralized applications that require cross-chain interactions because they expand the functionality of smart contracts beyond the confines of their native blockchain. For instance, a smart contract on the Ethereum network can trigger an action on the Gnosis Chain, or vice versa, through messages passed by the AMB. It&apos;s a bridge that not only links two separate ecosystems but also enables them to work together harmoniously.</p><h3 id="h-how-message-dispatching-on-hashi-works" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0"><strong>How Message Dispatching on Hashi Works ✉️</strong></h3><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/edfdcb5d125420ff05a8b6ab8aac16c7ca4e52c286c96f6319f11a68ac7a6323.png" alt="You can look at the Hashi protocol like a mail-man. Every house is a different blockchain and he has all of the tools and data to mail things between every house. " blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">You can look at the Hashi protocol like a mail-man. Every house is a different blockchain and he has all of the tools and data to mail things between every house.</figcaption></figure><h3 id="h-message-transmission-from-goerli-to-gnosis-chain" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0"><strong>Message Transmission from Goerli to Gnosis Chain</strong></h3><p>Using the Hashi protocol to send a message from the Goerli testnet to the Gnosis Chain involves a sequence of carefully orchestrated steps that ensure the message is not only delivered but also verified and executed. Here&apos;s how the process unfolds:</p><ol><li><p><strong>Initiation by the User</strong>:</p><ul><li><p>A user starts by interacting with the Yaho contract on the Goerli network. They call the <code>dispatchMessagesToAdapters</code> function on Yaho to initiate the message sending process.</p></li></ul></li><li><p><strong>Message Processing by Yaho</strong>:</p><ul><li><p>Yaho takes the user&apos;s message and communicates with the AMB Message Relay. The role of the AMB Message Relay is to take the message from Yaho and prepare it for cross-chain delivery.</p></li></ul></li><li><p><strong>Relaying via AMB Message Relay</strong>:</p><ul><li><p>The AMB Message Relay, after receiving the message from Yaho, calls its <code>relayMessages</code> function. This function includes an operation to <code>storeHashes</code>, which is executed on an adapter on the Gnosis Chain. This action essentially packages the message for its cross-chain journey.</p></li></ul></li><li><p><strong>Cross-Chain Handover</strong>:</p><ul><li><p>The AMB Message Relay on Goerli then interacts with the AMB contract through the <code>requireToPassMessage</code> function. This is where the AMB takes the relayed message and securely sends it to the AMB contract on the Gnosis Chain.</p></li></ul></li><li><p><strong>Receipt and Verification on Gnosis Chain</strong>:</p><ul><li><p>Once the message arrives on the Gnosis Chain, the AMB Adapter contract calls its <code>storeHashes</code> function. This crucial step logs the message, ensuring that it&apos;s safely received and ready for the next phase. A <code>MessageDispatched</code> event is emitted, providing a messageId that is vital for tracking and executing the message.</p></li></ul></li><li><p><strong>Execution of the Message</strong>:</p><ul><li><p>The final step involves the user calling the <code>executeMessages</code> function on the Yaru contract on the Gnosis Chain. The user provides the messageId (obtained from the <code>MessageDispatched</code> event) and the original message as parameters.</p></li><li><p>Yaru then performs the execution of the message, completing its cross-chain journey and allowing the intended actions to be carried out on the Gnosis Chain.</p></li></ul></li></ol><h3 id="h-message-transmission-from-gnosis-chain-to-goerli" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Message Transmission from Gnosis Chain to Goerli</h3><p>The process of sending a message from the Gnosis Chain to the Goerli network through Hashi involves several components that work together to ensure the message is not only transmitted across chains but also validated and executed securely.</p><h4 id="h-step-by-step-process-from-gnosis-chain-to-goerli" class="text-xl font-header !mt-6 !mb-3 first:!mt-0 first:!mb-0">Step-by-Step Process from Gnosis Chain to Goerli</h4><ol><li><p><strong>User Interaction on Gnosis Chain</strong>:</p><ul><li><p>It begins with the user calling <code>Yaho.dispatchMessagesToAdapters</code> on the Gnosis Chain. This function is responsible for initiating the message relay process, much like dropping a mail into the postbox.</p></li></ul></li><li><p><strong>Message Handling by Yaho</strong>:</p><ul><li><p>Yaho processes the message and forwards it to the AMB Message Relay. Here, <code>relayMessages</code> (which involves <code>storeHashes</code>) is called, packaging the message and its metadata for the journey ahead.</p></li></ul></li><li><p><strong>Message Relay to AMB</strong>:</p><ul><li><p>The AMB Message Relay invokes <code>requireToPassMessage</code> on the AMB contract. This step is akin to handing over the message to the courier service, which will carry it across the bridge to the Goerli network. During this process, the <code>UserRequestsForSignature</code> event is emitted.</p></li></ul></li><li><p><strong>Signature Retrieval by User</strong>:</p><ul><li><p>On the Gnosis side, the user now interacts with the AMB Helper contract. By calling <code>getSignature</code> and providing the <code>encodedData</code> from step 3, the user receives a signature, a cryptographic proof that the message is valid and ready to be accepted on the Goerli chain.</p></li></ul></li><li><p><strong>Message Passing to Goerli&apos;s AMB</strong>:</p><ul><li><p>With the signature in hand, the user then calls <code>executeSignature</code> on the AMB contract deployed on the Goerli network. The signature and <code>encodedData</code> are provided as parameters. This step is crucial as it&apos;s where the message is verified and accepted by the Goerli network&apos;s AMB, which in turn calls <code>storeHashes</code> from the AMB Adapter. The <code>MessageDispatched</code> event is emitted, granting the user the messageId needed for the final step.</p></li></ul></li><li><p><strong>Execution on Ethereum via Yaru</strong>:</p><ul><li><p>The last phase of the journey takes place on the Ethereum network. The user calls <code>Yaru.executeMessages</code> with the obtained messageId and the original message as parameters. Yaru then executes the message, thereby completing the cross-chain communication loop.</p></li></ul></li></ol><p>This process exemplifies the robustness of Hashi in handling cross-chain messages, incorporating cryptographic verification at each step to maintain security and integrity. From the user&apos;s perspective on the Gnosis Chain, the journey of the message is transparent and results in a series of actions being triggered on the Goerli network, all orchestrated by the Hashi protocol.</p><p><strong>Ok, so what’s next?</strong></p><p>To delve deeper into the Hashi protocol and explore its full potential, a comprehensive suite of resources is available. These materials include technical documentation, tutorials, and community discussions, all designed to provide a thorough understanding of the protocol and its applications. Whether you&apos;re looking to integrate Hashi into your project or simply curious about the mechanics of cross-chain bridges, these resources serve as a gateway to a wealth of knowledge.</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/atj3097/hashi-chiado-to-goerli-vrf">https://github.com/atj3097/hashi-chiado-to-goerli-vrf</a></p><p>Chainlink’s VRF Service doesn’t exist on Goerli/Chiado. So with Hashi, we’re able to request a random number from Chainlink’s VRF on Goerli and have it listened for on our dapp deployed on Chiado. This is less documentation and more so of a technical implementation.</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://hashi-doc.gitbook.io/hashi/v0.1/introduction">https://hashi-doc.gitbook.io/hashi/v0.1/introduction</a></p><p>Hashi Protocol Documentation</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/gnosis/hashi">https://github.com/gnosis/hashi</a></p><p>Hashi Protocol Github &amp; Contract Deployments here 👉 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://docs.gnosischain.com/bridges/hashi/Deployment">Deployments</a></p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://ethresear.ch/t/hashi-a-principled-approach-to-bridges/14725">https://ethresear.ch/t/hashi-a-principled-approach-to-bridges/14725</a></p><p>This forum post is a more in depth explanation of Hashi and the problem it solves.</p>]]></content:encoded>
            <author>adam-33@newsletter.paragraph.com (Adam)</author>
            <enclosure url="https://storage.googleapis.com/papyrus_images/12ad0504e023883c577b61ae5eeb6e47356923901dfcb1f6bfbeb4e1222b288c.png" length="0" type="image/png"/>
        </item>
        <item>
            <title><![CDATA[Uniswap V4 🤝 Polygon zkEVM/Miden: The ultimate tools to create the next generation of DeFi Protocols]]></title>
            <link>https://paragraph.com/@adam-33/uniswap-v4-polygon-zkevm-miden-the-ultimate-tools-to-create-the-next-generation-of-defi-protocols</link>
            <guid>0JywDiBglQNqoqMrW4fg</guid>
            <pubDate>Thu, 19 Oct 2023 01:45:43 GMT</pubDate>
            <description><![CDATA[Zero Knowledge Proofs Are HereLong gone are the days of us sitting in tech talks at crypto conferences imagining all of the cool things zero knowledge proofs will be able to do in the blockchain space. The tools are here. From zk co-proccessors like Axiom, to fully blown zkVMs by RISC ZERO, Polygon’s coming Miden VM, etc. we have the tools to create the next generation of apps that will not only scale ethereum, but also increase privacy and enable an entirely new set of defi apps that are uni...]]></description>
            <content:encoded><![CDATA[<h2 id="h-zero-knowledge-proofs-are-here" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>Zero Knowledge Proofs Are Here</strong></h2><p>Long gone are the days of us sitting in tech talks at crypto conferences imagining all of the cool things zero knowledge proofs will be able to do in the blockchain space. The tools are <em>here.</em> From zk co-proccessors like Axiom, to fully blown zkVMs by RISC ZERO, Polygon’s coming Miden VM, etc. we have the tools to create the next generation of apps that will not only scale ethereum, but also increase privacy and enable an entirely new set of defi apps that are uniquely enabled by with these tools. Last time I wrote about how <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://mirror.xyz/0x0e729b11661B3f1C1E829AAdF764D5C3295e1256/WLCo-GzVqum1PEiHgqZzx4I4BqRGYvV6MMZynUzbv6w">Axiom</a> enables interesting use cases of Uniswap Hooks on the coming Uniswap V4 with their zk co-processor. Lately I’ve been deep diving into the new Polygon zkEVM &amp; their coming Miden VM, two of Polygon’s new zk rollup solutions. This research has inspired me to write this piece on how these tools that will further extend of DeFi protocols with the capabilities of the coming Uniswap V4.</p><h2 id="h-bootstrapping-your-defi-protocol-on-top-of-uniswap-v4" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Bootstrapping Your DeFi Protocol On Top Of Uniswap V4</h2><p>At this point, most people know what Uniswap V4 is, but just a quick overview one more time in plain terms:</p><p>Uniswap V4 is the next iteration of the Uniswap Protocol. Uniswap Liquidity Pools are now created using a singleton <code>PoolManager</code> instance and we have “hooks“, which are functions of code that run at different stages of actions that happen in a pool.</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/Uniswap/v4-core/blob/main/whitepaper-v4-draft.pdf">If you want to learn more, Uniswap V4 whitepaper draft here</a></p><p>Before this, when people wanted to start their own DeFi protocol, we had to fork 🍴 Uniswap V3. This was not an easy feat for engineers, from the headaches of launching V3 on your own all the way to bootstrapping your own liquidity. This barrier to entry kept a lot of developers out of the innovation race that of DeFi. Uniswap V4 takes down these barriers to entry <em>drastically</em> for developers with the its new architecture.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/78ee433140633ae80b0d564250f6be8023e7236e5e622518a9c1219a2448f5ab.jpg" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>If you’re able to attract liquidity to hooks and pools that <em>you</em> made, you can effectively create your own DeFi protocol on top of Uniswap V4. V4 has essentially positioned the Uniswap Protocol to become the fundamental layer of decentralized finance. While you still have to do the legwork to find and bootstrap your own liquidity, Uniswap V4 abstracts you alot of your work as a developer to get to a proof of concept of your own DeFi protocol on the ground. But ok, now we have V4 but the next question is, which chain(s) will I launch on?</p><h2 id="h-choosing-your-chain-to-launch-the-case-for-polygons-zkevm-rollup" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Choosing Your Chain To Launch: The Case For Polygon’s zkEVM Rollup</h2><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/599e15996fe4b2de1e3fb322d9911e0716cddda31335e156d64b9359d5064a9a.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>On-Chain summer just ended. From Base, to Optimism, Scroll, etc. Developers have an insane amount of options for the different blockchains that they will launch their next DeFi application on. Polygon’s PoS chain has long been a widely adopted layer 2, a high throughput EVM <em>compatible</em> layer 2 that was a convenient option for many during the last bull run when Ethereum gas fees were ridiculously expensive. Polygon’s PoS chain was extremely cheap and we saw thousands of dApps launched on that chain, while in the background many were waiting on the launch of many of zk-rollup &amp; optimistic solutions. Well…..ladies and gentlemen….we got em.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/2690648bf48320c07f1ccadaf029b3d1ac680ee3e7ea5872e15f0f3235659a99.gif" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>Last year fall(2022), Polygon now upped the ante with its zkEVM chain, a promising enhancement that is poised to be a game-changer in the blockchain arena.</p><h3 id="h-how-zkevms-work" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0"><strong>How zkEVMs Work:</strong></h3><ul><li><p><strong>Efficient Scalability:</strong></p><ul><li><p>zkEVMs process more transactions off-chain, reducing the on-chain load. This structure promotes faster and more cost-efficient transactions.</p></li></ul></li><li><p><strong>Enhanced Privacy:</strong></p><ul><li><p>Zero-knowledge proofs allow for the validation of transactions without revealing sensitive data, bolstering transaction confidentiality.</p></li></ul></li><li><p><strong>Reduced Costs:</strong></p><ul><li><p>By handling more transactions off-chain, zkEVMs significantly reduce gas fees, making transactions more economical.</p></li></ul></li><li><p><strong>Improved Performance:</strong></p><ul><li><p>zkEVMs optimize the network, preventing it from becoming overwhelmed by transaction volumes, thus ensuring smoother operation and improved user experiences.</p></li></ul></li><li><p><strong>EVM Equivalence:</strong></p><ul><li><p>zkEVM is designed to be compatible with the Ethereum Virtual Machine (EVM). This equivalence allows for seamless migration and integration of Ethereum-based dApps, smart contracts, and tools, thus providing developers with a familiar environment and the ability to leverage existing Ethereum ecosystems and communities for enhanced collaboration and innovation.</p></li><li><p>TL;DR you can launch your dApp on Polygon’s zkEVM with out all the hiccups of the EVM <em>“compatible“</em> chains</p></li></ul></li></ul><p>Launching your next DeFi app using Uniswap V4 on top of Polygon&apos;s zkEVM isn&apos;t just an upgrade; it’s a revolutionary leap. Uniswap V4, with its myriad of innovative features, when paired with the scalability and privacy of a zkEVM, creates a supercharged environment where DeFi applications can operate at and easily scale when your defi protocol explodes in the next bullmarket.</p><h2 id="h-harnessing-polygon-miden-for-zkamms-in-uniswap-v4" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>Harnessing Polygon Miden for zkAMMs in Uniswap V4</strong></h2><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/78cbd3fff63c6a6ed0f686634f6f61a496b69e8ead506c48202f6019584385dd.png" alt="If you don&apos;t understand this meme stop reading right now and go watch this youtube video on zk-proofs 👉 https://www.youtube.com/watch?v=fOGdb1CTu5c" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">If you don&apos;t understand this meme stop reading right now and go watch this youtube video on zk-proofs 👉 https://www.youtube.com/watch?v=fOGdb1CTu5c</figcaption></figure><p>Description from Polygon on what is Polygon Miden</p><p><em>Polygon Miden is a zero-knowledge rollup running on the Miden VM. Polygon Miden prioritizes ZK-friendliness over EVM compatibility; that way it can offer features and benefits that are not available on Ethereum. It aims at builders that want to create high-throughput and private dApps. Miden is a general purpose rollup and builders can write and deploy arbitrary smart contracts.</em></p><p>Incorporating the advanced functionalities of Polygon Miden can help revolutionize the capabilities of an AMM like Uniswap, leading to the birth of zkAMMs 🤫 and enhanced privacy measures for users.</p><ol><li><p><strong>Scalability through zk-Design</strong>: One of the defining features of Polygon Miden is its ZK-centric design, enabling users to locally execute smart contracts and produce ZK proofs for network verification. For Uniswap V4, this scalability is insane. The ability to process transactions locally and then use ZK proofs for verification ensures that trading can occur at unmatched speeds, making Uniswap V4 a prime candidate for high-frequency decentralized trades. This approach significantly diminishes the computational load on the network, offering traders rapid and smooth experiences.</p></li><li><p><strong>Privacy-First AMMs with zkAMM</strong>: The transparency of blockchains, while beneficial for many use-cases, can be a hindrance in scenarios where transactional privacy is vital. Polygon Miden is designed with privacy at its core. Integrating Miden&apos;s technology into Uniswap V4 could lead to the inception of zkAMMs, where trades are not only efficient but also cloaked in privacy. This system would allow traders to retain the privacy of their trading strategies, amounts, and timing – a game-changer in the AMM landscape.</p></li><li><p><strong>Asynchronous Interactions &amp; Uniswap Hooks</strong>: Polygon Miden&apos;s architecture champions asynchronous interactions. All interplays between smart contracts are asynchronous, meaning token transfers, NFT swaps, and more don&apos;t have to touch the public state. This fits harmoniously with the idea of Uniswap hooks. By leveraging Miden&apos;s asynchronous model, Uniswap developers can create hooks that function seamlessly, interacting effortlessly between locally executed transactions and network transactions.</p></li><li><p><strong>Safety Innovations &amp; Uniswap</strong>: Safety is paramount in DeFi, and Polygon Miden has made significant strides in this arena. With every account in Miden being a smart contract, and the potential for recallable transactions, the chances of erroneous transfers are drastically reduced. Incorporating these safety measures into Uniswap V4 ensures a safer trading environment. Traders can operate with the confidence that their assets are secure and protected from common pitfalls and hacks that have plauged the DeFi ecosystem for the past few years.</p></li></ol><p>In summary, Polygon Miden&apos;s advanced ZK-centric design/privacy first approach with Uniswap V4&apos;s upgrade on the way paves the way for a new DeFi paradigm. zkAMMs and privacy-enabled Uniswap hooks could very well be the next significant advancement in the decentralized trading world, providing users with the perfect blend of speed, security, and privacy. Even though we’re in a pretty brutal crypto winter, the tools to create the next generation of DeFi apps to further legitimize and increase crypto’s adoption are being provided to us right in front of our eyes.</p><h2 id="h-so-whats-next" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">So What’s Next?</h2><p>Well, at this point I hope I’ve shown you the possibilities of what can be done in the coming months with the launch of Uniswap’s V4 &amp; Polygon zkEVM/Miden. Uniswap V4 is already on the Mumbai testnet of Polygon while Polygon’s Miden is still in the works with just a <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://0xpolygonmiden.github.io/examples/">simple playground for now</a>. But if I were you anon? I’d get ahead of the curve <em>now</em>. So below I’ve compiled a list of everything you need to learn to get started. These resources will accommodate both the newbies and the shadowy super coders.</p><h3 id="h-uniswap-resources" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Uniswap Resources</h3><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://uniswap.university/guides">https://uniswap.university/guides</a> - For Uniswap Beginners especially</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://docs.uniswapfoundation.org/">https://docs.uniswapfoundation.org/</a></p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/fewwwww/awesome-uniswap-hooks#-examples">https://github.com/fewwwww/awesome-uniswap-hooks#-examples</a></p><p>zkAMM proposal in the EF Forum</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://ethresear.ch/t/zkuniswap-a-first-of-its-kind-zkamm/16839">https://ethresear.ch/t/zkuniswap-a-first-of-its-kind-zkamm/16839</a></p><h3 id="h-polygon-resources-some-evm-stuff" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Polygon Resources + Some EVM Stuff</h3><p>Ok, before you can <em>really</em> appreciate how cool the Polygon solutions are I’d recommend that you dive deep into the EVM(most people reading this article probably already are but I personally have to get refreshed on EVM stuff yearly)</p><div data-type="youtube" videoId="yV4vHMaKZT0">
      <div class="youtube-player" data-id="yV4vHMaKZT0" style="background-image: url('https://i.ytimg.com/vi/yV4vHMaKZT0/hqdefault.jpg'); background-size: cover; background-position: center">
        <a href="https://www.youtube.com/watch?v=yV4vHMaKZT0">
          <img src="{{DOMAIN}}/editor/youtube/play.png" class="play"/>
        </a>
      </div></div><p>This playlist is probably the best explainer on the fundamentals of Ethereum and how the EVM works. They’re long but worth the watch.</p><p>Honestly in terms of Polygon, you don’t need to look any further than the Polygon University. And I’m adding two talks on Polygon zkEVM/Miden too</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://university.polygon.technology/">https://university.polygon.technology/</a></p><div data-type="youtube" videoId="pLu7XeEN-f4">
      <div class="youtube-player" data-id="pLu7XeEN-f4" style="background-image: url('https://i.ytimg.com/vi/pLu7XeEN-f4/hqdefault.jpg'); background-size: cover; background-position: center">
        <a href="https://www.youtube.com/watch?v=pLu7XeEN-f4">
          <img src="{{DOMAIN}}/editor/youtube/play.png" class="play"/>
        </a>
      </div></div><div data-type="youtube" videoId="fGGrJNeYlHI">
      <div class="youtube-player" data-id="fGGrJNeYlHI" style="background-image: url('https://i.ytimg.com/vi/fGGrJNeYlHI/hqdefault.jpg'); background-size: cover; background-position: center">
        <a href="https://www.youtube.com/watch?v=fGGrJNeYlHI">
          <img src="{{DOMAIN}}/editor/youtube/play.png" class="play"/>
        </a>
      </div></div>]]></content:encoded>
            <author>adam-33@newsletter.paragraph.com (Adam)</author>
            <enclosure url="https://storage.googleapis.com/papyrus_images/8da20e2371f363dc4e3ab49d5447c77004aca01cc581433b603df20facb78d9e.png" length="0" type="image/png"/>
        </item>
        <item>
            <title><![CDATA[Integrating Axiom and Uniswap V4 For Data-Rich Trustless DeFi Applications]]></title>
            <link>https://paragraph.com/@adam-33/integrating-axiom-and-uniswap-v4-for-data-rich-trustless-defi-applications</link>
            <guid>wv4nlLKypDudw2Hv1Lwd</guid>
            <pubDate>Wed, 04 Oct 2023 22:22:20 GMT</pubDate>
            <description><![CDATA[How Uniswap V4 & Axiom come togetherUniswap V4 represents the latest iteration of the leading decentralized exchange protocol. It introduces an innovative hooks architecture that enables developers augment pool functionality at different stages in a pools lifecycle.Figure from draft of Uniswap V4 WhitepaperHooks allow building customized features on top of Uniswap pools, like whitelisting liquidity pools, oracles, and more. However, hooks have limited access to on-chain data, hindering their ...]]></description>
            <content:encoded><![CDATA[<h2 id="h-how-uniswap-v4-and-axiom-come-together" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">How Uniswap V4 &amp; Axiom come together</h2><p>Uniswap V4 represents the latest iteration of the leading decentralized exchange protocol. It introduces an innovative hooks architecture that enables developers augment pool functionality at different stages in a pools lifecycle.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/d3abe6dde88ab4e2c1d674702efa65873674c7b574817e46eb70015dc78cb6f2.png" alt="Figure from draft of Uniswap V4 Whitepaper" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">Figure from draft of Uniswap V4 Whitepaper</figcaption></figure><p>Hooks allow building customized features on top of Uniswap pools, like <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/atj3097/whitelist-hook">whitelisting liquidity pools</a>, <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/Uniswap/v4-periphery/blob/main/contracts/hooks/examples/VolatilityOracle.sol">oracles</a>, and more. However, hooks have limited access to on-chain data, hindering their capabilities. Meanwhile, <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.axiom.xyz/">Axiom</a> has introduced an on-chain &quot;coprocessor&quot; for Ethereum. Axiom allows smart contracts to make queries for historical data like past prices, balances, contract states and have the results verified on-chain via zk proofs Axiom uses two main contracts for you to accomplish this:</p><p><em>Note - If you’re like me, you’re not a God-Tier cryptographer like the folks at Axiom. I highly recommend to review some of the common blockchain cryptographic concepts. The more you understand these concepts the more Axiom and it’s capabilities will “click“ more for you</em> <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://ethereum.org/en/developers/docs/data-structures-and-encoding/patricia-merkle-trie/#:~:text=A%20%22Merkle%22%20Radix%20tree%20is,guarantee%20of%20the%20stored%20data.">Merkle Trees</a> | <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://ethereum.org/en/zero-knowledge-proofs/">zero-knowledge proofs</a> | <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://docs.axiom.xyz/protocol-design/ethereum-on-chain-data">Ethereum Data Structures</a></p><p><strong>AxiomV1</strong> - a cache of Ethereum block hashes starting from genesis</p><p><code>AxiomV1</code> is a smart contract that caches historical blockchain data to allow verifying queries about the past. It stores past block hashes in two main ways:</p><ul><li><p>As Merkle roots of consecutive blocks grouped together. This lets you prove a specific block hash is valid.</p></li><li><p>In a Merkle Mountain Range structure. This allows verifying ranges of blocks.</p></li></ul><p><code>AxiomV1</code> has functions like <code>updateRecent</code> and <code>updateHistorical</code> that add new hashed blocks to the cache by verifying them with zk-proofs. It provides methods like <code>isBlockHashValid</code> to verify a specific block hash against the cached roots. And <code>mmrVerifyBlockHash</code> to verify against the Merkle Mountain Range.</p><p>The contract stores the latest mountain range and commitments to past ones. This allows using the cache to verify historical blockchain queries through cryptographic proofs of validity. The cache is updated over time so an increasing range of historical data can be proven. So in summary, <code>AxiomV1</code> maintains verifiable caches of past block hashes that allow proving historical blockchain data through zk proofs.</p><p><strong>AxiomV1Query</strong> - A smart contract which fulfills queries against <code>AxiomV1</code></p><p>The query protocol allows requesting and verifying historical blockchain data through Axiom&apos;s contract. Here&apos;s a quick rundown of how it works:</p><ul><li><p>To request data, you call Axiom&apos;s <code>sendQuery</code> or <code>sendOffchainQuery</code> functions. This submits the query specifying what data you need.</p></li><li><p>You provide a payment in ETH when submitting the query. This acts as a bounty for someone to do the work of fetching your requested data.</p></li><li><p>The query also specifies a deadline block. If the data isn&apos;t provided by then, you can get a refund.</p></li><li><p>To respond to a query, an Axiom node operator runs the off-chain work of retrieving the requested data from Ethereum&apos;s history.</p></li><li><p>The node then generates a zk cryptographic proof that verifies the data is correct.</p></li><li><p>This proof gets submitted back on-chain via the fulfillQuery function.</p></li><li><p>Axiom&apos;s contract checks the proof is valid and matches the original request.</p></li><li><p>If everything checks out, the contract records the data as verified.</p></li></ul><p>So in summary, the query protocol consists of the on-chain functions to request data, pay bounties, refund, and verify responses. The core innovation is using zk proofs to generate proofs of historical blockchain data.</p><p>Integrating these two technologies unlocks alot of new potential. With Axiom providing trustless historical data access and Uniswap V4 hooks enabling custom functionality on liquidity pools, developers can now build data-rich defi apps on top of the Uniswap Protocol. Together, Axiom and Uniswap V4 provide the perfect ingredients for the next evolution of sophisticated data-driven DeFi products.</p><p>The integration of Axiom and Uniswap V4 brings a new era of possibility for data-rich decentralized finance applications. Axiom unlocks historical on-chain data for use in smart contracts by allowing developers to query information like past prices, balances, ownership records, and contract states. These results can be reliably incorporated into dapps thanks to Axiom&apos;s use of zk proofs for verifiable computation. By using Axiom with Uniswap hooks, developers can build decentralized applications that intelligently leverage historical data in automated, trustless ways.</p><h2 id="h-uniswap-v4-axiom-hook-ideas" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Uniswap V4 🤝 Axiom Hook Ideas</h2><p>Here are some ideas for Uniswap V4 hooks using Axiom</p><ol><li><p>TWAP trading based on historical prices - Execute TWAP trades using price data fetched from Axiom.</p></li><li><p>Limit order hook - Place limit orders using Axiom to access historical pricing data off-chain.</p></li><li><p>Lending fee adjustment - Adjust lending rates based on historical utilization ratios pulled from Axiom.</p></li><li><p>Automated concentrated liquidity - Optimize concentrated liquidity positions based on historical trade data.</p></li><li><p>Decentralized TWAP arbitrage - Arbitrage across DEXs using historical prices from Axiom.</p></li><li><p>Liquidity provider profiler - Analyze historical provider behavior using Axiom data to identify profitable LPs.</p></li><li><p>Time-based access control - Restrict access based on past on-chain activity verified through Axiom.</p></li><li><p>Decentralized moving averages - Calculate custom on-chain moving averages using historical pricing data.</p></li><li><p>Smart contract price feeds - Build reliable on-chain price feeds using historical data from Axiom.</p></li><li><p>Liquidity incentives framework - Reward LPs based on historical usage data pulled from Axiom.</p></li><li><p>Automated ecosystem buybacks - Perform token buybacks when historical prices hit specific thresholds.</p></li><li><p>Automated Blacklist Identification - Identify malicious actors by analyzing transaction histories and patterns of abuse.</p></li></ol><h2 id="h-resources-to-get-started" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>Resources to get started</strong></h2><p>Hooks using Axiom</p><p>Built by @saucepoint on Twitter during the ETHNYC Hackathon</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/saucepoint/v4-axiom-rebalancing/tree/main">https://github.com/saucepoint/v4-axiom-rebalancing/tree/main</a></p><p><strong>A hook using Axiom I’m currently implementing - will be finished soon!</strong></p><p>The buyback hook uses Axiom to access historical price data for a protocol&apos;s token. It sets a target price threshold and monitors the current price. When the price crosses below the threshold, the hook automatically executes a buyback.</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/atj3097/buyback-hook">https://github.com/atj3097/buyback-hook</a></p><p><strong>Axiom Documentation &amp; Talks/Articles</strong></p><div data-type="youtube" videoId="GauVCNRjigE">
      <div class="youtube-player" data-id="GauVCNRjigE" style="background-image: url('https://i.ytimg.com/vi/GauVCNRjigE/hqdefault.jpg'); background-size: cover; background-position: center">
        <a href="https://www.youtube.com/watch?v=GauVCNRjigE">
          <img src="{{DOMAIN}}/editor/youtube/play.png" class="play"/>
        </a>
      </div></div><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://mirror.xyz/camiinthisthang.eth/qb9kbqj9-OOuUCQxmYJuRnBrkICQHe8YEohTrmZeqLM">https://mirror.xyz/camiinthisthang.eth/qb9kbqj9-OOuUCQxmYJuRnBrkICQHe8YEohTrmZeqLM</a></p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://docs.axiom.xyz/developers/axiom-for-developers">https://docs.axiom.xyz/developers/axiom-for-developers</a></p><p><strong>Axiom Demo Projects(This is really useful for seeing Axiom in action, especially the code examples as well)</strong></p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://demo.axiom.xyz/account-age">https://demo.axiom.xyz/account-age</a></p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/axiom-crypto/examples">https://github.com/axiom-crypto/examples</a></p><p><strong>Compilation of Uniswap Hooks Resources and some of my examples</strong></p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/atj3097/univ4-hooks-portfolio">https://github.com/atj3097/univ4-hooks-portfolio</a></p>]]></content:encoded>
            <author>adam-33@newsletter.paragraph.com (Adam)</author>
            <enclosure url="https://storage.googleapis.com/papyrus_images/a8666b3fc58856800bc5bef8b9912f207b27e38a94761b5066faa978df3e75bb.jpg" length="0" type="image/jpg"/>
        </item>
    </channel>
</rss>