<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Manmit on Medium]]></title>
        <description><![CDATA[Stories by Manmit on Medium]]></description>
        <link>https://medium.com/@genisis0x?source=rss-9a6f1a454fdc------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*E8zijjV_YksCVl3adin4pg@2x.jpeg</url>
            <title>Stories by Manmit on Medium</title>
            <link>https://medium.com/@genisis0x?source=rss-9a6f1a454fdc------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 12:22:24 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@genisis0x/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Ethereum’s Leap : How Fusaka and Verkle Trees Will Redefine Blockchain Scalability]]></title>
            <link>https://medium.com/@genisis0x/ethereums-leap-how-fusaka-and-verkle-trees-will-redefine-blockchain-scalability-9cd2b2eb0005?source=rss-9a6f1a454fdc------2</link>
            <guid isPermaLink="false">https://medium.com/p/9cd2b2eb0005</guid>
            <category><![CDATA[ethereum-scalability]]></category>
            <category><![CDATA[blockchain-4]]></category>
            <category><![CDATA[ethereum-upgrade]]></category>
            <category><![CDATA[stateless]]></category>
            <category><![CDATA[verkle-tree]]></category>
            <dc:creator><![CDATA[Manmit]]></dc:creator>
            <pubDate>Fri, 05 Dec 2025 19:46:31 GMT</pubDate>
            <atom:updated>2025-12-09T19:54:29.991Z</atom:updated>
            <content:encoded><![CDATA[<h3>Verkle Trees: Making Ethereum Faster Without Breaking It</h3><p><strong><em>By Manmit</em></strong></p><p>Ethereum has grown into the world’s most decentralized and trusted smart contract platform — but with that growth comes an invisible problem: <strong>data bloat</strong>. Every transaction, every contract, every update adds to a state that <em>every</em> full node must store forever. Over time, this has become a major scalability bottleneck.</p><p>Running a full node today requires substantial storage, long sync times, and large proof sizes just to verify simple information like account balances. It works — but it is not efficient, and it certainly isn’t sustainable at global scale.</p><p>To address this challenge, Ethereum is introducing a completely new data structure: <strong>Verkle Trees</strong>. Although it seems like a technical detail, it is one of the most important upgrades for Ethereum’s long-term scalability and decentralization.</p><h3>Ethereum Has a Storage Problem — and It’s Getting Worse</h3><p>Every piece of Ethereum’s state is stored permanently across thousands of nodes. That means:</p><ul><li>Full nodes require increasing storage over time</li><li>Syncing a new node can take days</li><li>Proofs are large and expensive to transmit</li><li>Stateless validation is practically impossible</li></ul><p>Think of it like asking every librarian in the world to store every book ever published — including first drafts, revisions, and mistakes — on their personal shelves. It’s doable, but not elegant.</p><p>Ethereum needs a future where running a node is lightweight, inexpensive, and widely accessible. Verkle Trees are a key part of achieving that vision.</p><h3>The Vision: Stateless Clients</h3><p>The idea behind stateless clients is simple but revolutionary:<br> <strong>What if nodes didn’t have to store the entire blockchain state at all?</strong></p><p>In a stateless model:</p><ul><li>Clients receive a block along with a <strong>witness</strong> (small proof containing only the relevant state).</li><li>They verify the block using the witness.</li><li>They discard the data and move on — no long-term storage required.</li></ul><h3>Why This Matters</h3><ul><li>Running a node becomes cheap and accessible</li><li>Syncing becomes nearly instant</li><li>More participants can join the network</li><li>Ethereum becomes more decentralized and resilient</li></ul><p>The problem? Ethereum’s current data structure — <strong>Merkle Patricia Tries</strong> — makes witness proofs far too large. They simply cannot fit within Ethereum’s block-time constraints.</p><p>Verkle Trees solve this.</p><h3>The Limits of Merkle Trees</h3><p>Merkle Patricia Tries represent data by hashing nodes along a path from the value to the root. To prove a single value, you must include:</p><ul><li>the value</li><li>all sibling hashes along the path</li></ul><p>For multiple values, the proof must include multiple paths, making witness sizes balloon quickly. This directly prevents efficient stateless verification.</p><p>Ethereum needs a structure that allows <strong>compact proofs</strong>, even when verifying many values. That is exactly what Verkle Trees provide.</p><h3>Verkle Trees: A Smarter Way to Prove State</h3><p>Verkle Trees rely on <strong>polynomial commitments</strong> — specifically KZG commitments — rather than long hash chains.</p><p>You don’t need to understand the math to appreciate the benefits.</p><h3>How It Works (Conceptually)</h3><ul><li>Instead of hashing every node, Verkle Trees create a <strong>mathematical commitment</strong> to a group of values.</li><li>Any value inside that group can be proven using a small, fixed-size proof.</li><li>This proof works even when proving <em>multiple</em> values at once.</li></ul><h3>Why Verkle Trees Are Better</h3><ul><li>Proofs stay <strong>small and consistent</strong> regardless of how much data is involved</li><li>No sibling hashes required</li><li>The tree structure is <strong>flatter</strong>, reducing depth</li><li>Multiple values can be verified with <strong>one combined proof</strong></li></ul><p>This makes Verkle Trees ideal for enabling stateless clients — and for reducing Ethereum’s verification overhead.</p><h3>What a Verkle Tree Looks Like</h3><p>Ethereum stores state as 32-byte keys. Verkle Trees interpret them as:</p><ul><li><strong>Stem:</strong> first 31 bytes</li><li><strong>Suffix:</strong> final byte (distinguishes multiple values under one stem)</li></ul><p>Verkle Trees contain two main node types:</p><h3>1. Extension Nodes</h3><p>Hold all values under the same stem, with up to 256 suffixes.</p><h3>2. Inner Nodes</h3><p>Organize and connect multiple stems, each with up to 256 children.</p><p>This wide, shallow design reduces tree depth, which in turn reduces proof size.</p><h3>A Simple Code Analogy (Not Real Cryptography)</h3><pre>class VerkleProofDemo:<br>    def __init__(self, root):<br>        self.root = root</pre><pre>    def create_proof(self, keys, values):<br>        return {<br>            &quot;root&quot;: self.root,<br>            &quot;keys&quot;: keys,<br>            &quot;values&quot;: values,<br>            &quot;proof&quot;: f&quot;Proof for {len(keys)} values&quot;<br>        }</pre><pre>    def verify(self, proof):<br>        print(f&quot;Verifying proof using root {proof[&#39;root&#39;]}&quot;)<br>        return True</pre><pre># Example usage<br>if __name__ == &quot;__main__&quot;:<br>    tree = VerkleProofDemo(&quot;0xRootHash&quot;)<br>    keys = [&quot;user1_balance&quot;, &quot;user2_balance&quot;, &quot;vault_data&quot;]<br>    values = [&quot;100 ETH&quot;, &quot;500 USDC&quot;, &quot;3000 DAI&quot;]<br>    proof = tree.create_proof(keys, values)<br>    print(&quot;Is proof valid?&quot;, tree.verify(proof))</pre><h3>Analogy</h3><p>Think of the tree root as a signed library certificate.<br> If someone wants to prove that certain books exist inside the library, they don’t need the entire catalog. A small stamped list verifies those titles. Whether you’re proving one book or ten, the size of the certificate remains about the same.</p><h3>Where Verkle Trees Stand Today</h3><p>Verkle Trees have moved well beyond theory. Ethereum client teams — including Geth, Erigon, and Nimbus — are actively implementing and testing them.</p><p>Progress includes:</p><ul><li>Dedicated Verkle testnets</li><li>Experimental client implementations</li><li>Research on migration strategies</li><li>Community-wide testing and auditing</li></ul><p>Because the change affects how Ethereum stores and verifies all state data, the rollout must be cautious, phased, and thoroughly validated.</p><p>Developers can already experiment with test clients and tools to prepare for the transition.</p><h3>Security Considerations</h3><p>No major upgrade comes without risks. Verkle Trees rely on advanced cryptography and introduce new validation logic.</p><h3>Potential Risks</h3><ul><li>A flaw in KZG commitment math could compromise proofs</li><li>Implementation bugs could cause clients to accept invalid state</li><li>Migrating from Merkle to Verkle structures is complex and must be carefully orchestrated</li></ul><h3>How Ethereum Mitigates These Risks</h3><ul><li>Multiple independent client implementations</li><li>Formal verification of critical components</li><li>Extensive testnets and fuzzing</li><li>Multi-team audits and peer review</li><li>Phased rollout with safe fallback paths</li></ul><p>Security remains the top priority throughout the transition.</p><h3>Final Thoughts: Why Verkle Trees Matter</h3><p>Verkle Trees mark one of the most important architectural upgrades in Ethereum’s history. They enable:</p><ul><li><strong>Smaller proofs</strong></li><li><strong>Stateless clients</strong></li><li><strong>Faster synchronisation</strong></li><li><strong>Lower hardware requirements</strong></li><li><strong>Greater decentralisation</strong></li></ul><p>As Ethereum grows into a global settlement layer, these improvements are essential. Verkle Trees help ensure the network remains accessible, efficient, and resilient — ready to support millions of users and applications for decades to come.</p><p>They aren’t just a technical improvement; they’re a foundational step toward a faster, lighter, and more decentralised Ethereum.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9cd2b2eb0005" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Beacon Proxy]]></title>
            <link>https://medium.com/@genisis0x/beacon-proxy-603c5ebaf1c?source=rss-9a6f1a454fdc------2</link>
            <guid isPermaLink="false">https://medium.com/p/603c5ebaf1c</guid>
            <dc:creator><![CDATA[Manmit]]></dc:creator>
            <pubDate>Thu, 04 Dec 2025 22:22:36 GMT</pubDate>
            <atom:updated>2025-12-04T22:22:36.997Z</atom:updated>
            <content:encoded><![CDATA[<p>As we all are aware about the behaviour of the solidity smart contract, once the contract has deployed we are not able to upgrade the contract code because of the immutability of the smart contract. But at certain points we need to make changes into our smart contract. Maybe the reason behind the upgradability could be the buggy code, developers’ mistakes and many more things that would force us to upgrade our smart contract.</p><p>To deal with the above mentioned problem, the smart contract community introduced the different types of <strong>Proxy patterns </strong>which provide easy upgradability to the smart contract without changing the state of the contract.</p><p>Let’s understand what a proxy is?</p><p>Proxy is an abstract contract that is responsible for delegating the call to a particular implementation of the contract. Proxy use delegate call to execute function call, In simple words storage of the proxy contract use to execute the function call and implementation address used to call a specific function.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_vIc37D1h4D1HAzfrv-Lew.png" /></figure><p>In the above diagram you can clearly see the working of the proxy contract.</p><p>Let’s understand step by step</p><ul><li>Firstly, the user makes a function call to the proxy contract.</li><li>Proxy contract use its fallback function to delegate the call to the implementation address</li><li>Implementation contract returns the final response to the proxy contract and proxy contract returns the response to the user.</li></ul><p>Note : as function calls in the context of the proxy contract that’s why storage of the proxy contract will execute the function.</p><p>As now we know what is proxy now we will try to understand what is the <strong>Beacon Proxy is</strong></p><h3>Beacon Proxy:</h3><p>Beacon proxy is a type of proxy in which multiple proxy contracts refer to the implementation contract. Implementation contract called beacon contract.</p><p>First question arises in our mind: what is the use of beacon proxy? And how it is better the normal proxy?</p><h4>Uses of Beacon Proxy:</h4><p>Main reason to use the beacon proxy is to update multiple contracts with a single change or which implementation we need, we can update our proxy on that implementation. When several proxies are referring to a single implementation contract that has been modified to meet our requirements, a beacon proxy is employed.</p><p>If we talk about how the beacon proxy is better than transparent and UUPS proxy, we need to understand if we are using transparent proxy and UUPS proxy in this case you have to add implementation address one by one which can be a complex operation. But if you have a lot of contracts to upgrade you should use Beacon proxy where you don’t need to change implementation address one by one you can choose implementation address according to your need.</p><p>Let’s understand architecture of the <strong>Beacon proxy<br></strong>This is the proxy contract which contains different functionality to perform specific action</p><ul><li>constructor(address beacon, bytes data)</li><li>_beacon()</li><li>_implementation()</li><li>_setBeacon(address beacon, bytes data)</li></ul><p>constructor : using the constructor we try to implement our first beacon implementation with call data to transfer the call over the implementation address.</p><p>_beacon() : Using this function we will get our beacon address.</p><p>_implementation : This function returns the implementation address that is in use right now with a connected beacon.</p><p>_setBeacon() : this function will take the address of the beacon and calldata to delegate call over a specific location this will set a new beacon address.</p><p>Let’s understand with code and deploy script that how we will update our contract into the beacon proxy</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5Eil-qQYwbspusioja9RHw.png" /></figure><p>This is the abstract contract which will use in below mention contracts</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H5RzST2CVhgWw38_MZ1S4g.png" /></figure><p>This is our first implementation contract that we will deploy in our hardhat script</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iLSGOsqVGZdGqoCZ8n3eWA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1-ZMum_aWk-5zafzso9NxQ.png" /></figure><p>In the above hardhat script you can see how we are upgrading the implementation address of the contract to upgrade our smart contract from version 1 to version 2.</p><p><strong>References:</strong></p><p><a href="https://medium.com/coinmonks/how-to-create-a-beacon-proxy-3d55335f7353"><strong>How to create a beacon proxy</strong></a></p><p><a href="https://docs.openzeppelin.com/contracts/3.x/api/proxy"><strong>Openzeppelin Proxies</strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=603c5ebaf1c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Payment Service Providers and Web3 Intents: Bridging Traditional Payment Infrastructure and…]]></title>
            <link>https://medium.com/@genisis0x/payment-service-providers-and-web3-intents-bridging-traditional-payment-infrastructure-and-93dc0cd49226?source=rss-9a6f1a454fdc------2</link>
            <guid isPermaLink="false">https://medium.com/p/93dc0cd49226</guid>
            <category><![CDATA[payments]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[payment-service-provider]]></category>
            <category><![CDATA[crosschain]]></category>
            <category><![CDATA[web3]]></category>
            <dc:creator><![CDATA[Manmit]]></dc:creator>
            <pubDate>Sun, 25 May 2025 12:03:34 GMT</pubDate>
            <atom:updated>2025-05-25T12:03:34.218Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Payment Service Providers and Web3 Intents: Bridging Traditional Payment Infrastructure and Blockchain User Experience 🚀</strong></h3><p>The convergence of traditional payment infrastructure and emerging blockchain technologies represents a fundamental shift in how users interact with digital financial services. Payment Service Providers (PSPs) have long served as critical intermediaries in traditional e-commerce and digital payments, while web3 intents represent an innovative approach to simplifying blockchain interactions. This analysis examines both technologies and explores how web3 intents address similar user experience challenges that PSPs have historically solved in traditional payment systems.</p><h3>Understanding Payment Service Providers (PSPs)</h3><h4>Definition and Core Functions</h4><p>A payment service provider (PSP) is a third-party company that allows businesses to accept electronic payments, such as credit card and debit card payments. PSPs function as crucial intermediaries between consumers who make payments and retailers who accept them, fundamentally simplifying the complex landscape of digital transactions. These entities provide comprehensive merchant services and often act as payment gateways or payment processors for both e-commerce and brick-and-mortar businesses.</p><p>The operational scope of PSPs extends far beyond basic payment processing. They offer risk management services for card and bank-based payments, transaction payment matching, digital wallets, reporting, fund remittance, currency exchange, and fraud protection. Additionally, PSPs typically provide software integration capabilities for e-commerce websites or point-of-sale systems, creating a seamless bridge between merchant operations and payment infrastructure. This comprehensive service model has made PSPs indispensable to modern commerce, as they help businesses accept a wide range of online payment methods, including online banking, credit cards, debit cards, e-wallets, and cash cards</p><h3>Technical Infrastructure and Market Position</h3><p>PSPs establish technical connections with acquiring banks and card networks, enabling merchants to accept different payment methods without the need to partner with a particular bank. This infrastructure approach makes merchants less dependent on banking institutions while fully managing payment processing and external network relationships. The regulatory framework governing PSPs varies by jurisdiction, with US-based online payment service providers supervised by the Financial Crimes Enforcement Network (FinCEN), a bureau of the United States Department of the Treasury. European payment service providers operate under the supervision of the European Payment Services Directive.</p><p>The fee structure for PSPs typically follows one of two models: charging as a percentage of each transaction or implementing a fixed cost per transaction. This pricing flexibility allows businesses of various sizes to access sophisticated payment infrastructure without significant upfront investment. PSPs have evolved to process next-generation payment methods, including cash payments, wallets, prepaid cards, vouchers, and even paper or e-check processing</p><h3>Challenges in PSP Reconciliation</h3><p>Despite their benefits, PSPs introduce significant operational complexities for businesses, particularly in the area of PSP reconciliation. PSP Reconciliation is an accounting process that compares account balances and different settlements from payment service provider entities to ensure all transactions are true and well-recorded. This process becomes increasingly challenging as businesses adopt multiple payment options to meet consumer expectations for seamless purchasing experiences.</p><p>The reconciliation challenges stem from the sheer volume of transactions and the variety of factors involved, including different payment methods, service terms, currencies, and varying timeframes between service providers. Organisations handling high volumes of transactions via several PSPs daily are advised to perform PSP reconciliation as frequently as possible to avoid payment fraud and maintain accurate financial records. The complexity increases exponentially with each additional PSP, creating significant operational overhead for businesses seeking to offer comprehensive payment options</p><h3>Web3 Intents: A New Paradigm for Blockchain Interactions</h3><h4>Conceptual Framework and Innovation</h4><p>The concept of “intent” in web3 represents a novel and evolving idea currently without a set definition, marking it as an early-stage innovation in the blockchain ecosystem. Intents represent a new paradigm beyond traditional transactions, offering an innovative approach to depict user requirements across the blockchain industry. Unlike traditional transactions that require users to construct specific calldata and navigate complex technical specifications, intents free users from concerning themselves with underlying intricacies such as choosing appropriate decentralised exchanges (DEXs) or determining suitable bridges for cross-chain operations.</p><p>Intent-based systems fundamentally reshape how users interact with blockchain protocols by focusing on desired outcomes rather than specific execution paths. Intents have generated significant buzz recently, as examining transactions through the user’s perspective unveils a whole new ecosystem and introduces concepts that have the potential to reshape how developers approach user experience in web3. This paradigm shift addresses the substantial knowledge requirements and complex steps traditionally required for interacting with web3 protocols</p><h3>Technical Implementation and Architecture</h3><p>A simple intent is typically represented in a structured format that specifies the desired input and output without detailing the execution mechanism. For example, an intent might specify “1 ETH” as the amount, “Ethereum/ETH” as the input, and “Bitcoin/BTC” as the output, leaving the specific execution path to be determined by specialised entities called solvers<a href="https://phala.network/posts/index-decoded-the-multi-chain-intent-model">5</a>. This abstraction layer enables an open solver system capable of resolving intents based on individual interests and capabilities.</p><p>Intent-centric infrastructure in the blockchain ecosystem identifies the best trading prices across liquidity pools on multiple chains, ensuring MEV protection and preserving user privacy. This infrastructure leverages Account Abstraction components that significantly simplify intent solving, including gas-less transactions that eliminate the need for users to hold specific tokens for transaction fees, delegation mechanisms that allow pre-authorisation of wallet interactions with specified accounts, and bundling capabilities that enable solvers to batch intents for gas efficiency.</p><h3>Integration with Existing Web3 Infrastructure</h3><p>The WalletConnect Network exemplifies how intent-based systems can integrate with existing web3 infrastructure to enhance user experience. The WalletConnect Network is the on-chain UX ecosystem that makes web3 work by facilitating users’ use of any wallet across any app and platform. As a chain-agnostic infrastructure, it operates across ecosystems from EVM and its Layer 2 solutions to Solana, Cosmos, Polkadot, Bitcoin, and more.</p><p>Since its inception in 2018, WalletConnect has established itself as critical infrastructure in the web3 space, with the protocol’s ability to provide secure, end-to-end encrypted connections being fundamental in creating interoperability for every wallet, every app, and every chain. The platform has expanded to over 40,000 applications and 600+ wallets, facilitating more than 150 million connections as of 2024. This extensive network provides a foundation for intent-based systems to operate across multiple blockchain ecosystems seamlessly.</p><h3>How Web3 Intents Address PSP-Like Challenges</h3><h4>Simplifying Complex Payment Infrastructure</h4><p>Web3 intents address similar fundamental challenges that PSPs solve in traditional payment systems, primarily the complexity of managing multiple payment options and technical integrations. Just as PSPs abstract away the complexity of integrating with various banks, card networks, and payment methods, web3 intents abstract away the complexity of interacting with multiple blockchain protocols, DEXs, and cross-chain bridges. This abstraction enables users to focus on their desired outcomes rather than the technical mechanics of achieving them.</p><p>The parallel between PSP services and web3 intents becomes particularly evident when considering transaction processing complexity. PSPs handle the intricate process of verifying card details, checking fund availability, and coordinating with payment processors to complete transactions. Similarly, intent-based systems manage the complex process of finding optimal execution paths across multiple blockchain networks, liquidity pools, and protocols while ensuring the best possible outcomes for users.</p><h3>Reducing Technical Barriers and Knowledge Requirements</h3><p>The chief motivation for further developments on already existing intent systems is that it can dramatically lower the knowledge requirements and simplify the steps for anyone who wants to get started in interacting with web3 protocols. This objective directly parallels the value proposition of PSPs, which enable businesses to accept electronic payments without requiring deep knowledge of banking infrastructure, card network protocols, or regulatory compliance requirements.</p><p>Web3 intents eliminate the need for users to understand protocol-specific interfaces, signature types, validation logic, and varying transaction data specifications across different chains and decentralised applications. This simplification is analogous to how PSPs eliminate the need for merchants to establish direct relationships with acquiring banks or navigate the complexities of different payment card networks. Both systems serve as abstraction layers that make sophisticated financial infrastructure accessible to users without specialised technical knowledge.</p><h3>Cross-Chain and Multi-Protocol Integration</h3><p>Intent-based systems excel in managing multi-chain interactions, addressing fragmentation issues that parallel the multi-PSP challenges faced by traditional businesses. An intent-centric infrastructure in the blockchain ecosystem identifies the best trading prices across liquidity pools on multiple chains, similar to how businesses use multiple PSPs to access different payment methods and geographic markets. The complexity of reconciling transactions across multiple blockchain networks mirrors the PSP reconciliation challenges that businesses face when managing multiple payment service providers.</p><p>The unified approach of intent systems helps prevent fragmentation among intent pools by increasing the number of solvers and decreasing the likelihood of centralisation. This design philosophy addresses the same scalability and efficiency concerns that drive businesses to consolidate their payment infrastructure through PSPs rather than managing individual relationships with multiple financial institutions.</p><h3>Conclusion</h3><p>Web3 intents represent a paradigm shift that addresses fundamental user experience challenges in blockchain interactions, offering solutions analogous to those provided by Payment Service Providers in traditional digital commerce. Both technologies serve as crucial abstraction layers that simplify complex financial infrastructure, reduce technical barriers for users, and enable broader adoption of sophisticated payment and transaction systems.</p><p>The convergence of these approaches suggests a future where financial interactions, whether traditional or blockchain-based, prioritise user intent and desired outcomes over technical implementation details. As web3 intents continue to evolve and mature, they may eventually bridge the gap between traditional payment infrastructure and blockchain-based financial services, potentially offering unified solutions that combine the reliability and regulatory compliance of traditional PSPs with the innovation and decentralization benefits of blockchain technology.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=93dc0cd49226" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Top 28 DeFi attack vectors]]></title>
            <link>https://medium.com/@genisis0x/top-28-defi-attack-vectors-eba0ce89e19a?source=rss-9a6f1a454fdc------2</link>
            <guid isPermaLink="false">https://medium.com/p/eba0ce89e19a</guid>
            <category><![CDATA[defi]]></category>
            <category><![CDATA[smart-contracts]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[smartcontract-audit]]></category>
            <category><![CDATA[finance]]></category>
            <dc:creator><![CDATA[Manmit]]></dc:creator>
            <pubDate>Tue, 13 Jun 2023 18:01:26 GMT</pubDate>
            <atom:updated>2023-06-13T18:01:26.048Z</atom:updated>
            <content:encoded><![CDATA[<ol><li><strong>Flash Loan Attacks: </strong>Flash loan attacks involve taking advantage of the ability to borrow and manipulate large sums of assets within a single transaction. Malicious actors exploit this feature by borrowing funds, manipulating the market, and repaying the loan within the same transaction. By doing so, they can profit from price discrepancies and vulnerabilities in DeFi protocols.</li><li><strong>Reentrancy Attacks:</strong> Reentrancy attacks occur when a malicious contract repeatedly calls back into a vulnerable contract before the previous execution completes. This allows attackers to drain funds from the vulnerable contract, resulting in financial losses. This attack vector gained prominence after the notorious DAO attack in 2016.</li><li><strong>Front-running:</strong> Front-running involves manipulating the order of transactions in the mempool to take advantage of price changes before they are executed. Malicious actors monitor pending transactions and quickly execute transactions that benefit them, resulting in financial losses for other traders.</li><li><strong>Oracle Manipulation:</strong> DeFi protocols rely on external data sources called oracles to obtain real-world information such as asset prices. Oracle manipulation involves exploiting vulnerabilities in these oracles to provide false data, leading to price manipulation, liquidations, or other malicious actions within DeFi protocols.</li><li><strong>Governance Attacks:</strong> Governance attacks aim to gain control over a protocol’s governance system to modify rules, redirect funds, or execute other malicious actions. By accumulating governance tokens or exploiting vulnerabilities, attackers can manipulate protocol parameters and decisions, resulting in financial losses for users.</li><li><strong>Cross-Chain Attacks:</strong> Cross-chain attacks exploit vulnerabilities in bridges or interoperability protocols that enable assets to move across different blockchain networks. Attackers can manipulate transactions, steal assets, or exploit inconsistencies between blockchains to their advantage.</li><li><strong>Impermanent Loss:</strong> Impermanent loss occurs when liquidity providers in automated market-making protocols experience temporary losses due to price imbalances between the provided assets. This loss is a result of the dynamic nature of asset prices and can impact the profitability of liquidity provision.</li><li><strong>Token Swap Attacks</strong>: Token swap attacks involve manipulating the prices of tokens in decentralized exchanges (DEXs) to execute profitable trades. Attackers can exploit vulnerabilities in DEX algorithms, liquidity pools, or token prices to their advantage.</li><li><strong>Collateral Undercollateralization</strong>: Collateral undercollateralization occurs when an attacker manipulates the value of collateral to borrow more assets than the collateral’s actual worth. This can lead to defaults, insolvency, or losses for the affected DeFi protocol or its users.</li><li><strong>Sybil Attacks:</strong> Sybil attacks involve creating a large number of fake identities or accounts to gain control over a DeFi protocol. By controlling a significant portion of the network, attackers can manipulate voting systems, consensus mechanisms, or other governance-related processes.</li><li><strong>Liquidity Pool Manipulation:</strong> Liquidity pool manipulation involves exploiting vulnerabilities in decentralized exchanges’ liquidity pools to manipulate prices, execute profitable trades, or drain funds. Attackers can leverage flash loans, complex trading strategies, or pool imbalances to their advantage.</li><li><strong>Tokenization Attacks:</strong> Tokenization attacks target the process of converting real-world assets into digital tokens on the blockchain. Attackers can manipulate tokenized assets, create counterfeit tokens, or deceive investors through fraudulent tokenization schemes.</li><li><strong>Fake Projects and Scams:</strong> DeFi ecosystems are prone to fake projects and scams that deceive users into investing in fraudulent tokens or platforms. These scams often involve fake teams, false promises, or misleading information, resulting in significant financial losses for unsuspecting investors.</li><li><strong>Malicious Wallets and Phishing:</strong> Malicious wallets and phishing attacks aim to steal users’ private keys, seed phrases, or login credentials. Attackers create fake wallet applications or phishing websites that resemble legitimate platforms, tricking users into disclosing their sensitive information.</li><li><strong>Price Oracle Attacks</strong>: Price oracle attacks involve manipulating the data provided by price oracles to deceive DeFi protocols. By providing false information, attackers can influence asset prices, trigger liquidations, or exploit vulnerabilities in price-dependent protocols.</li><li><strong>Yield Farming Exploits:</strong> Yield farming exploits involve taking advantage of vulnerabilities or bugs in yield farming protocols to maximize returns or drain funds. Attackers can exploit inconsistencies in reward calculations, withdrawal mechanisms, or other protocol functionalities.</li><li><strong>Pump and Dump Schemes:</strong> Pump and dump schemes involve artificially inflating the price of a token through coordinated buying, creating a frenzy among investors, and then quickly selling off the token at a profit. Unsuspecting investors are left with worthless tokens and financial losses.</li><li><strong>MEV Exploitation: </strong>MEV (Miner Extractable Value) exploitation refers to the practice of miners or front-runners taking advantage of the knowledge of pending transactions to extract additional profits. By manipulating transaction order, miners can gain an unfair advantage and exploit price discrepancies.</li><li><strong>Wallet Vulnerabilities:</strong> Wallet vulnerabilities can expose users’ private keys or sensitive information to attackers. Weak encryption, insecure key storage, or flaws in wallet software can result in unauthorized access to funds and potential loss of assets.</li><li><strong>Chain Reorganization Attacks:</strong> Chain reorganization attacks target blockchain networks with low hash power. Attackers with significant computational power can create longer alternative chains, leading to the invalidation of confirmed transactions and potential double-spending.</li><li><strong>Malicious Token Contracts:</strong> Malicious token contracts are smart contracts designed with hidden functionalities or vulnerabilities that allow attackers to manipulate token balances, drain funds, or perform other malicious actions without the knowledge of token holders.</li><li><strong>Insider Attacks:</strong> Insider attacks involve individuals with privileged access or knowledge exploiting their positions to compromise DeFi protocols. This can include developers, admins, or employees with malicious intent who abuse their authority to manipulate systems or steal funds.</li><li><strong>Stablecoin Attacks:</strong> Stablecoin attacks target decentralized stablecoins, which aim to maintain a stable value relative to a specific asset or a basket of assets. Attackers can exploit vulnerabilities in the underlying collateral, liquidity mechanisms, or governance systems to undermine stability or cause financial losses.</li><li><strong>Governance Token Exploits:</strong> Governance token exploits exploit vulnerabilities in governance tokens’ functionalities, such as voting or delegation mechanisms. Attackers can manipulate token distribution, create artificial voting power, or influence governance decisions for their benefit.</li><li><strong>Denial-of-Service (DoS) Attacks:</strong> DoS attacks aim to disrupt the normal functioning of DeFi protocols by overwhelming them with a high volume of malicious requests or transactions. This can lead to network congestion, delays, or even complete unavailability of the system.</li><li><strong>Sandwich Attack:</strong> Attacker exploits the order book by placing two transactions on either side of a targeted transaction. The attacker buys assets before the target transaction and sells them immediately after, profiting from the price movement caused by the target transaction. This coordinated action allows the attacker to capitalize on the price impact and potentially manipulate the market. Sandwich attacks highlight the importance of monitoring and protecting against front-running and other types of market manipulation in DeFi platforms.</li><li><strong>Rug Pull: </strong>The creator or developer of a project abruptly abandons the project and withdraws all the funds invested by users, leaving them with worthless tokens. It is a form of exit scam where the rug puller takes advantage of investors’ trust and liquidity to maximize their profits. Rug pulls highlight the risks associated with investing in DeFi projects and the importance of conducting thorough research before participating in any investment opportunity. Investors should be cautious and vigilant to avoid falling victim to rug pulls and other fraudulent schemes in the DeFi space.</li><li><strong>Liquidity squeeze: </strong>When a large number of users attempt to withdraw their funds from a protocol simultaneously, causing a shortage of available liquidity. This can lead to significant slippage and a decline in the value of assets, resulting in losses for investors. Liquidity squeezes can be intentional or unintentional, caused by factors such as market manipulation, panic selling, or technical issues. They highlight the importance of robust risk management and diversification strategies in DeFi investing.</li></ol><h4><strong>Conclusion</strong></h4><p>In conclusion, understanding and being aware of various attack vectors is crucial in the world of decentralized finance (DeFi). The rapidly evolving DeFi space presents numerous opportunities for innovation and financial growth, but it also introduces significant risks. By examining different attack vectors, we gain valuable insights into the vulnerabilities that exist within DeFi protocols and smart contracts.</p><p>Throughout this blog, I have explored a wide range of attack vectors, including flash loan attacks, rug pulls, sandwich attacks, and more. Each attack vector carries its own unique risks and consequences, highlighting the need for robust security measures and diligent risk management.</p><p>As DeFi continues to expand and attract more users and value, it becomes increasingly important for developers, investors, and users to stay informed and take proactive steps to protect themselves. This includes conducting thorough audits of smart contracts, implementing multi-factor authentication, practicing proper due diligence when investing, and staying updated on the latest security practices.</p><p>By being aware of the potential attack vectors and understanding how they operate, individuals can make more informed decisions and actively contribute to the overall security and stability of the DeFi ecosystem. Together, we can foster a safer and more resilient environment for decentralized finance to thrive.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eba0ce89e19a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Exploring Singleton Contracts in Smart Contract Development]]></title>
            <link>https://medium.com/@genisis0x/exploring-singleton-contracts-in-smart-contract-development-269b6a1cea20?source=rss-9a6f1a454fdc------2</link>
            <guid isPermaLink="false">https://medium.com/p/269b6a1cea20</guid>
            <category><![CDATA[smart-contracts]]></category>
            <category><![CDATA[skeleton]]></category>
            <category><![CDATA[contracts]]></category>
            <dc:creator><![CDATA[Manmit]]></dc:creator>
            <pubDate>Tue, 13 Jun 2023 16:59:51 GMT</pubDate>
            <atom:updated>2023-06-13T16:59:51.001Z</atom:updated>
            <content:encoded><![CDATA[<h4><strong>Introduction</strong></h4><p>Singleton contracts play a vital role in smart contract development, providing a unique and efficient way to manage contract instances on blockchain platforms. In this blog post, we will delve into the concept of singleton contracts, their benefits, and how they are implemented in the context of decentralised applications (dApps).</p><h4><strong>Understanding Singleton Contracts</strong></h4><p>A singleton contract refers to a design pattern that ensures the creation of only one instance of a contract throughout the application’s lifespan. Once deployed, subsequent attempts to create additional instances will fail, ensuring the uniqueness of the contract.</p><h4><strong>Benefits of Singleton Contracts</strong></h4><ol><li><strong>Resource Efficiency</strong> <br>By limiting the creation of multiple contract instances, singleton contracts optimize resource allocation, reducing storage requirements, computational overhead, and gas costs. This leads to more efficient and cost-effective dApps.</li><li><strong>Standardization and Interoperability</strong><br>Singleton contracts provide a standardised interface or implementation that other contracts or applications can interact with. This promotes interoperability and consistency within a decentralized ecosystem, making it easier to integrate and communicate with other components.</li><li><strong>Governance and Control<br></strong>Singleton contracts can serve as governance or control contracts, centralising critical decision-making or managing system parameters. They provide a single point of control, facilitating upgrades, permission management, and overall system governance.</li><li><strong>Security and Access Control<br></strong>Singleton contracts enable the implementation of robust access control mechanisms. Only authorized entities can interact with specific functionalities or data, enhancing security and mitigating potential risks.</li></ol><h4><strong>Implementing Singleton Contracts</strong></h4><p>Implementing singleton contracts involves utilizing design patterns such as the factory pattern or the proxy pattern. The factory pattern involves a contract responsible for creating and managing the single instance, while the proxy pattern delegates calls to the singleton contract. These patterns enforce the uniqueness and immutability of the contract instance.</p><h4><strong>Best Practices and Considerations</strong></h4><p>When working with singleton contracts, it is important to consider the following:</p><ol><li><strong>Design Considerations<br></strong>Carefully plan the contract’s responsibilities, ensuring that it encapsulates the necessary functionalities for the intended use case. Consider potential upgradeability requirements and future scalability.</li><li><strong>Access Control<br></strong>Implement robust access control mechanisms to restrict interactions with critical functionalities or sensitive data. Ensure that only authorized entities can invoke specific actions.</li><li><strong>Security Audits<br></strong>Conduct thorough security audits of the contract code to identify and mitigate potential vulnerabilities. Protect the contract against potential attacks or misuse.</li><li><strong>Testing and Deployment<br></strong>Rigorously test the contract’s functionality and behavior under different scenarios. Deploy the contract on a test network before deploying it to the mainnet to ensure its correctness and efficiency.</li></ol><pre>pragma solidity ^0.8.0;<br><br>/**<br> * @title SingletonContract<br> * @dev This contract provides the skeleton code for implementing a singleton contract.<br> */<br>contract SingletonContract {<br>    bool private initialized; // Flag to check if the contract has been initialized<br><br>    constructor() {<br>        initialized = false;<br>    }<br><br>    /**<br>     * @dev Modifier to check if the contract has already been initialized.<br>     */<br>    modifier onlyNotInitialized() {<br>        require(!initialized, &quot;Contract already initialized&quot;);<br>        _;<br>    }<br><br>    /**<br>     * @dev Initializes the contract. This function can only be called once.<br>     */<br>    function initialize() external onlyNotInitialized {<br>        // Perform initialization tasks here<br><br>        initialized = true;<br>    }<br><br>    /**<br>     * @dev Returns whether the contract has been initialized or not.<br>     */<br>    function isInitialized() external view returns (bool) {<br>        return initialized;<br>    }<br><br>    // Other contract functionalities and business logic can be added here<br>    // ...<br>}</pre><h4><strong>Conclusion</strong></h4><p>Singleton contracts provide an efficient and standardised approach to managing contract instances in decentralised applications. By optimising resource allocation, promoting interoperability, facilitating governance, and enhancing security, singleton contracts contribute to the development of robust and scalable dApps. By following best practices and understanding the nuances of implementing singleton contracts, developers can harness their benefits and create more reliable and efficient blockchain-based applications.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=269b6a1cea20" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[EIP-1153: Enhancing Efficiency with Transient Storage Opcodes]]></title>
            <link>https://medium.com/@genisis0x/eip-1153-enhancing-efficiency-with-transient-storage-opcodes-2d79d720e9a0?source=rss-9a6f1a454fdc------2</link>
            <guid isPermaLink="false">https://medium.com/p/2d79d720e9a0</guid>
            <category><![CDATA[eip155]]></category>
            <category><![CDATA[solidity]]></category>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[eip]]></category>
            <dc:creator><![CDATA[Manmit]]></dc:creator>
            <pubDate>Tue, 13 Jun 2023 16:48:43 GMT</pubDate>
            <atom:updated>2023-06-13T16:48:43.992Z</atom:updated>
            <content:encoded><![CDATA[<p>Introduction: Ethereum Improvement Proposal 1153 (EIP-1153) presents a significant advancement in optimizing transaction execution on the Ethereum blockchain. This proposal introduces transient storage opcodes, which aim to improve efficiency and reduce costs associated with storage operations during smart contract execution. In this blog post, we will explore the key concepts and benefits of EIP-1153’s transient storage opcodes.</p><h4><strong>Understanding Transient Storage</strong></h4><p>In Ethereum, storage plays a crucial role in maintaining the state of smart contracts. However, accessing and modifying storage can be resource-intensive, leading to high gas costs. Transient storage, introduced by EIP-1153, provides a temporary storage area within a transaction’s execution context. Unlike persistent storage, transient storage is not persisted in the contract’s state after the transaction is completed.</p><p>Benefits of Transient Storage Opcodes:</p><ol><li><strong>Gas Cost Reduction:</strong> By leveraging transient storage opcodes, developers can perform computations and store intermediate values without incurring the full gas cost of persisting data in the contract’s storage. This optimization significantly reduces the overall gas costs associated with complex computations.</li><li><strong>Efficient Complex Computations:</strong> Transient storage opcodes enable more efficient execution of complex computations within a single transaction. Developers can leverage transient storage to store intermediate results and avoid redundant calculations, resulting in faster and more cost-effective contract execution.</li><li><strong>Improved Contract Interactions:</strong> With the use of transient storage opcodes, contract interactions can be streamlined and made more efficient. By storing necessary data in transient storage during a transaction, contracts can avoid costly read and write operations to persistent storage, thereby enhancing overall performance.</li></ol><h4><strong>Community Impact and Future Developments</strong></h4><p>EIP-1153’s transient storage opcodes have the potential to revolutionise smart contract development on the Ethereum blockchain. By reducing the reliance on persistent storage operations and optimising computations, developers can create more resource-efficient applications, improving scalability and usability.</p><p>It is important to note that EIP-1153 is a proposal, and its opcodes are subject to community discussion and consensus. Continued research and collaboration among developers, researchers, and Ethereum stakeholders will shape the final implementation and adoption of transient storage opcodes.</p><h4><strong>Conclusion</strong></h4><p>EIP-1153’s transient storage opcodes hold great promise in enhancing efficiency and reducing gas costs associated with storage operations in Ethereum smart contracts. This optimization opens up new possibilities for complex computations and streamlined contract interactions, ultimately driving the growth and scalability of the Ethereum ecosystem. Stay tuned for further updates and discussions as the Ethereum community continues to explore and refine the implementation of EIP-1153’s transient storage opcodes</p><h3><strong>EIP-1153 skeleton code</strong></h3><pre>pragma solidity ^0.8.0;<br>/**<br> * @title EIP-1153: Transient Storage Opcodes<br> * @dev This contract provides the skeleton code for implementing EIP-1153&#39;s transient storage opcodes.<br> */<br>contract EIP1153Skeleton {<br> // Transient storage variables<br> mapping(bytes32 =&gt; bytes32) private transientStorage;<br>/**<br> * @dev Stores a value in the transient storage.<br> * @param key The key to store the value under.<br> * @param value The value to be stored.<br> */<br> function store(bytes32 key, bytes32 value) external {<br>   transientStorage[key] = value;<br> }<br>/**<br> * @dev Retrieves a value from the transient storage.<br> * @param key The key to retrieve the value from.<br> * @return The stored value.<br> */<br> function retrieve(bytes32 key) external view returns (bytes32) {<br>   return transientStorage[key];<br> }<br>/**<br> * @dev Deletes a value from the transient storage.<br> * @param key The key to delete the value from.<br> */<br> function remove(bytes32 key) external {<br>   delete transientStorage[key];<br> }<br> <br> // Other contract functionalities and business logic can be added here<br> // …<br>}</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2d79d720e9a0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ERC-6551]]></title>
            <link>https://medium.com/@genisis0x/erc-6551-21b798795016?source=rss-9a6f1a454fdc------2</link>
            <guid isPermaLink="false">https://medium.com/p/21b798795016</guid>
            <category><![CDATA[erc]]></category>
            <category><![CDATA[erc6551]]></category>
            <category><![CDATA[solidity]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[blockchain-technology]]></category>
            <dc:creator><![CDATA[Manmit]]></dc:creator>
            <pubDate>Fri, 09 Jun 2023 02:49:17 GMT</pubDate>
            <atom:updated>2023-06-09T02:49:17.693Z</atom:updated>
            <content:encoded><![CDATA[<p>Before ERC-6551, there were several challenges and limitations in the management and ownership of tokens (NFTs) within token-based ecosystems. Here are some of the problems that existed prior.</p><p>Without ERC-6551, it was often difficult to establish clear ownership of tokens. Ownership records were maintained off-chain or required manual tracking, making it challenging to verify token ownership and track the history of token transfers.</p><p>Tokens were typically stored in wallets or accounts that were not specifically designed for token management. This led to security issues, as wallets might not have had the necessary mechanisms to protect and secure tokens against hacks or unauthorised access.</p><p>Transferring tokens required a separate process and manual confirmation, which could be a time-consuming process. The lack of standardisation for token transfers often resulted in errors or delays, impacting the efficiency and user experience.</p><p>Without ERC-6551, the ability to interact with tokens within platforms or applications was limited. Users had to manually handle token transfers and keep track of their tokens across different platforms, which made it difficult to integrate tokens.</p><p>The absence of ERC-6551, made it challenging to establish accountability and trust within token-based ecosystems. It was difficult to verify token ownership, track token history, and hold individuals accountable for token transactions.</p><p>To solve the above problems ERC-6551 comes into existence, which provides a structured and secure framework for managing tokens. Token-bound accounts establish a direct link between users’ accounts and their associated tokens, enabling clear ownership, secure storage, easy transfers, enhanced interactions, and improved security within token-based ecosystems (ERC-721).</p><h3>Introduction of ERC-6551</h3><p>ERC-6551 is an innovative concept introduced in the context of ERC-721 tokens, which are non-fungible tokens (NFTs) on the Ethereum blockchain. ERC-6551 establishes a direct association between token ownership and individual user accounts, enhancing the management, ownership, and user experience within token-based ecosystems (NFTs).</p><p>With ERC-6551, users can easily track, transfer, and interact with their ERC-721 tokens. They provide a secure environment where users can store their tokens Additionally, token-bound accounts simplify the token transfer process by streamlining transactions within the account system, reducing errors and enhancing user experience.</p><p>We can say that ERC-6551 is an extension of ERC-721 (NFTs). Because it contains all the standards of ERC-721 with addition of <strong>Token bound accounts.</strong></p><h3>Benefits of having ERC-6551</h3><ul><li><strong>Ownership and Accountability</strong>: ERC-6551 provides a clear and accountable ownership structure for NFTs. By binding each token with a specific account, so that it becomes easier to track and verify ownership of unique digital assets.</li><li><strong>Secure Token Management</strong>: ERC-6551 offers a secure and controlled way for managing tokens. By binding tokens with accounts, users can trust that their tokens are secured with accounts, reducing the risk of loss. The use of smart contracts for token transfers ensures transparency, security and efficiency.</li><li><strong>Personalised User Experience</strong>: ERC-6551 enables personalised experiences within token-based platforms or applications. Users can easily manage, transfer, and interact with their tokens within the context of their accounts.</li><li><strong>Transaction Restrictions and Rules</strong>: ERC-6551 allows the implementation of transaction restrictions or rules for the particular token. For example, an account may be restricted from transferring tokens to certain addresses or during specific conditions, these restrictions create more security to your digital assets.</li><li><strong>Integration with Ecosystems and Applications</strong>: ERC-6551 enables easy integration within platforms, applications, or decentralised applications (dApps). By binding tokens with accounts, platforms can provide user-specific functionalities. This integration enhances the overall user experience and utility of tokens within the ecosystem.</li></ul><h4>Code implementation of ERC-6551:</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tyK6S_UJoQ6YX5rQosq79w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bP0eHgiDcNN-JICKipNdbg.png" /></figure><h4>Let’s discuss the overview of the above mentioned functions.</h4><p><strong>TokenBoundAccount</strong> contract represents a basic token-bound account system. It includes functions for checking token ownership, getting token balances, and transferring tokens between accounts.</p><p>The contract relies on the ERC721 token contract. The constructor takes the address of the ERC721 token contract and initialises the tokenContract variable.</p><p>The <strong>ownsToken</strong> function checks if a given account owns a specific token by verifying if the token’s owner address matches the provided account address.</p><p>The <strong>getTokenBalance</strong> function returns the number of tokens owned by a given account.</p><p>The <strong>getTokenByIndex</strong> function retrieves the token ID at a specific index for a given account.</p><p>The <strong>transferToken</strong> function allows an account to transfer a token to another account. It verifies ownership, performs the transfer using the <strong>transferFrom</strong> function of the ERC721 token contract, updates the token ownership mapping, and adjusts the token balances of the involved accounts.</p><p>The <strong>addTokenToAccount</strong> and <strong>removeTokenFromAccount</strong> internal functions are used to manage the token lists associated with each account.</p><h4>Application where we can implement ERC-6551 (Token bound account)</h4><p><strong>Wallet Applications</strong>: Cryptocurrency wallets can be designed to support token-bound accounts. Wallets like MetaMask to manage and transact securely with their token-bound accounts.</p><p><strong>NFT Platforms</strong>: Non-Fungible Token (NFT) platforms can implement token-bound accounts to manage ownership and transfer of unique digital assets. These accounts ensure that the tokens representing NFTs are securely kept and can be easily transferred between users.</p><p><strong>Tokenized Asset Platforms</strong>: Platforms that tokenize real-world assets, such as real estate, art, or commodities, may also utilise token-bound accounts. These accounts help ensure transparency, traceability, and secure ownership transfer of the tokenized assets. Examples include platforms like Polymath and Harbor.</p><p>Overall, a token-bound account for ERC-721 tokens provides a robust infrastructure for ownership, management, and secure transfer of unique digital assets. It enhances the usability and utility of ERC-721 tokens within platforms, applications, and ecosystems that rely on the ERC-721 standard.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=21b798795016" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How Ethereum’s immutable smart contract can be upgraded]]></title>
            <link>https://medium.com/@genisis0x/how-ethereums-immutable-smart-contract-can-be-upgraded-578b323a1367?source=rss-9a6f1a454fdc------2</link>
            <guid isPermaLink="false">https://medium.com/p/578b323a1367</guid>
            <category><![CDATA[upgradable-contracts]]></category>
            <category><![CDATA[etherum]]></category>
            <category><![CDATA[decentralization]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[solidity]]></category>
            <dc:creator><![CDATA[Manmit]]></dc:creator>
            <pubDate>Thu, 25 May 2023 08:55:55 GMT</pubDate>
            <atom:updated>2023-05-25T08:55:55.633Z</atom:updated>
            <content:encoded><![CDATA[<p>Ethereum, as a decentralised blockchain platform, follows the principle of immutability for its smart contracts. Immutability refers to the concept that once a smart contract is deployed on the Ethereum blockchain, its code and state cannot be modified. This idea brings several benefits to the Ethereum ecosystem.</p><p>Immutability enhances trust and security by providing transparency. Once a smart contract is deployed, its code and behaviour are publicly visible and verifiable by anyone on the blockchain.</p><p>The immutability of Ethereum smart contracts ensures that once a transaction is recorded on the blockchain, it cannot be altered. This property protects against fraud, or any unauthorised changes to transactions. It ensures that the history of transactions remains reliable.</p><p>Immutability plays an important role in maintaining the integrity of the consensus mechanism in the Ethereum platform. Ethereum’s consensus algorithm, currently transitioning from Proof of Work to Proof of Stake through Ethereum 2.0, relies on the immutability of previous blocks to secure the network and validate new transactions.</p><p>Immutability provides a stable and reliable foundation for developers and users . Once a smart contract is deployed, developers can be sure that the contract’s logic will not be changed. Users can trust that the contract’s behaviour remains unchanged. This increases their confidence in engaging with decentralised applications and interacting with smart contracts.</p><p>While immutability brings lots of benefits, it also creates challenges for upgrading or modifying smart contracts. As we know if we are creating any application which solves some real world problems, it needs continuous upgrade by the time. If it will be immutable, in that case to add a new feature we have to create a new application and that is not a good practice at all.</p><p>To deal with the smart contract immutability problem, the Ethereum community has developed techniques such as proxy contracts, Delegate Call, upgradeable contract, and inheritance to introduce upgradability while maintaining the core principles of immutability. These approaches are able to preserve trust and security while enabling the upgradability of smart contracts on Ethereum.</p><h4>Let’s discuss various approaches to upgrade our solidity immutable smart contract</h4><p>DelegateCall:</p><p>delegatecall is a low-level function in Solidity that enables one contract to execute code from another contract while preserving the context of the calling contract. It is a powerful feature that allows contracts to delegate the execution of a function to another contract, even if the called function is not part of the calling contract’s interface. Here is an explanation of delegatecall:</p><p>Functionality</p><p>When a contract uses a delegate call to invoke a function in another contract, the called contract’s code is executed within the context of the calling contract. This means that the called function can access and modify the calling contract’s storage and state variables. It also means that any modifications to the state made by the called contract will affect the calling contract.</p><p>Use Cases</p><p>The delegate call function is commonly used in scenarios where we need upgradeability . By delegating the execution of a function to a separate contract, the calling contract can benefit from external logic without having to include that logic directly. This enables upgradeable contract patterns, where the implementation contract can be upgraded while preserving the same interface and storage of the calling contract.</p><p>Note: If you are trying to upgrade your smart contract with the help of delegatecall in that case you have to be very careful about the order of the storage slot. We cannot change the order of the storage variable in any condition.</p><p>Contract A has variables like <strong>uint32 num1</strong> , <strong>uint256 num2</strong>, so you have to put the same order into contract B. If you want to add a new variable add that in the last position to avoid storage collisions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fFfV4oFs2fbqaSfBDzbCpQ.png" /></figure><h4><strong>Inheritance:</strong></h4><p>Smart contract upgrade using inheritance is a technique that allows for contract upgrades by separate contracts for different versions of the contract logic. By using inheritance, new versions of the contract can be created while reusing and extending the functionality of the previous version.</p><p>Steps we need to follow while upgrading our smart contract with inheritance</p><ol><li>The initial version of the smart contract is created with its complete functionality and logic. This contract serves as the base contract that will be extended and upgraded in subsequent versions. Let’s call this contract BaseContract.</li><li>To perform an upgrade, a new contract is created that inherits from the BaseContract. Let’s call this new contract UpgradedContract. By inheriting from BaseContract, UpgradedContract inherits all the functions, state variables, and modifiers from the base contract.</li><li>In UpgradedContract, you can modify, extend, or add new functions and state variables to introduce new functionality or improve existing functionality.</li><li>To perform the upgrade, the new version of the contract, UpgradedContract, is deployed to the blockchain. The deployment process typically involves creating a new contract instance and assigning it a new address.</li><li>Once UpgradedContract is deployed, users and other contracts can interact with the upgraded functionality by referencing the address of the new contract instance.</li></ol><p>Using inheritance for smart contract upgrades provides several benefits:</p><ol><li>By inheritance, common code and logic can be shared between the base contract and the upgraded contract, reducing code duplication..</li><li>Upgrades can be performed in a controlled and incremental manner by introducing new functionality or improvements in each new contract version.</li><li>By establishing communication between the old and upgraded contracts, data sharing and interoperability between different versions can be facilitated.</li></ol><h4>Proxy patterns:</h4><p>The proxy pattern in Solidity is a design pattern used to implement upgradeable smart contracts. It involves separating the contract logic from the contract’s address and using a proxy contract for interacting with the implementation contract. The proxy contract delegates function calls to the implementation contract, enabling upgrades to the contract’s logic while preserving the contract’s address and interface.</p><p><strong>Here’s an overview of how the proxy pattern works in Solidity:</strong></p><p>Proxy Contract:</p><p>The proxy contract acts as a transparent wrapper around the implementation contract. It receives function calls and forwards them to the implementation contract. The proxy contract typically contains minimal logic, mainly focusing on the delegation of function calls.</p><p>Implementation Contract:</p><p>The implementation contract contains the actual logic and functionality of the smart contract. It is decoupled from the proxy contract and holds the contract’s state variables, data structures, and functions.</p><p>Delegation Mechanism:</p><p>The proxy contract delegates function calls to the implementation contract using the delegatecall opcode. The delegatecall opcode allows the proxy contract to execute the code of the implementation contract while preserving the proxy contract’s storage and state.</p><p>Storage Separation:</p><p>In the proxy pattern, the storage of the contract is maintained separately from the logic. The storage is held by the proxy contract, while the implementation contract only focuses on the contract’s functionality. This separation allows for upgrades to the implementation contract without affecting the contract’s storage or state.</p><p>Upgrade Process:</p><p>To upgrade the contract’s logic, a new version of the implementation contract is deployed. The proxy contract is then updated to point to the new implementation contract’s address. This upgrade process does not require modifying the proxy contract itself, maintaining the same contract address and interface.</p><p>There are different types of proxy pattern are in existence, which will help to upgrade our smart contract in very easy and secure manners</p><h4>Transparent proxy pattern:</h4><p>In Solidity, the concept of a transparent proxy pattern refers to a design pattern that allows for upgradability of smart contracts while maintaining the same contract address. It involves separating the contract logic from the contract’s address and using a proxy contract as an intermediary for interacting with the implementation contract. The transparent proxy pattern is the simplest proxy pattern.</p><p>Example:</p><p><strong>Implementation contract</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rAFjBoWS0pUhsDaoHynFFg.png" /></figure><p><strong>Proxy contract</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DwoXHwIYqNyM4C24flQcug.png" /></figure><p><strong>Deploy and upgrade</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cYPt53wWyrwFEdNUgNBueA.png" /></figure><p>UUPS Proxy Pattern:</p><p>The Universal Upgradable Proxy pattern in Solidity is a standard approach for implementing upgradeable smart contracts. It provides a flexible and secure way to upgrade contract logic while preserving the contract address and state. Here’s an example implementation of the Universal Upgradable Proxy pattern</p><p><strong>Proxy contract</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ci3ij6AmXCBGEZhNJf7rWg.png" /></figure><p><strong>Implementation contract:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JqiFYDtlYOP64aZEz_TOqA.png" /></figure><p><strong>Deploying and upgrading:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sy8Yyy37A1PU98JQjxEmZw.png" /></figure><p>In UUPS pattern if we want to upgrade with new code to do this we just need to change the implementation address in the proxy contract.</p><p>Let’s discuss where we have to use the Transparent proxy , where to use Beacon Proxy and where to use UUPS Proxy.</p><p><strong>Transparent Proxy:</strong></p><ul><li>Use Transparent Proxy when you want to maintain the same contract address during upgrades. This is useful when you have existing contracts interacting with the proxy contract and you want to seamlessly upgrade the contract logic without requiring updates to those external contracts.</li><li>Transparent Proxy is relatively straightforward to implement and has a low complexity compared to other proxy patterns.</li><li>It is suitable when you don’t want to change the address.</li></ul><p><strong>Beacon Proxy:</strong></p><ul><li>Use Beacon Proxy when you want to separate the storage of the implementation address from the proxy contract.</li><li>Beacon Proxy is useful when you have multiple instances of the proxy contract that can reference the same implementation contract.</li><li>It provides flexibility in managing the implementation address, allowing you to change the implementation without modifying the proxy contract itself.</li></ul><h4>UUPS Proxy:</h4><ul><li>Use UUPS Proxy when you want a standardised approach for contract upgrades.</li><li>UUPS Proxy introduces a defined upgrade interface with functions like <strong>initialise</strong> and <strong>upgradeTo</strong>, making the upgrade process more standardised and easier to manage.</li><li>It is suitable when you want a specific upgrade standard and have a clear separation between initialisation and upgrade functions.</li><li>UUPS Proxy is beneficial when you want to ensure consistency and compatibility across different versions of your contract.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KmwuCdze8-aNnPbRW_Pyzg.png" /><figcaption>Comparison Between <strong>Transparent Proxy, Beacon Proxy and UUPS Proxy</strong></figcaption></figure><p>Overall, the ability to upgrade smart contracts in a controlled and secure manner enhances the flexibility and functionality of decentralised applications built on the Ethereum blockchain</p><p>References:</p><p><a href="https://medium.com/coinmonks/proxy-pattern-and-upgradeable-smart-contracts-45d68d6f15da"><strong>Proxy Pattern and Upgradeable Smart Contracts</strong></a></p><p><a href="https://dev.to/yakult/tutorial-write-upgradeable-smart-contract-proxy-contract-with-openzeppelin-1916"><strong>write upgradeable smart contract (proxy) using OpenZeppelin</strong></a></p><p><a href="https://blog.openzeppelin.com/proxy-patterns/"><strong>OpenZeppelin Proxy Patterns</strong></a></p><p><a href="https://ethereum.org/en/developers/docs/smart-contracts/upgrading/"><strong>UPGRADING SMART CONTRACTS</strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=578b323a1367" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ERC-4626]]></title>
            <link>https://medium.com/@genisis0x/erc-4626-c5550caa09e0?source=rss-9a6f1a454fdc------2</link>
            <guid isPermaLink="false">https://medium.com/p/c5550caa09e0</guid>
            <category><![CDATA[erc4626]]></category>
            <category><![CDATA[erc20]]></category>
            <category><![CDATA[erc20-token]]></category>
            <dc:creator><![CDATA[Manmit]]></dc:creator>
            <pubDate>Mon, 22 May 2023 08:30:41 GMT</pubDate>
            <atom:updated>2023-05-22T08:30:41.816Z</atom:updated>
            <content:encoded><![CDATA[<p>In this article, we are going to discuss the ERC-4626. To understand this first we need to know, What is the need of ERC-4626?</p><p>When something new is introduced in markets there are lots of efforts and ideas behind it. Whenever developers or the community create a proposal or idea, they try to reduce the problem associated with it and want to make changes into the ongoing scenario. Same case is with ERC-4626.</p><p>Before ERC-4626 there was no standardisation for lending, staking and yield farming vaults. Every protocol which implements the vault feature in his application, uses his own method and strategy to create vaults. There was no standardisation for vaults, which caused waste of time and development resources. Every protocol has its own interface, its own adapter and its own strategy to create a vault .</p><p>Let’s take an example where a vault faces lack of standardisation</p><p>Suppose there are 3 protocols that want to implement a vault in his application. And the vault should have 3 functions. One for depositing assets, one for withdrawal assets and one for giving the information of total assets into the vault.</p><p>All three protocols have to create the same methods but because of no standardisation each protocol tries to implement methods with different names, which increase the cost and complexity of the code. Each protocol has its own interface and adopters.</p><p>To solve the above problems ERC-4626 comes with the idea of “Tokenized Vaults with a single underlying EIP-20 token” which is an extension of the ERC-20 token, where you can also deposit and withdraw your token and also get yield over the time period on your deposited assets.</p><p>Let’s Deep dive into the ERC-4626</p><h3>ERC-4626</h3><p>ERC-4626 is a standard for vaults, which is the extension of the ERC-20 token that comes with a tokenized vault facility. Vaults represent your share in the form of vault Token minted by the vaults on behalf of the assets that you provided to the vault. In simple words ERC-4626 is a “Tokenized Vault with a single underlying EIP-20 token”.</p><p>Vault has its own strategy and methods, on the basis of the strategy it tries to invest your assets into the different protocol to maximise your yield profit.</p><p>Let’s understand what yield-bearing vaults are.</p><p>Yield-bearing vaults are smart contracts that follow some strategy for higher returns. Yield-bearing vaults allow users to deposit their ERC-20 token into a pool of tokens and on behalf of the deposited assets it mints vault tokens to the depositor, which represent your share.</p><p>How Yield bearing vaults are able to maximise profit?</p><p>Yield bearing vault maximises the profit by depositing into the most profitable protocol. To find the most profitable protocol, the vault assigns a rank to different protocols according to the most profitable protocol and on the basis of rank, they deposit a fraction of the token into the different protocols and keep some reserve to deal with the withdrawal condition.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oZxUxzwb68gpF1JWToP7SA.png" /></figure><p>Above mentioned diagram shows how yield-bearing vaults work to maximise profit.</p><p>Now let’s try to understand some functionality of the ERC-4626 standard.</p><p>ERC-4626 contain different function and events let’s discuss them one by one</p><h4>Functions:</h4><ul><li>asset</li><li>totalAssets</li><li>convertToShares</li><li>convertToAssets</li><li>maxDeposit/previewDeposit/deposit</li><li>MaxMint / previewMint / mint</li><li>MaxWithdraw / PreviewWithdraw / withdraw</li><li>MaxRedeem / previewRedeem / redeem</li></ul><h4>Events:</h4><ul><li>Deposit</li><li>Withdraw</li></ul><p>1. <strong>Asset : </strong>Assets is a view function which returns address of the asset token associated with pool</p><p>2.<strong> totalAsset : </strong>totalAssets return the total assets stored into the vault.</p><p>3. <strong>ConvertToShare : </strong>This function returns the number of shares that the vault would swap for the specified number of assets.</p><p>4. <strong>ConvertToAsset : </strong>This method returns the quantity of assets that the vault would trade for the specified number of shares.</p><p>5. <strong>MaxDeposit : </strong>The maximum number of underlying assets that can be deposited by the receiver in a single deposit call is returned by this function.</p><p>6. <strong>PreviewDeposit :</strong> Users can simulate the impact of their deposit at the present block using this tool.</p><p>7. <strong>Deposit : </strong>This process transfers ownership of shares to the receiver and secures the assets of the underlying tokens in the vault.</p><p>8. <strong>MaxMint : </strong>The maximum number of shares that can be issued by the receiver in a single mint call is returned by this function.</p><p>9. <strong>PreviewMint : </strong>Users can simulate the impacts of their mint at the current block using this function.</p><p>10. <strong>Mint :</strong> By depositing assets from underlying tokens, this function mints exact shares of the vault to the recipient.</p><p>11. <strong>MaxWithdraw : </strong>The maximum amount of underlying assets that can be taken out of the owner’s balance in a single withdrawal call is returned by this function.</p><p>12. <strong>PreviewWithdraw : </strong>Users can mimic the impact of their withdrawal at the present block using this tool.</p><p>13. <strong>Withdraw : </strong>This function burns shares owned by the owner and sends the recipient exactly the assets token from the vault.</p><p>14. <strong>MaxRedeem : </strong>The maximum number of shares that can be purchased with a redeem call from the owner balance is returned by this function.</p><p>15. <strong>PreviewRedeem</strong> : Users can simulate the results of their redemption at the present block using this function.</p><p>16. <strong>Redeem : </strong>This process buys back a certain number of shares from the shareholder and transfers the assets of the underlying token from the vault to the recipient.</p><h4>Events:</h4><p>1.<strong>Deposit : </strong>When tokens are deposited into the vault through the mint and deposit methods, they MUST be emitted.</p><p>2. <strong>Withdraw : </strong>When shares are withdrawn from the vault by a depositor using the redeem or withdraw methods, a signal MUST be released.</p><p>To implement the ERC-2646 standards into your application to do this you have to inherit the interface of the ERC-2646 which is mentioned below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zHoXYL4UbhVBmyssWCmpWg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wn_0TYsTy_5sTqp0NdEelA.png" /></figure><h3>Application where we can implement ERC-4626</h3><p>Leveraged Trading: Tokenised Vaults can be used to enable leveraged trading strategies. Users can lock their base tokens as collateral in a vault and mint vault tokens representing leveraged positions. These vault tokens can be traded or used for various purposes while the base tokens act as collateral, allowing users to magnify their exposure to the underlying asset.</p><p>Decentralised Lending and Borrowing: Tokenised Vaults can facilitate decentralised lending and borrowing platforms. Users can deposit their base tokens as collateral in a vault and mint vault tokens. These vault tokens can then be lent out to borrowers who provide suitable collateral. This mechanism enables peer-to-peer lending and borrowing without the need for intermediaries.</p><p>Stablecoin Collateralization: In a stablecoin system, Tokenized Vaults can be used to collateralize the stablecoin with the underlying base token. The base token is locked in a vault, and stable coins are minted against the value of the collateral. This mechanism helps to maintain the stability and backing of the stablecoin by ensuring the presence of sufficient collateral..</p><p>There are many advantages of the ERC-4626 standard</p><ul><li>We get a vault facility associated with the ERC-20 token so it will be more secure to deposit the ERC-20 token into the vault.</li><li>No need to create a separate adapter for every protocol now we have standardisation for vault creation.</li><li>Cost will be reduced because the integration process is less time consuming.</li><li>If any application contains a vault facility then it will be easy to integrate ERC-4626 with a particular application.</li></ul><h3>Conclusion :</h3><p>After this lots of discussion we all are aware that the ERC-2646 is a really very good standard that set some standards for the vault related contract.</p><p>There may be some points where we have to face some problems with ERC-2646</p><p>Like as we know it is just a smart contract which uses some strategy to maximise the profit of the user but sometimes where there will be lots of up and down in the DeFi market in that case this might not be able to gain profit as usual.</p><p><strong>References:</strong></p><p><a href="https://eips.ethereum.org/EIPS/eip-4626"><strong>Official ERC-4626 (Tokenized Vaults)</strong></a></p><p><a href="https://medium.com/mstable/exploring-the-erc-4626-universe-36b40c51618"><strong>Exploring the ERC-4626 Universe</strong></a></p><p><a href="https://medium.com/idle-finance/integrating-erc-4626-a-game-changer-in-tokenized-vaults-ee9e9fc28481"><strong>Integrating ERC-4626: A Game-Changer in Tokenized Vaults</strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c5550caa09e0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Violent attack vectors in WEB3]]></title>
            <link>https://medium.com/@genisis0x/violent-attack-vectors-in-web3-addeb417b87d?source=rss-9a6f1a454fdc------2</link>
            <guid isPermaLink="false">https://medium.com/p/addeb417b87d</guid>
            <category><![CDATA[blockchain-development]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[web-attack]]></category>
            <category><![CDATA[web3]]></category>
            <category><![CDATA[solidity]]></category>
            <dc:creator><![CDATA[Manmit]]></dc:creator>
            <pubDate>Fri, 12 May 2023 11:09:47 GMT</pubDate>
            <atom:updated>2023-05-18T06:59:39.674Z</atom:updated>
            <content:encoded><![CDATA[<p>In today’s time WEB3 (blockchain) is something that is continuously growing and building trust over millions of users. Main reason for trust is its transparency and decentralisation.</p><p>There are billion dollars crypto currency flowing over the blockchain with full transparency. Community and dAPP are continuously enhancing the features of the blockchain. Community or governance always try to make secure applications, But there are lot’s of cases where developers face many security issues in dAPP that lead to serious problems for users who use that service.</p><p>Basically we just want to say no matter how great and reliable technology is, there are still security issues present that lead to serious problems. So in today’s article we discuss the <strong>Violent attack vectors in web3</strong> that create problems for the developers, community as well as users.</p><p>In the past few years WEB3 has faced many Violent attacks. Because of these attacks users and services lose millions of dollars. With every attack developers try to enhance the securIty of the application.</p><p>Let’s discuss issues in WEB3 which cause the different types of attacks.</p><h4>Issues in WEB3:</h4><p>No doubt web3 is an advanced technology but still there are many security related issues present that invite the different types of attacks over the blockchain.</p><p>There are some following issues present in the blockchain.</p><ul><li><strong>Smart contract logic hack : </strong>It is something that will be caused because of the code quality of the smart contract. Hackers try to find some loopholes in the contract and on the basis of those loopholes they perform some malicious activity over the network.</li><li><strong>Flash Loans : </strong>Flash loan is something where a platform provides a very big amount of loan to the borrower without any collateral for a minimum amount of time. If there are some vulnerabilities present in the smart contract in this case hackers can take out large amounts of money in terms of flash loan without paying back.</li><li><strong>Architecture related issues : </strong>sometime we find some architecture related issues in application which causes violent attacks over the application. This is the mistake of the architecture team.</li><li><strong>Rug pull : </strong>Rug pull is something where an insider developer team is involved to create some loopholes inside the application.</li></ul><p>There are many issues still present in WEB3 which lead serious attacks over the application let’s discuss some <strong>violent attacks vector in WEB3</strong></p><h4>Denial of Services:</h4><p>Denial of services is a kind of attack which slows down your application or shutdown any application for a certain amount of time. In denial of services attacks, hackers try to send heavy traffic on the application, they try to send multiple requests continuously that create heavy traffic and our application gets slow down or sometimes down.</p><ul><li>DDOS might restrict any service to perform action</li><li>DDOS might restrict any authorization.</li></ul><h4>Different way to perform DDOS attack over blockchain:</h4><ol><li><strong>By sending transaction flood : </strong>This is one of the major attacks which occur by sending multiple transactions over the network. Attackers send multiple transactions that contain spam and fake transactions. We all know before transaction verification all unconfirmed transactions are kept into the <strong>Mempool</strong> which is the queue from where validators pick transactions and try to validate. But because of the fake and spam transaction Mempool continuously filled which continuously created heavy load over the network.</li><li><strong>Attack via the smart contract : </strong>In this scenario attackers target smart contracts to create traffic. Attackers send high computational transactions that prevent other real transactions from being included in the current block.</li></ol><h4>Impact over Blockchain:</h4><p><strong>Load over the network : </strong>This type of attack creates heavy load on the network which restricts many services of the particular network.</p><p><strong>Node Crashes : </strong>This can lead towards node crash. Which causes failure of the service.</p><p><strong>Software failure: </strong>By the DDOS attack effect software failed in various services. It may stop various services of the software.</p><h4>Real world DDOS attack:</h4><ol><li>The Solana blockchain was unavailable on September 14, 2021, for a period of time. This failure was actually caused by a DDoS attack of 400,000 Transaction Per Second. When over 80% of validators concur on that state of the network, the Solana network decides to undertake a rolling back of the network as a result.</li><li>Arbitrum also underwent a DDoS attack on September 14, 2021. Since there were too many transactions for the Sequencer to handle, Arbitrum was unavailable for about 45 minutes.</li></ol><h3>Double spending attack:</h3><p>Double spending is same as its name, double spending attack allows hackers to spend there crypto twice or more then twice to avail services. This is the flow where hackers can avail two or more services by just paying for one service.</p><p>This is just possible with the digital currency because digital currency is just a file and there is a possibility to make a copy of the file. But this will not work with actual currency. This issue can occur if there are copies of the digital currency present in the network. By the double spending attack the user can lose his money twice, one for the fake account created by the hacker and one for the actual account.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dlrLImAfUk7SMcME7thu1w.png" /></figure><ul><li>Hacker initiates first transaction with merchant A.</li><li>Copy of the currency store into the computer.</li><li>Again the hacker initiates a second transaction with merchant B.</li><li>Since the transactions were not verified by the miners, both merchants now believe that the money has been credited.</li></ul><h4>Type of Double Spending attack</h4><ol><li>Feany Attack</li><li>Race Attack</li><li>51% Attack</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Gmzym9bN2gWr3jb_J3vm6Q.png" /></figure><p>The above diagram shows the inner structure of bitcoin and how it protects itself from double spending attack.</p><h3>Sybil Attack:</h3><p>Sybil attack creates multiple identities over the network at the same time the main aim of this attack is to create malicious and inappropriate activity over the affected network without any permission.</p><p>This type of attack mostly occurs in peer to peer networks. Because of this attack a single entity has power to run multiple identities over the network.</p><p>You can find history about the sybil attack <a href="https://www.freehaven.net/anonbib/cache/sybil.pdf">here</a>.</p><h4>Types of sybil attack</h4><ol><li><strong>Direct attack</strong> : This type of attack occurs when malicious node directly interact with actual node in the network.</li><li><strong>Indirect Attack : </strong>This attack happens when one or more fake node interact with a node that is connected with an authentic node.</li></ol><h4>How to protect network with Sybil attack:</h4><ol><li><strong>Performing validation over identity while joining : </strong>when any one want to join the network make sure you will perform appropriate action before joining</li><li><strong>Cost to join the network : </strong>We can fix some amount to join the network by doing this we can reduce the chances of attack.</li></ol><h3>Eclipse Attack:</h3><p>Eclipse attack is a peer to peer attack, which is only possible over the peer to peer network. It can only perform over the node that accepts incoming connections. And you know in blockchain a node by default can accept <strong>117 incoming TCP and 8 outgoing TCP connections</strong>.</p><p>Eclipse attack is possible because a node can not be connected with all its neighbours nodes it will connect with limited nodes, because of this eclipse attack is possible.</p><p>Let’s discuss how Eclipse attack perform over the node</p><p>To perform this attack we need a botnet that performs specific action over the network. Bot send a flood of IP addresses over the target node, because of the ton of IP address target node perform sync and try to reconnect with the node. Now in the time frame when nodes try to reconnect with other nodes, at the same time bot try to connect malicious node with target node. This process may take multiple attempts to succeed.</p><p><strong>References:</strong></p><p><a href="https://medium.com/hackless/web3-security-types-of-attacks-dfd433dc5ba3"><strong>Web3 security: types of attacks</strong></a></p><p><a href="https://medium.com/@spartan_21003/how-web3-threat-attack-vectors-can-take-over-the-metaverse-environment-77decee25654"><strong>How Web3 Threat Attack Vectors Can Take Over the MetaVerse Environment</strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=addeb417b87d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>