<?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>Madhav Goyal</title>
        <link>https://paragraph.com/@madhavg</link>
        <description>Just a tinkerer in this wonderful world</description>
        <lastBuildDate>Thu, 03 Dec 2026 08:05:57 GMT</lastBuildDate>
        <docs>https://validator.w3.org/feed/docs/rss2.html</docs>
        <generator>https://github.com/jpmonette/feed</generator>
        <language>en</language>
        <image>
            <title>Madhav Goyal</title>
            <url>https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/87b4b0e0fe86bd7507094e325644b17ef4100d4d209f68bf457cccf67cafb82c.png</url>
            <link>https://paragraph.com/@madhavg</link>
        </image>
        <copyright>All rights reserved</copyright>
        <item>
            <title><![CDATA[Halo: A privacy layer for stablecoins ]]></title>
            <link>https://paragraph.com/@madhavg/halo-a-privacy-layer-for-stablecoins</link>
            <guid>EV1tmNTEhcBSa4G7vEIX</guid>
            <pubDate>Sat, 03 Jan 2026 14:32:48 GMT</pubDate>
            <description><![CDATA[AbstractHalo is a privacy layer for stablecoins unlocking the next private neobanks and applications that were blocked by the lack of anonymity and confidentiality of networks. Halo Network introduces a new extension a a privacy-preserving EVM chain purpose-built for stablecoin use cases. Halo combines the familiarity and composability of the EVM with the confidentiality of a UTXO-based privacy layer, allowing users to transact and build privately without sacrificing interoperability or liqui...]]></description>
            <content:encoded><![CDATA[<br><hr><h2 id="h-abstract" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Abstract</h2><p>Halo is a privacy layer for stablecoins unlocking the next private neobanks and applications that were blocked by the lack of anonymity and confidentiality of networks. <strong>Halo Network</strong> introduces a new extension a a <strong>privacy-preserving EVM chain purpose-built for stablecoin use cases</strong>. Halo combines the <strong>familiarity and composability of the EVM</strong> with the <strong>confidentiality of a UTXO-based privacy layer</strong>, allowing users to transact and build privately without sacrificing interoperability or liquidity.</p><h2 id="h-introduction" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Introduction</h2><p>Privacy has been one of the afterthoughts but long standing problem in crypto, especially for an industry whose biggest pmf is payments and savings. While blockchains have revolutionized how value moves across borders, their transparency has come at a big cost: every transaction is publicly traceable, every balance is visible, and putting the targeted parties especially the core users of stablecoins → citizens in unstable economies in danger.</p><p>To fill this gap, users have relied on <strong>centralized exchanges (CEXs)</strong> as neobanks using them to hold and move stablecoins. These Exchanges are themselves prone the changing regulation landscape of different countries and the reliance on custodial intermediaries reintroduces the very risks blockchains were designed to eliminate: censorship, surveillance, opaque operations, and counterparty dependence</p><p>At the same time, <strong>stablecoins</strong> have emerged as crypto’s biggest product market fit → the digital equivalent of internet-native dollars. They have become the backbone of global crypto activity, powering remittances, commerce, and on-chain savings at a scale that now rivals traditional payment networks. Yet despite their adoption, stablecoins today operate on fully public rails, making privacy and confidentiality virtually impossible. Although a wide range of on-chain products attempt to provide varying degrees of privacy for users, <strong>most suffer from fundamental trade-offs that compromise usability, composability, or economic feasibility</strong>. Many of these systems achieve privacy only by isolating themselves from the broader EVM ecosystem → introducing new virtual machines, custom asset standards, or complex transaction formats that degrade user experience. Others rely on heavy cryptographic operations that make transactions slow, expensive, and impractical for everyday payments. While interacting with some thru public wallets can be of future concern and regulation.</p><p>Most of the tradefoffs</p><ol><li><p>Single state → Current prevelant method of introducing privacy is splitting the state in two and running one private state and second public evm state where most of the private ops occur as you guessed on the private state. This draws a big amount of flaws</p><ol><li><p>Wallet → Its breaks wallet composability where either the user downloads a new wallet for the chain and manage a new private key</p></li><li><p>EIP delegation → or delegate their signing keys to a smart wallet which is the motherload of scurity issues.</p></li></ol></li><li><p>Client Side Compatbility → Users should be able to transact with just their metamask and not have either the need to donload a new walet or extension like metamask snap.</p></li><li><p>Composability → being evm is just not about ethereum mainet but opening up privacy to the whole suite of applications built for ethereum with minimal changes.</p></li></ol><p>These were some of the core design principles while Building Halo: A privacy layer focused on stablecoins supporting confidential balances transfers and multiple operations unlcoking a new suite of defi applications</p><p>In practice, this means that while privacy-preserving protocols exist, <strong>none have managed to deliver a seamless, composable, and cost-efficient experience comparable to mainstream EVM networks</strong>.</p><p><strong>Halo Network</strong> was designed to address this structural gap.</p><h2 id="h-architecture-and-design-philosophy" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Architecture and Design philosophy</h2><p>Halo design works backwards from focusing on</p><ul><li><p><strong>Security →</strong> Introducing newer ayers adds more security security and escape risk, Halo uses Polygon agglayer to allow exit hatches. This allows users to take their funds out even if the node is not responding by forcing txns on the l1.</p></li><li><p><strong>Composability</strong> → Composability is the defining feature of the Ethereum ecosystem — the ability for applications to interoperate trustlessly, share liquidity, and build upon one another like money legos. Most existing privacy solutions sacrifice this by introducing custom virtual machines or new smart contract languages, making it impossible to leverage existing EVM codebases or DeFi primitives. Halo preserves <strong>full EVM composability</strong>, allowing any existing Ethereum-compatible contract, stablecoin, or application to be deployed without modification. Developers can integrate privacy into existing protocols with minute changes rather than rewriting them for a new stack.</p><ul><li><p>This also implies the need for a single shared state.</p></li></ul></li><li><p>Wallets: The first point of interaction with any network onchain is a wallet, Most of the current privacy layers end p breaking the UX . Most privacy systems require specialized wallets, custom transaction formats, or new signing standards that alienate users and slow adoption. Halo eliminates this friction completely . Users interact with Halo through the same interfaces they already trust, such as <strong>MetaMask, Rabby, or Frame</strong>, using standard EIP-7702 authorization flows. This allows any user familiar with Ethereum to access private functionality on Halo instantly, without switching networks or learning new tools.</p></li></ul><h2 id="h-halo-architecture" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Halo Architecture</h2><p>The core idea is to keep as much as possible in house and relying on other networks ie TEEs,MPCs as low as possible.</p><ul><li><p><strong>Public State (EVM account model)</strong>&nbsp;— Standard Ethereum which is a Merkle Patricia Trie storing account balances, contract code, and storage. When you interact with public DeFi protocols, swap tokens on a DEX, or use any standard EVM operation, you're operating in this layer. It's fully composable, fully transparent, and fully compatible with every existing Ethereum tool.</p></li><li><p><strong>Encrypted balances</strong>&nbsp;— We store encrypted balances directly into the ethereum state. These aren't stored in a separate UTXO tree or parallel VM they live in standard <code>SSTORE</code> slots, visible on-chain but cryptographically meaningless without decryption keys. User can hod both public and private balances and move them.</p></li></ul><h2 id="h-twisted-elgamal-over-bn254" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Twisted ElGamal over BN254</h2><h3 id="h-homomorphic-properties" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Homomorphic Properties</h3><p>ElGamal encryption is additively homomorphic, meaning you can perform arithmetic operations on encrypted values without decryption:</p><p><code>Enc(a) + Enc(b) = Enc(a + b) Enc(a) - Enc(b) = Enc(a - b)</code></p><p>This is critical for privacy-preserving transfers. When Alice sends 100 USDC to Bob:</p><ol><li><p>Alice's encrypted balance: <code>Enc(balance_alice)</code></p></li><li><p>Subtract encrypted amount: <code>Enc(balance_alice) - Enc(100)</code></p></li><li><p>Bob's encrypted balance: <code>Enc(balance_bob) + Enc(100)</code></p></li></ol><p>The sequencer performs these operations on encrypted elliptic curve points without ever learning the actual amounts. All it sees are point additions and multiplications on the BN254 curve.</p><h3 id="h-why-bn254" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Why BN254?</h3><p>BN254 (also known as alt_bn128) is already supported by Ethereum through precompiles at addresses <code>0x06</code> (ecAdd), <code>0x07</code> (ecMul), and <code>0x08</code> (pairing check). This means:</p><ul><li><p><strong>Hardware acceleration</strong>: EVM clients already optimize these operations</p></li><li><p><strong>Low gas costs</strong>: Precompiled operations are orders of magnitude cheaper than equivalent Solidity</p></li><li><p><strong>Proven security</strong>: Widely audited and battle-tested in production systems</p></li></ul><p>We've extended this with additional precompiles for ElGamal-specific operations at addresses <code>0x1A</code>, <code>0x18</code>, and <code>0x19</code>.</p><h3 id="h-encrypted-balance-storage" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Encrypted Balance Storage</h3><p>Balances are stored as <strong>elliptic curve points</strong> in contract storage:</p><pre data-type="codeBlock" text="mapping(address =&gt; EncryptedBalance) private balances;

struct EncryptedBalance {
    uint256 c1_x;  // First curve point X coordinate
    uint256 c1_y;  // First curve point Y coordinate  
    uint256 c2_x;  // Second curve point X coordinate
    uint256 c2_y;  // Second curve point Y coordinate
}
"><code><span class="hljs-keyword">mapping</span>(<span class="hljs-keyword">address</span> <span class="hljs-operator">=</span><span class="hljs-operator">&gt;</span> EncryptedBalance) <span class="hljs-keyword">private</span> balances;

<span class="hljs-keyword">struct</span> <span class="hljs-title">EncryptedBalance</span> {
    <span class="hljs-keyword">uint256</span> c1_x;  <span class="hljs-comment">// First curve point X coordinate</span>
    <span class="hljs-keyword">uint256</span> c1_y;  <span class="hljs-comment">// First curve point Y coordinate  </span>
    <span class="hljs-keyword">uint256</span> c2_x;  <span class="hljs-comment">// Second curve point X coordinate</span>
    <span class="hljs-keyword">uint256</span> c2_y;  <span class="hljs-comment">// Second curve point Y coordinate</span>
}
</code></pre><p>Each encrypted balance is actually a pair of BN254 curve points <code>(C1, C2)</code> representing the ElGamal ciphertext. These are stored in public storage slots—anyone can read them, but they reveal nothing about the actual balance without the private key.</p><h2 id="h-the-tee-backend-hardware-backed-decryption" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">The TEE Backend: Hardware-Backed Decryption</h2><p>While homomorphic encryption handles transfers, TEE is important for fair and isolated key generation that backs the encryption across the system and becoming the verifier for every single private txn.</p><h3 id="h-intel-tdx-secure-enclave" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Intel TDX Secure Enclave</h3><p>Halo runs a TEE backend using TDX enclave hosted on <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://phala.com/">phala</a>. Think of these as hardware-isolated execution environments with several critical properties:</p><ol><li><p><strong>Memory Encryption</strong>: All data inside the enclave is encrypted in hardware. Even if someone gains physical access to the server or dumps RAM, they see only encrypted data.</p></li><li><p><strong>Attestation</strong>: The TEE generates cryptographic proofs (attestations) that specific code ran inside a genuine secure enclave, producing specific outputs. This is verifiable on-chain.</p></li><li><p><strong>Isolated State</strong>: The TEE maintains internal state tracking to prevent double-spending. It knows which encrypted balances it's previously decrypted and attested.</p></li></ol><h3 id="h-precompiles" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Precompiles</h3><p>We've implemented two key&nbsp;precompiles for TEE integration:</p><p><strong>0x15&nbsp;- VerifyTEEAttestation(message, signature, timestamp)</strong></p><ul><li><p><strong>Input</strong>: Message data + TEE's&nbsp;ECDSA signature + timestamp</p></li><li><p><strong>Purpose</strong>: Verifies that&nbsp;a signature actually&nbsp;came from the&nbsp;authorized TEE's&nbsp;private&nbsp;key</p></li><li><p><strong>Output</strong>: Boolean indicating&nbsp;valid/invalid signature</p></li><li><p><strong>Usage</strong>: Called by&nbsp;SetPrivateBalance&nbsp;(0x10) to ensure&nbsp;encrypted balance&nbsp;updates&nbsp;are TEE-authorized</p></li></ul><p><strong>0x17&nbsp;- RegisterTEEPublicKey(publicKey)</strong></p><ul><li><p><strong>Input</strong>: 64-byte uncompressed ECDSA public key</p></li><li><p><strong>Purpose</strong>: Registers which&nbsp;TEE is authorized to&nbsp;sign&nbsp;balance&nbsp;updates</p></li><li><p><strong>Access</strong>: Admin-only, typically called once during system&nbsp;setup</p></li><li><p><strong>Output</strong>: Success/failure status</p></li></ul><hr><h2 id="h-transaction-flow-from-wallet-to-settlement" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Transaction Flow: From Wallet to Settlement</h2><p>Let's walk through a complete private transfer from start to finish.</p><h2 id="h-setup-tee-key-generation" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Setup: TEE Key Generation</h2><p>A <strong>trusted execution environment (TEE)</strong> is used for secure key generation, providing cryptographic assurance that the process is isolated and free from interference. The private key is generated and remains entirely within the enclave, never leaving the trusted boundary.</p><ul><li><p>TEE (Intel SGX/AMD SEV secure enclave) generates a public/private keypair on initialization</p></li><li><p>Public key is shared on-chain, available to all users as <code>TEEpubkey</code></p></li><li><p>Private key never leaves the TEE hardware</p></li></ul><hr><h2 id="h-step-1-user-transaction-standard-eip-1559" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Step 1: User Transaction (Standard EIP-1559)</h2><p>Alice wants to send 100 USDC privately to Bob. She opens MetaMask and signs a standard transaction:</p><pre data-type="codeBlock" text="// MetaMask handles this natively
{
  from: &quot;0xAlice&quot;,
  to: &quot;0xPrivateUSDC&quot;,  // Privacy-enabled USDC contract
  data: transferPrivate(
    &quot;0xBob&quot;,
    amount  // 100 USDC (plaintext at this stage)
  ),
  gas: 150000,
  maxFeePerGas: 50,
  maxPriorityFeePerGas: 2
}
"><code><span class="hljs-comment">// MetaMask handles this natively</span>
{
  <span class="hljs-keyword">from</span>: <span class="hljs-string">"0xAlice"</span>,
  to: <span class="hljs-string">"0xPrivateUSDC"</span>,  <span class="hljs-comment">// Privacy-enabled USDC contract</span>
  data: transferPrivate(
    <span class="hljs-string">"0xBob"</span>,
    amount  <span class="hljs-comment">// 100 USDC (plaintext at this stage)</span>
  ),
  <span class="hljs-built_in">gas</span>: <span class="hljs-number">150000</span>,
  maxFeePerGas: <span class="hljs-number">50</span>,
  maxPriorityFeePerGas: <span class="hljs-number">2</span>
}
</code></pre><p><strong>No custom transaction format. No special wallet. Just a standard Ethereum transaction calling a contract function.</strong></p><hr><h2 id="h-step-2-sequencer-routing-cdk-erigon" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Step 2: Sequencer Routing (cdk-erigon)</h2><p>The Halo L2 sequencer (running cdk-erigon, the same client Polygon zkEVM uses) receives the transaction and routes it based on the called function:</p><p><strong>For </strong><code>transferPrivate()</code><strong>:</strong></p><ol><li><p><strong>Check if transaction is private</strong>: <code>isPrivate == true</code></p></li><li><p><strong>Encrypt the transaction data</strong> using <code>TEEpubkey</code>:</p><ul><li><p>Encrypt amount: <code>Enc(100)</code></p></li><li><p>Encrypt recipient address: <code>Enc(0xBob)</code></p></li></ul></li><li><p><strong>Send encrypted transaction to TEE</strong> for attestation and validation</p></li><li><p><strong>TEE validates</strong> the transaction:</p><ul><li><p>Decrypts transaction inside secure enclave</p></li><li><p>Verifies Alice has sufficient encrypted balance</p></li><li><p>Checks for double-spending using internal state</p></li><li><p>Returns <code>isValid == true</code> with attestation signature</p></li></ul></li><li><p><strong>If </strong><code>isValid == true</code>, sequencer proceeds with homomorphic operations:</p><ul><li><p>Read Alice's encrypted balance from storage: <code>balances[0xAlice]</code></p></li><li><p>Call precompile <code>0x18</code> for homomorphic subtraction: <code>Enc(balance_alice) - Enc(100)</code></p></li><li><p>Store updated encrypted balance: <code>SSTORE(balances[0xAlice], newEncryptedBalance)</code></p></li><li><p>Read Bob's encrypted balance: <code>balances[0xBob]</code></p></li><li><p>Call precompile <code>0x19</code> for homomorphic addition: <code>Enc(balance_bob) + Enc(100)</code></p></li><li><p>Store updated encrypted balance: <code>SSTORE(balances[0xBob], newEncryptedBalance)</code></p></li></ul></li></ol><p><strong>Critical point</strong>: The sequencer never decrypts these values. It's performing elliptic curve arithmetic on encrypted points. The actual amounts remain confidential throughout execution.</p><hr><h2 id="h-step-3-tee-attestation-for-withdrawals-when-required" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Step 3: TEE Attestation for Withdrawals (When Required)</h2><p>Now suppose Bob wants to withdraw his private balance to public state or a DEX. The contract needs to verify he actually has 100 USDC before allowing the withdrawal:</p><pre data-type="codeBlock" text="function withdrawToPublic(uint256 requestedAmount) external {
    // Get encrypted balance from storage
    EncryptedBalance memory encBal = balances[msg.sender];
    
    // Call TEE to decrypt and attest
    (uint256 actualBalance, bytes memory attestation) = 
        decryptTEE(encBal, userPublicKeys[msg.sender]);
    
    // Verify the attestation came from genuine TEE
    require(
        verifyTEEAttestation(actualBalance, attestation, block.timestamp),
        &quot;Invalid TEE attestation&quot;
    );
    
    // Check sufficient balance
    require(actualBalance &gt;= requestedAmount, &quot;Insufficient balance&quot;);
    
    // Update encrypted private balance (homomorphic subtraction)
    balances[msg.sender] = encBal.subtract(requestedAmount);
    
    // Credit public ERC-20 balance
    publicBalances[msg.sender] += requestedAmount;
}
"><code><span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">withdrawToPublic</span>(<span class="hljs-params"><span class="hljs-keyword">uint256</span> requestedAmount</span>) <span class="hljs-title"><span class="hljs-keyword">external</span></span> </span>{
    <span class="hljs-comment">// Get encrypted balance from storage</span>
    EncryptedBalance <span class="hljs-keyword">memory</span> encBal <span class="hljs-operator">=</span> balances[<span class="hljs-built_in">msg</span>.<span class="hljs-built_in">sender</span>];
    
    <span class="hljs-comment">// Call TEE to decrypt and attest</span>
    (<span class="hljs-keyword">uint256</span> actualBalance, <span class="hljs-keyword">bytes</span> <span class="hljs-keyword">memory</span> attestation) <span class="hljs-operator">=</span> 
        decryptTEE(encBal, userPublicKeys[<span class="hljs-built_in">msg</span>.<span class="hljs-built_in">sender</span>]);
    
    <span class="hljs-comment">// Verify the attestation came from genuine TEE</span>
    <span class="hljs-built_in">require</span>(
        verifyTEEAttestation(actualBalance, attestation, <span class="hljs-built_in">block</span>.<span class="hljs-built_in">timestamp</span>),
        <span class="hljs-string">"Invalid TEE attestation"</span>
    );
    
    <span class="hljs-comment">// Check sufficient balance</span>
    <span class="hljs-built_in">require</span>(actualBalance <span class="hljs-operator">&gt;</span><span class="hljs-operator">=</span> requestedAmount, <span class="hljs-string">"Insufficient balance"</span>);
    
    <span class="hljs-comment">// Update encrypted private balance (homomorphic subtraction)</span>
    balances[<span class="hljs-built_in">msg</span>.<span class="hljs-built_in">sender</span>] <span class="hljs-operator">=</span> encBal.subtract(requestedAmount);
    
    <span class="hljs-comment">// Credit public ERC-20 balance</span>
    publicBalances[<span class="hljs-built_in">msg</span>.<span class="hljs-built_in">sender</span>] <span class="hljs-operator">+</span><span class="hljs-operator">=</span> requestedAmount;
}
</code></pre><p>The TEE attestation proves Bob has sufficient balance without revealing his total holdings to the public chain state.</p><hr><h2 id="h-balance-queries-private-vs-public" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Balance Queries: Private vs Public</h2><p>Users can query balances through two paths depending on their privacy needs:</p><h3 id="h-private-balance-query" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Private Balance Query</h3><pre data-type="codeBlock" text="function getPrivateBalance() external view returns (uint256) {
    EncryptedBalance memory encBal = balances[msg.sender];
    
    // TEE decrypts and attests
    (uint256 balance, bytes memory attestation) = 
        decryptTEE(encBal, userPublicKeys[msg.sender]);
    
    // Verify attestation
    require(verifyTEEAttestation(balance, attestation, block.timestamp));
    
    return balance;
}
"><code><span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">getPrivateBalance</span>(<span class="hljs-params"></span>) <span class="hljs-title"><span class="hljs-keyword">external</span></span> <span class="hljs-title"><span class="hljs-keyword">view</span></span> <span class="hljs-title"><span class="hljs-keyword">returns</span></span> (<span class="hljs-params"><span class="hljs-keyword">uint256</span></span>) </span>{
    EncryptedBalance <span class="hljs-keyword">memory</span> encBal <span class="hljs-operator">=</span> balances[<span class="hljs-built_in">msg</span>.<span class="hljs-built_in">sender</span>];
    
    <span class="hljs-comment">// TEE decrypts and attests</span>
    (<span class="hljs-keyword">uint256</span> balance, <span class="hljs-keyword">bytes</span> <span class="hljs-keyword">memory</span> attestation) <span class="hljs-operator">=</span> 
        decryptTEE(encBal, userPublicKeys[<span class="hljs-built_in">msg</span>.<span class="hljs-built_in">sender</span>]);
    
    <span class="hljs-comment">// Verify attestation</span>
    <span class="hljs-built_in">require</span>(verifyTEEAttestation(balance, attestation, <span class="hljs-built_in">block</span>.<span class="hljs-built_in">timestamp</span>));
    
    <span class="hljs-keyword">return</span> balance;
}
</code></pre><p>This reveals the balance only to the querying user, with cryptographic proof of correctness via TEE attestation.</p><h3 id="h-public-balance-query" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Public Balance Query</h3><pre data-type="codeBlock" text="function balanceOf(address account) external view returns (uint256) {
    return publicBalances[account];  // Standard ERC-20
}
"><code><span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">balanceOf</span>(<span class="hljs-params"><span class="hljs-keyword">address</span> account</span>) <span class="hljs-title"><span class="hljs-keyword">external</span></span> <span class="hljs-title"><span class="hljs-keyword">view</span></span> <span class="hljs-title"><span class="hljs-keyword">returns</span></span> (<span class="hljs-params"><span class="hljs-keyword">uint256</span></span>) </span>{
    <span class="hljs-keyword">return</span> publicBalances[account];  <span class="hljs-comment">// Standard ERC-20</span>
}
</code></pre><p>Standard transparent balance—fully composable with existing DeFi protocols.</p><hr><h2 id="h-compliance-and-regulatory-features" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Compliance and Regulatory Features</h2><p>Privacy doesn't mean lawlessness. Halo includes built-in compliance mechanisms:</p><h3 id="h-tee-selective-disclosure" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">TEE Selective Disclosure</h3><p>The TEE can decrypt specific encrypted balances under authorized conditions (e.g., court order, regulatory audit). When this occurs:</p><ol><li><p>Authority provides signed authorization to TEE</p></li><li><p>TEE validates authorization signature against pre-configured compliance keys</p></li><li><p>TEE decrypts requested balance and generates audit log</p></li><li><p>Audit log is cryptographically attested and timestamped</p></li></ol><p>This creates an <strong>auditable trail</strong> of all compliance disclosures—who requested what, when, and under what authority.</p><h3 id="h-0xpredicate-protocol-level-rules" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">0xPredicate Protocol-Level Rules</h3><p>Smart contracts can enforce compliance rules directly:</p><pre data-type="codeBlock" text="// Example: Maximum daily transfer limit
mapping(address =&gt; uint256) public dailyTransferVolume;
uint256 constant MAX_DAILY_VOLUME = 10000e6;  // 10k USDC

function transferPrivate(address to, EncryptedAmount memory amount) external {
    // Decrypt amount using TEE for compliance check
    (uint256 decryptedAmount, ) = decryptTEE(amount, msg.sender);
    
    // Enforce daily limit
    dailyTransferVolume[msg.sender] += decryptedAmount;
    require(
        dailyTransferVolume[msg.sender] &lt;= MAX_DAILY_VOLUME,
        &quot;Daily limit exceeded&quot;
    );
    
    // Proceed with private transfer...
}
"><code><span class="hljs-comment">// Example: Maximum daily transfer limit</span>
<span class="hljs-keyword">mapping</span>(<span class="hljs-keyword">address</span> <span class="hljs-operator">=</span><span class="hljs-operator">&gt;</span> <span class="hljs-keyword">uint256</span>) <span class="hljs-keyword">public</span> dailyTransferVolume;
<span class="hljs-keyword">uint256</span> <span class="hljs-keyword">constant</span> MAX_DAILY_VOLUME <span class="hljs-operator">=</span> <span class="hljs-number">10000e6</span>;  <span class="hljs-comment">// 10k USDC</span>

<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">transferPrivate</span>(<span class="hljs-params"><span class="hljs-keyword">address</span> to, EncryptedAmount <span class="hljs-keyword">memory</span> amount</span>) <span class="hljs-title"><span class="hljs-keyword">external</span></span> </span>{
    <span class="hljs-comment">// Decrypt amount using TEE for compliance check</span>
    (<span class="hljs-keyword">uint256</span> decryptedAmount, ) <span class="hljs-operator">=</span> decryptTEE(amount, <span class="hljs-built_in">msg</span>.<span class="hljs-built_in">sender</span>);
    
    <span class="hljs-comment">// Enforce daily limit</span>
    dailyTransferVolume[<span class="hljs-built_in">msg</span>.<span class="hljs-built_in">sender</span>] <span class="hljs-operator">+</span><span class="hljs-operator">=</span> decryptedAmount;
    <span class="hljs-built_in">require</span>(
        dailyTransferVolume[<span class="hljs-built_in">msg</span>.<span class="hljs-built_in">sender</span>] <span class="hljs-operator">&lt;</span><span class="hljs-operator">=</span> MAX_DAILY_VOLUME,
        <span class="hljs-string">"Daily limit exceeded"</span>
    );
    
    <span class="hljs-comment">// Proceed with private transfer...</span>
}
</code></pre><p>These predicates run at the protocol level &amp; no way to bypass them without forking the chain.</p><hr><h2 id="h-why-this-architecture-works" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Why This Architecture Works</h2><p>Let me tie together why each design decision matters:</p><p><strong>1. No UTXO Complexity</strong> By storing encrypted balances in standard EVM storage, we avoid the massive complexity of UTXO state management—no Merkle trees to sync, no nullifier sets to maintain, no spent output tracking. It's just storage slots.</p><p><strong>2. Instant Homomorphic Transfers</strong> Private transfers execute in milliseconds using precompiled elliptic curve operations. No MPC coordination, no complex circuit proving, no expensive zk-SNARK generation on the critical path.</p><p><strong>3. Full EVM Composability</strong> Since encrypted balances are accessible via precompiles, any smart contract can read and manipulate them. A DEX can check private balances, a lending protocol can verify collateral, a payment processor can confirm funds—all while maintaining privacy.</p><p><strong>4. Standard Wallet Compatibility</strong> Users sign standard EIP-1559 transactions. MetaMask, Rabby, Frame—they all work out of the box. No browser extensions, no custom signing flows, no new key management.</p><p><strong>5. Regulatory Viability</strong> Built-in compliance through TEE selective disclosure and protocol-level predicates means Halo can serve regulated institutions (neobanks, payment processors) without sacrificing privacy for everyday users.</p>]]></content:encoded>
            <author>madhavg@newsletter.paragraph.com (Madhav Goyal)</author>
            <enclosure url="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/368cdec48420ba53038f3b3f4eac9f60aaebcb39ec5c460a28eb9cb6f8b5dc8d.jpg" length="0" type="image/jpg"/>
        </item>
        <item>
            <title><![CDATA[Ape tax]]></title>
            <link>https://paragraph.com/@madhavg/ape-tax</link>
            <guid>WWty0lnNxH45Bcp8zQDm</guid>
            <pubDate>Sat, 07 Jun 2025 10:51:22 GMT</pubDate>
            <description><![CDATA[For the longest time, I didn’t view pump.fun in any different way than how I thought about most of the meme ecosystem. It was just a new interesting way to bootstrap liquidity for memetics, but as it went on to become the biggest onchain revenue and crime avenue, my thoughts remained mixed and convoluted. Kaito came to ct late last year, I had seen their website before but the ux was clunky and unimpressive so I never gave a second thought but kaito was bigger than a twitter engagement dashbo...]]></description>
            <content:encoded><![CDATA[<p>For the longest time, I didn’t view pump.fun in any different way than how I thought about most of the meme ecosystem. It was just a new interesting way to bootstrap liquidity for memetics, but as it went on to become the biggest onchain revenue and crime avenue, my thoughts remained mixed and convoluted.</p><p>Kaito came to ct late last year, I had seen their website before but the ux was clunky and unimpressive so I never gave a second thought but kaito was bigger than a twitter engagement dashboard, it introduced a new incentive structure into the semi monetised twitter where largely the value had remained in closed KOL deals. CT wrote threads and airdrop guides and shilled their bags. There were also Kol deals from big accounts to promote specific projects, but that was it. There were bad parts about ct, but they were largely isolated, Kaito came and democratised the financial incentives on Twitter, like when layerzero launched a paid bridge for sepolia.</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://x.com/gregthegreek/status/1628062799971897345">https://x.com/gregthegreek/status/1628062799971897345</a></p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://x.com/gregthegreek/status/1628179157510422529">It was sharply criticised since testnet</a> tokens were not supposed to have monetary value, creating a market for them introduced the wrong incentives in the ecosystem while a big argument in favour was it actually allowed interested parties to obtain sepoliaETH a lot easier.</p><p>Kaito&apos;s model was simple: users earn yaps for tweeting about specific content ie new projects or about their campaigns, and projects could incentivize users through this system. However, as ct went through cycles, it lost its charm and transformed into what Cobie called a &quot;pigeon farm.&quot;</p><blockquote><p>&quot;The desperation, lack of relevance or invitation, and generally low quality and futility of the perpetual attempts... just like a pigeon trying to get your food.&quot;</p></blockquote><p>Now everyone can tweet and shill projects for the direct or future promise of monetary incentives, the more you tweet more likely it is to get you higher on the leaderboard, no matter what quality you tweet. Yaps are the only parameter. Kaito and pumpfun allowed a bigger part of the ct to become pigeons since thats what their incentive was -&gt; either a pump on their low mcap shitcoin they launched while you were refreshing twitter or the yap feed they will be on for a pre tge project to get airdrop allocation.</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://infinex.xyz/yaprun">Infinex announced one of these &apos;yap to earn&apos; campaigns</a> with incentives starting from May 15th. This is a rough graph showing how that led to a sharp increase in the number of yaps.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/9c7727d5d601df828aa365094f5a8c55661413a5e273c80b069a5f9365fbf06f.png" alt="Twitter mentions" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">Twitter mentions</figcaption></figure><p><br>This might be a good enough metric, but paying 6-7 fig in rewards for twitter mentions probably doesnt feel like the most productive decision.</p><p>One of the more interesting things that happened while I was writing was the launch of another project called Loudio, also based on “yaps.” Loudio’s website read <em>“an experiment that explores perpetual incentives for social engagement. The core idea: what happens when you reward people for talking about a coin, forever?”</em></p><p>It was a perfect case study in how unreliable and easily manipulated ct is. The ecosystem, increasingly PvP and attention-driven, can be swayed overnight by a new shiny narrative. What was once signal quickly becomes noise as the incentives shift. More than an experiment, it was a mirror reflecting how cheap attention has become and how quickly the entire conversation can be redirected by clever incentive design which is basically free money.</p><h2 id="h-musings" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Musings</h2><p>The core argument remains unchanged: crypto itself isn&apos;t inherently bad. It&apos;s a credibly neutral technology → one that can just as easily be used to hedge against inflation as it can be to buy drugs. The same logic somewhat applies to platforms like Pump.fun and Kaito. While they are for-profit companies, they were created to fill real market gaps, as any rational actor would do. What they evolved into may differ from their original intent, but that doesn&apos;t make their existence inherently negative. The democratization of coin launches or tracking Twitter contributions isn&apos;t inherently bad; the problem lies in how these tools fuel a short-term mindset and create bad incentives for most crypto participants.<br><br>I think this trend will only intensify as crypto Twitter becomes increasingly PvP, with diminishing returns and a growing hunger for the next 100x or major airdrop. Every time a new shiny object hits the scene whether it’s Blast, Friend.tech, Farcaster, Pump.fun, or Believe.app the cycle of apes aping continues for the slightest of dopamine hits.</p><blockquote><p>Monkey business pays well in Ape Season, when even the lowest IQ can make the highest percent gains. Gamified shitcoins and anonymous yield farms are good food for the modern trader who has given in to his primal instincts.</p></blockquote><p>This is one of my favourite quotes, capturing the timeless crypto twitter in APE TAX by <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="">rekt.news</a> .</p><h2 id="h-closing" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Closing</h2><p>These just a bunch of convoluted thoughts I have been pondering over a while, I do not claim any moral high ground but just sharing my opinions. <br>Always open to chat and share ideas &amp; learn from everyone, feel free to hit me up on twitter @Madhav_goyal_.</p>]]></content:encoded>
            <author>madhavg@newsletter.paragraph.com (Madhav Goyal)</author>
        </item>
        <item>
            <title><![CDATA[Musings on Price Discovery]]></title>
            <link>https://paragraph.com/@madhavg/musings-on-price-discovery</link>
            <guid>WiT3HZYLrgYpGoqkOuxY</guid>
            <pubDate>Wed, 05 Mar 2025 10:11:26 GMT</pubDate>
            <description><![CDATA[Musings on Price discoveryWith a fading bull run comes the pressure to do a token generation event at high valuations because otherwise if you are a VC backed project with 8 figs in funding, you are cooked without a binance listing since you definitely know your tech is only valued at the number of CEX listings and shady market makers you can get for the launch. Jokes and criticism aside, I have been diving into the price discovery for a mix of work and my own interests in the past few months...]]></description>
            <content:encoded><![CDATA[<h1 id="h-musings-on-price-discovery" class="text-4xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Musings on Price discovery</h1><p>With a fading bull run comes the pressure to do a token generation event at high valuations because otherwise if you are a VC backed project with 8 figs in funding, you are cooked without a binance listing since you definitely know your tech is only valued at the number of CEX listings and shady market makers you can get for the launch. Jokes and criticism aside, I have been diving into the price discovery for a mix of work and my own interests in the past few months and have been observing trends and advising teams on what might be a better way to get your token into the world.</p><hr><p>Price discovery is the process of price determination based on the interactions of counterparties. In Crypto, price discovery is mainly the idea of having a distribution channel for your token and having counterparties trade and determine the market value of those tokens.</p><p>Token is one of the core pillars that defines any project in crypto that launches it, its either an exit for all the VCs you raised from or a way to reward the community who made your ecosystem what it is today,y and arguably some teams can pull off both at the same time which is no small feat.</p><p>My focus for now is on price discovery and how the market comes and interacts with your token/equity post-launch, I am in no sense an expert or even a respect person in this field but this post is totally my own observations and musings.</p><p>I will broadly divide the post into CEX/DEX , Airdrops, Liquidity &amp; Market Makers</p><hr><h2 id="h-cex-and-dex-listings" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">CEX &amp; DEX Listings</h2><p>Exchanges are the distribution channels for the products ie tokens in crypto, where your goal as a good founder is to get the best distribution for your product without paying too much fee or getting ripped off in the process.</p><p>Centralized exchanges are the biggest distribution channels for any type of digital currency or even assets since they can handle users from multiple continents and offer the same products unlike securities exchanges and brokers who are tied to a specific jurisdiction which makes CEXs a highly preferred method for launch but that comes with Caveats. Each exchange has its own listing process and insider deals where Exchanges leverage their channels to extract or find the best deal for themselves from the token listings. In this case, each party has two totally different interest alignment</p><p>Founders -&gt; Token prices pumping is the best KPI</p><p>Exchanges -&gt; More volume = More revenue (token prices are not the direct incentive)</p><p>Definitely if the price goes up people are more likely to trade it more but for the exchanges the idea is to get as much volume as possible</p><p>Decentralised exchanges (DEXs) are the backbone of crypto, serving as one of the biggest use cases for on-chain blockspace. Uniswap alone consistently accounts for 10-20% of Ethereum’s total gas consumption, pretty much the biggest PMF in crypto.Most leading spot DEXs operate on an Automated Market Maker (AMM) model rather than an order book and matching engine. The primary reason is that Ethereum cannot fully support on-chain order books, despite being the largest liquidity hub in crypto. DEXs enable direct on-chain distribution, allowing anyone to participate in DeFi without the need for KYC or paperwork—one of the most unrestricted internet capital market innovations.</p><p>Permissionless access, allows users in restricted regions to trade their tokens freely. Each model has its own pros and cons, but as a founder, balancing on-chain liquidity with centralized exchange (CEX) listings is key. DEXs offer permissionless trading and fee-based incentives, while CEXs provide the best distribution and user traffic for your token. A common trend I’ve noticed is teams that neglect DEX liquidity entirely, funneling all volume into a single CEX they’ve partnered with. This exposes token holders—including community members and stakers—to indirect KYC requirements, as all liquidity exists on a CEX where KYC is mandatory for transactions. While anyone can technically launch AMM pools, retail investors often lack the liquidity to sustain them, leading to price imbalances and arbitrage-driven inefficiencies. Binance remains the biggest name CEX listings, with a listing there seen as the gold standard and a gateway to multi-billion-dollar FDV launches—whether sustainable or not. However, the problem isn’t solely with CEXs; much of the token generation event (TGE) process has become an exit strategy for VCs and teams since the interests are not aligned. Exchanges also require some sort of kickback to either Holder Airdrops or just multi million dollar listing fee. CEX listings are an entirely different world, each with its own complexities and trade-offs but its up to the nature of how a team sees their token.</p><p><strong>One Insight -&gt;</strong></p><p>Rather than seeing your TGE as an exit, it could be the biggest driver of your ecosystem. Ie If all the new L1s moved all their trading on their Native DEXs ie Movement did around half a billion on the first day and so did Bera, <strong>0.25% if the pool fee or trade fee with 500 mil volume you get 1.25 Mil fee literally on the launch day in your ecosystem revenue.</strong> If all the community members could use that airdrop to ie</p><ul><li><p>Either spot trade on the chain</p></li><li><p>Use the token as a collateral to either borrow/lend</p></li><li><p>Use it for Asset-backed perps or as a normal collateral for Perpetual trading?</p><p>They could have generated multi-millions in fee and kick-started their defi ecosystem with a pretty big bang and introduced better mechanisms around that.</p></li></ul><h2 id="h-premarket-price-discovery" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">PreMarket Price discovery</h2><p>Pre TGE discovery is one of the more interesting obscure parts, When teams raise at their decided valuations it unlocks the price discovery and speculation of that project.</p><ul><li><p>Private Raise → Normal Private funding rounds where a set of accredited investors and funds invest into projects, mostly that are yet to be open to public markets.</p></li><li><p>Public raise → ICO type public sales where accredited and nonaccredited investors are able to invest in some sort of direct token sale. There are different platforms that provide different levels of tweaking here ie Echo allows you to raise from KYCed users and get more distributed participants in the round at an early stage. Coinlist is for later stage raise and closer to the TGE. One big idea of echo is that retail can invest at the same valuations as the Big name investors .</p></li></ul><p>The normal flow in crypto has been raise 1-2 rounds from Private investors and Do a TGE or offer a public sale months before the token launches which allows a more organic price discovery since retail interest gives you a rough idea on what would happen on TGE.</p><p>I have been thinking and what I have realized would be a great approach is Having a Private and Public sale with a Dutch Auction Mechanism where the price drops or goes up based on the demand which allows for organic retail interest to be reflected in the price.</p><ul><li><p>Allowing More OTC rather than locked deals so folks who wanna exit can whenever they feel rather than are bound by contracts.</p></li><li><p>having one more public round or Coinlist before TGE so the project can see the retail inflows and do a TGE at the right price rather than having a multi-billion dollar FDV without low volumes at the start which would lead to worse token sustainability.</p></li></ul><p>One interesting scenario is Teams selling Foundation token allocation right before the unlock or just selling the airdropped tokens with full unlock with some arbitrary criteria, Quite a few big-name teams have done this in the past few months where they raise a 9 fig VC round post TGE and call it a strategic raise where a big part of the team also sells their token in the deal before the unlock so they do not have to deal with regulatory and sell pressure etc.</p><hr><h2 id="h-jupiter" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Jupiter</h2><p>JUP team had the most interesting Token launches where rather than working on CEX listings, they used their own product Meteora to bootstrap the initial liquidity and price discovery for the Token.</p><ul><li><p>A single-sided LP pool containing 5% of all the liquidity</p></li><li><p>As users start trading the LP pool starts converting a majority of the token into stables for initial price discovery and more organic discovery</p></li><li><p>The team Removes Liquidity after 5-7 days and moves it into the DAO treasury with a 75% fee split set aside for the DAO.</p></li></ul><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://x.com/JupiterExchange/status/1755497196928094667">https://x.com/JupiterExchange/status/1755497196928094667</a></p><p>Since there were no early rounds either private or public, all the price discovery took place onchain. Team removed the the usdc liquidity which was a pretty good cashout.</p><hr><h2 id="h-liquidity" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Liquidity</h2><p>In crypto, projects die and live by liquidity. Thicker orderbooks and fat pools are something every degen loves but for every TGE a team has to go through hoops and loops to make sure there is sufficient float or give the illusion of sufficient float to show token volumes etc. Partnering with market makers is pretty common for liquidity but more and more predatory characteristics can be found in the market patterns where Teams sell a huge sum to Market makers in the form of liquidity provisions and form a call options where either Market Makers can sell the tokens back at a fixed price or just hedge on perp Markets.</p><p>This is a common pattern in a lot of recent TGEs</p><ul><li><p>After 1-2 days when most of the retail has sold their airdrop</p></li><li><p>Funding rates start to go negative</p></li><li><p>Price appreciates around 2-3x in the next coming days with funding rates averaging around &gt;2000%. This gives a good picture of where Market Makers are trying to hedge their positions.</p></li></ul><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/11075615f5d1e7b45d1ec1ae7844b022b14d2a1762729fcb15e38124a8ee1957.png" alt="Coinglass : IP wrighter Funding rate" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">Coinglass : IP wrighter Funding rate</figcaption></figure><p>But regardless having a good Market Maker strategy to allow for sufficient price discovery and movement remains key, its varies how different teams try to find the best path towards that. I like Berachains approach quite a bit to bootstrap the initial liquidity. Berachain launched a clear defi incentive program where users were rewarded for depositing into locked vaults what would be bridged onto Berachain upon the mainnet directly into specific applications that were whitelisted from the Berachain Broposal.</p><ul><li><p>They had a clear net allocation for incentives set out</p></li><li><p>Each vault had its own risk number where lending markets had the least AMMs/loopers got more yield but were also more risky</p></li></ul><p>!Screenshot 2025-03-04 at 4.58.27 PM.png</p><h2 id="h-remarks-and-conclusion" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Remarks &amp; Conclusion</h2><p>This post was mainly my observations and musings on the past few months of the fiasco of Token launches and dumps, I might dive deeper and write another post. <br><br>As said earlier I am no expert and this is just a braindum</p>]]></content:encoded>
            <author>madhavg@newsletter.paragraph.com (Madhav Goyal)</author>
        </item>
        <item>
            <title><![CDATA[LRTs beyond Airdrop Meta]]></title>
            <link>https://paragraph.com/@madhavg/lrts-beyond-airdrop-meta</link>
            <guid>ZVy2D218PvxwtuescHgo</guid>
            <pubDate>Wed, 07 Aug 2024 16:57:54 GMT</pubDate>
            <description><![CDATA[Tldr ->LSTs are delegation vouchers that show your participation the consensus of the network which has and these fungible assets have emerged as the biggest defi protocol to exist on any single VM with more than 35 Billion locked on eth and nearly 70% of total solana in circulation staked with liquid delegation voucher protocols. Markets price LST based on $$lst_value ∝ native_yield+ native_slashing_risk$$dune dashboard by lidoWith the emergence of restaking and economic security as a meme, ...]]></description>
            <content:encoded><![CDATA[<h3 id="h-tldr-greater" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Tldr -&gt;</h3><p>LSTs are delegation vouchers that show your participation the consensus of the network which has and these fungible assets have emerged as the biggest defi protocol to exist on any single VM with more than 35 Billion locked on eth and nearly 70% of total solana in circulation staked with liquid delegation voucher protocols. Markets price LST based on</p><p>$$lst_value ∝ native_yield+ native_slashing_risk$$</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/4b86ee95353cdb1d770c9d93cb14c14472757e71839fa2859af483967d72fd65.png" alt="dune dashboard by lido" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">dune dashboard by lido</figcaption></figure><p>With the emergence of restaking and economic security as a meme, a new delegation voucher emerged called Liquid restaking token where a protocol would take the native eth or lst and delegate it to specified operators or members of the restaking protocol to get yield for the economic security it provides. ex Renzo, Puffer So LRT issuers are not just the asset issuing layer but also become the risk managers by deciding which operators they stake with the dapps they secure</p><p>$$LRT_value ∝ AVS_yield + restaking_slashing + lst_value$$</p><p>Now the risk causes the price to be at a discount from native assets.</p><hr><h1 id="h-user-risks" class="text-4xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">User Risks</h1><p>LRTs have ballooned to around 13 Billion in TVL which shows the market apetite but there are around 10 different LRT protocols.</p><p>Now there are two different approaches -&gt;</p><ol><li><p><strong>AAVE approach</strong> -&gt;AAVE manages the risk of all the positions on its platform and in the situation of liquidiation allows users to liquidate position to keep of the bad debt from accuring the network where the losses are socialized. Mainly all the LRT protocols work the same way where they manage their own risk and try to keep bad debt of the balance sheet.</p></li></ol><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/8f2e58e86fb658b544501cf569ae73ef4c48f40b2f6324fdff7a9b81f4fad9f0.png" alt="defillama-&gt; eigen tvl" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">defillama-&gt; eigen tvl</figcaption></figure><p><strong>2. Morpho Way</strong> -&gt; Allow any risk curator to use the framework, build their own vaults, and manage the risk like Mellow Finance did.</p><p>This introduces few new risks and options</p><ul><li><p>Restaking protocols and strategy managers want to secure blue chip AVS&apos;s who are less likely to get slashes This in turn leads to stake accumulation to very few projects</p><ul><li><p>As stakes get accumulated, the same AVS can only provide so much yield and which leads to lower yield in turn maybe outflows.</p><ul><li><p>Only secure the BLUE chip applications and stake/partner with good AVS to stake with them.</p></li><li><p>Launch their own node operator which is a good strategy, where lets say someone like figment has a big chunk of restaked eth and can launch their operator securing their own portfolio companies.</p></li></ul></li></ul></li><li><p><strong>Liquidity</strong> -&gt; Post Renzo depeg we realized no matter what liquidity is the king but as more teams launch LRTs and form different delegation vouchers on top of restaking layers the fragmentation and arbitrage will get bigger. - One of the ways to solve this is by building a liquidity layer</p></li><li><p><strong>Fungibility</strong> -&gt;The trend of bridging Liquid Restaking Tokens (LRTs) to Layer 2 networks (L2s) has gained popularity as a strategy to boost network activity. However, this approach has become somewhat formulaic, with many growth teams launching bridge-to-earn campaigns in anticipation of future airdrops. While these initiatives drive short-term engagement, they often lead to fragmented liquidity across multiple LRTs, each with its own risk profile and separate liquidity pool.One of the primary motivations for users to seek liquid delegation vouchers is to utilize them as collateral in DeFi applications. For instance, stETH has emerged as a leading DeFi collateral asset. However, when LRTs are scattered across various L2s with unbalanced pools and limited DeFi utility, they become nearly as illiquid as NFTs.</p><p>Although bridging LRTs to different rollups has been an effective tactic for earning points, it significantly impairs overall liquidity. Lending markets on these sub-ecosystems struggle to support numerous delegation assets, resulting in users holding essentially useless LRTs across multiple rollups.This fragmentation ultimately undermines the core value proposition of LRTs, leaving users with tokens that lack meaningful utility or liquidity across disparate networks.</p></li></ul><h2 id="h-infinite-lrt" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Infinite LRT</h2><p>To solve all this a simple structure could be established</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/aca8c6c192ec7a4e1fbc45eb4ccde5e77eac96c568e4292559916c44787bd6ed.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><ul><li><p>User Deposits asset into different vaults, every vault is a different risk/strategy manager.</p></li><li><p>If they give LRT, the risk can be redistributed according to strategy manager</p></li><li><p>The asset is sent into a liquidity pool which can be used for borrowing and lending + becomes a buffer AMM for asset conversion.</p></li><li><p>Users get yield for the AMM and a fungible asset across DeFi.</p></li></ul><p>This prevents risk of liquidations and saves from depeg since the liqETh is a debt asset where native eth is the collateral not in USD terms but in native eth terms.</p>]]></content:encoded>
            <author>madhavg@newsletter.paragraph.com (Madhav Goyal)</author>
        </item>
        <item>
            <title><![CDATA[Tales of composability]]></title>
            <link>https://paragraph.com/@madhavg/tales-of-composability</link>
            <guid>cCmloYBxTLRwRTHpVsei</guid>
            <pubDate>Wed, 22 Nov 2023 13:58:47 GMT</pubDate>
            <description><![CDATA[You can get away through any protocol conversation in crypto by saying "But its not composable bro" like you did when you just added zk to the bio or name of your project at the start of 2023 but like everything interesting but overhyped Composability is just known and there is a chasm of difference between knowing and understanding something. The Focus of this post is to give a general sense of what We mean and don&apos;t mean by composability and the landscape of the myth of "Cross-chain co...]]></description>
            <content:encoded><![CDATA[<p>You can get away through any protocol conversation in crypto by saying &quot;But its not composable bro&quot; like you did when you just added zk to the bio or name of your project at the start of 2023 but like everything interesting but overhyped Composability is just known and there is a chasm of difference between knowing and understanding something.</p><p>The Focus of this post is to give a general sense of what We mean and don&apos;t mean by composability and the landscape of the myth of &quot;Cross-chain composability&quot;. Headliners of todays post will be -&gt;</p><ul><li><p><strong>WAT is composability? and is interoperability the same thing?</strong></p></li><li><p><strong>Myth or Truth?</strong></p></li><li><p><strong>Are cross chains apps truly composable?</strong></p></li><li><p><strong>Endgame?</strong></p></li></ul><h2 id="h-defining-composability" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Defining Composability</h2><p>At its core, composability involves the ability to seamlessly interact with various programs and systems within an environment, eliminating the need to start from scratch for every component. A prime illustration of composability is the practice of cross-program invocations, enabling the calling of functions or importing actions from other smart contracts. This approach spares you the effort of building everything from the ground up and reinventing the wheel. It&apos;s a key factor behind the efficiency of the crypto space. For instance, it&apos;s the reason why every NFT creator doesn&apos;t have to define token standards from scratch, and why you can place orders on openbook through any DEX because their functions are public and can be accessed by agents.</p><p><strong>Why Does it matter?</strong> The idea of having a composable developer environment is build Lego-like developer tools and infra that can built upon for a wide range of applications. But it also is important to allow developers the flexibility to choose whether what they build should be open for anyone to interact with like some DAO Governance contracts or being able to withdraw funds from treasury might be better of whitelisted for specific wallets which is where you get the idea of <code>msg.sender and. let context = accounts[0]</code> in case of solana.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/9e94169e2bd2ad817b6f7b66fd8c4ff7b26ecf98ccc813e7622b632c71acc8ac.png" alt="the dopest meme supping up composability" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">the dopest meme supping up composability</figcaption></figure><h2 id="h-what-is-interoperability-then" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">What is Interoperability then?</h2><p>Defining interoperability in one word would be compatibility between programs and the state, Smart contracts need to have access to the same state so that it produces a predictable outcome like a general Turing machine.To get a repeatable output from a program we need to ensure that there are no changes in the data the program has access to and the environment it runs which in case of blockchains is the execution system aka virtual machine like CosmoWASM or EVM. Blockchain interoperability in the EVM ecosystem is focused on a big part on the opcode and bytecode compatibility as many teams are building ZkEvms. Every zkevm has its own level of compatibility and there is a caveat.</p><p>The more you want it to be aligned with evm and compatible more will the zk circuits and proof generation be bigger, The more custom zk Virtual machine faster it is but adds a lot of developer friction. So everyone is weighing on which side they going, Vitalik <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://vitalik.ca/general/2022/08/04/zkevm.html">categorized them on a scale in his blogpost.</a></p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/fe65068c222b1ab930fb5512cb8d659afb5170740a6e2fb3ebe84eb1e9f132c6.png" alt="Spectrum of zkevms" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">Spectrum of zkevms</figcaption></figure><h2 id="h-composability-myth-or-truth" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Composability: Myth or truth?</h2><p>As of right now, A &quot;Multichain Dapp&quot; is nothing but taking the evm code and deploying the dapp on every single evm clone and L2 has been the norm so far when folks talk about their dapp code being Interoperable, then degens who were earning yield on the mainnet bridged the same assets on an L2 and kept doing what they were doing to pay less fee on their eth interactions. This approach to some level has worked well for a big part of the ecosystem but there are some blind spots everyone missed when they write a DAO governance proposal to take their DeFi app &quot;Multichain&quot;.</p><p><strong>Separate Hub Model→ AAVE</strong> is deployed on 9 different protocols, with very little difference in architecture other a big chunk of them being rollups with just cheaper gas costa and off chain computation. 30% of the Total Value locked lies in different EVM forks and L2s while them having pretty much the same architecture and no big improvements other than cheaper blockspace. <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://vitalik.ca/images/zkevm/chart.png">Looking at one of the</a> <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://snapshot.org/#/aave.eth/proposal/0x8fd34012029bec536f779b7bf46813beb57f42705b24acaf239e42353ddf7b8c">dao proposals</a> for AAVE to deploy on zkEVM l2 and the biggest motivation is to capture the market early on while for a big part, its the same group of people using both of the chains. But they also built Portals, a protocol on top of AAVE that allows positions and tokens to be migrated across aave supported chains. This functionality is primarily utilized by bridging protocols, and there are no direct methods for end-users to leverage <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://docs.aave.com/developers/whats-new/portal">Portals</a> within the core protocol.</p><blockquote><p>Aave protocol V3 allows <strong><em>approved bridges</em></strong> to burn <em>aTokens</em> on the source network while instantly minting them on the destination network. The underlying assets can then be supplied to Aave on the destination network, in a deferred manner, by passing it to the pool after it has been moved through a bridge.</p></blockquote><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://governance.aave.com/t/arc-whitelist-debridge-for-portals-v3/8259">Debridge X AAVE</a> → This integration allowed folks to tap directly into the Portals V3 and access the liquidity for cross-chain swaps without the need to introduce new liquidity vaults and additional security overhead.</p><p><strong>Uniswap</strong> is deployed on over 10 chains with a total TVL of 4 Billion of which around 500 Million lies on Polygon and Arbitrum but produces more than 25% of the protocol fee. LPs who deposit their assets on L1 for yield even though constituting a big part of the volume only reap less percentage of yield while paying extra gas.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/86f6859f276d768c99dfffb56d7e400314bc06e24877a45de7c7175de72fd001.png" alt="defillama" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">defillama</figcaption></figure><ul><li><p>I have huge respect for AAVE and what the team has done but I dont really understand how deploying the same dapp on diff chains is adding more value when a big part of the users end up bridging assets to actually use the same thing on a different chain.</p></li></ul><p><strong>Hub and Spoke Model</strong> <strong>of Governance</strong>→</p><p>A clever design strategy adopted by Uniswap involved leveraging Ethereum as their central voting hub while utilizing cross-chain messaging for deployment and governance. Kinda like a Hub-spoke model, the cross-chain messages validate and send cross chain contract execution logic. They use MMA model where Uniswap uses multiple bridges and relayers to send the result of votes onto another chain where a Uniswap contract aggregates them all and they are voted on again for verification</p><blockquote><p>On the destination chain, MultiBridgeReceiver receives messages from every bridge receiver adapter. Each receiver adapter gets encoded message data from its bridge contracts, and then decode the message and call <code>receiveMessage()</code> of <code>MultiBrideReceiver</code>.</p></blockquote><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/c727bd7a6bd779aedafee46dea0f99c631ede17e524796726e2c5d31f36b7578.png" alt="Uniswap governance" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">Uniswap governance</figcaption></figure><p>Uniswap went a step further by publishing a <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://gov.uniswap.org/t/cross-chain-bridge-assessment-process/20148">comprehensive report</a> in which they categorized various bridges based on their suitability and security for Uniswap governance integration. This is great in a way that allows for the aggregation of power on ethereum . Drawbacks →</p><ul><li><p>If the holders hold most of their assets on a rollup and have staked their governance token in some liquidity pool they won’t be able to take part in governance without occurring some more overhead.</p></li><li><p>Contract Mutability depends on the message passed by bridges and if the bridge is compromised the contract state on the spokes could have exposure</p></li></ul><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/9375eda323fb283df9fb688a9e5ba2a45dddff3c8a708c1d899e7edfe9c57d6b.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><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="">nft://undefined/undefined/undefined?showBuying=true&amp;showMeta=true</a></p><h2 id="h-envisioning-a-different-multichain-model" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Envisioning a different Multichain model</h2><p>To build a truly MultiChain dapp, why not use different chains to leverage their strengths? Rather than deploying the same dapp on different chains what if we truly used the factor of cross chain composability and bridges we could host parts of the dapp on protocols that support it the most and use cross chain messaging to tie it together. Lets take an example</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/0xJim/status/1597319705202946048?ref_src=twsrc%5Etfw%7Ctwcamp%5Etweetembed%7Ctwterm%5E1597319705202946048%7Ctwgr%5E58f801725171624d3ffd6687a2b6ee6b5a0fa295%7Ctwcon%5Es1_&amp;ref_url=https%3A%2F%2Fwww.notion.so%2Fmadhavg%2FTales-of-Composability-e2f6dce63f0947238af0dbebe8cc1e89">https://twitter.com/0xJim/status/1597319705202946048?ref_src=twsrc%5Etfw%7Ctwcamp%5Etweetembed%7Ctwterm%5E1597319705202946048%7Ctwgr%5E58f801725171624d3ffd6687a2b6ee6b5a0fa295%7Ctwcon%5Es1_&amp;ref_url=https%3A%2F%2Fwww.notion.so%2Fmadhavg%2FTales-of-Composability-e2f6dce63f0947238af0dbebe8cc1e89</a></p><p>Ethereum stands out as the central hub of DeFi, primarily due to its liquidity. However, it does come with certain limitations. Most DeFi protocols rely on Oracles to provide price feed updates. These price feeds are crucial for price discovery and determining how users swap, lend, and trade on DEXs. Unfortunately, Ethereum&apos;s price feeds can only update as fast as the blockchain&apos;s block time, which is approximately 12 seconds. Even then, they must navigate the typical transaction pipeline and face challenges related to Maximum Extractable Value (MEV) and the proposer builder separation. This complexity makes it challenging to ensure that prices are always accurate, and in the history of DeFi, stale prices have caused unnecessary liquidations. On the other hand, Solana block time of just 400 milliseconds, and it has native oracles like Pythnet. However, a notable setback occurred with the FTX incident, which significantly reduced liquidity on the network. <br><strong>A cross chain lending protocol:</strong> Users can park collateral on any evm chain and get a loan on nonevm chain and vice versa using a single liquidity layer like a wormhole with single clicks. A separate rollup maintains all the state of the program and registry for address mapping and posts state proofs on the main chain uses cross-chain messaging for liquidation and uses native pyth price feeds in the messages for accurate prices.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/709f14a2a3bb4cdf527a3a5712bd4fce29054642d6aa829e059aa95fe049a0e3.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>A Perpetual Dex takes Collateral on Arbitrum but also takes a position on Aptos which ensures that liquidations happen on accurate prices. As the security profile of assets changes when they move from one chain to another, Leveraging cross-chain messaging rather than bridging allows dapps to offer better security and scalability at the same time.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/21f81c1627d2c5cbcd787e2f3b197a519c0ee55aea4125a55951ed16aa62f519.png" alt="evm defi 101" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">evm defi 101</figcaption></figure><h2 id="h-interoperability-of-assets" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Interoperability of assets</h2><p>One of the most basic mechanisms to bridge assets from one chain to another is lock and release which adds the requirement of liquidity pools on both sides but they introduce one big hurdle → The bridge needs to have liquidity pairs for every single token. Having more liquidity pools adds to the attack vectors and security considerations for every single bridge but this can be taken care of a unified pool where the assets are not swapped based on the xy=k equations where the assets swapped on the right side must maintain an equal value but based on on chain price feeds. The price feeds are used to compare prices and then swapped with the use of a unified pool as an AMM.</p><p>However, a significant challenge when it comes to cross-chain swaps is that, apart from the Ethereum Virtual Machine (EVM), each blockchain has its own unique token standard. In some cases, these token standards may not seamlessly translate from one chain to another. As a result, many bridges resort to minting their own assets on the receiving chain. These assets are often &quot;wrapped&quot; or take the form of derivatives that are backed 1:1 by the bridge&apos;s smart contracts. This approach renders them somewhat non-fungible with one another, as many bridges have their own variations of wrapped tokens. Consequently, users are required to take extra steps, such as wrapping or performing additional swaps, to obtain the native tokens.</p><p>This is where Canonical Bridges emerge as game-changers in terms of user experience. Canonical bridges prioritize the bridging of native tokens without wrapping unless it becomes absolutely necessary. For instance, in cases where Bitcoin cannot support a native bridge due to the absence of smart contract capabilities, individuals can park their tokens through non-native bridges and use them to mint wrapped or threshold Bitcoin. This approach allows users to access and utilize these assets in the realm of DeFi with greater ease and efficiency.</p><h2 id="h-the-endgame" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">The Endgame</h2><p>Till now we have talked about smart contracts being able to call cross-program functions to wrapping of assets but one of the true end games for cross-chain interoperability is not just being able to deploy smart contracts flawlessly but having cross-chain messaging standardisation. At this point every bridge has a different mechanism to transmit messages and usually totally different message formats and relayers to do so which adds to the complexity that if the dapp developers want to switch from one bridge to another they have to totally overhaul their smart contracts and approach to messaging which is not the ideal state.</p><p>One of the examples of this IBC and cosmos, Cosmos has a basic set of defined rules that allows any chain to interact with each other in a pretty standardized way unlocking the best cross-chain model but IBC approach is limited to cosmos at this point as all of the app specific chains follow the same tendermint consensus.</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/auryn_macmillan/status/1389594385604653060">https://twitter.com/auryn_macmillan/status/1389594385604653060</a></p><ol><li><p><strong>Consensus Difference</strong>: While cross-chain messaging for EVM-to-EVM interactions is relatively straightforward due to shared token standards and cryptographic signatures, extending this to EVM-to-non-EVM chains poses a unique paradigm. Token standards often do not have direct equivalents on other chains.</p></li><li><p><strong>Block Difference</strong>: Each blockchain operates with varying confirmation times, making synchronization a challenge when implementing cross-chain messaging.</p></li><li><p><strong>Proof Generation</strong>: Facilitating state transitions and transaction signature validation across chains is a key objective for bridges. However, when dealing with chains of different architectures, this process involves complex security assumptions and considerations.</p></li></ol><h2 id="h-conclusion" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Conclusion</h2><p>Cross chain interoperability has been in talks for more than 2 years but every there keeps popping new designs and security structures because the incentives are super high for anyone who solves this problem but we can always be sure that it is going keep getting more exciting since new bridges like Circle’s cctp and Chainlinks own solutions are coming on mainnets.</p>]]></content:encoded>
            <author>madhavg@newsletter.paragraph.com (Madhav Goyal)</author>
        </item>
        <item>
            <title><![CDATA[How to get tf out(crypto bridge edition) ]]></title>
            <link>https://paragraph.com/@madhavg/how-to-get-tf-out-crypto-bridge-edition</link>
            <guid>l2XTSRoguUk9nvGIM9ml</guid>
            <pubDate>Tue, 17 Oct 2023 07:56:48 GMT</pubDate>
            <description><![CDATA[This post is part #2 of my bridges journey where I take readers through asset security in a cross-chain world and how the tech behind these magical structures aka bridges work. Today we will go down the rabbit hole ofHow to cook your own BridgeIsn&apos;t ZK the solution to everything?How to get your moni back(incase of bridge switch off)How to cook a bridge from scratchWell if you are not a chain maximalist spending all your attention and brain power about why some chain is the best, you must...]]></description>
            <content:encoded><![CDATA[<p>This post is part <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://mirror.xyz/madhavg.eth/bvfitYl9U8-KxfPZXOfjHqoT5et9ocQFSueUtsUg3X0">#2</a> of my bridges journey where I take readers through asset security in a cross-chain world and how the tech behind these magical structures aka bridges work. Today we will go down the rabbit hole of</p><ul><li><p><strong>How to cook your own Bridge</strong></p></li><li><p><strong>Isn&apos;t ZK the solution to everything?</strong></p></li><li><p><strong>How to get your moni back(incase of bridge switch off)</strong></p></li></ul><h2 id="h-how-to-cook-a-bridge-from-scratch" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">How to cook a bridge from scratch</h2><p>Well if you are not a chain maximalist spending all your attention and brain power about why some chain is the best, you must have at one point held different crypto assets and maybe even tried to move the same ones across chains just to f*ck around and find out. Well then you have 2 choices, go the old Centralised exchange way or try the risky and more fun path leading to cross-chain bridges but have you wondered how these</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/798db508f3c817e10eef9644fd6f44d5923e89e667c25c2f36528381dd3eaf9e.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>Hey there, my fellow degens! In today&apos;s enlightening session, we&apos;ll reveal the mind-blowing concoction of ingredients required to whip up a magical bridge that lets us juggle assets and even the wildest of data across the chaotic abyss of chains. Hold onto your socks, folks, because this is about to get as exciting as watching paint dry!</p><p>First, we need to which ingredients we need and why -&gt;</p><ul><li><p><strong>Smart contract on Chain(1)</strong> -&gt; We need a program that can accept proofs or inputs that we provide about the assets we want it to handle and check state changes from others.This could also be used as the burn/mint contract for assets.</p></li><li><p><strong>Smart Contract on Chain(2)</strong> -&gt; A program that works as the endpoint for assets and messages on the chain that we want the message/asset relayed from.</p></li><li><p><strong>Relayer</strong> -&gt; And Finally we need some third party that works as the proxy and communication layer between the two chains as every chain is an isolated virtual computer unable to take data unless it fits its model. At this point, we are able to divide bridges based on what kind of relayer of off chain third party they use.</p></li></ul><p>And Voila! With just three simple Ingredients you have your own whole new bridge. Smart contracts to receive data on both sides and an agent/system that can relay data.</p><p>It&apos;s a bit akin to the art of telegraphy—setting up those essential hooks at both ends and linking them with a communication wire. All you need is a sender, a receiver, and a reliable means of transportation.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/de4bafc7bb42dcd157c22ec4edfd2a540f73771018d8db75e48355642587d464.png" alt="ELI5 of a bridge structure" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">ELI5 of a bridge structure</figcaption></figure><p>Relayer is the part where we differentiate between bridges present right now, every bridge has its own approach to transport the messages.</p><ul><li><p><strong>Trusted Threshold Network</strong> -&gt; A bridge has its node network that works as guardian that verifies the cross-chain message requests and passes it on to sequencers/relayers that then turn it into a transaction interaction with its smart contracts on the other end.</p><p>Wormhole and DeBridge both use this approach where agents that are trusted by the creators are entrusted as node operators and will likely benefit from the network. Though there are plans to turn this into DAO governed bridges.</p></li><li><p><strong>Light Client Bridges</strong> -&gt; Replacing the guardian node network with a light client that only downloads the headers of the block and is able to verify state transitions by relying on the honest majority assumption makes it an LC bridge. The smart contract on the receiving end could have something like <code>`msg.sender</code>` where only the Deployer Light client is able to verify the state transitions or the network of light clients could be rewarded on posting the fastest proof.</p></li></ul><h3 id="h-doesnt-zk-magic-solve-this" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Doesn&apos;t ZK magic solve this?</h3><p><strong>ZK Bridges</strong> -&gt; Using Light clients and an off-chain network that produces a Zero-knowledge proof of the state attestations to feed it to the receiver chain allows for a better security model at the cost of computational overhead. We can delve into more precise details by considering the option to generate a Zero-Knowledge (ZK) proof exclusively for the cross-chain messages directed at the bridge&apos;s smart contracts. Alternatively, we have the choice to create a ZK proof that encompasses the entire state transitions or even an entire block this to some sort can be tackled by using deVirgo.</p><p>But one of the biggest issues remains that ZK curve signatures are supported by the chains, Some chains support ed25519 and other BN254 so developers have to compute zk proofs over different curves in their bridge mechanisms which imposes the complexity of bigger zk circuits, and the required gas costs to verify the signatures/proofs on chains. Some Signatures like Groth16 that have a size of ~130 bytes can take 250k gas units to verify on mainnet while the ones like old zksnarks take 20M gas units which renders it impossible with the compute unit cap leaving the costs aside. One of the ways to solve this is to do recursive proving that allows you to shrink the proof size and you are able to verify even the history of the state.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/45c12945fb8633d7be34c888d0485fbabab584a9403286662275e7066d4242fa.png" alt="Credits: 0xParc " blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">Credits: 0xParc</figcaption></figure><p>One of my open questions was If we introduce more distributed proof generation like with DeVirgo to introduce a better level of decentralization in the bridge but how do we maintain a level of incentive alignment between the actors?</p><p>Currently, <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.gnosis.io/blog/succincts-ethereum-zk-light-client-and-the-road-to-trust-minimzed-bridges-with-hashi">Gnosis Succinct Bridge</a> and LayerZero are using Zk light clients with different architectures.</p><hr><p>One of the most basic mechanisms used by bridge networks to send assets across chains is something called lock and release where you lock your tokens on one chain and release the tokens on the other chain to a desired wallet. Now this data transfer is the component of the bridge but the real assets lay in the escrows/smart contracts on the chains. This is where we have to be careful and choose our bridges wisely, Let differentiate between Custodian and ownership. When someone has full control over some arbitrary assets we say they have the ownership of that asset and Custodianship/escrowing means that the user still owns the asset but has passed the custody to interact and manage assets to a third party. From this a favorable feature we want our bridge to be an escrow bridge that can manage our assets but never has full control over them but become a custodian or guardian for our assets.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/becb983672ab0b8403b24d8405d8cf4bdfa9dea2383b06e218555fc9d76ceb41.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><h2 id="h-what-if-the-bridge-goes-rogue" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">what if the bridge goes rogue?</h2><p>As all bridges necessitate the involvement of trusted third parties to interface with diverse blockchains, there&apos;s an inherent need for alignment of incentives among these parties and the users, even when employing the mystical power of zero-knowledge proofs.Nonetheless, there remains a lurking possibility that these involved parties could misappropriate user funds and attempt to manipulate the network. This risk is notably challenging in threshold networks like Wormhole and Debridge, where a robust network of nodes is established. However, it&apos;s a different story for most L2 bridges, where only a handful of proving nodes exist. In such cases, users lack the capacity to submit fraud proofs to contest transactions that might harm them.</p><p>The onus falls entirely upon the teams operating these proof generators and sequencers. While Starknet is making strides towards decentralizing its sequencers and provers as outlined in its roadmap, many other zk and optimistic rollups, despite proclaiming &quot;robust networks&quot; in their grand roadmaps, are yet to make significant progress . A mechanism called Escape Hatches was introduced where users are able to exit their funds by forcing a state transition transaction of the L2 on L1 where the funds were locked, They usually are either able to submit a fraud proof or merkle tree root to exit. There are a few ways to exit with escape shuttles →</p><ul><li><p><strong>Force Exit L1:</strong> The user sends a transaction to the L1 that introduces a state change to the L2 bridge smart contract on the mainnet. These transactions can not be censored by the rollup sequencer and like in <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://docs.arbitrum.io/inside-arbitrum-nitro#inboxes-fast-and-slow">Arbitrum</a> any of these txns are delayed by a day and then executed.</p></li><li><p><strong>Enqueue L1:</strong> Users can post transactions to exit the assets but they are not guaranteed for execution.</p></li><li><p><strong>Applicative :</strong> As zkrollups usually don’t have the same address it’s hard to map them beforehand, for this bridges have to maintain a directory of mapped addresses. In <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://community.starknet.io/t/starknet-escape-hatch-research/1108">Starknet</a> When a forced transaction is pushed, the L1 contract pings a cross chain message to the address directory on the Starknet.</p></li></ul><p>You can head to <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://L2beat.com">L2Beat</a> and check which of the L2 bridges have escape and hatches and how they are deployed but even right now unless you are good at solidity and calling functions on chain it will be super hard to use this functionality.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/28d4ac9d6139a9d3aac8234d074cef6bbe595eb924803590ebc82ffe37fd4925.png" alt="L2 beat: Current state of L2 bridge security" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">L2 beat: Current state of L2 bridge security</figcaption></figure><h3 id="h-some-open-questions-about-shuttles" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Some Open questions about shuttles</h3><p>One of the biggest challenges is that Force exit transactions go through the same pipeline as any other transaction, and in times of high gas or market turbulence, it might not be viable for the user to exit $500 worth of funds by paying $1k to call the escape functions on chain.</p><p>Other than L2 bridges, many cross chain bridges don’t have any security fallbacks if the trusted committee is down. If while bridging the Trusted third party goes which is solely responsible for consensus and custody, the assets could be locked as long as the network is back up.</p><p><strong>Which assets to exit?</strong> One of the functionalities I am curious about is whether a user is able to exit specific tokens or standards or whether the whole account state is moved. You might have a few AAVE positions on an L2 which due to sequencer failure is unable to process new transactions is there any way to move the AAVE balance and position directly to the mainnet? If the users just want to exit their ERC-20 or wrapped tokes and not the Native tokens that they bridged?</p><hr><p>PS: Big shoutout to yet again making it till the end of my bridge rendezvous, This was a series of 2(till which I planned) on writing about bridge security.This work was funded by a Wormhole Grant so a huge shoutout to them for giving me the support to work on this! Next time till then. <strong>Resources:</strong></p><ul><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://rdi.berkeley.edu/zkp/uploads/paper.pdf">https://rdi.berkeley.edu/zkp/uploads/paper.pdf</a></p></li><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://docs.zkbridge.com/zkbridge-trustless-cross-chain-bridges-made-practical/proof-systems-of-zkbridge">https://docs.zkbridge.com/zkbridge-trustless-cross-chain-bridges-made-practical/proof-systems-of-zkbridge</a></p></li><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://dicg-workshop.github.io/2022/papers/gorzny.pdf">https://dicg-workshop.github.io/2022/papers/gorzny.pdf</a></p></li><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://arxiv.org/pdf/2210.16209.pdf">https://arxiv.org/pdf/2210.16209.pdf</a></p></li></ul>]]></content:encoded>
            <author>madhavg@newsletter.paragraph.com (Madhav Goyal)</author>
        </item>
        <item>
            <title><![CDATA[A Hitchhikers Guide to Bridge Security]]></title>
            <link>https://paragraph.com/@madhavg/a-hitchhikers-guide-to-bridge-security</link>
            <guid>qWxSX3W7QMdqYnTZ7izj</guid>
            <pubDate>Wed, 27 Sep 2023 15:11:45 GMT</pubDate>
            <description><![CDATA[The primary objective of this post is to illustrate that tokens held on various blockchain networks through different bridges exhibit distinct security profiles and values, despite the fact that their purpose is to represent the same underlying assets.Agenda ->God didn’t create all bridges the sameSecurity profiles of tokensTrustless or wat? (Bridges and trusted setups)Bridges are named as the Harbinger of the multi-chain world where supposedly it doesn&apos;t matter where your assets are bec...]]></description>
            <content:encoded><![CDATA[<p>The primary objective of this post is to illustrate that tokens held on various blockchain networks through different bridges exhibit distinct security profiles and values, despite the fact that their purpose is to represent the same underlying assets.</p><h2 id="h-agenda-greater" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Agenda -&gt;</h2><ul><li><p><strong>God didn’t create all bridges the same</strong></p></li><li><p><strong>Security profiles of tokens</strong></p></li><li><p><strong>Trustless or wat? (Bridges and trusted setups)</strong></p></li></ul><p>Bridges are named as the Harbinger of the multi-chain world where supposedly it doesn&apos;t matter where your assets are because you will be able to bridge your assets to anywhere but things are not as easy as they seem. First,we need to set some ground rules. At its essence, cryptocurrency bridges aim to address the challenge of achieving fair exchanges between two blockchain networks. This challenge entails ensuring that both parties involved either receive their intended assets, or neither party receives them.</p><p>Consider a scenario involving two parties, Ram and Sham. Ram intends to acquire asset X from Sham, while Sham seeks asset Y from Ram. Since both Ram and Sham maintain their assets in separate ledgers, the following transactions must occur: Ram needs to transfer Y from his ledger (Ledger A) to Sham at time t, and Sham must transfer X from her ledger (Ledger B) to Ram which happens when the Trusted third party verifies the commitment and does transaction at time t’.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/23abfe0ea603eb5abc4b2948056396328c6b17ac8ae37bfa4d972703911ec82a.gif" alt=".." blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">..</figcaption></figure><p>Now there are two main implementations to achieve this →</p><h2 id="h-liquidity-networks" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Liquidity Networks</h2><p>This type of exchange involves inputting a combination of tokens, whether they are the same or different, and receiving a different set of tokens at a specified destination, based on the principle of xy = K. Throughout this trading process, the total value of the liquidity pool remains constant, with the exception of atomic price fluctuations. It&apos;s important to note that this mechanism only applies to fungible tokens such as SPL tokens and ERC-20 tokens since liquidity pools are not feasible for other types of assets. An example of this concept is Thorchain, which operates as a liquidity protocol and serves as a cross-chain decentralized exchange (DEX). Thorchain facilitates the bridging and swapping of assets, but it requires that the underlying tokens are interoperable between different blockchains. Since Thorchain operates as a protocol beyond the individual blockchains it connects, it involves governance and voting mechanisms to implement changes to the bridge and its architecture.Liquidity networks typically involve high gas and computational costs due to interactions with multiple smart contracts and liquidity pools.</p><h2 id="h-messaging-protocols" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Messaging Protocols</h2><p>Message protocols allow you to transfer arbitrary payloads which could include as the name suggests Messages, tokens, and of course cross chain program invocation the foundation of crosschain interoperability. Since tokens are also storage slots or strings in the general token contract, message bridges allow token transfers. eg Utilizing Wormhole, you have the capability to transfer both assets and messages, ranging from simple &quot;Hello World&quot; greetings to participating in cross-chain governance voting, thanks to the functionality provided by Messaging bridges.Using message bridges is relatively cheap since you only have to transfer a message string and the protocol contract/endpoint on the other chain is able to take care of the rest.</p><p>Now Bridges 101 is out of the picture, let’s dive into the nitty-gritty of the so-called &quot; Chains don’t matter era&quot;</p><blockquote><p>Whenever some says their bridge is trustless, RUN</p></blockquote><p>As blockchains are isolated state systems there needs to be another system like a bridge that fetches and verifies data of chains and interacts with them which always comes with a certain number of security assumptions and relies on some kind of trusted third party to an arbitrary degree which depends from bridge to bridge but everyone has to rely on something either oracles, relayers, light clients.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/835db6ef361c5499de38c30d7abe593e1a2835a38a878c7f07269111d3344dd0.png" alt="Smol chart" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">Smol chart</figcaption></figure><p>Check out the <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.youtube.com/watch?v=b813V2Oqmfs">Talk by Vaibhav if you wanna dive</a> into the differences between liquidity networks and Bridges.Now lets talk about assets and holding the same ones on a different chain.</p><hr><h3 id="h-whenever-you-move-your-assets-from-one-chain-to-another-a-few-things-change" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Whenever you move your assets from one chain to another a few things change</h3><ul><li><p>Security</p></li><li><p>Nativity</p></li><li><p>Liveliness</p></li></ul><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/37e18cba02edba05bdefc76a4b182a01b687c8a664ec3cb38a167ec08b1f19fa.png" alt="Tokens after being bridged from one chain to another" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">Tokens after being bridged from one chain to another</figcaption></figure><h2 id="h-security" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Security</h2><p>Let&apos;s say you&apos;ve been experiencing some joy because you&apos;ve made profits and have USDT (Tether) on a relatively new blockchain called Terra. However, this blockchain has a somewhat questionable reputation, and you start to worry when something suspicious begins to unfold. You might think, &quot;Well, the asset is the same regardless of the blockchain it&apos;s on, isn&apos;t it?&quot;</p><p>The truth is, it&apos;s not that simple. When you hold assets on a particular blockchain, it&apos;s crucial to understand what underpins the economic security of that blockchain. For instance, in the case of Bitcoin, it&apos;s the enormous amount of energy expended in mining to produce each bitcoin. For instance, if it takes 10 kilowatts of energy to mine one bitcoin worth of block rewards, anyone attempting to reverse your work would need to do significantly more work, costing more than the bitcoin itself. This fact discourages potential attackers, making the risk profile of your assets relatively secure from protocol attackers.</p><p>Now, with the advent of proof-of-stake mechanisms, such as the one used in Ethereum, every finalized block&apos;s economic security is tied to the number of native tokens staked by block producers. At present, this value exceeds $60 billion, which provides a strong indication of security.</p><p>This all ties back to the concept of how challenging it is to execute a hard fork or reorganization on a particular blockchain. The more difficult it is, the more secure the blockchain tends to be.</p><p>If you happen to hold USDT on both Ethereum and Terra, you can assess the security of your assets by considering the value and amount of tokens staked in the protocol by validators. Crunching the numbers will reveal that Ethereum offers a higher level of security in this regard.</p><h2 id="h-nativity" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Nativity</h2><p>Have you ever wondered about the concept of &quot;wrapped&quot; tokens when you bridge assets between blockchains? Essentially, when a blockchain does not natively support a particular token, a bridge steps in to compensate for it. It achieves this by providing you with a representative token, backed by a promise from the bridge, ensuring a 1:1 correspondence with the token it holds on the native chain you were bridging from. This mechanism is called Lock and release.</p><p>Wrapped assets play a significant role in token transactions. For example, Ethereum, they simplify the exchange of assets, such as ERC-20 tokens to ERC-20 tokens. However, when utilizing bridges, it&apos;s essential to verify that the bridge indeed holds your tokens on the original chain and to consider its security aspects carefully.</p><p>Like for a long time Polygon did not support native USDC so whenever you bridged USDC from eth mainnet to Polygon, Circle was not the one responsible for backing your USDC with 1 dollar but the bridge in this case Polygon POS bridge and you could not redeem your usdc for 1 dollar directly from circle which you should be able to do with other chains.Avalanche bridge and Pulse chain only offer wrapped assets meaning every token you swap becomes an erc20 proxy.</p><h2 id="h-liveliness" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Liveliness</h2><p>Liveliness as the name suggests health and functioning in terms of consensus on state transitions and transactions. To a certain point it could also be meant as the chain uptime, the higher the uptime more secure your assets on top of it. Liveliness has been the debate of the century as more and more L2s are propping up, There are doubts about the liveliness and security of withdrawing funds from an L2 back to the mainnet in times of a critical bug or attack.</p><p>If I were to boil down all three of these factors and right into a few lines that describe the safety and security here it would be -&gt;</p><ul><li><p><strong>Re-org -</strong> Whether a signed or voted-on block be scraped?</p></li><li><p><strong>Data Availability</strong> - The transaction data was made available at the time of computation and voting by the node validators so that in the future nodes can recreate the state. Data availability is different from having the actual data at an arbitrary instance of time.</p></li><li><p><strong>Censorship Resistance</strong> - Anyone willing to pay the necessary fees can get their transactions included. This can also have some unthought-of consequences where a rogue agent could just increase the base fee enough that make it inaccessible for a large portion of the users.</p></li></ul><p>We can define these properties of a blockchain by looking at its nodes and consensus mechanism but it’s a bit more complicated for L2s. Layer 2s don&apos;t have their own transactions supply, they work as off-chain proving systems for the base layer where they compute the state changes off the mainnet nodes and post the validity proof(zk or optimistic) on the chain to verify the validity. Because of this, they inherit the liveliness of the base layer to a certain point. If you want to head into the treasure chest of l2 security research check out <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://dba.mirror.xyz/LYUb_Y2huJhNUw_z8ltqui2d6KY8Fc3t_cnSE9rDL_o">John&apos;s mini books</a></p><h2 id="h-trustless-or-wat" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Trustless or wat?</h2><p>Now comes the juiciest part of the post, categorizing bridges based on their Architecture and how that affects other factors. The recipe to a good bridge is to make it decentralized (I know a bit cliche) and as trust minimized as possible so that it relies on as least number of off-chain actors as possible as adding more agents only adds it to the level of attack vectors.</p><p>Well, to be honest, most of the smart contracts on chains that work as endpoints for bridges are upgradable and controlled by multi-sig wallets but most of them inherit some level of security from their base chains but that line is blurred there have been some debates I was not able to find a good answer.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/b160d00cbf8516e2dadd61f17e21e14a80dbdd4b859935cdf7990fa72821f505.png" alt="ifykyk" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">ifykyk</figcaption></figure><h2 id="h-bridges-and-trusted-entities" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Bridges and Trusted entities</h2><p>This part focuses on consensus and verification mechanisms used by messaging bridges and not liquidity networks as networks don&apos;t really transfer assets but work like Automated market makers as described above. The security of bridges depends on their trust assumptions and with different architecture comes different attack vectors.</p><ul><li><p><strong>External Validators</strong>: Bridges have another set of validators that listen and verify messages from the chains and act as middleware for passing assets, these validators are usually permission nodes whose incentives align with those of the bridge. These are bridges that rely on external Validators, which means that these Validators form a distinct committee separate from the Validators on either the source or destination chain. Depending on the specific implementation, these Validators may employ various methods such as basic MultiSig, run a consensus algorithm (usually from the propose-and-vote category), utilize Threshold Signature schemes, SGX, or secure enclaves like in trusted execution environments etc. Ie</p><ul><li><p><strong>Wormhole</strong>: Wormhole has a set of Guardians that run full nodes for all the blockchains they support and listen to gossip for contracts that interact with its core contracts once one does the relayers relay the message to Guardians who then vote on the validity of the payload.</p><p>wormhole is a general-purpose bridge that passes arbitrary payload and the token bridge is built on top of it.</p></li></ul></li></ul><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/2793e4a6cf7007173e217fa5e7c09b792b26aa654623d7861b69ba5d2307feb4.png" alt="High level overview of wormhole" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">High level overview of wormhole</figcaption></figure><p><strong>Light Clients and Validators</strong>: Rather than having an external set of nodes, bridges can run light clients that work on the trust assumption of an honest majority and verify the state transitions without having to run a full staking node or just running a gossip spy which is unable to verify proofs. As most chains run some fork of BFT consensus, a good rule of thumb is to check for a signature quorum by the voting nodes. The approach used for Proof of work chains is to see the canonical chain or the longest one according to the fork choice rule.</p><ul><li><p><strong>LayerZero</strong>: LayerZero is a Messaging bridge that uses a combination of a light client and oracle to verify the state transitions and pass messages. The light clients and Oracle work independently and check each other for fraud detection. LayerZero now uses the polyhedra zk light client which uses the state root for verification of txns.</p></li></ul><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/4d38f55e6984a615d93b1aad8dc61ab115998c89a88200059cb054229e11c064.png" alt="Polyhedra X Layer Zero labs" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">Polyhedra X Layer Zero labs</figcaption></figure><p>If you want to dive into zkBridges, <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://arxiv.org/abs/2210.00264">check out this paper</a>.</p><h3 id="h-escrows-vs-custodians" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Escrows vs Custodians</h3><p>One important security feature most bridge users overlook is the type of custody the bridge holds over your assets. <strong>Escrows</strong> → The assets are in conditional control of the program and can be revoked. The bridge&apos;s smart contract typically relies on predefined logic and if the conditions are not met the assets are returned back to the agents. Though it’s slower, even if the escrow goes rogue the tokens can be transferred back to the owner. <strong>Custodians</strong>→ The keeper gets unconditional control over the tokens and users and if gone rogue could steal funds. The user relies on a TTP(trusted third party) rather than the smart contracts.</p><h2 id="h-conclusion" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Conclusion</h2><p>This post was the first of a series diving into cross-chain bridges and some of the intricate structures they work on. The goal here was to dive in and set the groundwork of what makes a good bridge. Shoutout to the wormhole team for funding this research.</p><hr>]]></content:encoded>
            <author>madhavg@newsletter.paragraph.com (Madhav Goyal)</author>
        </item>
        <item>
            <title><![CDATA[Building on Openbook]]></title>
            <link>https://paragraph.com/@madhavg/building-on-openbook</link>
            <guid>DaEtTBgmuDxY8KTeh0Iv</guid>
            <pubDate>Wed, 23 Aug 2023 08:08:50 GMT</pubDate>
            <description><![CDATA[This post has nothing much concrete but works like a small raindrop from my time spent tinkering with Wormhole. Contents →Some FundamentalsAMM vs OrderbooksLiquidityBuilding on open-bookSome FundamentalsExchanges and markets work by helping two parties who want to trade assets or liabilities, whether that be a simple bazaar or Nasdaq-the basic idea is having a platform connecting two agents who want to trade. Stock exchanges and physical markets could be easily manipulated by regulation and l...]]></description>
            <content:encoded><![CDATA[<p>This post has nothing much concrete but works like a small raindrop from my time spent tinkering with Wormhole. <br>Contents →</p><ul><li><p>Some Fundamentals</p></li><li><p>AMM vs Orderbooks</p></li><li><p>Liquidity</p></li><li><p>Building on open-book</p></li></ul><hr><h2 id="h-some-fundamentals" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Some Fundamentals</h2><p>Exchanges and markets work by helping two parties who want to trade assets or liabilities, whether that be a simple bazaar or Nasdaq-the basic idea is having a platform connecting two agents who want to trade.</p><p>Stock exchanges and physical markets could be easily manipulated by regulation and lobbying, as of today users need to have Brokerage accounts aka middlemen who execute orders on behalf of the customers on the stock exchange.&apos;&apos; This middlemen&apos;s inefficiency and censorship led to the development of defi (Decentralised finance) or in layman&apos;s terms the finance markets that were censorship-resistant and did not need the intervention of operators.</p><p>There are two foundational pillars of modern exchanges:-</p><h3 id="h-ammautomated-market-makers-greater" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">AMM(Automated Market Makers)-&gt;</h3><p>Users don&apos;t trade with other users but with a liquidity pool of different assets . In AMM models users come in and swap their assets based on a simple model of (<strong>xy = k</strong> ) Where x is the value of the asset they want to exchange and y is the value of the asset they are exchanging for <strong>K</strong> is the total value of the pool which should remain constant at the end of the trade(neglecting atomic price changes). Since blockchains are isolated systems, the price of the assets is received from the oracles that provide off-chain data in a verifiable manner that can be accepted on-chain. eg Uniswap, Flash.trade</p><h3 id="h-orderbooks-greater" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Orderbooks-&gt;</h3><p>Connecting traders based on their orders is the sole purpose of an order book.</p><p>Think of it as a simple matrix that has a bunch of bids of selling and buying an asset and at the center is the price the order is to be executed at.The function of the orderbook is to match these buy and sell orders managing the slippage and price changes along the way. eg Opnbook</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/021db907f2c992cddbd1a650d0bb90f9f1dec6a79ad8f761c0546d2832652eb9.png" alt="Building orderbooks for the Long Haul by Jarry Xiao" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">Building orderbooks for the Long Haul by Jarry Xiao</figcaption></figure><p>Check this talk to dive deeper into how orderbooks <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.youtube.com/watch?v=FyWkWrjQJpQ">work on a higher level</a></p><h3 id="h-liquidity" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Liquidity</h3><p>Markets work on the promise of liquidity the promise that if there is someone selling an asset there is a party willing to buy it too, being able to exchange a good for liquid cash or another asset, most of the time this liquidity is provided by whales that have a high amount of liquid assets.</p><p><strong>AMMs</strong>-&gt; In the Pool-to-peer model, Market Makers become the liquidity providers by staking their tokens in the pool to get some fraction of the fees charged on trades. Pools have different types of risks associated with them based on how the liquidity and leverage are managed.</p><p><strong>Order books</strong> -&gt; Market Makers have orders on both sides of the order both buy and sell +- fractions of $ fulfilling orders by the normal or retail users.</p><p>This is one of the reasons Solana defi suffered so much from FTX crash because the biggest orderbook on solana was Serum built by ftx and Alameda the hedge fund by ftx was the largest amm and liquidity provider literally managing the pillars</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/c7e120a7b0428d30f7423a696131a6cad504407df68fed96bd90ccd1fa0ea543.png" alt="Total Solana DeFi TVL -DefiLlama" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">Total Solana DeFi TVL -DefiLlama</figcaption></figure><p>As the update authority of the program was still ftx which allowed them access and manipulation of user funds, to prevent any damage the community stepped in and forked serum with the update authority of a multi-sig containing the defi founders.</p><p>Check out <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="">Article by yash to get more</a> deeper view into Market analysis and Serum.</p><h3 id="h-building-on-openbook-v2-lets-get-our-hands-dirty" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Building on openbook V2 (lets get our hands dirty)</h3><p>Let&apos;s dive into the core openbook program!</p><p>(Note: we will be using openbook-v1 for the instructions.)</p><h3 id="h-wait-how-does-it-work" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0"><strong>wait how does it work?</strong></h3><p>To build on top of Openbook we use instructions that are built out by the Openbook team by first importing it and then using the instructions so that we don&apos;t have to start from scratch, we can use the order book to build new defi primitives on top of it like prep exchanges and simple desks with different liquidate constraints.</p><pre data-type="codeBlock" text="//To import any rust packages we use the command 
Cargo add serum-dex 
// we can replace any but I&apos;m using serum cause its easy lol 
"><code><span class="hljs-comment">//To import any rust packages we use the command </span>
Cargo <span class="hljs-keyword">add</span> serum-dex 
<span class="hljs-comment">// we can replace any but I'm using serum cause its easy lol </span>
</code></pre><p>This brings the crate in scope and adds it to the cargo.toml file which is important to compile the program.</p><p>Now one of the best &amp; worst parts about Solana development→ Each and every library, and program we interact with during deployment has to be listed out which allows the network to parallelize the transactions and makes the compute more efficient. Here we import all the libraries we might be using in the program.</p><pre data-type="codeBlock" text="#![cfg_attr(not(feature = &quot;program&quot;), allow(unused))]
use solana_program::{
    account_info::AccountInfo,
    entrypoint,
    entrypoint::ProgramResult,
    pubkey::Pubkey,
    msg,
        AccountMeta, Instruction,
    pubkey::Pubkey,
    sysvar::rent,
};
use crate::error::DexError;
use crate::matching::{OrderType, Side};
use bytemuck::cast;
use serde::{Deserialize, Serialize};
use std::convert::TryInto;

use arrayref::{array_ref, array_refs};
use num_enum::{IntoPrimitive, TryFromPrimitive};
use std::num::NonZeroU64;
use serum-dex::*;

pub mod openbook_program {
    use solana_program::declare_id;
    declare_id!(&quot;srmqPvymJeFKQ4zGQed1GFppgkRHL9kaELCbyksJtPX&quot;);
}
"><code><span class="hljs-meta">#![cfg_attr(not(feature = <span class="hljs-string">"program"</span>), allow(unused))]</span>
<span class="hljs-keyword">use</span> solana_program::{
    account_info::AccountInfo,
    entrypoint,
    entrypoint::ProgramResult,
    pubkey::Pubkey,
    msg,
        AccountMeta, Instruction,
    pubkey::Pubkey,
    sysvar::rent,
};
<span class="hljs-keyword">use</span> crate::error::DexError;
<span class="hljs-keyword">use</span> crate::matching::{OrderType, Side};
<span class="hljs-keyword">use</span> bytemuck::cast;
<span class="hljs-keyword">use</span> serde::{Deserialize, Serialize};
<span class="hljs-keyword">use</span> std::convert::TryInto;

<span class="hljs-keyword">use</span> arrayref::{array_ref, array_refs};
<span class="hljs-keyword">use</span> num_enum::{IntoPrimitive, TryFromPrimitive};
<span class="hljs-keyword">use</span> std::num::NonZeroU64;
<span class="hljs-keyword">use</span> serum-dex::*;

<span class="hljs-keyword">pub</span> <span class="hljs-keyword">mod</span> openbook_program {
    <span class="hljs-keyword">use</span> solana_program::declare_id;
    declare_id!(<span class="hljs-string">"srmqPvymJeFKQ4zGQed1GFppgkRHL9kaELCbyksJtPX"</span>);
}
</code></pre><p>Two super important rust crates →</p><ul><li><p>Solana_sdk (Interacting with off chain programs)</p></li><li><p>solana_program (everything solana on chain)</p></li></ul><p>If you are new to rust you might be wondering what <br><strong><em>#![cfg_attr(not(feature = ‘program’),allow(unused)]</em></strong> <br>is, its a way to suppress warnings with the compiler which halt the program deployment, if you are planning to dive into rust this will become second nature to you</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/224756ec7ca5f8d5d8c7f0a80c9c79f9d5a7b58ea9f63ea2ef040f511826b83c.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>Now we start writing functions and invoking the programs from the openbook instructions, all the actions that a user can take from Limit order to cancel trades to create new swap markets has their own instruction in the core openbook program.</p><p>One of the basic ways is to do <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.soldev.app/course/cpi">Cross program invocation</a>, invoking functions from other on-chain programs, targeting a specific instruction on the program. Being able to call functions and programs written by other accounts on chain is what a big part of interoperability is about which means not wasting resources on the foundational infra that every team needs to use. An additional pivotal facet of CPIs is their capacity to empower programs to provide digital signatures for their Program Derived Accounts. In the context of Solana&apos;s development landscape, PDAs are heavily employed, granting programs the authority to govern specific addresses in a manner that prevents external users from generating transactions bearing valid signatures for those addresses. The absence of CPIs would drastically diminish the efficacy of PDAs, effectively rendering them inaccessible enclaves—any data deposited into a PDA would be entrapped, unretrievable without the CPI framework.</p><p>Like when you use Jupiter, it’s not Jupiter that has the liquidity or access to funds but the contract makes a bunch of CPIs to the different DEXs and orderbooks to find the best route for tokens to maximize fair pricing for the user hence DEX aggregator. being able to access the global state and functions in it allows these protocols to tap into each other’s specific functions.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/e02d9c1dca25ee74725585509ed2f9573c1a61a8eb1f3161439048bfcb6bd38a.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>In rust these functions are either instructions or implications, to check out all the openbook instructions head here . To invoke any program we use</p><pre data-type="codeBlock" text="invoke(
    &amp;Instruction {
        program_id: &quot;srmqPvymJeFKQ4zGQed1GFppgkRHL9kaELCbyksJtPX&quot;,
        accounts: accounts_meta,
        data,
    },
    &amp;account_infos[account1.clone(), account2.clone(), account3.clone()],
)?;
// specify all the read write accounts before hand
"><code>invoke(
    <span class="hljs-operator">&#x26;</span>Instruction {
        program_id: <span class="hljs-string">"srmqPvymJeFKQ4zGQed1GFppgkRHL9kaELCbyksJtPX"</span>,
        accounts: accounts_meta,
        data,
    },
    <span class="hljs-operator">&#x26;</span>account_infos[account1.clone(), account2.clone(), account3.clone()],
)?;
<span class="hljs-comment">// specify all the read write accounts before hand</span>
</code></pre><p>Like if we want to invoke one of the instructions from the openbook that cancels all the open programs</p><p>we would create a new variable that uses the order and fills its hyperparameters.</p><pre data-type="codeBlock" text="let new_order = NewOrderV3 {
    side: openbook::matching::Side::Bid,
    limit_price: 100_000, // Example limit price
    max_quantity: 1000,   // Example max quantity
    order_type: openbook::matching::OrderType::Limit,
    ... // Other fields
};
"><code><span class="hljs-keyword">let</span> <span class="hljs-variable">new_order</span> = NewOrderV3 {
    side: openbook::matching::Side::Bid,
    limit_price: <span class="hljs-number">100_000</span>, <span class="hljs-comment">// Example limit price</span>
    max_quantity: <span class="hljs-number">1000</span>,   <span class="hljs-comment">// Example max quantity</span>
    order_type: openbook::matching::OrderType::Limit,
    ... <span class="hljs-comment">// Other fields</span>
};
</code></pre><hr><p>Python for Openbook We can use the Pyserum library to interact with the client in python or fetch the price updates.</p><pre data-type="codeBlock" text="from pyserum.connection import conn
from pyserum.market import Market

cc = conn(&quot;&lt;https://api.mainnet-beta.solana.com/&gt;&quot;)
market_address = &quot;openbook adress&quot; 

market = Market.load(cc, market_address)
asks = market.load_asks()
print(&quot;Ask Orders:&quot;)
for ask in asks:
    print(&quot;Order id: %d, price: %f, size: %f.&quot; % (
          ask.order_id, ask.info.price, ask.info.size))

print(&quot;\\n&quot;)
# outpiuts all the current orders
print(&quot;Bid Orders:&quot;)
bids = market.load_bids()
for bid in bids:
    print(f&quot;Order id: {bid.order_id}, price: {bid.info.price}, size: {bid.info.size}.&quot;)
"><code><span class="hljs-keyword">from</span> pyserum.connection <span class="hljs-keyword">import</span> conn
<span class="hljs-keyword">from</span> pyserum.market <span class="hljs-keyword">import</span> Market

cc = conn(<span class="hljs-string">"&#x3C;https://api.mainnet-beta.solana.com/>"</span>)
market_address = <span class="hljs-string">"openbook adress"</span> 

market = Market.load(cc, market_address)
asks = market.load_asks()
<span class="hljs-built_in">print</span>(<span class="hljs-string">"Ask Orders:"</span>)
<span class="hljs-keyword">for</span> ask <span class="hljs-keyword">in</span> asks:
    <span class="hljs-built_in">print</span>(<span class="hljs-string">"Order id: %d, price: %f, size: %f."</span> % (
          ask.order_id, ask.info.price, ask.info.size))

<span class="hljs-built_in">print</span>(<span class="hljs-string">"\\n"</span>)
<span class="hljs-comment"># outpiuts all the current orders</span>
<span class="hljs-built_in">print</span>(<span class="hljs-string">"Bid Orders:"</span>)
bids = market.load_bids()
<span class="hljs-keyword">for</span> bid <span class="hljs-keyword">in</span> bids:
    <span class="hljs-built_in">print</span>(<span class="hljs-string">f"Order id: <span class="hljs-subst">{bid.order_id}</span>, price: <span class="hljs-subst">{bid.info.price}</span>, size: <span class="hljs-subst">{bid.info.size}</span>."</span>)
</code></pre><hr><p>PS: This post didn’t have much structure as it was just a braindrop that dived into basic defi fundamentals and into how basic solana development works. Will link up all the resources you need here</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://app.realms.today/dao/BtD6wKiazt4EEvfw6tqDh1BPSVchGeqyZ1e4HhV9VHJ6">openbook DAO voting</a> | <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://solscan.io/account/srmqPvymJeFKQ4zGQed1GFppgkRHL9kaELCbyksJtPX">Openbook mainnet deployment</a> | <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/openbook-dex/resources">Openbook resources</a></p>]]></content:encoded>
            <author>madhavg@newsletter.paragraph.com (Madhav Goyal)</author>
        </item>
        <item>
            <title><![CDATA[🧊Solana::Leader schedule]]></title>
            <link>https://paragraph.com/@madhavg/solana-leader-schedule</link>
            <guid>dkAvWU4WxbS5Touo7zaM</guid>
            <pubDate>Sat, 01 Jul 2023 15:35:17 GMT</pubDate>
            <description><![CDATA[I have been diving into Solana and its Validator code realizing the incredible design behind the selection of Validators and block producers, so here is a small rundownWhat are Blocks?What are POW and POS?Solana Leader ScheduleSpecial Considerations to produce the Tastiest BlockOpen QuestionsSome ResourcesBlocks wat?Blocks containing transactions and state transition data lined on top of one another with cryptography securing their computational integrity is the foundation of blockchain aka c...]]></description>
            <content:encoded><![CDATA[<p>I have been diving into Solana and its Validator code realizing the incredible design behind the selection of Validators and block producers, so here is a small rundown</p><ul><li><p>What are Blocks?</p></li><li><p>What are POW and POS?</p></li><li><p>Solana Leader Schedule</p></li><li><p>Special Considerations to produce the Tastiest Block</p></li><li><p>Open Questions</p></li><li><p>Some Resources</p></li></ul><h1 id="h-blocks-wat" class="text-4xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Blocks wat?</h1><p>Blocks containing transactions and state transition data lined on top of one another with cryptography securing their computational integrity is the foundation of blockchain aka chain of blocks.</p><p>Bitcoin was a breakthrough in this architecture where distributed parties could mine blocks by brute forcing and computing the hash for the block, the miner getting the hash got the reward and built the block. Because of this bitcoin was a pure game of computational resources where the miners with higher hash power or better hardware had &gt;&gt;&gt; chances than any normal user. This was a great security model as if any malicious party tried to overturn a hashed block or change the history they would have to challenge the compute resources of the whole blockchain or wanted to add a rogue transaction in a future block they would have to build blocks faster than everyone combined which was kinda impossible giving bitcoin the better security.</p><p>Though this is a great model it’s not very feasible if you wanna get a more decentralized system without draining immense amounts of energy and resources that’s where POS was pioneered.</p><h1 id="h-what-is-pos" class="text-4xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">What is POS?</h1><p>In Proof of Stake, a builder is selected ahead of schedule to build a block and only if they have staked some amount of native token to get &quot;Skin in the game&quot;. It’s a basic game of reinforcement learning where there is positive feedback aka block reward if they build a block with right hashes and get their stake slashed if they do any malicious activity that hurts the chain. Proof of stake systems is just a solution to the byzantine problem of how decentralized parties could coordinate without trusting much. As in a proof-of-work system like Bitcoin, the chain is commanded by hash power, POS system is stake controlled</p><ul><li><p>If 1/3rd or 33% of the stake goes rogue then user transactions can be censored and the state changes be halted</p></li><li><p>To roll back history and append hashed state changes it requires 2/3rd (67%) of the stake.</p></li></ul><h1 id="h-solana-leaders-and-schedule" class="text-4xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">⚡️Solana Leaders and Schedule</h1><p>In Solana validators that stake Solana and build blocks are called Leaders that have a leader schedule based on which they build blocks. Leaders aka validators are selected based on the amount of their stake aka stake weight and the higher it is more are the chances of a staker being picked to build up a block.</p><p>Because Solana is so fast it needs to track leaders and time well so that blocks are not delayed or become stale. Solana ledger has its own internal clock which maps the time it takes to run an iterative SHA-256 hash function per second, as a minimal ceiling has been reached on how fast SHA256 can be hashed it gives us a uniform time for how long it takes for a general machine to generate one hash.</p><pre data-type="codeBlock" text="// GCP n1-standard hardware and also a xeon e5-2520 v4 are about this rate of hashes/s
pub const DEFAULT_HASHES_PER_SECOND: u64 = 2_000_000;
"><code><span class="hljs-comment">// GCP n1-standard hardware and also a xeon e5-2520 v4 are about this rate of hashes/s</span>
<span class="hljs-keyword">pub</span> <span class="hljs-keyword">const</span> DEFAULT_HASHES_PER_SECOND: <span class="hljs-type">u64</span> = <span class="hljs-number">2_000_000</span>;
</code></pre><p>On every hash they produce a tick and these ticks can vary from machine to machine but to the ledger, the ticks are the main source of time and 2 ticks look the same.<br>There are 12,500 hashes in every single tick and 2 million hashes per second giving 800k hashes for every single block.<br>2,000,000/12500 = 160 ticks per second</p><p>The leader schedule is created for each epoch which is ~2 days. Solana has block slots of 400 milliseconds making 432,000 slots in a single epoch. During each slot, the leader gets 0.4s seconds to build the block and submit for voting before the schedule shifts for the next leader but every leader gets a pack of 4 slots, the time and schedule just passes even if the leader doesn&apos;t submit the block. Built blocks are turned into <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/solana-labs/solana/blob/master/ledger/src/shred.rs">shreds</a> and sent over <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://docs.solana.com/cluster/turbine-block-propagation">Turbine</a>, and the transactions are executed before they are voted upon for validity that’s why it’s called Optimistic execution freeing up a lot of time from back-and-forth gossip.</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/solana-labs/solana/blob/9488a73f5252ad0d7ea830a0b456d9aa4bfbb7c1/sdk/program/src/clock.rs#L65">Dive into the clock code</a></p><h3 id="h-solana-txns-in-a" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Solana txns in a 🌰🐚</h3><p>Transactions have 3 simple parts →</p><ol><li><p>Signatures → Ed25519 signature which verifies that the transaction is sent by user holding the private key + the signature from validators</p></li><li><p>Blockhash → To make a transaction, wallet pulls the <strong><em>latestBlockHash and uses it prove that the transaction is recent, transactions containing blockhash older than 152 blocks is rejected so if you fetch a block hash now it takes around 60 seconds for it become stale.</em></strong></p></li><li><p>Instructions → Solana utilising the parallel execution needs all the programs and invocations prehand so all the cpis and programs + their addresses tuched by your transaction need to be specified before hand.</p></li></ol><p>**But what about invalid transactions or out-of-bound txns?**If the transactions are incompatible they will fail anyway during their bytecode compilation in the Berekly packer filter virtual machine and safely halt the execution of that specific contract without hurting other transactions in that block.</p><blockquote><p>Leader nodes &quot;timestamp&quot; blocks with cryptographic proofs that some duration of time has passed since the last proof</p></blockquote><p>There are no limits to the no. of slots a single leader could be selected for, even if a validator has &lt;50% stake there are chances could build more than half of all the blocks in the epoch because of the nature of the schedule.</p><p>Now lets dive into some codeeeee</p><pre data-type="codeBlock" text="impl LeaderSchedule {
    // Note: passing in zero stakers will cause a panic.
    pub fn new(ids_and_stakes: &amp;[(Pubkey, u64)], seed: [u8; 32], len: u64, repeat: u64) -&gt; Self {
        let (ids, stakes): (Vec&lt;_&gt;, Vec&lt;_&gt;) = ids_and_stakes.iter().cloned().unzip();
        let rng = &amp;mut ChaChaRng::from_seed(seed);
        let weighted_index = WeightedIndex::new(stakes).unwrap();
        let mut current_node = Pubkey::default();
        let slot_leaders = (0..len)
            .map(|i| {
                if i % repeat == 0 {
                    current_node = ids[weighted_index.sample(rng)];
                }
                current_node
            })
            .collect();
        Self::new_from_schedule(slot_leaders)
    }
"><code>impl LeaderSchedule {
    <span class="hljs-comment">// Note: passing in zero stakers will cause a panic.</span>
    pub fn <span class="hljs-keyword">new</span>(ids_and_stakes: <span class="hljs-operator">&#x26;</span>[(Pubkey, u64)], seed: [u8; <span class="hljs-number">32</span>], len: u64, repeat: u64) <span class="hljs-operator">-</span><span class="hljs-operator">></span> Self {
        let (ids, stakes): (Vec<span class="hljs-operator">&#x3C;</span><span class="hljs-keyword">_</span><span class="hljs-operator">></span>, Vec<span class="hljs-operator">&#x3C;</span><span class="hljs-keyword">_</span><span class="hljs-operator">></span>) <span class="hljs-operator">=</span> ids_and_stakes.iter().cloned().unzip();
        let rng <span class="hljs-operator">=</span> <span class="hljs-operator">&#x26;</span>mut ChaChaRng::from_seed(seed);
        let weighted_index <span class="hljs-operator">=</span> WeightedIndex::<span class="hljs-keyword">new</span>(stakes).<span class="hljs-built_in">unwrap</span>();
        let mut current_node <span class="hljs-operator">=</span> Pubkey::default();
        let slot_leaders <span class="hljs-operator">=</span> (<span class="hljs-number">0</span>..len)
            .map(<span class="hljs-operator">|</span>i<span class="hljs-operator">|</span> {
                <span class="hljs-keyword">if</span> i <span class="hljs-operator">%</span> repeat <span class="hljs-operator">=</span><span class="hljs-operator">=</span> <span class="hljs-number">0</span> {
                    current_node <span class="hljs-operator">=</span> ids[weighted_index.sample(rng)];
                }
                current_node
            })
            .collect();
        Self::new_from_schedule(slot_leaders)
    }
</code></pre><p>This code block shows how the leader&apos;s schedule is generated. As on the top, each validator’s id and stake are serialized into vectors and then a weighted index is created to calculate the stake weight of validators.</p><p>If you want to learn more about Solana Block production feel free to check out →</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://madhavgoyal.substack.com/p/async-program-execution-and-simd">https://madhavgoyal.substack.com/p/async-program-execution-and-simd</a></p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/522156f95271ebd4d63b2a7923693308ef7df047c3f120a4cc42f2ba57e30b60.jpg" alt="🕰️Async program execution and SIMD-0045" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">🕰️Async program execution and SIMD-0045</figcaption></figure><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.umbraresearch.xyz/writings/lifecycle-of-a-solana-transaction">https://www.umbraresearch.xyz/writings/lifecycle-of-a-solana-transaction</a></p><h2 id="h-special-considerations-to-produce-the-tastiest-block" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Special Considerations to produce the tastiest Block</h2><p>Block production and propagation is a complex process involving several parameters and considerations to achieve the best outcome.</p><p>Leaders have to optimize for the Uncle rate which is a parameter of the time it takes to build &amp; forward a block and reach a consensus on it, the higher the Uncle rate higher the chances of the block becoming stale and not accepted by other nodes on the network. While Earlier a single Leader was producing and hashing the block with the implementation of PBS there are N of builders and even more searchers competing to get their blocks included and if the builders with the highest gas fee are farther it could lead to higher latency. Leaders have to keep</p><ul><li><p>Priority fee and Block reward from the block inclusion</p></li><li><p>Latency from the block builder</p></li><li><p>Price of inclusion of transactions as if they get too greedy and try to add too many transactions in the same block it could lead to longer propagation time and higher uncle rate</p><ul><li><p>Block_size is directly proportional to Stale_blockrate</p></li></ul></li></ul><p>Decentralization →</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/Madhav_goyal_/status/1661225300825460736">https://twitter.com/Madhav_goyal_/status/1661225300825460736</a></p><p>so block builders need to find the sweet spot where the size of the block is good right and the gas fee is attractive enough for the leader. Solana&apos;s data throughput is upwards of 100kb per second so this also loosens up a bit for better block packaging.</p><h2 id="h-open-questions" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Open Questions</h2><p>As transaction order flow and supply chain gets more completed with time due to the introduction of new actors using complex strategies to extract profit and self-interests, this could change a lot and there are already new Protocols in work to improve the leader schedules on Ethereum to maintain the <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://ethresear.ch/t/whisk-a-practical-shuffle-based-ssle-protocol-for-ethereum/11763">anonymity</a> of the builders Solana has high chances of following the footsteps that’s why nothing is concrete even the most fundamental parts of a blockchain.</p><p>PS: Thank you for reading till the end! 🫡Added some resources if you wanna dive deeper and check out ideas</p><p>Resources used-&gt;</p><ul><li><p>Biggest inspiration for this post <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.shinobi-systems.com/primer.html">https://www.shinobi-systems.com/primer.html</a></p></li><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/solana-labs/solana/blob/master/ledger/src/leader_schedule.rs">https://github.com/solana-labs/solana/blob/master/ledger/src/leader_schedule.rs</a></p></li><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/solana-labs/solana/blob/master/ledger/src/leader_schedule_utils.rs">https://github.com/solana-labs/solana/blob/master/ledger/src/leader_schedule_utils.rs</a></p></li><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://docs.solana.com/ar/cluster/synchronization#relationship-to-vdfs">https://docs.solana.com/ar/cluster/synchronization#relationship-to-vdfs</a></p></li><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://docs.solana.com/cluster/turbine-block-propagation">https://docs.solana.com/cluster/turbine-block-propagation</a></p></li></ul>]]></content:encoded>
            <author>madhavg@newsletter.paragraph.com (Madhav Goyal)</author>
        </item>
        <item>
            <title><![CDATA[L2s on solana?]]></title>
            <link>https://paragraph.com/@madhavg/l2s-on-solana</link>
            <guid>2rAkhIVLHaOKG88TKgpN</guid>
            <pubDate>Sat, 01 Jul 2023 11:06:32 GMT</pubDate>
            <description><![CDATA[There has been a lot of debate about whether Layer 2 or any scaling solutions on Solana won&apos;t be of much value. Let’s dive right in.more specifically after a tweet by Mert, It was Sunday midnight, and had nothing else to do so thought why not https://twitter.com/0xMert_/status/1673014633630691331Do we need Layer 2s on Solana?The biggest question when thinking of Layer 2 is whether the base layer is congested or unable to execute all the transactions needed with thousands of transactions ...]]></description>
            <content:encoded><![CDATA[<p>There has been a lot of debate about whether Layer 2 or any scaling solutions on Solana won&apos;t be of much value. Let’s dive right in.more specifically after a tweet by Mert, It was Sunday midnight, and had nothing else to do so thought why not</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/0xMert_/status/1673014633630691331">https://twitter.com/0xMert_/status/1673014633630691331</a></p><h2 id="h-do-we-need-layer-2s-on-solana" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Do we need Layer 2s on Solana?</h2><p>The biggest question when thinking of Layer 2 is whether the base layer is <strong>congested or unable to execute all the transactions</strong> needed with thousands of transactions stuck in the mempool waiting for their turn.</p><p>If we were set out to answer the upper question, no Solana mainnet is functioning pretty well and still hasn&apos;t hit its top TPS ever, I know I know what you thinking but doesn&apos;t Solana have vote txns and stuff like that</p><p>well even after a deduplication Solana as of now should be able to handle upwards of 100k transactions per second but in the real world, it usually hovers around 1k so clearly there is not that high demand for the Solana blockspace right now.Even if the rollups were implemented having solana as their da or execution layer It wouldn&apos;t even get close to the data throughput speed of the mainnet even if the rollups themselves are using the Solana virtual machine(fork of Berkeley packet filter).</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/ad2f9c3ee313f066cc0020a41c4c0f9a6eba62cad20ce5913ca77abc0293fbf0.jpg" alt="Image" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">Image</figcaption></figure><p>Credits: Logan Jastremsk</p><h2 id="h-solana-forked-rollups-on-other-chains" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Solana forked rollups on other chains?</h2><p>That is a good idea to have the fast execution of solana on another chain but here again, we run with da problems, if your dapp is consuming that much compute it would need to dump the data produced somewhere, and right no data availability solution comes close not even thinking about Ethereum.</p><h2 id="h-what-about-zk" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">What about zk?</h2><p>Sadly adding zk to everything doesn&apos;t fix it, Zero knowledge proofs the heart of zk rollups are super compute expensively and take time to be produced that why most of the zk rollups on Ethereum wait hours to batch transactions and post the proof of computation on mainnet.Even if we had parallelized zkp production it would take a long time before it gets to the speed of Solana but one of the pros of that is it would enable a lot faster syncing of Solana nodes that take days as of now.At one point gas fee was higher on zksync and Polygon Hermez because it takes the same amount of compute to make a zk proof and divided amongst the users, if there are few users they would have to contribute to the production of proof</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/DefiIgnas/status/1641426707172425730?lang=en">https://twitter.com/DefiIgnas/status/1641426707172425730?lang=en</a></p><p>But there is one feature that makes rollups attractive, they provide another level of developer flexibility that is not possible with a single-state machine. Right now every dapp has different requirements and they are made to submit improvement proposals that take ages if accepted and implemented ever but with rollups, devs can just ensure the data availability and conformations of the transactions on some other chain.</p><p>The dapp developers might want to have a different fee structure or hope to capture the mev by running their own sequencers for their dapp unlocking another source of revenue in a bear market which would not be possible with mainnet.</p><p>PS: Wrote this post at midnight so sorry for any mistakes or typos, if you wanna help feel free to reach out</p>]]></content:encoded>
            <author>madhavg@newsletter.paragraph.com (Madhav Goyal)</author>
        </item>
        <item>
            <title><![CDATA[🕰️Async program execution and SIMD-0045]]></title>
            <link>https://paragraph.com/@madhavg/async-program-execution-and-simd-0045</link>
            <guid>FbBAOsoANVbLgQERzdqR</guid>
            <pubDate>Sat, 20 May 2023 09:25:41 GMT</pubDate>
            <description><![CDATA[What is orderlfow and MEV?The simplest way to process a transaction on a blockchain for the user is to just send it to the RPC client which routes it to the next selected block builder aka Leader. This seems easy at first but has a whole lot of drawbacks as the transactions go unencrypted through an RPC and Leader, if any of the agents find an opportunity to leverage their speed or resources to front run and make a profit out of your transactions this will lead to bad incentive alignment wher...]]></description>
            <content:encoded><![CDATA[<h2 id="h-what-is-orderlfow-and-mev" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">What is orderlfow and MEV?</h2><p>The simplest way to process a transaction on a blockchain for the user is to just send it to the RPC client which routes it to the next selected block builder aka Leader. This seems easy at first but has a whole lot of drawbacks as the transactions go unencrypted through an RPC and Leader, if any of the agents find an opportunity to leverage their speed or resources to front run and make a profit out of your transactions this will lead to bad incentive alignment where block builders are hurting users for personal gain.</p><p>For eg. Let’s say there is a swap order on <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.orca.so/whirlpools/browse">Orca</a> for 1 million USDC X SOL with the maximum slippage set at +-5%, an MEV(Maximum Extractable value) bot could send a transaction with a priority fee for faster execution in the block(aka frontrunning) and buy up the sol and sell it to the buyer at a 2-3% markup which is still under the slippage &lt;5% and the transaction will go through. 2% of a million is 20k which is a huge loss to the user who placed the order. Now Solana mitigates this to a considerable level because of its super small block times which usually hover around 400ms and don&apos;t leave much time for MEV bots to do multi-step swaps and contract interactions but what if the agents who actually help execute the transaction become value extractors? The validator could see this opportunity or copy another mev bot and execute its transaction first in the block while also taking the priority fee from the bot or agent trying to arbitrage the opportunity.</p><h2 id="h-pbs" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">PBS</h2><p>One of the biggest ways to solve this problem is to divide the tasks done by validators so it doesn&apos;t have a monopoly over the transaction inclusion and execution. Right now validators build blocks that contain the user transactions and compute the hash for them to include it in the slot, with the approach of PBS <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://notes.ethereum.org/@vbuterin/pbs_censorship_resistance"><strong>Proposer builder separation</strong></a> that decouples the task of Building blocks and Including them in the ledger.This would allow different agents to build blocks and submit them to the scheduled leader, the leader of the block proposer won’t be able to append the order of transactions but can pick the one with the highest gas reward, and as many block builders are trying to get their blocks included they have to use sophisticated techniques to capture more gas and make it worthwhile for the leader. This prevents any special treatment or off-chain deals between proposers and builders while maintaining a level playing field for Builders.</p><ul><li><p>One of the drawbacks of this approach is that as many agents are competing to build the better block while only one of them gets selected, there is a huge waste of computing but it this important to move away from centralized block production that can harm user experience right now</p></li></ul><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/e09f0064d1896636e5a88df65bcfc7c925d27c7e233b583be8aaec8466726528.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>PBS pipeline</p><p>Implementing this could help the Solana order flow and Jito has done a lot of work in this area. They have published their jito Searcher and MEV client which allows searchers to pack bundled transactions in a supper efficient way and send it to the block engine which picks the best block with highest gas making it attractive for the leader to include it in the slot but Bundled blocks can only be included if the current Leader is using the Jito solana Client.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/8db694ee11839194e31b0edd68ee98d836ef098fc17f33b656d432194359b307.png" alt="Jito Searcher and block engine (Jito medium)" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">Jito Searcher and block engine (Jito medium)</figcaption></figure><p>But there is a problem, Having different parties produce blocks for the Proposer could lead to higher latency but first, we need to understand different types of transactions. Solana has two types of transactions →</p><ul><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://docs.solana.com/cluster/vote-signing"><strong>Vote transactions</strong></a>: These are executed to reach consensus on blocks by the validators as it is easier just to pack consensus data over the turbine rather than having another overhead gossip component that could increase the block times.<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://solana.fm/?cluster=mainnet-solanafmbeta">Around </a>3/4 of all transactions on the chain are vote transactions that have to pay fees like any normal txn.</p></li><li><p><strong>User transactions</strong>: Transactions submitted by users and bots on the chain that interact with smart contracts and don’t touch the vote state program</p></li></ul><p>As the vote txns are packed in the normal blocks they have to be executed after the program execution which becomes a bottleneck. But there is a way to solve this.</p><h2 id="h-simd-0045" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">SIMD-0045</h2><p>Clients and RPC networks are all over the world but the Leader is a single entity scheduled to confirm the blocks, to make the system more efficient rather than having a single leader produce blocks that contain all kinds of votes that might not be that useful we can</p><ul><li><p><strong>Segregate Vote transactions</strong> from the regular transactions that don’t interact with the Vote Program</p></li><li><p>Allow any N number of builders to take nonvote user transactions and efficiently pack them in blocks and sent over turbine of which one could be picked up by the Leader to include in POH in the form of</p></li><li><p>Vote transactions are just executed before the user transactions.</p></li></ul><p>Earlier the state transitions had to be processed first for the fork choice rule and voted upon later but that didn’t have much effect on the regular program execution which could be done async and moved to an isolated state.</p><p>This solves two big problems in block production</p><ul><li><p><strong>Latency</strong> - As there are N no builders producing blocks competing with each other, the leader could pick the one closest to them and that offers more rewards. This introduces competition for block building aligning incentives to work on more efficient blocks with better reordering.</p></li><li><p><strong>Parallel execution</strong> of Vote accounts rather than waiting for the nonvote txn execution and then vote execution.</p></li></ul><blockquote><p>Note</p><p>Transactions with instructions that touch stake change accounts would prob need Vote transactions to be run for them so its open question would happen here.</p></blockquote><h2 id="h-some-open-questions" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Some Open questions</h2><p>For a Block Builder to get their block included by the leader they have to make it attractive and incentivize the leader to do so with some kind of Fee and now with priority fee implemented on mainnet there seems to be a good economic plan to figure out the way this will go through, but here are some ways I think</p><ul><li><p>Builders take MEV and Priority fee giving all the gas reward to Leader</p></li><li><p>Priority fee + Gas to the Leader and Builders try to maximize their MEV output</p></li></ul><p>One of the double-edged swords of this approach is that Leaders won’t care much about the source of the block as long as it offers a good fee and maximizes</p><p>\(Gas\ paid/Compute_\ unit\)</p><p>but if a builder has some kind of secret sauce that allows them to outperform all the builders it could lead to block production centralization which is kinda happening on <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.relayscan.io/">Ethereum</a> with over 70% blocks from 3 builders This is where SIMD might shine as the builders are rotated based on their stake weight but still it’s an open area of discussion!</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/9aed0aea832ae88fd3962f9f320aee01fa03f64d0c80a0382ac4658b5b27e417.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 think you can contribute feel free to head to the github link!</p><p>PS: Thanks for making it till the end dear read! I am sure there will be a lot of mistakes in this post as I am just getting my hands dirty in this space so feel free to hit me up on twitter or comment on the post for corrections!</p><p>Resources</p><ul><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/solana-labs/solana/pull/24127/files#diff-d1383a1feca651b47a8978b468cf901eb5a5a1125292f004e2fda677067fa759">Github pr for async execution</a></p></li><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/solana-foundation/solana-improvement-documents/pull/45/files?short_path=43f62bd#diff-43f62bd92a8490e983f48d7c21f0d29f20f86af02b4706f9e5b5a5404beede01">SIMD</a></p></li><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.umbraresearch.xyz/writings/lifecycle-of-a-solana-transaction">Solana program life cycle</a></p></li><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://jito-labs.medium.com/jito-block-engine-expands-access-to-all-solana-mev-traders-96704fd6faaf">Jito Block engine</a></p></li><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/solana-labs/solana/blob/master/ledger/src/leader_schedule.rs">Solana Leader schedule</a></p></li></ul>]]></content:encoded>
            <author>madhavg@newsletter.paragraph.com (Madhav Goyal)</author>
        </item>
        <item>
            <title><![CDATA[⚡️Towards better Sequencer Decentralisation]]></title>
            <link>https://paragraph.com/@madhavg/towards-better-sequencer-decentralisation</link>
            <guid>hNL41za10FYevw5n24IK</guid>
            <pubDate>Thu, 11 May 2023 15:41:48 GMT</pubDate>
            <description><![CDATA[This post for a big part was inspired by Jon and Frontier’s work on MEV and sequencers, will be extending and diving into some of the ideas that would help with better block production and transaction flow in the future for rollup and alt L1 space.StructureWhat are Rollups?Architecture of rollupsWhat are Sequencers and MEV?Shared sequencers and different approaches.All things rollups!Rollups have been regarded as the future of Ethereum scaling because they solve the congestion issues on the m...]]></description>
            <content:encoded><![CDATA[<p>This post for a big part was inspired by <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/jon_charb">Jon</a> and <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://frontier.tech/">Frontier’s</a> work on MEV and sequencers, will be extending and diving into some of the ideas that would help with better block production and transaction flow in the future for rollup and alt L1 space.</p><h2 id="h-structure" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Structure</h2><ul><li><p>What are Rollups?</p></li><li><p>Architecture of rollups</p></li><li><p>What are Sequencers and MEV?</p></li><li><p>Shared sequencers and different approaches.</p></li></ul><h2 id="h-all-things-rollups" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">All things rollups!</h2><p>Rollups have been regarded as the <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://ethereum-magicians.org/t/a-rollup-centric-ethereum-roadmap/4698">future of Ethereum scaling</a> because they solve the congestion issues on the mainnet and partly because base layer Sharding is out of the picture for Ethereum but as the focus on Rollups increased they are still limited by the Data Availability and bandwidth of the base chain. This could be partially solved by the implementation of <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://notes.ethereum.org/@vbuterin/proto_danksharding_faq#">Proto-Danksharding</a> which introduces <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://madhavgoyal.substack.com/i/111679798/what-are-eip-and-blob-transaction">blob-carrying transactions</a> but that would still be limited to 2 X 125kb blobs per block so in crypto, blockspace is a commodity like real estate. Everyone wants to be at the hotspot where the activity/nightlife is good but as more people pour(Demand ∝Price) the price shots up so does the eth gas fee as more people are willing to pay for their transactions to be included in the latest block but one of the ways to solve this is built taller buildings and accommodate more people in the same footprint which is what rollups do. In simple terms, Rollups just compress a batch of transactions and post their proof of execution on the mainnet to prove their validity.</p><p>This way they can accommodate more transactions in the footprint of very few transactions saving blockspace. As rollups compress and do off-chain verifiability which means that the whole transaction data won&apos;t be on the mainnet but off-chain data stored in the machines that produced the proof of your transaction or the light clients.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/657290f21c6b11fef69c38c8eba2f7d8093e80fee6d6b72775b446dd11c6bb51.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>In this pipeline, Users send a transaction that first goes to a rpc/relayer which acts as the entry point and is then sent to sequencers that make blocks and submit them to proof producers. One machine could perform multiple operations, maybe the sequencer is also the proof producer depending on the case But why this architecture?</p></li></ul><p>This is different from the relayer directly sending the transactions to the validator scheduled to produce blocks because of <strong>Proposer Builder separation(PBS)</strong>. To make the system more censorship-resistant and save users, PBS was introduced in which the role of a block builder and proposer was separated. Now multiple block builders make blocks by packing transactions from users and only sharing the block headers with the amount of gas fee reward for Proposer but the transaction themselves are not shared. The proposer chooses the blocks with the highest rewards and includes them in the slot which still aligns the validator values to make more profits and user experience.</p><p>In older architecture, a block builder/validator would directly choose the transactions to include in the block which led to user exploitation(aka MEV) where Builders could arbitrage the user orders by front running them and taking profits from the slippage thus disincentivizing users like in traditional Finance where big HFT firms pay to get their supercomputers inside the exchange itself so they could read and write before the wider world and front run the opportunities which Defi is trying to solve by providing everyone the same data at the same time. MEV is basically the arbitrary reordering or insertion of transactions by block producers to increase the value extraction. Though there is nothing inherently bad about MEV because in an open permissionless system, agents work to maximize their output but it can hurt users.</p><h2 id="h-single-centralized-sequencers" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Single Centralized Sequencers</h2><p>These Block producers/sequencers are very important for the transaction pipeline to work efficiently as they have the power to include and drop any transaction but it becomes even more important in the rollup space as right now most of the big optimistic and zk rollups have centralized sequencers meaning that no one can run their own node outside of the team. This assumes a high degree of trust by the users and a security assumption of 1 of 2 as even if the sequencer drops the transaction, the user can still post their data directly to the rollup contract which would in the end defeat the purpose of using a rollup to save gas but it has some Big pros for its users and teams-&gt;</p><ul><li><p><strong>Soft Conformation</strong>: As rollups post transaction proofs or batches where the size of the proof does not increase at the same rate as the number of transactions it&apos;s economical for them to batch as many transactions and find the optimal time to post on the chain. Though this approach is great for saving gas but comes at the cost of user experience as someone posting a transaction would have to wait for till the proof is posted, by using single sequencers the rollup can give a soft confirmation and giving the final hard confirmation later when its posted as there is no one to interfere the proof production other than the founders.</p></li><li><p><strong>Extractions</strong>: Being able to maximize the gas and reward from a block incentivizes the team to improve the liveliness and security of the rollup.</p></li></ul><p>We can&apos;t forget at the end that the biggest ethos of being in crypto is Decentralisation and on that front rollups of today don&apos;t look quite good but teams are working + progressing on their roadmap of better decentralization but some cons are -&gt;</p><ul><li><p><strong>User experience</strong>: Recently after the Arbitrum airdrop, due to high load the <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://decrypt.co/124385/arbitrum-foundation-homepage-crashes-as-users-rush-to-claim-arb-tokens">Arbitrum sequencer hit the rate limit</a>, and because of it being a centralized sequencer system the network was not able to process transactions for a few hours.</p></li><li><p><strong>Censorship</strong>: With most of the sequencers based out of the USA and the recent OFAC ban on Tornado Cash, the teams would have to be responsible to censor the transactions that tried to interact with the tornado cash smart contract. As a big part of the eth block producers were using the same MEV framework of <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.google.com/search?q=ofac+complaint+ethereum+blocks&amp;oq=ofac+complaint+ethereum+blocks&amp;aqs=chrome..69i57.3907j0j1&amp;sourceid=chrome&amp;ie=UTF-8">Flashbots they were of complaint</a> meaning censoring the tornado cash transactions.</p></li></ul><p>One of the ways to handle this is open-sourcing the sequencer as Starknet did with <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/starkware-libs/blockifier">Blockifier</a> and <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/lambdaclass/starknet_tendermint_sequencer">Lambda team</a> made another implementation of the sequencer but this has also led to long confirmation times for the starkex ecosystem and loss of MEV to the team which I think is a good enough tradeoff if you are looking for decentralization and security but wait what if there is a better approach? Glad you asked about it my fren</p><h2 id="h-shared-sequencers" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Shared Sequencers</h2><p>To push for decentralization and better block production than centralized sequencers, Shared sequencers where rollups don’t have specified relays for their block production but rely on a network of shared relayers. It aggregates the security and liveliness of many rollups into a single layer eg <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://hackmd.io/@EspressoSystems/EspressoSequencer#">Espresso</a></p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/e58320c442f155408fa345d367be26ecc6c66b6a7f168d376ea528c1d63c6c23.jpg" alt="Credits: DBA from Jons Post" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">Credits: DBA from Jons Post</figcaption></figure><p>Credits: DBA from Jons Post</p><p>There are a lot of approaches to better transaction sequencing but Shared sequencers get a little bit good part of both worlds(a bit bad too)</p><ul><li><p><strong>Better Security &amp; Trust:</strong> Shared sequencers inherit better security as it&apos;s a network of participants and you just need to trust that at least 1 of N sequencers will pick up your transaction rather than 1 of 1 or 1 of 2 security assumptions in general rollup systems.</p></li><li><p><strong>Cross Domain MEV: I</strong>t would allow better cross-rollup communication and better arbitrage opportunities as the data from different state layers are readily available. This is good for rollup ecosystems like Arbitrum but App chains that see MEV as their biggest revenue stream wont have much value alignment with Shared Sequencers.Also, check out this paper going into <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://arxiv.org/abs/2112.01472">Cross domain MEV</a></p></li><li><p><strong>Competition: The i</strong>ntroduction of more participants introduces competition among agents to improve their services and quote fair prices.</p></li><li><p><strong>No Soft Conformation</strong></p></li></ul><h3 id="h-approaches-to-shared-sequencers-and-solutions-along-the-lines" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Approaches to shared sequencers and Solutions along the lines</h3><h2 id="h-based-rollups" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Based Rollups</h2><p>L1 enriched aka <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://ethresear.ch/t/based-rollups-superpowers-from-l1-sequencing/15016">based rollups</a> share their sequencers with L1 and inherit the security and censorship-resistant as they follow the same PBS system as the L1. Scheduled Builders and searchers would also be able to produce blocks for the rollup taking away the authority of centralized systems. Some Ws</p><ul><li><p><strong>Decentralization</strong>: It would allow L1 PBS to extract MEV for the rollups driving up their rewards and making it attractive for more folks to run Builder/proposer nodes for the base layer.</p></li><li><p><strong>Liveliness</strong>: Based rollups inherit their liveliness from L1 as the block production pipeline is the same.</p></li></ul><p>Some Ls</p><ul><li><p><strong>MEV</strong>: It&apos;s one of the biggest topics of consideration in any transaction supply chain discussion. If we get based rollups then the app chains will give up on one of their prime income sources which is MEV as fees on rollups as supposed to be less they would lose a huge chunk of their revenue. Having an application fee where users pay a fixed amount of fee for interaction with the dapp.</p></li><li><p><strong>Conformations</strong>: Having centralized sequencers give the rollups the ability to give soft conformations as blocks are built by the founding team which has some degree of trust that they won&apos;t do a reorg or produce an invalid state transition. Having shared PBS will lead to longer wait times as we would have to wait for the fraud-proof window to expire.</p></li></ul><h2 id="h-ss-on-cosmos-and-networks" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">SS on Cosmos and Networks</h2><p>Cosmos ecosystem stands out as the biggest advocate for modularity and app chain thesis where every dapp has its sub-chain that inherits security from the shared protocol, in this case, <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://ibcprotocol.org/">IBC(Inter Blockchain communication) protocol</a>. This opens up a huge world of possibilities for dapp developers giving them the flexibility that would not be possible with monolithic chains or would require whole network upgrades but it also comes with its challenges. Ethereum with its few rollups faces backlash because of its immature sequencer ecosystem but with the cosmos having thousands of chains the problem is amplified where each chain has to set up its own sequencer and builder. One of the ways to solve this is having a shared sequencer network kinda like what <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://blog.astria.org/introducing-astria/">Astria</a> is building where The sequencer network produces blocks containing transactions for multiple rollups and directly to the data availability layer and rollups retrieve transactions from there and produce new state roots for hard conformations.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/abb90f7679b1b2e0885b97997383dffa0cc330c79875bb0a811589e58ec0a52d.jpg" alt="Astria architecture" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">Astria architecture</figcaption></figure><h2 id="h-suave" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">SUAVE</h2><p>With MEV and a few different factors to maximize rewards, the Ethereum block production started centralizing and a few entities producing more than <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.relayscan.io/">60% of the blocks</a> to tackle this with a better system than having Shared sequencers, the flashbots team released SUAVE (<strong>Single Unifying Auction for Value Expression</strong>) which would act as a middleware for block production by building a credibly neutral encrypted mempool for transaction flow which will be resistant to bad MEV(to some degree) and being chain agnostic it would accelerate cross chain MEV extraction. With better MEV it would attract more agents to become a part of the network and better decentralization.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/e1d47e437d6d87504cfeb4e25fac88e1a02253f47c2439efb855a36fd9ddd641.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>SUAVE is more like a shared builder rather than just a sequencer which works as a plug-and-play for any chain but one of the considerations is that it would have to report all the state transitions happening due to its transactions back to the builders.</p><h3 id="h-conclusion" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Conclusion</h3><p>In this post I explained how rollups work and what are some good ways to reach a better level of sequencers decentralization, I never looked on the MEV front before this but it was a fascinating ride learned a lot about how complex actors collude to just verify a transaction on-chain. There are pros and cons to every approach but having a neutral shared sequencer network is going to be important for credible rollups in the future.</p><h2 id="h-open-questions" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Open Questions</h2><p>How would having a shared mempool of transactions for all the rollups and side chains affect the rent paid by them to the base layer?Right now rollups pay huge amounts of eth to the base layer as their DA and conformation layer, how does that look like in the future with sovereign rollups and many using Celestia as their DA but ethereum mainnet as their conformation layer? Might explore this in the next post!</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/70b368d12bac6179598b8f45e51529fb69345322f494e89561d84a722c50b307.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>PS: Thanks if you read this till the end! I am still learning so if you see any mistakes or corrections feel free to reach out!</p><p>Resources used-&gt;</p><ul><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://arxiv.org/pdf/2112.01472.pdf">Unity is Strength: A Formalization of Cross-Domain Maximal Extractable Value</a></p></li><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://joncharbonneau.substack.com/p/rollups-arent-real">Rollups Aren’t Real</a></p></li><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://arxiv.org/abs/1904.05234">Flash Boys 2.0 paper</a></p></li><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://frontier.tech/beyond-extraction">Beyond Extraction</a></p></li><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://ethresear.ch/t/proposer-block-builder-separation-friendly-fee-market-designs/9725">Market Friedly PBS</a></p></li><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://stonecoldpat.substack.com/p/tiers-of-transaction-finality-for">Tiers of Finality</a></p></li><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://dune.com/web3_data/block-producers">Dune Dashboards</a></p></li></ul>]]></content:encoded>
            <author>madhavg@newsletter.paragraph.com (Madhav Goyal)</author>
        </item>
        <item>
            <title><![CDATA[🏕️State of Solana ReFi]]></title>
            <link>https://paragraph.com/@madhavg/state-of-solana-refi</link>
            <guid>7wHMfg76i4ZymlcbthmW</guid>
            <pubDate>Sat, 08 Apr 2023 19:17:02 GMT</pubDate>
            <description><![CDATA[Crypto has been mocked as a planet-killing machine that’s causing climate change with its carbon footprint, but is it even true? Could it be the opposite of this? Some of the biggest blockchains are carbon neutral and a few like Celo are even carbon negative many times over 8x to be precise! Carbon Markets and regenerative projects are the only hope to stop the looming climate disaster because we as a society can not cut our energy and material consumption at a speed that matches our carbon b...]]></description>
            <content:encoded><![CDATA[<p>Crypto has been mocked as a planet-killing machine that’s causing climate change with its carbon footprint, but is it even true? Could it be the opposite of this?</p><p>Some of the biggest blockchains are carbon neutral and a few like Celo are even carbon negative many times <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://blog.celo.org/a-carbon-negative-blockchain-its-here-and-it-s-celo-60228de36490)">over 8x to be precise</a>! Carbon Markets and regenerative projects are the only hope to stop the looming climate disaster because we as a society can not cut our energy and material consumption at a speed that matches our carbon budget left to<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.carbonbrief.org/analysis-how-much-carbon-budget-is-left-to-limit-global-warming-to-1-5c/"> reach 1.5 C goal</a>, we can either offset it or replace them with more efficient alternatives but there will always be an impact on the environment at some level so our biggest hope is offsetting the carbon we release with investing in regenerative projects like afforestation.Carbon markets are predicted to grow 1<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.mckinsey.com/business-functions/sustainability/our-insights/a-blueprint-for-scaling-voluntary-carbon-markets-to-meet-the-climate-challenge">5x by 2030 and 100x by the year 2030</a>. But Carbon Markets and offsetting projects today face all sorts of challenges that need to be addressed before we hinge our hopes on them.</p><h2 id="h-problems-faced-by-traditional-markets-and-how-web3-can-solve-them" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Problems faced by traditional Markets and how Web3 can solve them!</h2><h3 id="h-double-spending" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Double Spending</h3><p>Having isolated distributed ledgers mean that there is no consensus on the data about a carbon credit or its current state, traditional carbon markets have faced this for a long time where a single credit was counted in several different ledgers and sold to different customers rendering its impact to a fraction of what it was intended.</p><p>It is estimated that current carbon markets are <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.statista.com/statistics/1334848/global-carbon-market-size-value/">having less than half</a> of the intended effect they should make.So, how can we solve this? The answer is having an open decentralized ledger where anyone can verify the data which would be a boon for the industry, having all the data in a single place and verified by several agents can easily improve the efficiency by 40%.</p><h3 id="h-gate-keeping" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Gate Keeping</h3><p>Starting an Offsetting or regenerative project takes millions of dollars in funding and approval from a million different government agencies later the need to pay fees on being able to trade them and make them available to the global carbon market. The fee charged by these exchanges leaves very less room for improving the project.</p><p>Web3 allows anyone to start their project without the need for old conformations by just following the on-chain permissionless protocol standards it democratizes the process reducing the friction and unlocking the potential!</p><p>For example -projects like the <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.openforestprotocol.org/"><strong>Open Forest protocol</strong></a> allow people to start their projects and incentivize the verifiers to check the data which mints an nft into the data of the projects that is verified on chain.</p><h3 id="h-standardization" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Standardization</h3><p>Having a consensus on the quality and verifiability of the credits would assure the buyers of the credits’ origin and impact. Right now most of the multinational companies that need to meet their climate goals buy the lowest grade of credits just to be carbon neutral on paper and never check its actual impact.Having unified standards to rank real-world assets on their impact could solve this.</p><h2 id="h-why-solana" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Why Solana?</h2><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/96361dad23a66335c05f6dfb1f14cea13d2eae9a9f10cbd119df920cb13fa433.png" alt="Solana Energy usage" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">Solana Energy usage</figcaption></figure><p>Solana is inherently aligned with the values of refi being one of the most optimized and efficient blockchains out there. Most of the blockchains like Ethereum, evm, and Bitcoin can only use a fraction of the cores of the total CPUs whereas today CPUs have on avg 8 cores meaning a big part of the computational capacity is unused while energy usage remains the same but with Solana&apos;s <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://medium.com/solana-labs/sealevel-parallel-processing-thousands-of-smart-contracts-d814b378192">sea level runtime</a> the node can is able to utilize the hardware much better and able to isolate spikes in activity to special threads leading the development of<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://madhavgoyal.substack.com/p/solana-fee-markets"> local fee markets</a> on Solana where a spike in activity in one program doesn&apos;t affect the fee paid by overall users. One of the central parts of any refi/ carbon industry is having a robust central registry of all the carbon assets and their data. <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.theclimatewarehouse.org/work/climate-action-data-(cad)-trust">Projects like CAD(Central Action Data)</a> trust are building a warehouse of credits and unifying the carbon registry ledgers to solve the problems of traditional markets. They need a chain that’s fast and can handle vast amounts of on-chain data. In Solana, everything is an account and for different purposes, there are different types of them. Accounts handle data/programs and can be upto 10mb which allows the functionality to have an account for every single carbon credit which and to store its metadata by paying the rent as long as the credit is in use and when the credit is retired the account is deleted freeing up the rent which is transferred back to the retiree. With <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://solana.com/news/state-compression-compressed-nfts-solana">compressed nfts</a> this could be taken further!</p><hr><h2 id="h-refi-landscape-and-projects" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">ReFi Landscape and Projects</h2><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/2d210c53492375b6c33ab06532769a233b218f3b8a66171ecf8718039ed8315e.jpg" alt="Solana refi knowledge graph built by me" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">Solana refi knowledge graph built by me</figcaption></figure><p>Obsidian Knowledge graph of all the refi projects built or planning to build on Solana! The graph is o<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/hydrogenbond007/Solana-refi-graph">pen source</a> feel free to check it out and contribute! <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://publish.obsidian.md/solana-refi/CarbonX">Website </a>→ <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://publish.obsidian.md/solana-refi/CarbonX">https://publish.obsidian.md/solana-refi/CarbonX</a></p><h3 id="h-deplan-proto" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">De_Plan Proto</h3><p>Proto is a data registry protocol built on Solana that provides the functionality of proof of location for the assets in the data registry. This allows us to build Geo Nfts which can work as location tagging for different assets and in their interoperability which will allow better mapping of different aspects of real-world assets(RWA). Proto introduces POL(Proof of Location) verifying the location with new standards like Bluetooth beacon, LoRaWAN Hotspot, and mobile bandwidths nullifying the tampering of location with normal VPNs. To measure the quality of the mapped location Proto assigns a POL score for the assets. Check out t<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://docs.proto-geo.xyz/error-handling-rate-limits-and-suppor">he proto docs</a>!</p><h3 id="h-atlantis-dao" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Atlantis DAO</h3><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.atlantians.world/litepaper">Atlantis team</a> is working on building systems and infrastructure to align incentives and help institutes coordinate better to offset their climate impact with the help of their &quot;proof of impact&quot;. They building a decentralized bounty dashboard that works as a coordination point for someone who can offset carbon and someone who wants to offset carbon. The progress is tracked on a chain with smart contracts and parties. They have also built <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.linkedin.com/company/hydrop-india/?originalSubdomain=in&amp;ref=blog.refidao.com">Hydrop</a> which streamlines, quality checks, and decentralizes the water access to Bangalore and Chikmagalur.</p><h3 id="h-sunrise-stake" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Sunrise Stake</h3><p>Sunrise Stake incentives people to stake with them and uses the yield/ stake rewards generated to fund regenerative projects around the globe. For every Sol staked they get a gSol which is<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://docs.sunrisestake.com/#feeless-liquid-unstaking"> 1:1 backed and is used to redeem the Sol back.</a></p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/9b76ee6443532abd687d7200a3a58370c8558e6bb629b4032b0c2bc6912b13ef.jpg" alt="Sunrise stake Working map" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">Sunrise stake Working map</figcaption></figure><h3 id="h-gainforest" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">GainForest</h3><p>Gainforest has to be one of the most exciting projects in the refi space, they are aligning incentives of the donors and conservationists by building an open protocol that allows conservationists to plant &amp; maintain forests which are then monitored by <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://gainforest.app/overview/3">satellite imagery for MRV</a> processes and as the data becomes more accurate the conservationists are rewarded with tokens.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/941a10cb16c5660fea0e8de2dc0e3d3f01e1e68d6be7d48d5110822d69573b40.png" alt="Gainforest flowchart" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">Gainforest flowchart</figcaption></figure><h3 id="h-carbovalent" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Carbovalent</h3><p>Bridging the gap between Voluntary Carbon Markets to Solana, Carbovalent is providing access to Carbon assets for investment and retirement. There are four main components of the protocol to onboard the assets onto Solana</p><ul><li><p>Reviewing the data about the credit and making sure it matches the sourcing standards for validity and quality.</p></li><li><p>Bridging them onto the chain with <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://docs.carbovalent.com/bridge/morpheus-carbon-bridge">Morpheus bridge</a> and making sure they retired from their old registry</p></li><li><p>NFT is minted to represent the carbon credit and contains the data about the transactional history and all other data like quality, heritage can be viewed on the dappMake sure to check <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://docs.carbovalent.com/understanding-carbon/carbon-credits">out all the amazing tech built!</a></p></li></ul><h3 id="h-arbon" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Arbon</h3><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://docsend.com/view/jmc2cqhpsmzj9t9h">Arbon</a> is one of the recent winners of the Grizzlithon Hackathon building on the Data side of Refi providing Using AI and real-time mapping of the earth and posting the results onchain to prevent data tampering allowing better incentivization model for stewards who actually maintain all the eco projects.</p><hr><h2 id="h-gaps-and-improvements" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Gaps and Improvements</h2><p>After researching different blockchains for the past few months I have realized that Solana has immense potential because of its accounts model and data management for more refi projects but there seem to be fewer projects being built on Solana compared to other rollups and alt L1s. <strong>Here are some of the aspects we could improve to kickstart the Refi Summer on Solana.</strong></p><h3 id="h-lack-of-refi-awareness-among-devs-and-the-ecosystem" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Lack of ReFi Awareness among devs and the ecosystem</h3><p>This seems to be one of the most common pain points shared by founders where very few developers are climate-conscious or even know about refi space which makes it hard for them to hire new developers. One of the founders said finding a developer is like I quote &quot;finding a needle in a haystack&quot;.</p><p><strong>What Could solve this? More Resources and funding towards building the ReFi knowledge stack on Solana to educate developers that are exploring building on Solana about the ReFi space and its opportunities!</strong></p><h3 id="h-mrv-and-orcales" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">MRV and Orcales</h3><p>ReFi projects need off-chain real-world data to function as their models are based on changing Environments and stimuli but there are very few projects that have an MRV(Measurement, reporting and Verification) protocol that allows anyone to tap into the data and build on top of it.</p><p>De_plan Proto &amp; Gainforest are building on this front but we need better services that fetch real-world data; for example - changing weather and forest cover from satellites and posting it on the chain.Helium Would be a boon to this as many projects are building DMRV solutions on top of helium which will soon migrate to Solana!</p><h3 id="h-spl-limitations-and-lack-of-native-carbon-assets" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">SPL limitations and lack of native Carbon Assets</h3><p>Even with all the amazing refi projects building on Solana, the community doesn&apos;t yet have a native carbon asset like Celo does because of Toucan which is one of the key aspects of any thriving Refi ecosystem. Most of the wallets only support SPL token standards leaving out SFT and other standards that could be used as assets representing the real world.</p><h3 id="h-conclusion" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Conclusion</h3><p>We as an ecosystem have amazing builders and products that have the potential to have a huge impact on the world but we also have a long way to go. ✌🏾</p><p><strong>PS</strong>: Shoutout to you dear reader for sticking it till the end of the post! make sure to check out the refi graph I made and the work by Climate Collective mapping all the<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://kumu.io/climate-collective/web3-climate-map#main/internet-of-energy"> refi projects in web3 ecosystem</a>!</p><p>Resources used: A lot of research went into this piece so sorry if I forget to mention any resource would gladly link just shoot me an email at <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="mailto:madhav@civicsunplugged.org">madhav@civicsunplugged.org</a></p><ul><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://blogs.sap.com/2014/01/08/has-the-era-of-greenwashing-passed/">https://blogs.sap.com/2014/01/08/has-the-era-of-greenwashing-passed/</a></p></li><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.carbonbrief.org/analysis-how-much-carbon-budget-is-left-to-limit-global-warming-to-1-5c/">https://www.carbonbrief.org/analysis-how-much-carbon-budget-is-left-to-limit-global-warming-to-1-5c/</a></p></li><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.academia.edu/1160231/Fault_lines_in_climate_policy_what_role_for_carbon_markets">https://www.academia.edu/1160231/Fault_lines_in_climate_policy_what_role_for_carbon_markets</a></p></li><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://blog.refidao.com/top-refi-projects-on-solana/?ref=refi-roundup-newsletter">https://blog.refidao.com/top-refi-projects-on-solana/?ref=refi-roundup-newsletter</a></p></li><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.theguardian.com/sustainable-business/blog/why-are-carbon-markets-failing">https://www.theguardian.com/sustainable-business/blog/why-are-carbon-markets-failing</a></p></li></ul>]]></content:encoded>
            <author>madhavg@newsletter.paragraph.com (Madhav Goyal)</author>
            <enclosure url="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/9f3bc0ad22b76033df8a528ff1722835dd66cb316282f027b07d1475750dc135.jpg" length="0" type="image/jpg"/>
        </item>
        <item>
            <title><![CDATA[📜Rollups on Solana and EIP-4844]]></title>
            <link>https://paragraph.com/@madhavg/rollups-on-solana-and-eip-4844</link>
            <guid>joeQFOV8cDogMFIv6LOe</guid>
            <pubDate>Fri, 31 Mar 2023 13:48:59 GMT</pubDate>
            <description><![CDATA[When there is a global virtual machine running inside thousands of machines computing the same data it&apos;s hard to be as fast as a single server computing that data without any verification from outer sources/inspectors. This has been one of the biggest fallouts of Ethereum and its low tps which has given rise to a totally another ecosystem working on allowing Ethereum to process more transactions. Blockchains have caps on the amount of data + computation that can be fit into a single bloc...]]></description>
            <content:encoded><![CDATA[<p>When there is a global virtual machine running inside thousands of machines computing the same data it&apos;s hard to be as fast as a single server computing that data without any verification from outer sources/inspectors. This has been one of the biggest fallouts of Ethereum and its low tps which has given rise to a totally another ecosystem working on allowing Ethereum to process more transactions. Blockchains have caps on the amount of data + computation that can be fit into a single block to prevent dos attacks done by malicious vectors to halt the network. As Ethereum has only limited blockspace and many parties wanted to include their transactions in the latest block this started to drive the fee paid to validators/miners to include their transactions higher. Ethereum is a single global fee market where all the parties are competing for their transaction to be included in the block and activity on any one program affects the gas paid by all users, unlike Solana which has paralleled local fee markets where every program hotspot is contained allowing users who do general transactions to carry on.This is achieved by the state management system of Solana where everyone program has to specify beforehand all the programs &amp; states it’s going to touch. Ethereum’s global fee market led to huge fee spikes to thousands of dollars whenever there was a big hyped event like an nft mint or a token airdrop rendering the chain unusable for an average person who wanted to transfer some tokens and was unable to pay hundred dollars for the transfer. This will be solved by sharding to only a small extent as even after sharding it won’t be able to create isolated states and separate fee markets for different programs.This problem has been intended to be solved by rollups.</p><p>Rollups are off-chain scaling solutions where they verify and compute the transaction of the mainnet and post the data proof that maintains the computational integrity of the transaction. To make this efficient rollups batch many transactions in submit proof that validates them on the mainnet. There are two types of rollups-&gt;</p><h1 id="h-what-are-rollups" class="text-4xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">What are Rollups?</h1><ul><li><p><strong>Optimistic rollups</strong>: They optimistically assume that every transaction is correct and verify it, but there is a time window where one can object to the integrity of the transaction by producing fraud-proof. A fraud-proof usually consists of transactions itself and some Merkle tree data to convince it’s invalidity.It is a pretty good system for the most part but as there is a time window which is usually around ~1 week the transaction has a chance of failing to lead to longer wait times. But optimistic rollups also get a lot of things right check <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://mirror.xyz/toghrulmaharram.eth/NU-rLAJmgMpl_8O8_1svhbIYmU5sk44Nn5UzmkOThQs?ref=defi-suomi">out this post</a>.</p></li><li><p><strong>Zero-Knowledge rollups</strong>: <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://people.csail.mit.edu/silvio/Selected%20Scientific%20Papers/Proof%20Systems/The_Knowledge_Complexity_Of_Interactive_Proof_Systems.pdf">ZK</a> rollups post a cryptographic proof on the mainnet showing the execution of the transaction. The type of zk rollup depends on the type of zero-knowledge proof produced by the rollup, <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://pseudotheos.mirror.xyz/_LAi4cCFz2gaC-3WgNmri1eTvckA32L7v31A8saJvqg">won&apos;t go into much detail as there is an excellent blog post on the difference between zk proofs</a> -&gt;</p><ul><li><p>SNARKS (Succinct Non-Interactive Argument of Knowledge) -&gt; Non-interactive meaning once the proof is generated the parties don’t need to interact and their validity can be checked by anyone by running a verification algorithm.</p></li><li><p>STARKS(Scalable Transparent Argument of Knowledge) -&gt; Starks are bigger than Snarks but easier to compute and proof as verifier\_time= O(N * poly-log(N)). but as the size of the proof goes up for stark the verification times don’t go up allowing a better verification system.</p></li></ul></li></ul><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/4fdf139908e9539730b45913ae25ac12e96af01adf12ec18e71d78d65465473e.png" alt="Source: consensys and mysten labs " blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">Source: consensys and mysten labs</figcaption></figure><p>The number of transactions rollups can do is limited to their data availability layer and consensus layer because, at the end of the day, they have to post the proofs on the mainnet. Decoupling the two layers is what <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://celestia.org/resources/">Celestia is working</a> on by making sovereign rollups that are not attached to any mainnet but are free to choose and move around different Data availability layers but L2 rollups have the security of Ethereum. To fix the issue of DA(data availability) on Ethereum post-sharding the proposal <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://ethereum-magicians.org/t/eip-4488-transaction-calldata-gas-cost-reduction-with-total-calldata-limit/7555">EIP 4844</a> was introduced.</p><h1 id="h-what-are-eip-4844-and-blob-transactions" class="text-4xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">What are EIP-4844 and Blob Transactions?</h1><p>It is <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://notes.ethereum.org/@vbuterin/proto_danksharding_faq#">proto-dank sharding</a> means it will implement the scaffolding needed for dank sharding to happen on Ethereum and the biggest focus is on introducing a new type of transaction called blob transactions. These transactions will be blob-carrying transactions that are quite bigger in the order of &gt;100kb. As these blobs have a big data limit it will allow the rollups to post bigger batches of transactions on the mainnet, this data is not available to the mainnet so the validators do not have to process this data themselves but need to be maintained for a short period.</p><h1 id="h-why-rollups-on-solana" class="text-4xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Why Rollups on Solana?</h1><p>Solana was one of the pioneers of parallel execution in blockchains which unlocked a whole set of new features that makes it a super-performant blockchain. Solana&apos;s Sealevel runtime allows thread assigning to programs and isolates different states so that there are no fee spikes faced by normal users.</p><p>If the transactions on Solana are already very cheap then why rollups? Solana Virtual Machine is a high performant virtual machine if implemented on other chains could have a great impact eclipse takes it further by building an SVM rollup that could work as a settlement layer for other L3s kinda like fractal scaling of Starknet but with the performance boost of Solana. Eclipse hopes to build an SVM settlement layer that could have its consensus on any chain chosen by the developers of L3. <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.eclipse.builders/documentation/what-is-eclipse">As of now, Eclipse rollups are optimistic</a> rollups meaning they use fraud proofs but they are also building zk rollups with <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.risczero.com/">RiscZero.</a> Also one of the biggest cases is that Rollups allow a degree of composability and developer freedom that is not allowed by a monolithic chain but there is a hurdle, SVM has a transaction data limit of ~ 1.3 kb, and the need to write data into an account slowly which would be a hurdle for posting large batches of transaction for rollups.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/8594ad948d2a98df26120e150640daa1320632c401bd51a0a335804cd6bda557.jpg" alt="Eclipse " blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">Eclipse</figcaption></figure><p>As rollup data is not necessary to be written into the state changes itself but only needs to be verified for availability blob transactions can also be applied to Solana. These data blobs will have data and metadata of commits in the form of <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://scroll.io/blog/kzg">KZG</a>, data will be posted with a sidecar but only the KZG commits will be written on the chain and the blob itself needs to be only maintained for a little amount of time for data availability but later it could be verified with the help of KZG commits which would take a lot less time.</p><p>What <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://scroll.io/blog/kzg">KZG? KZG is a p</a>olynomial commitment scheme in which whenever we make a commit c to a polynomial p, it becomes binding meaning for a value of c there is only one p. The cool thing about commitment schemes is that with the commitments made, we can verify it belongs to the polynomial without ever revealing the polynomial itself. We can verify that for any value of m there is only one value n while keeping the function or phrase itself private.</p><p>Another application is Proto-Danksharding: data blobs are represented as polynomials, and their commitments are computed via KZG. The mathematical properties of KZG enable data availability sampling, which is critical to the scaling of Ethereum’s data layer.</p><hr><p>PS and resources used→ Thanks for reading the post dear reader! means a lot to me and if you want to support me feel free to airdrop anything at madhavg.eth or madhavg.sol! Also would love feedback! Big shout to Neel Salami, Xoheb and harsh for their feedback! (thanks lads!)</p><ul><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/Eclipse-Laboratories-Inc/solana-improvement-documents/blob/sidecar-data-availability/proposals/0019-data-availability.md">https://github.com/Eclipse-Laboratories-Inc/solana-improvement-</a></p></li><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/Eclipse-Laboratories-Inc/solana-improvement-documents/blob/sidecar-data-availability/proposals/0019-data-availability.md">documents/blob/sidecar-data-availability/proposals/0019-data-availability.md</a></p></li><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/ethereum/research/wiki/A-note-on-data-availability-and-erasure-coding">https://github.com/ethereum/research/wiki/A-note-on-data-availability-and-erasure-coding</a></p></li><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://notes.ethereum.org/@vbuterin/proto_danksharding_faq#">https://notes.ethereum.org/@vbuterin/proto_danksharding_faq#</a></p></li><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://pseudotheos.mirror.xyz/">https://pseudotheos.mirror.xyz/</a></p></li><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.eclipse.builders/how-does-eclipse-work">https://www.eclipse.builders/how-does-eclipse-work</a></p></li></ul>]]></content:encoded>
            <author>madhavg@newsletter.paragraph.com (Madhav Goyal)</author>
        </item>
        <item>
            <title><![CDATA[⚡️Current Solana]]></title>
            <link>https://paragraph.com/@madhavg/current-solana</link>
            <guid>E8NZogFO5R0rAEqlb6qJ</guid>
            <pubDate>Thu, 23 Mar 2023 16:47:53 GMT</pubDate>
            <description><![CDATA[BackgroundThis post has been inspired by the eth core dev updates and current ethereumMost of the information here is sourced from the solana main repo pull requests and issues And the Solana community calls + Notes so feel free to dig in. The main goal is to bring more eyes to upcoming proposals so that folks could contribute and get more active in shaping the Solana roadmap.This will be a series of Posts covering Simds and core solana tech so stay tuned!What are SIMDs?SIMD-0022 ( first comm...]]></description>
            <content:encoded><![CDATA[<h2 id="h-background" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Background</h2><p>This post has been inspired by the eth core dev updates and <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://luozhu.mirror.xyz/9cpjU63vBLoQPAalc7ORG_BtHkOJFqPtY9UpK5qWuGM">current ethereum</a>Most of the information here is sourced from the solana main repo pull r<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/solana-labs/solana/pulls">equests and issues</a> And the <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/solana-foundation/core-community-call">Solana community calls + Notes</a> so feel free to dig in. The main goal is to bring more eyes to upcoming proposals so that folks could contribute and get more active in shaping the Solana roadmap.This will be a series of Posts covering Simds and core solana tech so stay tuned!</p><ul><li><p>What are SIMDs?</p></li><li><p>SIMD-0022 ( first community-accepted core SIMD)</p></li><li><p>SIMD-0016: Application Fee</p></li><li><p>SIMD-0019: Sidecar for Data Availability</p></li></ul><h2 id="h-what-are-simds" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">What are SIMDs?</h2><p>What truly makes a decentralized protocol is its functioning and maintenance/upgrades run by the community with its effort. For changes to the core implementation, all the decentralized protocols like Ethereum, ENS, Solana, and Mozilla have community proposals that are discussed and then voted on by the community before they are implemented in the core. SIMD aka Solana Improvement Documents/proposals are the community proposals to make changes to the solana core validator, there has been convo around which updates should require a proposal and general consensus is that an simd should be targeting a substantial new feature. One of the hardest parts of introducing new features and making changes to core client code is that as new client implementations get built like <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://jumpcrypto.com/firedancer/">Firedancer</a>, tinydancer they would also have to make changes and make sure that the bugs are battle-tested cause small bugs can cause big problems. One of the last outages was caused by a bug in the <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://solana.com/news/02-25-23-solana-mainnet-beta-outage-report">consensus on the newly released versions</a> which has brought a lot of attention to new approaches to test new updates + features. A proposal goes through a lot of phases from ideation to forums to poc(proof of concept) to testing before its implemented in the core even then to maintain the stability of the network is closely monitored for bug fixes. Most of the hyped new features like dank sharding, Account Abstraction were first introduced as new <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://eips.ethereum.org/">EIPs</a> to the community which was heavily worked on.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/68d814e6fbf06246e5c80cdbd6aa92f93817d27b64eba722b471d73e6fc813a4.jpg" alt="A small flow diagram of how SIMDs are implemented" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">A small flow diagram of how SIMDs are implemented</figcaption></figure><p>Note: Only 1 simd has been accepted so the process is still flexible to the community’s needs and nothing is hard coded.</p><h2 id="h-simd-0022" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">SIMD-0022</h2><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://docs.solana.com/cli/delegate-stake#advanced-derive-stake-account-addresses">Multi-stake proposal</a> is the first SIMD to be accepted + implemented making changes to the stake features of the Solana protocol. In POS systems where validators stake their tokens to qualify to be block producers, anyone can delegate their tokens to validators so that they could reap the benefits of mining without putting the effort into setting up a new node. As everything on solana is an account even a program, whenever some amount of data is stored a new account with paying rent in lamports is created. As more and more folks delegate to diff parties this process could become cumbersome but with small stakes + liquid staking the validators have to maintain liquidity so delegators could exit as they wish or there&apos;s no exit liquidity at all. whenever a delegator wants to re-delegate their stake with some other validator it has to be deactivated which unlocks after the epoch and re-activated with the new validator which adds the cost of opening multiple accountsSolution -&gt; Make a new type of account that has 2 <strong>Delegation instances</strong> that can be called and updated without making/closing additional accounts using less storage and in turn fee. A stake account can be created by</p><pre data-type="codeBlock" text="solana create-stake-account --from &lt;KEYPAIR&gt; stake-account.json &lt;AMOUNT&gt; \--stake-authority &lt;KEYPAIR&gt; --withdraw-authority &lt;KEYPAIR&gt; \
--fee-payer &lt;KEYPAIR&gt;
// to create a stake account

solana stake-account &lt;STAKE_ACCOUNT_ADDRESS&gt;
//to check amount of sol in stake_account
"><code>solana create<span class="hljs-operator">-</span>stake<span class="hljs-operator">-</span>account <span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-keyword">from</span> <span class="hljs-operator">&#x3C;</span>KEYPAIR<span class="hljs-operator">></span> stake<span class="hljs-operator">-</span>account.json <span class="hljs-operator">&#x3C;</span>AMOUNT<span class="hljs-operator">></span> \<span class="hljs-operator">-</span><span class="hljs-operator">-</span>stake<span class="hljs-operator">-</span>authority <span class="hljs-operator">&#x3C;</span>KEYPAIR<span class="hljs-operator">></span> <span class="hljs-operator">-</span><span class="hljs-operator">-</span>withdraw<span class="hljs-operator">-</span>authority <span class="hljs-operator">&#x3C;</span>KEYPAIR<span class="hljs-operator">></span> \
<span class="hljs-operator">-</span><span class="hljs-operator">-</span>fee<span class="hljs-operator">-</span>payer <span class="hljs-operator">&#x3C;</span>KEYPAIR<span class="hljs-operator">></span>
<span class="hljs-comment">// to create a stake account</span>

solana stake<span class="hljs-operator">-</span>account <span class="hljs-operator">&#x3C;</span>STAKE_ACCOUNT_ADDRESS<span class="hljs-operator">></span>
<span class="hljs-comment">//to check amount of sol in stake_account</span>
</code></pre><p>Links <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/solana-labs/solana/pull/24762">PRs</a> <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/solana-foundation/solana-improvement-documents/blob/main/proposals/0022-multi-stake.md">SIMD</a></p><h2 id="h-simd-0016-application-fee" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">SIMD-0016 (Application Fee)</h2><p>For any interaction with the protocol, the states that are touched by the interaction have to be predefined which allows Solana to parallelize the transactions and assign threads for the computation of specific programs. This makes local fee markets where the different amount of gas fee is paid for interaction with different programs allowing for the normal functioning of the protocol during high activity due to specific events. But this also creates the concept of Dapp Blockspace where only a certain amount of the block is filled by specific program interactions, when rogue/greedy agents spam the same program it becomes unusable for normal users.<br>Solution-&gt; this Simd tries to introduce something called an application fee which everyone has to pay in order to interact with the program and directly goes to the developer of the program(who has access to the dapp account). The fee can be rebated depending on the developer and the fee has to be paid even if the transaction fails which penalizes the bad behavior and makes dapps more user-centric. On a high level, it would require a new native program with instruction of <strong>App_fee</strong> to be set by the developer.<br>Links <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/solana-foundation/solana-improvement-documents/pull/16">SIMD</a> <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/solana-labs/solana/issues/21883">https://github.com/solana-labs/solana/issues/21883</a><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.wordcelclub.com/madhavg.sol/a-case-for-application-fee">MY blogpost</a></p><h2 id="h-simd-0019-sidecar-for-data-availabilty" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">SIMD-0019 (Sidecar for Data Availabilty)</h2><p>The main focus of rollups is to verify a bunch of transactions with the help of off-chain computation and post the least amount of data to cryptographically secure the transaction on the chain. Zero-knowledge rollups just put the zk proof of the transactions executed on the chain to show its computational integrity. But a big part of it is that the transaction data itself is not saved on the mainnet but on off-chain services which makes it less likely to be there for a long time but it still maintains the hash of txn. As the proofs are smaller than the data of all the txns combined they are still bigger than a single txn which makes Solana&apos;s single transaction data limit ~ 1.3 kb to be a hurdle. Ethereum will be facing the same issue post-sharding so they introduced a new EIP named <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://notes.ethereum.org/@vbuterin/proto_danksharding_faq#https://notes.ethereum.org/@vbuterin/proto_danksharding_faq#">Proto-Danksharding</a> which would use Data availability sampling for the data blobs.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/3e3f83caa1b1dd40eb359da0bb217e18eebb7163f2d4f43a24424308c70be898.png" alt="Taken from vitaliks post on protodanksharding" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">Taken from vitaliks post on protodanksharding</figcaption></figure><p><strong>SIMD-0019</strong> enables <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/ethereum/research/wiki/A-note-on-data-availability-and-erasure-coding">blob transaction</a>s which are chunks of data posted on the mainnet bigger than the current limit. As the posted proofs themselves don&apos;t require computational effort they are only needed to be stored for a certain amount of time and with the help of <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.paradigm.xyz/2022/08/das">DA sampling</a> it could be further optimized. This would allow a more rollup-friendly approach where dapps could launch rollups to add more functionality to it and still maintain solana as their root base where they post the proof and inherit its security.Links <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/Eclipse-Laboratories-Inc/solana-improvement-documents/blob/sidecar-data-availability/proposals/0019-data-availability.md">SIMD</a></p><p>The <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://forum.solana.com/">Solana forum</a> is up which will be one of the centers of discussion for new updates and features so make sure to check it out</p><p>PS: thanks for Making it to the end! Gonna be making more tech dives on solana in the future. Also there were way too many resources and fragmented readings that went into this post so if I forget to link a resource feel free to reach out to me!</p>]]></content:encoded>
            <author>madhavg@newsletter.paragraph.com (Madhav Goyal)</author>
        </item>
        <item>
            <title><![CDATA[A case for Application Fee]]></title>
            <link>https://paragraph.com/@madhavg/a-case-for-application-fee</link>
            <guid>pElqhRatt3XyRV8rTxEz</guid>
            <pubDate>Wed, 22 Mar 2023 12:44:10 GMT</pubDate>
            <description><![CDATA[One of the biggest selling points for Solana is its ability to provide super cheap transactions no matter the amount of activity happening on the chain because of its feature of local fee markets. But with great power comes great responsibility as gas fee is one of the biggest security measures against spam/attack vectors Solana has been dealing with the issue for a while where many different bots fill up the blockspace with useless transactions and normal users are unable to do anything. As ...]]></description>
            <content:encoded><![CDATA[<p>One of the biggest selling points for Solana is its ability to provide super cheap transactions no matter the amount of activity happening on the chain because of its feature of <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.wordcelclub.com/madhavg.sol/solana-fee-markets">local fee markets</a>. But with great power comes great responsibility as gas fee is one of the biggest security measures against spam/attack vectors Solana has been dealing with the issue for a while where many different bots fill up the blockspace with useless transactions and normal users are unable to do anything. As with the concept of local fee markets, it also forms a cap on the dapp blockspace.</p><p>Here in the thread, Jito team shares how 585 of the validator processing time is spent on failed mev transactions which clog up the block space and waste the validator, and how in the end only 2% of the mev transactions are actually verified.</p><br><p>a big example of this is especially with defi markets where hft bots are trying to front-run the normal users whenever they see an opportunity to make a buck. As these failed transactions are in nobody&apos;s interest but hurt the developers as these txns eat up their dapp blockspace and still not turning up in profit or volume. One of the solutions to this would be the implementation of <strong>QUIC.</strong></p><p>Solana uses <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.geeksforgeeks.org/user-datagram-protocol-udp/">udp (User Datagram Protocol)</a> where the data is sent directly to the other Party without any bi-lateral authentication. Let&apos;s say bob sends Alice a packet of data containing the transaction that it wants to process on the chain, Alice being a good validator takes the txn and includes it in the block but seeing the good behavior of Alice Bob starts sending countless small txns to Alice and overflooding its resources, as Alice doesn&apos;t really know where the packets are coming from they are unable to block the inflow/spam. This leads to super fast communication but as the IP address and details are not of much concern here Bob could be a spam bot and the chain won&apos;t be able to censor it to stop the overflow of packets.</p><p>One of the defenses against this is the introduction of <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://fasterdata.es.net/data-transfer-tools/quic-quick-udp-internet-connections/">QUIC</a> a better version of UDP where a network handshake is done before sending the data packets making it easier for the network ops to censor in case of bad behavior.</p><br><p>One of the other ways of solving this issue is by i<strong>mplementing an application fee which is paid by the user every time they interact with a dapp</strong>. It&apos;s up to the dapp developer if they wanna use the fee as a source of profit or rebate just to make the dapp more secure/penalize bad behavior like hfts.</p><ul><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/godmodegalactus/solana-improvement-documents/blob/application_write_account_fees/proposals/0016-simd-application-fees.md">Make sure to check out the SIMD!</a></p></li></ul><p>As the fee goes to the program account which can then be transferred by the authority of that account(aka developer/team) to another team it incentives developers to onboard more single users rather than just increasing the activity. Something similar to imposing a fee on write instructions has been discussed in the <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/solana-labs/solana/issues/21883">write lock fee</a> issue but one of the demerits is that it would increase fees not just for bad actors but everyone and the dapp won&apos;t be able to rebate.</p><p>A new native Solana program would be needed to build like App_fee to check the rebates and check transfers to the dapp program. new instructions like set_appfee would be added to the dapp program by developers to set the application to the amount of sol they like.</p><p>The final fee would be</p><p>\(base\_fee + App\_fee + priority\_fee = total\_fee\)</p><p>The App_fee is not rebated when the transaction fails, it decreases the chances of a rogue agent sending useless transactions for the sake of filling blockspace and denying users of transaction verification.  </p><p>Ps: a big part of the post comes from t<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/godmodegalactus/solana-improvement-documents/blob/application_write_account_fees/proposals/0016-simd-application-fees.md#checkapplicationfees-instruction">he proposa</a>l so make sure to check it out if you wanna dive deep! Big shout out to <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/XohebS">Xoheb</a> for giving me the idea to write about this topic! <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/realbuffalojoe">Joe</a> and <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/jacobvcreech">Jacob</a> for the feedback!</p><ul><li><p>Resources used-&gt; <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/godmodegalactus/solana-improvement-documents/blob/application_write_account_fees/proposals/0016-simd-application-fees.md#checkapplicationfees-instruction">https://github.com/godmodegalactus/solana-improvement-documents/blob/application_write_account_fees/proposals/0016-simd-application-fees.md#checkapplicationfees-instruction</a><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/quic-go/quic-go/issues/2586">https://github.com/quic-go/quic-go/issues/2586</a> <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/solana-labs/solana/issues/23211">https://github.com/solana-labs/solana/issues/23211</a> <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/solana-labs/solana/issues/21883">https://github.com/solana-labs/solana/issues/21883</a></p></li></ul>]]></content:encoded>
            <author>madhavg@newsletter.paragraph.com (Madhav Goyal)</author>
        </item>
        <item>
            <title><![CDATA[💸Solana Fee Markets]]></title>
            <link>https://paragraph.com/@madhavg/solana-fee-markets</link>
            <guid>r7nfDchVhSPJXawyTKo1</guid>
            <pubDate>Wed, 22 Mar 2023 12:42:42 GMT</pubDate>
            <description><![CDATA[Most of the pos chains use a simple model where the txns(short for transactions) are chosen based on whether the block proposer wants to include the txn and earn the fee from the executed computation which seems to be a good enough model for most days until something big event comes along like a hyped nft mint or some hft bots see an arbitrage opportunity filling up blocks of spam executions because when a lot of people are willing to give huge wads of money to interact with the same state it...]]></description>
            <content:encoded><![CDATA[<p>Most of the pos chains use a simple model where the txns(short for transactions) are chosen based on whether the block proposer wants to include the txn and earn the fee from the executed computation which seems to be a good enough model for most days until something big event comes along like a <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://cryptoslate.com/ethereum-user-spends-44000-in-gas-fees-to-mint-bored-ape-otherside-nfts/">hyped nft mint </a>or some hft bots see an arbitrage opportunity filling up blocks of spam executions because when a lot of people are willing to give huge wads of money to interact with the same state it drives up gas prices for everyone. There is one very cool way Solana has worked on it.</p><p>Solana has a different fee model than Ethereum, while in Ethereum transaction fee is calculated by the blockspace covered which treats all interactions the same but Solana has an accounts model.In accounts there are two types of instructions <strong>read</strong> and <strong>write</strong>. Whenever there is an interaction the user has to pre-define the states its program/contract is gonna touch and only interacts with that piece of that state, not the whole chain which makes it easier to read the same state for as many users as possible.</p><p>But when many parties try to write to the same state the fees spike only impacts that specific program and not the whole fee market on the Solana network which keeps the normal users who wanna interact with other states safe from higher fees. It isolates the impact on that specific state. Solana is able to execute this because it is one of the first chains to introduce parallel execution &amp; multithreading with global state management</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/63d364c5c7364089fe9be5620a9058ee45028c01fa2a17ef324774b31d8e5a79.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>Simple description of gas fee model on solana</p><p>.With this change having different gas fees for every contract forms a local fee market kinda like paying different amounts of money for groceries at different places. If you live in a posh neighborhood (big-name mint) then you are probably willing to pay more for groceries but that should not impact how other people pay for their groceries. Defi contract interactions take a lot of blockspace and when the contract which mints/swaps tokens is not optimized for gas consumption there are problems leading to the network being totally unusable for a normal user. I have myself paid upwards of $5 fee for just a simple swap(in bear market) while I could literally buy 4 meals for myself with that kinda money. Most days 15% of the eth gas is paid while using uniswap which other claim could be reduced if the contract was more gas efficient.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/5b06cb4358e5349069cf7dc57986dfa589db8d65f115834fbe59c581c89957f7.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><em>Eth gas fee usage as of 8th march 2023</em></p><p>One of the biggest advocates for gas fees is that it prevents spam transactions and prevents attackers from filling up the blockspace as high gas fees would cost more to interact. Solana transactions being the cheapest(as a user) there is a huge risk of getting the system DDos ed from attack vectors, it’s not important the spammer might have bad intentions. HFT seems like a juicy opportunity in a fast &amp; cheap system like Solana but one of the biggest problems faced is that these HFT(high-frequency trading) bots could fill blockspace with txns and deny user transaction execution for a long time. One of the ways to solve this is-&gt;</p><p>As most of the programs that receive spam are either defi smart contracts or mint contracts, with the implementation of the base fee and application fee, devs will be able to incorporate fees that everyone would have to pay in order to interact with the smart contract and that fee could be refunded if they actually end up interacting.</p><ul><li><p>This would penalize the behavior of bad transactions who just want to check liquidity and front-run normal users.</p></li></ul><p>One of the proposals/updates has allowed <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/solana-labs/solana/blob/master/docs/src/proposals/fee_transaction_priority.md">priority execution</a> of a program with a higher fee. This would not have a <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/solana-labs/solana/issues/21883">direct effect </a>on the global fee markets but will drive the validator profits making it more attractive to run a Solana node. Validators try to optimize for</p><p>$\((additional\ fee+base\ fee)/Compute-units\) $$</p><p><strong>But What if many agents are willing to pay high fees to access the same state? wouldn’t that fill the blockspace?</strong></p><p>Nope because all the txns are sequential and at once only one agent can access the state and the <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/aeyakovenko/status/1514672651972722697">amount of time that a block can spend on a single state/thread is capped</a> so that whenever there is a spike for a specific program, all the transaction will be serialized, executed one by one its amount won’t affect regular transactions. A Solana block is capped at 48 million compute units where the max amount a single program can use is 12 million or 1/4 of the total blockspace.</p><p>one of the biggest improvements in the fee markets could be when Firedancer goes mainnet, with the FD&apos;s block pre-packing algo</p><p>it will be able to map the amount of compute units a transaction is going to take making it easier for validators to calculate it beforehand and package the block more efficiently.</p><p>I am not sure even Ethereum’s rollup-centric roadmap could pull this off cause the fee model + structure will still be the same, rn rollups cost nearly 50 cents for a transaction while Upi in India costs nothing and works a lot faster than eth so we really need to think whether we are actually solving problems or working on pseudo-problems, especially with the recent blowup in the talks of zkevm and <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://mirror.xyz/madhavg.eth/ZYKgdaODr6_u93JK_3L4YLXQ31mlXMIGRQu6K64e3Fc">app chains</a>.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/2605cc84b6dae72744ebf407e39c8ba64077429578cad0f483b93fea0ad7a16a.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>Ps: This will be a series of blog posts lining up some of the technical advancements made by solana which for some reason no one is talking about right now.Big shout out to <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/jacobvcreech">Jacob</a> and <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/realbuffalojoe">Joe</a> for keeping up with all my dumb questions!</p><p>Resources used →<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/7LayerMagik/status/1615569374647287808?t=xHlhYlgTJf3dp12BDhp_og&amp;">One of the best 🧵</a>Eli5 thread<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/aeyakovenko/status/1514672649330311169"> by anantoly on the feemartkets and the new improvements</a><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/solana-labs/solana/issues/21883https://github.com/solana-labs/solana/issues/23211https://github.com/solanalabs/solana/blob/master/docs/src/proposals/fee_transaction_priority.mdhttps://github.com/solana-foundation/solana-improvement-documents/pullsA%5Bn">https://github.com/solana-labs/solana/issues/21883https://github.com/solana-labs/solana/issues/23211https://github.com/solanalabs/solana/blob/master/docs/src/proposals/fee_transaction_priority.mdhttps://github.com/solana-foundation/solana-improvement-documents/pullsA[n</a> amazing piece by Jito Labs](<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://jito-labs.medium.com/solana-validator-101-transaction-processing-90bcdc271143">https://jito-labs.medium.com/solana-validator-101-transaction-processing-90bcdc271143</a>)</p>]]></content:encoded>
            <author>madhavg@newsletter.paragraph.com (Madhav Goyal)</author>
        </item>
        <item>
            <title><![CDATA[📜State of Zero-Knowledge]]></title>
            <link>https://paragraph.com/@madhavg/state-of-zero-knowledge</link>
            <guid>jx0UGRGAE3qcdVcuX7vH</guid>
            <pubDate>Tue, 21 Feb 2023 13:21:06 GMT</pubDate>
            <description><![CDATA[Zero Knowledge cryptography is one of the most hyped sub ecosystems in web3 , you can be at any conference and someone spelling zk suddenly seems to be the serious guy but there are many different aspects of how it’s being used in scaling & making Ethereum more privacy-centric.What is ZK?Zero-knowledge cryptography is a type of cryptography that uses hash functions and cryptography schemes to prove some truth to a party as the name suggests without revealing the truth itself. How is this poss...]]></description>
            <content:encoded><![CDATA[<p>Zero Knowledge cryptography is one of the most hyped sub ecosystems in web3 , you can be at any conference and someone spelling zk suddenly seems to be the serious guy but there are many different aspects of how it’s being used in scaling &amp; making Ethereum more privacy-centric.</p><h1 id="h-what-is-zk" class="text-4xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">What is ZK?</h1><p><strong>Zero-knowledge cryptography</strong> is a type of cryptography that uses hash functions and cryptography schemes to prove some truth to a party as the name suggests without revealing the truth itself.</p><p>How is this possible you ask? Let me give you a simple example. Say I give you a card and say it’s a red one, and to prove that I take 26 black cards out of the deck. now I didn’t show you the card itself but did an operation that made you believe I was telling the truth.Now maybe another example let’s say I am drinking rn(I don’t) and someone asks for my id proof and I show them my marriage certificate. Note that in India the legal marriage age is the same as the drinking age for boys which proves that I am eligible to drink. (sorry for the dumb example)</p><ul><li><p>Here is an amazing video which is my first reference to zk</p></li></ul><div data-type="youtube" videoId="HUs1bH85X9I">
      <div class="youtube-player" data-id="HUs1bH85X9I" style="background-image: url('https://i.ytimg.com/vi/HUs1bH85X9I/hqdefault.jpg'); background-size: cover; background-position: center">
        <a href="https://www.youtube.com/watch?v=HUs1bH85X9I">
          <img src="{{DOMAIN}}/editor/youtube/play.png" class="play"/>
        </a>
      </div></div><p>Zk was first introduced by two researchers in the paper &quot;<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://people.csail.mit.edu/silvio/Selected%20Scientific%20Papers/Proof%20Systems/The_Knowledge_Complexity_Of_Interactive_Proof_Systems.pdf">The Knowledge complexity of interactive proof systems&quot;</a> and since then it has become a promising area of development for researchers but rn we will talk about how it’s being utilized in crypto.</p><h1 id="h-scaling" class="text-4xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Scaling</h1><p>Blockchain transactions are validated by doing the computation, finding its right hash, and then posting it on the chain. Every transaction is sent to a validator who includes in the block(if the right gas is paid) and spends their computational resources in proving it right which takes block space and resources. As the chain usage goes up so does the value of block space aka gas &amp; txn costs.</p><p>Now one of the coolest things about zk is that we can prove the computational integrity of anything in a very small amount of data and resources.</p><h2 id="h-rollups" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Rollups</h2><p>So an Idea is that for a batch of txns, the zk proof is calculated off-chain, and the zk proof generated is posted on the chain for verification and state changes. A zk proof is around 160 bytes while a txn is more than a few kilobytes literally reducing the data streaming on the chain by 10x and this same proof can prove a batch of txns let’s say 50 txn in 200 bytes of zk proof.</p><p>200 bytes➗ 50 = 4 bytes</p><p>While the eth Block size is 1 MB (15 million gas) and usually comes out to around 70 txns. so for each txn the size is around</p><p>1000 KB ➗ 70(no. of txns) = 14 Kilobytes</p><p>Data is money in the world of crypto and zk is much more efficient in proving the same thing but this comes with a tradeoff, as the proofs are generated off-chain there are always some risks and assumptions involved. One current example of a protocol using zk sna<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://zksync.io/">rks is ZK sync</a></p><p>Now what I have talked about is mostly related to <strong>SNARKS</strong>(Succinct Non-interactive Argument of Knowledge) but there are different types of Zk proof with different security and risk profiles. This an Amazing blog post if you wanna lea<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://pseudotheos.mirror.xyz/_LAi4cCFz2gaC-3WgNmri1eTvckA32L7v31A8saJvqg">rn about their dif</a>ference.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/d10157ed31ef478b528dd79a53fc0448d79e8f98a47ac1f5c132e411c6a2da95.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><em>Credits - Consensys</em></p><p>Stark proofs are what runs the whole Starknet ecosystem. They are amazing advancements in tech as Starks don’t rely on the trusted-setup assumption and are mostly considered quantum-safe meaning they are safe from the emergence of quantum computers. The coolest thing about stark proofs is that their provability time rises much with the size of the proof.</p><h2 id="h-zk-evm" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">ZK-EVM</h2><p>ZK evm seems to be the most common words out these days so can’t miss that lol.</p><p>While rollups are off-chain solutions that generate zips (Zero-knowledge proof systems) off-chain, a zk evm is a zk-compatible Ethereum virtual machine that produces zk proofs for txns itself.As the original evm didn’t support zkp compatibility and after seeing the promise of this technology many projects have aped in!But there is a huge difference in different ZK EVMs as many target byte code composability while others work on more efficient proof generation. Vitalik write about their diff in an amazing blog post check <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://vitalik.ca/general/2022/08/04/zkevm.html">it out there</a>A few Amazing projects that are building ZK evms are <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://ethresear.ch/t/unveiling-olavm-proof-of-concept-the-next-generation-full-featured-zkvm/14817">OLA VM by Sin7</a> was really funny to dive into and can’t forget the work by one of the community favs 📜<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://hackmd.io/@yezhang/B167uMZRs">Scroll</a> they are one of the best research teams in the space</p><h2 id="h-privacy" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Privacy</h2><p>Privacy was one of the first goals with zkp systems, rn every single txn on ethereum is public while that might be good if you are hunting down a hacker or scammer general users might not want everyone to know their life savings if crypto has to go for better adoption.</p><p>One of the great implementations of this and vision was Tornado Cash which was sanctioned by OFAC and since then most of the liquidity that made it function has dried up 😭</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://aztec.network/">Aztec Network</a> is Building on the privacy front of Ethereum like anyone can donate eth on Juicebox totally privately with the help of Aztec.</p><p>Solana Has its version of Zk.money where confidential transfers can be done with the he<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/solana-labs/solana-program-library/blob/master/token/program-2022/src/extension/mod.rs">lp of this program</a> its an extension of the spl-token-2022 program. If you wanna learn more about how it works feel f<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/solana-labs/solana-program-library/tree/master/token/zk-token-protocol-paper">ree to click here</a></p><p>Amazing work by one of the Scroll ZKevm researchers →</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://pseudotheos.mirror.xyz/">https://pseudotheos.mirror.xyz/</a></p><p>Post on Zk privacy → <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://medium.com/cryptodigest/digital-identity-privacy-and-zero-knowledge-proofs-zk-snarks-3d092b509990">https://medium.com/cryptodigest/digital-identity-privacy-and-zero-knowledge-proofs-zk-snarks-3d092b509990</a></p><p>And most of the ideas of rollups come from Vitaliks post Endgame → <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://vitalik.ca/general/2021/12/06/endgame.html">https://vitalik.ca/general/2021/12/06/endgame.html</a></p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://nakamoto.com/cambrian-explosion-of-crypto-proofs/">https://nakamoto.com/cambrian-explosion-of-crypto-proofs/</a></p>]]></content:encoded>
            <author>madhavg@newsletter.paragraph.com (Madhav Goyal)</author>
        </item>
        <item>
            <title><![CDATA[A Case for App Chains]]></title>
            <link>https://paragraph.com/@madhavg/a-case-for-app-chains</link>
            <guid>FYA6rR9dHvBPyEbyLfaS</guid>
            <pubDate>Sat, 18 Feb 2023 16:35:32 GMT</pubDate>
            <description><![CDATA[Dapps power everything we have built on blockchain as we know whether that be juicy staking defi protocols or storage networks for the next generation of research. They are fascinating pieces of technology as all their interactions are public and verified with cryptography. while this is dope it also brings in a lot of cons every time you have to deposit some tokens in a pool or sell an nft on the mainnet it costs gas which is dynamic and as the no of users of Ethereum goes up so does the val...]]></description>
            <content:encoded><![CDATA[<p><strong>Dapps</strong> power everything we have built on blockchain as we know whether that be juicy staking defi protocols or storage networks for the next generation of research.</p><p>They are fascinating pieces of technology as all their interactions are public and verified with cryptography. while this is dope it also brings in a lot of cons every time you have to deposit some tokens in a pool or sell an nft on the mainnet it costs gas which is dynamic and as the no of users of Ethereum goes up so does the value of the block space.Like the Yuga mint in 2022 where folks paid tens of thousands of dollars to mint the other side nft and $157 m<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://decrypt.co/99219/otherside-nft-mint-burned-more-157m-ethereum">illion was just spent on the gas in a few hours making the chain unusable for normal people</a>Which lead to the co<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://snapshot.org/#/apecoin.eth/proposal/0x367eecaffc20976a4f913154eceb61279793b06ac0ad93ab948d2d3b207ff860">mmunity voting on moving APecoin to its own chain</a></p><p>Its not. very convenient for a regular user to pay $5 to sign a txn with the dapp or make changes to their trades and using rollups is one of the most basic things that come to mind when txn fee is being decreased but that still leaves the awful ux of most dapps where you have to sign a txn for. every interaction, like it, wouldn’t make sense if you are using a decentralized version of a short blogging app aka Twitter, and signing a txn for every reply.One of the biggest things that can help with this is Account Abstraction which is being super hyphed rn because of the <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://eips.ethereum.org/EIPS/eip-4337">eip-4337</a></p><p>Account Abstraction in simple words means just abstracting the authority to approve some actions and not using the main seed phrase for signing it.</p><p>It had been a big problem that is being solved by the new eip but what If we could provide developers and builders with the ability to ingrain their dapps with the type of functionality they want while also making it cheap?</p><p>This can be achieved by something called app-specific rollups (<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://mirror.xyz/madhavg.eth/MWxYNxZNjPSSGwrR0Za3F0w-6AJkvfHTvwW-nMToenk">if you wanna get the idea read this</a>) the idea comes from the Starkent team about <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://medium.com/starkware/fractal-scaling-from-l2-to-l3-7fe238ecfb4f">Fractal Scaling</a> where the mainnet Ethereum is the main settlement layer which receives proofs and batches of proved computation from its rollups decreasing the gas fee by many folds. As the size of a single Ethereum txn is over ~ 300 kilo bytes, a single snark proof is around ~160 bytes which is orders of magnitude less and can fit the proof a batch of transactions rather than just one brining the gas prices down. This concept can be take further by Layer 3 rollups that post their proofs on layer 2 which then proves its state and validity to Layer 1. If an L2 is</p><p>cheaper than L1 than L3 will be</p><p>cheaper and reducing the size of proof posted on the L1 making txn more efficient even for the validators to store.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/71333259a63b9297d9e056fbb4c70436d972a2125e29d3fa59157c5e8e9638ca.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>Having different rollups for dapps where developers have the abiility to take the concept of <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.algorand.com/resources/blog/programmable-money-smart-contracts-make-money-better">programmable money</a> even further. Many Rollups as a service startup are gearing up now, here are a few projects I like -&gt;</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://artesi.xyz/">https://artesi.xyz/</a></p><ul><li><p>Building custom rollups with Optimistic rollups. Their vision is to allow anyone to launch a rollup just within a few clicks and allow folks to modify it tot their needs.</p></li></ul><p>Opside</p><ul><li><p>They are building one of the coolest techs in the ecosystem and pioneering something called <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://ethresear.ch/t/native-rollup-a-new-paradigm-of-zk-rollup/14529">Native rollups</a> which is a Zero knowledge rollup that posts Snark proofs to maintain and prove the integrity of the computation and also address the concern of data availability even at the layer 3.</p></li></ul><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/0xStacked">https://twitter.com/0xStacked</a></p><ul><li><p>They are building sdk which allows the functionality to develop rollups for anyone.</p></li></ul><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/fc0edd23fd7bd01057ef3890dab2b07e05e8e10117bc6cb3fef8fa1a1ea2a811.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>PS: A big part of the info was taken from the Starkware blogposts so a big shoutout to them! They are just doing mind blowing work!</p>]]></content:encoded>
            <author>madhavg@newsletter.paragraph.com (Madhav Goyal)</author>
        </item>
        <item>
            <title><![CDATA[Lets Scale]]></title>
            <link>https://paragraph.com/@madhavg/lets-scale</link>
            <guid>TsA7NLoqBY9QYdZqZmvx</guid>
            <pubDate>Mon, 02 Jan 2023 21:31:27 GMT</pubDate>
            <description><![CDATA[One of the main roadmaps and visions of bitcoin base layer is using it as a store of value rather than a payment method. Bitcoin is the most decentralized and robust blockchain out there with small blocks which makes the blockspace highly valuable and increases the gas price. Which is one of the reasons Most of the transactions happen on the lightning network which stores most of the info off-chain and maintains the most important info on chain as there is not much need to keep the regular tx...]]></description>
            <content:encoded><![CDATA[<p>One of the main roadmaps and visions of bitcoin base layer is using it as a store of value rather than a payment method. Bitcoin is the most decentralized and robust blockchain out there with small blocks which makes the blockspace highly valuable and increases the gas price. Which is one of the reasons Most of the transactions happen on the lightning network which stores most of the info off-chain and maintains the most important info on chain as there is not much need to keep the regular txn data on chain when we can prove the hash with very little data. One of the same approaches as outlined with Vitalik in his endgame blog post, in the 2021 bull market the gas fee was through and virtually impossible to pay less than $5 just for a little txn blockspace and there was a lot of debate on the viability of ethereum and at the same time, amazing teams were building rollups which are these off chain scaling methods which process the txn and data off the main base layer here in Ethereum and post the proof of operation which is a very small amount of data compared to the full txn.</p><p>So the vision of future Ethereum, the base layer has many hyper-scaled rollups which derive their security from the mainnet for just a fraction of the cost of interactions.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/96669aa6eefffee1ad6e02850623a3c75b688bbe7330619448eedf5194ded8f8.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>Sorry for the bad handwriting, but here’s everything in single page</p><p>There are many cool rollups like arbitrum and optimistic who are work on the principal of optimistic rollups where as the name suggests the txns are assumed to be always right and accepted to approve &amp; to make sure that fraud txns are not approved there is a time interval between sending and approval of txn in which if anyone has any objection can ask for cryptographic proofs and there will be a showdown of fraud proofs between the sender and objector. Fraud proofs are run by comparing roots of the <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.geeksforgeeks.org/introduction-to-merkle-tree/">Merkle tree</a> and verifying the end roots with computation proofs,but with time intervals and these proofs come to a huge issue of settlement of txns what if I told you there is another path?</p><p>One of the most interesting Ideas I have found is of validity proofs(aka zk). Rollups that use validity proofs abstract away most of the data and maintain a root state on the mainnet to update the merkle tree where they post these proofs which is substantially smaller and can settle the signature without revealing anything about the real computation or interaction. They have a better settlement time as they don&apos;t need to revert back to blocks if there is a fraudulent transaction proved by the proof.</p><p>These are some amazing scaling pathways but with <strong>great powers come greater responsibilities</strong>. With Ethereum transitioning to pos<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.youtube.com/watch?v=8qPpiMDz_hw"> mev</a> has become a huge part of the debate where validators try to pack txns in a way that increases their profit aka extractable value which in some sense leads us to a more centralized system where the block production is not so distributed but this we can tackle this by building more censorship resistance node implementations. some good thoughts on <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://ethresear.ch/t/how-much-can-we-constrain-builders-without-bringing-back-heavy-burdens-to-proposers/13808">limiting effect of centralized block production</a></p><p>There has also been debate on having decentralized sequencers and switching the block producer periodically.</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/tarunchitra/status/1609844022625067009">https://twitter.com/tarunchitra/status/1609844022625067009</a></p><p><em>a twitter thread where some ogs are calmly roasting each other lol, make sure to read the whole hread</em></p><p>To sum it up, the idea is to have Ethereum as a base layer with many rollups on top of it that maintain their proofs on the base layer making transactions cheaper and in the future <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://medium.com/starkware/redefining-scalability-5aa11ffc5880">having app-specific rollups that maintain root state on L2 rollups with validity proofs making gas fee</a> &amp; execution times even better for users while all the rollups and layers having interconnecting bridges like one big happy family!</p><p>PS: This blogpost was heavily inspired and sometimes might even seem dito cause been thinking about it way too much by the <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://ethresear.ch/t/how-much-can-we-constrain-builders-without-bringing-back-heavy-burdens-to-proposers/13808">endgame</a> and <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://medium.com/@starkware">starwares amazing research on rollups and further utilities of rollups.</a><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="http://buymeacoffee.com/madhavgoyal">Feel Free to buy me a coffee</a></p>]]></content:encoded>
            <author>madhavg@newsletter.paragraph.com (Madhav Goyal)</author>
            <enclosure url="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/165f2dd3700c0eca3e3c6f45bfb4ae80fa57c221fc60f583bb4b71fee5e82690.jpg" length="0" type="image/jpg"/>
        </item>
    </channel>
</rss>