<?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 Morayo Akran on Medium]]></title>
        <description><![CDATA[Stories by Morayo Akran on Medium]]></description>
        <link>https://medium.com/@eazy004?source=rss-68ffddfd2c23------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*yCdk7nPsni78UKNzz4OFpA@2x.jpeg</url>
            <title>Stories by Morayo Akran on Medium</title>
            <link>https://medium.com/@eazy004?source=rss-68ffddfd2c23------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 08:17:37 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@eazy004/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[ERC4337: Deep Dive]]></title>
            <link>https://medium.com/@eazy004/erc4337-deep-dive-abd00db22e39?source=rss-68ffddfd2c23------2</link>
            <guid isPermaLink="false">https://medium.com/p/abd00db22e39</guid>
            <category><![CDATA[erc-4337]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[ethereum-blockchain]]></category>
            <category><![CDATA[cryptocurrency]]></category>
            <category><![CDATA[web3]]></category>
            <dc:creator><![CDATA[Morayo Akran]]></dc:creator>
            <pubDate>Sat, 15 Apr 2023 15:30:21 GMT</pubDate>
            <atom:updated>2023-04-15T15:30:21.181Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Introduction</strong></p><p>ERC4337 was proposed as a solution to enable mainstream adoption of cryptocurrency. Previously, users were tasked with the effort of storing seed phrases for each wallet they set up. This procedure is needed as a failsafe mechanism to recover private keys if they are ever lost. For any transaction to be authorised on the blockchain, it must be signed by a unique private key. Therefore, the safekeeping of these keys enables a user to effectively operate a crypto network.</p><p>EIP4337 reduces the dependency of seed phrases and thus smoothens the onboarding journey for new users. Wallets such as Metamask are known as EOA (externally owned accounts) which are controlled by a public/private keypair. These types of wallet act as key management systems with access to the endpoint of a node provider. With the introduction of ERC4337, wallets will operate as contract accounts which enlarges their scope of possibilities.</p><p><strong>How does it work Technically</strong></p><p>Before an ERC is created, it starts as an EIP (Ethereum improvement proposal). After the on-chain governance model approves, grants authorization for, and verifies the modification, it is transformed into an Ethereum Request for Comment (ERC).</p><p>In the past, many EIPs have been proposed to implement account abstraction into the EVM ecosystem. Examples include;</p><p>- EIP86 was proposed with the objective of enabling smart contracts to trigger and endorse transactions. It’s worth mentioning that the existing range of wallets, including hardware and mobile wallets, mandate account owners to authorize transactions.</p><p>- EIP-2938 was suggested with the aim of developing a fresh category of high-level accounts utilizing the formation and application of address-specific smart contracts.</p><p>- EIP3074 focused on delivering self-executing smart contracts by introducing a new opcode</p><p>Although each of these proposals were theoretically possible, they require consensus level changes which mandates a hard fork. A hard fork is a software upgrade that requires each of the participants to update their systems to enable interoperability. As hard forks aren’t backwards compatible, they require extensive planning and warning before implementation. ERC4337 didn’t require any changes to the consensus layer and thus was simpler to implement. While this has sped up the implementation of account abstraction on Ethereum, the goal is to eventually implement this feature into the primary Ethereum protocol.</p><p>Lastly, the updates of ERC4337 are available across the EVM network which means chains such as Polygon, BNB and Avalanche can also reap the benefits. Other projects like ZKsync have implemented updates that are very similar.</p><p><strong>Advantages</strong></p><p>Introducing ERC4337 enables many features that were previously infeasible;</p><p>1) Zero gas fee minting</p><p>Especially on the Ethereum layer, it is particularly expensive to mint NFT’s. This may have proved an obstacle for starter projects in the past without a strong reputation to convince users of the benefits. However, ERC4337 makes it possible to sponsor users within the smart contract so that zero fees are charged during the transaction.</p><p>2) Bundling transactions</p><p>By bundling transactions into User Operations, users can perform multiple actions with a single click, which streamlines the blockchain transaction process. Instead of requesting a signature for each individual transaction on the blockchain, a single signature is now required for the entire batch. This brings blockchain transactions in line with the more conventional fiat transactions, where a group of items purchased together from a store are paid for in one transaction, rather than in payments for each individual item.</p><p>3) Security</p><p>Tailored account security mechanisms can now be configured to institute and enhance protection. This encompasses the capability to activate expenditure restrictions on particular devices, multi-signature for specific categories of transactions, and any other custom logic that can be integrated into a smart contract. If a user misplaces their phone, a social recovery mechanism with a time-lock feature permits a group of dependable associates or even a commercial entity to assist in retrieving it without jeopardizing the funds.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=abd00db22e39" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Oracles- The bridge between real world data and blockchain]]></title>
            <link>https://medium.com/@eazy004/oracles-the-bridge-between-real-world-data-and-blockchain-45b30b93b883?source=rss-68ffddfd2c23------2</link>
            <guid isPermaLink="false">https://medium.com/p/45b30b93b883</guid>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[chain-link]]></category>
            <category><![CDATA[oracles-network]]></category>
            <category><![CDATA[blockchain-technology]]></category>
            <category><![CDATA[cryptocurrency]]></category>
            <dc:creator><![CDATA[Morayo Akran]]></dc:creator>
            <pubDate>Sat, 13 Aug 2022 20:47:26 GMT</pubDate>
            <atom:updated>2023-03-27T08:51:23.262Z</atom:updated>
            <content:encoded><![CDATA[<p>Smart contracts, despite the name, aren’t inherently smart. They are chunks of code which reside on a blockchain network waiting to be called upon to perform pre-defined instructions. These instructions may range from sending tokens to checking wallet balances. Either way, a smart contract is deterministic which means if all the transactions from a blockchain were replayed then the same outputs will be achieved. This feature is partly what makes the blockchain so effective as it’s an immutable record of transactions.</p><p>However, the next phase of web3 includes interaction with real world events. To achieve this, smart contracts must communicate with off-chain data. Here lies the utility of oracles.</p><p>An oracle is any device or entity that connects a deterministic blockchain with off-chain data, oracles connect the blockchain ecosystem to real world data. This can be achieved through connecting APIs (application programming interfaces) which are channels that can be used to connect information to a blockchain. The information available from API’s extends from weather temperatures to exchange rates or sports results, greatly augmenting the range of possibilities available through dApps (decentralised applications). Oracles are extremely useful, but they must be deployed properly to maintain the decentralised nature of blockchain networks. For example, using an oracle that connects to a single API and feeds information to the blockchain perpetuates the same frailties of web2. If a single API is the sole contributor of information to a blockchain network, then the system becomes centralised. A centralised system is hazardous as its not reliable, a server API may be a victim of a DDoS (distributed denial of service) attack or network configuration issues causing the data feed to seize. This leads to a blockchain being unable to function completely as it is missing information.</p><p>How is Chainlink different</p><p>The aforementioned problem is known as the ‘oracle problem’ and it is something that is fully solved by Chainlink. Essentially, ChainLink is a decentralized network of nodes that uses Oracles to provide data from off-blockchain sources to on-blockchain smart contracts. Chainlink is able to offer decentralisation and real data by deploying a network of nodes. These nodes authenticate and verify data sources before passing them to smart contracts. The accuracy of information can be assured because Chainlink nodes stake LINK (ERC-20 token) before sourcing data from their range of API’s. By staking LINK, each node operator makes a financial pledge to certify their commitment of providing accurate information. If the information supplied to the smart contract falls below the threshold of acceptability, then the node loses their stake and credibility within the network. It is important to highlight that the nodes function as smart contracts themselves, by setting conditions within these contracts they are able to provide independent and decentralised computations to verify the completeness of the data being fed. In order to use Chainlink, a user must be able to deploy a request data function from their smart contract. This function is triggered when the oracle smart contract associated with the node emits an event.</p><p>Chainlink features</p><p>Chainlink offers many features which have cemented its place as the most popular decentralised oracle network. Another factor to bear in mind is that its services aren’t limited to Ethereum’s network despite LINK being an ERC-20 token. Chainlinks oracles can be deployed on any blockchain such as Avalanche or Solana. For example, Trader Joe (a DEX on Avalanche) uses Chainlink price feeds to support rapid scaling. This greatly extends the scope of utility for Chainlink services.</p><p>1) Smart contract automation</p><p>Off-chain maintenance is a tedious process when it is performed manually, keepers are nodes that typically enable the maintenance of smart contract networks within De-Fi. For example, a keeper may be tasked with the responsibility of ensuring a user’s loan doesn’t fall below the collateralisation limit. If it does, then the keeper will default the user’s position and sell the collateral to repay the loan. This role is important to maintain the credibility of a De-Fi network as too many defaulted loans negatively impacts the integrity of the platform.</p><p>Chainlink Keepers enables smart contracts to automate key functions and event-driven tasks in a highly reliable, decentralized, and cost-efficient manner. This alleviates the need to use individual keeper nodes which compromises decentralisation and increases the chance of error. Below is an example of how Aave deploys keeper nodes, so the protocol remains solvent;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/444/1*oCjqImxAZ2b8K5bQ5jD5pw.png" /><figcaption>Illustration of how keepers work on Aave</figcaption></figure><p>Chainlink Keepers enable you to execute smart contract functions based on conditions that you specify without having to create and maintain your own centralised stack</p><p>2) Data feeds (hybrid smart contracts)</p><p>Hybrid smart contracts define the combination of on-chain and off-chain data which can be integrated to create unique dApps.</p><p>Finance- Smart contracts can create the terms of connection between the buyer and the seller in global financial organisations, while DONs (decentralised oracle networks) can settle markets utilising outside data. Fair transaction ordering, KYC confirmation, transaction concealment, and quicker off-chain processing are additional areas where DONs can be useful.</p><p>Insurance- Smart contracts in the insurance sector can display premiums and claim procedures, and DONs can link the contract to external data streams. DONs are able to calculate risks, get sophisticated risk assessment outputs, and secretly validate IDs.</p><p>3) Verifiable Randomness</p><p>One of the biggest uses of Chainlink right now! It’s so useful because everything on chain is deterministic which means you can’t guarantee randomness.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/451/1*ftdApzSiMsy45aFOpOkdgw.png" /><figcaption>Illustration of how VRF works</figcaption></figure><p>This process connects smart contracts to VRF (verifiable random function) which generates one or more random values and cryptographic proof of how those values were computed. Recently, Chainlink VRF v2 has been launched and callback() function gas limit has been increased which means more complex transactions can be completed.</p><p>Verifiable randomness is important to many blockchain applications because its tamper-proof unpredictability enables fun gameplay, rare NFTs, and unbiased outcomes. Games such as PoolTogether have taken advantage of the functionality of VRF to randomly select winners in its crypto-powered savings protocol based on premium bonds.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=45b30b93b883" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Delegatecall() Vulnerability]]></title>
            <link>https://medium.com/@eazy004/delegatecall-vulnerability-cc9c24fb48c1?source=rss-68ffddfd2c23------2</link>
            <guid isPermaLink="false">https://medium.com/p/cc9c24fb48c1</guid>
            <category><![CDATA[cryptocurrency]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[solidity-language]]></category>
            <category><![CDATA[blockchain-security]]></category>
            <dc:creator><![CDATA[Morayo Akran]]></dc:creator>
            <pubDate>Sat, 30 Jul 2022 18:03:54 GMT</pubDate>
            <atom:updated>2022-07-30T18:03:54.227Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>What is it?</strong></p><p>Delegatecall() is a function used within solidity to activate the code of another contract. It is often used with libraries which are code repositories that are deployed on the blockchain. These libraries serve the purpose of re-using code, which makes the process of creating contracts simpler.</p><p>Delegatecall() is a low level function similar to call() which means it works when fallback () receive() is implemented, however, Delegatecall() differs from call() in a few ways. For example, when a contract deploys Delegatecall() it maintains the variables stored in its own despite calling a new contract. Reads and writes to state variables happen to the contract that loads and executes functions with Delegatecall(). Reads and writes never happen to the contract that holds functions that are retrieved. This also means that if I use Delegatecall() to send ETH, I’m using the ETH balance from the sender contract NOT the contract that is called upon.</p><p>There are 2 ways to complete a Delegatecall()</p><p>1) Abi.encodewithsignature</p><p>2) Abi.encodewithselector</p><p>The ABI is the standard way to interact with contracts in the Ethereum ecosystem. Both of these encodings create payloads in raw bytes for external contract calls, from outside the blockchain and for contract-to-contract interaction</p><p>They can be used interchangeably to obtain the function you’d like to call, e.g) abi.encodewithselector uses the <em>bytes4 </em>function selector of the function you want.</p><p>Side note, when making external calls, Solidity adds an extra check using the “extcodesize” opcode. This guarantees that either an exception is raised or that the contract that is about to be called genuinely exists (it contains code).</p><p>Low-level calls like call(), delegatecall(), staticcall(),send(), and transfer() that operate on addresses rather than contract instances do not do this check, making them gas-efficient but less secure.</p><p><strong>How to use it?</strong></p><p>As we mentioned, the contract that is called upon using Delegatecall() maintains the same state variables. But in order for the variables of the caller contract to be updated, the state variables must be inserted diligently in both contracts.</p><p>Here is an example of how state variables should be written within the two contracts;</p><p>As you can see, Contract B and C both contain the same state variables in their code. It is these state variables that are permanently stored in a blockchain/Ethereum ledger by miners, you can identify them as they are always declared outside of a function.</p><p>Additionally, it is important that the state variables are listed in the same order in both contracts. If not ,this may lead to an unintended variable being updated. For example, if contract B had <em>value </em>as its first state variable it would update this value NOT <em>msg.sender</em> as listed in the setVariable() function of Contract C.</p><p><strong>Examples of sabotage</strong></p><p>Delegatecall() must be used carefully or it may lead to a contract being sabotaged. Here is an example of how this may take place;</p><p>The owner of contract <em>Vulnerable </em>can be compromised by triggering the fallback() function and calling the <em>pwn </em>function of Contract <em>Lib. </em>Since we are already aware that delegatecalls only change the state variable of the sender contract, contract <em>Lib </em>is not vulnerable to an attack.</p><p>We still need to construct a contract that is able to execute the fallback() function of contract <em>Vulnerable</em>.</p><p>Since fallback functions can only be ran when a called function doesn’t exist, contract <em>Attack calls </em>“pwn” as a function to trigger the arguments within fallback() of <em>Vulnerable</em> contract.</p><p>When this happens, <em>Lib </em>is called via Delegatecall() and the functions within <em>Lib</em> are prompted which enables the substitution of the owner of contract <em>Vulnerable. </em>From this stage, an attacker can change any variable or execute selfdestruct() which is a function that can be deployed to completely wipe a contract from the blockchain.</p><p>This is an illustration of the threats that may surface if one forgets delegatecall() preserves context. When you make a delegatecall() the storage of your contract is at the mercy of whoever is able to call the function, so ensure that only trusted code is executed.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cc9c24fb48c1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Stateless vs Stateful Smart Contracts]]></title>
            <link>https://medium.com/@eazy004/stateless-vs-stateful-smart-contracts-b05e1aaa7445?source=rss-68ffddfd2c23------2</link>
            <guid isPermaLink="false">https://medium.com/p/b05e1aaa7445</guid>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[cryptocurrency]]></category>
            <category><![CDATA[smart-contracts]]></category>
            <dc:creator><![CDATA[Morayo Akran]]></dc:creator>
            <pubDate>Sun, 24 Jul 2022 22:52:56 GMT</pubDate>
            <atom:updated>2022-07-24T22:52:56.026Z</atom:updated>
            <content:encoded><![CDATA[<p>There exists two types of smart contracts that have differing usages and advantages. Stateless smart contracts refer to contracts that are unable to store data internally. In other words, a stateless smart contact doesn’t possess memory, so components like global variables can’t be stored within the code. Instead, stateless smart contracts are used to approve spending, or the transfer of assets. They operate based on logic inserted within the contract that authorises transactions based upon whether they meet certain criteria. As this process is scripted, it makes stateless smart contracts more scalable. This presents a significant benefit as scalability is a major consideration when it comes to building blockchains. Scalability refers to the ability for a blockchain to handle an increasing number of transactions and nodes entering the network. As the number of transactions increase, a stateless smart contract ensures scalability, because the stateless client enable the nodes to validate a block without storing the blockchain state.</p><p>On the other hand, stateful smart contracts are able to store and update on chain values. This makes them more flexible as there is a greater range of possibilities with these contracts. For example, blockchains that deploy stateful smart contracts can be used as a database where blockchain transactions change the data. This increased range of options means more complex applications can be constructed with stateful smart contracts.</p><p>Stateful smart contracts are more adaptable, but their scale for reliable verification is constrained. Alternatively, it simple to verify big stateless smart contracts, making it possible to construct massive verified systems.</p><p><strong>Algorand</strong></p><p>Algorand recently implemented stateful smart contracts into their architecture in a bid to better compete with Ethereum.</p><p>Algorand is approaching the issue of storing capacity on the blockchain in a novel way. It is sort of a hybrid technique where the least amount of information feasible is kept inside the scope of the code itself and the maximum amount of data is stored at the user account level, reducing the load on the network.</p><p>The foundational layer of the algorithm network executes the underlying smart contracts at the level of consensus since assembly-like programming is quick and native to computers. Its transaction results are then extremely quick and affordable, which makes it a perfect possibility to be utilised for DeFi applications.</p><p>The local and global storage of values in the account balance is possible with the Algorand stateful smart contracts. As opposed to global storage, which keeps the data on the blockchain for the global smart contract, local storage keeps the data in relation to the account balance. Both local and global storage values in the smart contract are subject to CRUD operations. A key-pair mapping is used to indicate the status of the values, which have a 64-byte storage space restriction. For executing CRUD operations on local and global store values, the TEAL language is used.</p><p><strong>Ethereum</strong></p><p>The largest smart contract platform in the world is Ethereum, and for good reason. The Ethereum Virtual Machine (EVM), a Turing-complete Virtual Machine, is used by smart contracts in Ethereum. This implies that, given sufficient resources, the EVM can compute anything.</p><p>Unlike Algorand, Ethereum’s entire ecosystem is built upon stateful smart contracts. As mentioned, this presents many advantages when building DeFi appliactions but as stateful contracts store and modify data, it makes them difficult to scale.</p><p><strong>Solana</strong></p><p>A smart contract (Solana program) includes only program logic — that is, it is stateless or read-only. Therefore, in order to store data within a Solana program, an ‘account’ is required. In Solana an account refers to a storage space or container to store data.</p><p>In actuality, this entails deploying the smart contract code and obtaining a public key for the location of the code. Then, a second account with a fixed and constrained quantity of disc space can be made exclusively to communicate with that smart contract. Consequently, you would have a public key for the code (also known as a programId) and a different public key for the appAccount.</p><p>The stateless nature of Solana contributes massively in its ability to boast one of the highest TPS’s in the industry. Stateless smart contracts must only facilitate the transfer of native tokens or assets, contributing to a reduced workload to verify transactions which leads to faster processing.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b05e1aaa7445" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[An insight into Front-Running]]></title>
            <link>https://medium.com/@eazy004/an-insight-into-front-running-93900a5f6e44?source=rss-68ffddfd2c23------2</link>
            <guid isPermaLink="false">https://medium.com/p/93900a5f6e44</guid>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[blockchain-security]]></category>
            <category><![CDATA[information-security]]></category>
            <category><![CDATA[automated-market-maker]]></category>
            <dc:creator><![CDATA[Morayo Akran]]></dc:creator>
            <pubDate>Tue, 12 Jul 2022 21:07:49 GMT</pubDate>
            <atom:updated>2022-07-12T21:08:12.821Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>What is front running?</strong></p><p>Front running is a hack that re-orders transactions that are executed from the Mempool. A Mempool is a database of unconfirmed or pending transactions which every node keeps. When a transaction is confirmed on the blockchain, it is removed from the Mempool.</p><p>The etymology of the name Mempool stems from memory pool, a name given as the transactions are stored in the RAM of nodes until they’re inserted on the blockchain.</p><p>Miners may take advantage of the way a Mempool works by prioritising transactions with high gas fees. As miners gain a percentage of tokens from each transaction they confirm, it is within their favour to validate the transactions with the highest fees.</p><p><strong>How is it performed?</strong></p><p>Due to the speed of execution required for front running to be successful, a bot is often used to exploit the vulnerability. A bot is short for ‘robot’, and it is an automated program that runs over the internet. It is superior to performing transactions manually because bots can be specially written to execute within milliseconds.</p><p>A bot will typically scan the Mempool in search for targets than can be attacked. A Mempool browser is depicted in the image below, it enables you to subscribe to transactions in the Mempool and view all of the associated details by configuring different filters.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/678/1*dIFAf5HSq1SadZb70qPh5A.png" /></figure><p><strong>Attack Types</strong></p><p>There are many types of front running attacks, including a technique called ‘slow matching’ in which timestamps are manipulated. However, the most common and critical is known as a “sandwich attack” against AMM (automated market makers).</p><p>Automated market makers (AMMs) allow digital assets to be traded without permission and automatically by using liquidity pools instead of a traditional market of buyers and sellers. The most common platforms are Uniswap and Balancer.</p><p>The attack occurs when a bot detects a user initiating a high-value transaction within the Mempool. As this is detected, the bot executes its own transaction using PGA (priority gas auction) to ensure the transaction is included in the blockchain earlier than the legitimate order. Once this transaction is executed, it raises the value of the asset and thus the victim purchases the asset (from the attacker) for a higher price.</p><p><strong>How to prevent front-running</strong></p><p>Sandwich attacks can be very profitable and are often undetected by users due to the small margins of returns. However, they can be prevented using a few techniques.</p><p>1) Avoid AMM’s with low liquidity pools as there is less traffic which means there is less chance of the transaction being disrupted. Big liquidity pools attract more users, therefore even if a user is a victim of front-running, the consequences may be less severe as many more transactions may be processed within the same time frame. More transactions being processed mean a front-runner has less control over the price sway of an asset.</p><p>2) Most DEXs allow you to set a maximum slippage tolerance. This is the maximum deviation from the expected return that you will allow — such as 0.5%. Keep your maximum slippage low, between 0.5 and 2 percent, to avoid front runners. Large orders and high slippage are favourites of front runners!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=93900a5f6e44" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Guide to Re-entrancy Attacks]]></title>
            <link>https://medium.com/@eazy004/a-guide-to-re-entrancy-attacks-37da672ea330?source=rss-68ffddfd2c23------2</link>
            <guid isPermaLink="false">https://medium.com/p/37da672ea330</guid>
            <category><![CDATA[information-security]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[blockchain-security]]></category>
            <category><![CDATA[reentrancy-attack]]></category>
            <category><![CDATA[cryptocurrency]]></category>
            <dc:creator><![CDATA[Morayo Akran]]></dc:creator>
            <pubDate>Sat, 25 Jun 2022 20:34:22 GMT</pubDate>
            <atom:updated>2022-06-25T20:34:22.890Z</atom:updated>
            <content:encoded><![CDATA[<p>Re-entrancy is a smart contract vulnerability within Solidity, that grants an attacker the ability to drain a smart contract of its funds, but how does it work?</p><p>The attack is composed of two smart contracts, a vulnerable contract and a malicious contract. The language of solidity contains many types of function modifiers which vary in their gas price and functionality. These functions are</p><p>Public — these functions can be called internally and externally, but as solidity copies arguments to memory in these functions, they are more expensive</p><p>External- these functions can only be called externally and are often a more efficient way of calling a function</p><p>Private- these functions are only visible for the contract they are defined in and thus can only be called internally</p><p>Internal- these functions can only be used internally or by derived contracts</p><p>A re-entrancy attack occurs when an external function is called from a malicious contract, during an attack this function triggers a withdrawal of funds. Re-entrancy weaknesses occur due to code being written in the wrong order, an example is an attacker calling a withdraw function and receiving funds before the vulnerable contract has updated the balance. Using a fallback function, numerous withdrawals can be called before the balance of the vulnerable contract is updated. This is a major hazard as it means a smart contract can be completely drained of its capital without any warning.</p><p>Inherently, re-entrancy is a feature that has been used throughout web2 for our benefit. Such as in web applications like Gmail when we are midway through constructing an email and pause it to reply to another one before returning to the former. These types of situations have made our internet experience more efficient, however they pose threats in the realm of web3.</p><p>There are ways to mitigate the threat of re-entrancy by deploying popular tools such as OpenZepelin’s re-entrancy guard. OpenZepelin is an open-source framework to build secure smart contracts, re-entrancy guard is a piece of code that causes execution to fail when re-entrancy is detected.</p><p>Another way to avoid the threat of re-entrancy is by using transfer() or send() instead of call() functions. These three methods provide different ways to send ETH between contracts, but there are distinct differences in the way they operate.</p><p>A re-entrancy attack relies upon the limited restrictions of call functions, as opposed to options such as send() or transfer() which levy a gas limit of 2300. Since a successful re-entrancy attack relies upon the continuous withdrawal of funds, a gas stipend would reduce the number of withdrawals possible. Unfortunately, call functions don’t have a gas limit which is why they present such a weakness *unless you manually limit the amount of gas passed to call.value()*. An attacker can continually call a function until the money within a contract is emptied.</p><p>As the web3 movement is still in its infancy, awareness is key to ensure people are aware of past mistakes and can learn from them when building their own projects. Below is a list of some re-entrancy attacks that have occurred:</p><p>The DAO: this is one of the biggest re-entrancy attacks to date, the DAO was a fund on Ethereum dedicated to pooling assets so token holders can decide on which projects to invest in. However, a flaw in the code meant 3.6m ETH was drained, the incident caused such a discourse within the community that it led to the fork of Ethereum chain which resulted in Ethereum Classic and Ethereum.</p><p>Lenf.me is a DeFi app that suffered a loss of $25m in April 2020. The vulnerability occurred in the protocols MoneyMarket smart contract, in which a function used for token deposits was updated <em>after </em>tokens had been transferred. As we discussed earlier, state must be updated when a function is executed, or a contract is vulnerable to re-entrancy exploit.</p><p>Lastly, Taiwan based CREAM Finance, a decentralised loan platform lost $18m to a re-entrancy attack in August 2021. In line with PeckShield, the criminal made a 500 ETH Flash loan and deposited the funds as collateral, then borrowed 19m AMP and exploited a re-entrancy worm to re-borrow 355 ETH inside the Amp token switch characteristic, and later self-liquidate the borrowed amount via repeating this process 17 times, the crypto-robber became able to advantage 5,980 ETH, worth about $19m.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=37da672ea330" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Cryware]]></title>
            <link>https://medium.com/@eazy004/cryware-2036cdcb761c?source=rss-68ffddfd2c23------2</link>
            <guid isPermaLink="false">https://medium.com/p/2036cdcb761c</guid>
            <category><![CDATA[cryptocurrency]]></category>
            <category><![CDATA[cyware]]></category>
            <category><![CDATA[malware]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[information-security]]></category>
            <dc:creator><![CDATA[Morayo Akran]]></dc:creator>
            <pubDate>Fri, 10 Jun 2022 19:30:43 GMT</pubDate>
            <atom:updated>2022-06-10T19:30:43.901Z</atom:updated>
            <content:encoded><![CDATA[<p>Cryware is a series of techniques targeting cryptocurrency users, the term was coined by Microsoft in May 2022.</p><p>As the ecosystem of cryptocurrency users grow, so does the potential returns available to malicious actors. Applications such as wallets are imperative to the cryptocurrency environment because they provide a means to store and exchange coins.</p><p>There are many options of wallets to use such as;</p><p>- <strong>Hot wallets </strong>(software wallets, in which private keys are stored online)</p><p>- <strong>Hardware wallets</strong> (wallets in which private keys are stored offline on a hardware device)</p><p>- <strong>Paper wallet</strong> (wallets in which private keys are written on paper)</p><p>Each kind of wallet has its pros and cons but for the purpose of this article, we’ll be focusing on hot wallets. These are without a doubt, the most popular option within the cryptocurrency space. Due to their easy accessibility, price and simplicity, hot wallets such as Metamask have dominated the cryptocurrency space with 21 million monthly users to date.</p><p>21 million users is a large amount, which suggests that Metamask is a secure option to facilitate cryptocurrency transactions. For the most part, this is true. But there are still risks.</p><p>Hot wallets such as Metamask store sensitive data such as private keys online, which is where the threat of Cryware becomes real.</p><p>Cryware uses a variety of techniques to obtain information like seed phrases, private keys and wallet passwords. When these bits of information are obtained, the threat actor siphons funds into their own private wallet.</p><p>There are different categories of Cryware which include;</p><p><strong>Cryptojackers-</strong> These are scripts that are used to mine cryptocurrency with a victims computer resources. Coinhive was one of the most popular kinds of Cryptojackers, dominating almost 2/3rds of the market until it was shut down in 2018.</p><p><strong>Information stealers</strong>- These target sensitive hot wallet data in the hopes of using it to enter the victims account and withdraw funds. There are many different strains of information stealers, Mars Stealer is the most prevalent at the moment. It is based off a previous threat named ‘Oski Trojan’ that was widespread in 2019.</p><p>Mars stealer is deemed to be more prolific because of its ability to navigate past the security settings of over 40 browser-based plug-ins and wallets. Even more concerning is its accessibility, the tool is available for less than £200 on the Darkweb.</p><p>The category of information stealers is continually growing, other threats include;</p><p>- Red Line stealer</p><p>- Arkei</p><p>- Raccoon</p><p>The best way to protect yourself from these threats is by remaining extra vigilant of files that you download. This may be from websites or emails, as phishing is a common attack surface used for information stealers.</p><p><strong>Clipbankers-</strong> These tools scan the clipboard and replace an original wallet address with that of an attacker.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*b7zRxeE57xXb9McCsWFReQ.png" /></figure><p>An attacker will commonly search for regexs to query common string patterns and replace it with their own. For example, if a user copies a wallet address (a 32–34 characters) then a threat actor can construct code that always replaces it with their own wallet address one its pasted. This may be an effective form of attack due to the intricate format of cryptocurrency addresses, many users may fail to notice a difference if they aren’t focused.</p><p>It is worth noting that many of these techniques aren’t new, but instead have evolved from previous tools to become more effective. Users must be aware of this fast-moving landscape of threats as malicious actors are constantly seeking ways to sabotage the experience of users. Awareness is always the best remedy when it comes to security issues, so please share with as many crypto users within your social circle!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2036cdcb761c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Axie Infinity Hack Explained]]></title>
            <link>https://medium.com/@eazy004/axie-infinity-hack-explained-a22ae12ff0bf?source=rss-68ffddfd2c23------2</link>
            <guid isPermaLink="false">https://medium.com/p/a22ae12ff0bf</guid>
            <category><![CDATA[blockchain-security]]></category>
            <category><![CDATA[nft]]></category>
            <category><![CDATA[cryptocurrency]]></category>
            <category><![CDATA[blockchain-technology]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Morayo Akran]]></dc:creator>
            <pubDate>Sun, 22 May 2022 14:32:13 GMT</pubDate>
            <atom:updated>2022-05-22T14:32:13.148Z</atom:updated>
            <content:encoded><![CDATA[<p>On 23rd March 2022, Ronin Bridge part of the popular NFT game Axie Infinity was compromised. It took the developers Sky Mavis 6 days to become aware of this incident, by that time $625m in cryptocurrency (174,000 ETH and $26m USDC) had been stolen.</p><p>Now I will delve into how this hack was possible by analysing the infrastructure of the Ronin network and highlighting the crucial errors that led to the hack.</p><p>It’s worth noting, this isn’t the first hack that has taken place on the blockchain but it’s certainly the biggest to date as per <a href="https://rekt.news/leaderboard/">https://rekt.news/leaderboard/.</a> The FBI have traced the source of the hack to Lazarus Group and APT38 based in North Korea. The former rose to prominence in 2014 when they launched a cyber-attack on Sony as retaliation for a film in which Kim Jung Un was depicted ‘negatively’.</p><p><strong>Sidechains &amp; Blockchains</strong></p><p>Sidechains can be connected to main blockchains such as Ethereum and Solana, they are usually constructed to facilitate quicker transactions and lower gas fees. Axie Infinity was originally built on top of Ethereum, but Ronin was built by Sky Mavis to make in-game transactions quicker and more affordable. It was a brilliant move by the devs as the popularity of Axie Infinity skyrocketed after this implementation.</p><p>However sidechains have an inherent problem, as by gaining speed and lower gas fees, security is compromised. Ethereum is a safe network because of the thousands of validators (over 300,000 at the time of writing). This scale of nodes massively reduces the chance of fraudulent transactions being authorised because it would require the negligence of an increasingly large number of people.</p><p>On the other hand, Ronin sidechain had a total of 9 validators and only 5 of them were required to authorise any transaction. Bruh.</p><p><strong>Private Keys and Multi-sig</strong></p><p>The reason sabotaging a validator node is such a big deal is because these nodes possess the private keys required to authorise a transaction. These private keys are the holy grail of everything in cryptocurrency, if they are stolen then a threat-actor has autonomy to do whatever he/she pleases.</p><p>Axie Infinity adopted a multi-sig ecosystem which is a method of confirming transactions in which numerous signatures (from private keys) are required.</p><p>It just so happens that 4 of these private keys were held on a server controlled by Sky Mavis, the 5th private key was managed by an RPC node controlled by the AxieDAO.</p><p>In November 2021, to further bolster the speed of the network Sky Mavis ‘borrowed’ the private keys of AxieDAO because signing transactions from a single server means less latency.</p><p>However, after this period of busy transactions passed, Sky Mavis retained a copy of this private key which meant the threat actor obtained all 5 keys needed to authorise any transaction when they breached Sky Mavis’s servers.</p><p><strong>How bridges work</strong></p><p>When the hacker gained control of the 5 validator nodes, along with the private keys, they targeted the Ronin Bridge.</p><p>Ronin Bridge is a useful component of Axie Infinity’s ecosystem which allows users to deposit and withdraw funds. Bridges are used throughout cryptocurrency as they are an efficient way to convert assets between blockchains. This is necessary in blockchain technology as L1’s are not interoperable, which mean your assets on Ethereum blockchain can’t be stored on Solana blockchain (for the moment anyway).</p><p>To transfer ETH from mainet, users of Axie Infinity would deposit it into ronin bridge and receive WETH representing the equivalent amount of ETH deposited. This WETH could be used within Axie Infinity’s marketplace to buy assets like land, axies etc.</p><p>The hack compromised this system because the threat actors were able to authorise the withdrawal of 174,000 ETH and $26m USDC, effectively draining the assets in the Ronin Bridge. As a result, the WETH possessed by users had little to no value as it wasn’t backed by anything in the ronin bridge.</p><p>Additionally, it meant any users that deposited ETH into the bridge around this time wouldn’t receive WETH as the total ETH in the bridge wouldn’t be able to fulfil this demand.</p><p>Bridges are commonly a target within cryptocurrency ecosystems because of the amount of TVL (total value locked) within them. Another bridge on the Solana ecosystem known as Wormhole suffered a $325m hack earlier this year, in addition to Poly Network hack in November 2021 for $611m.</p><p><strong>Aftermath</strong></p><p>Amongst the concerns of the breach was how long it took Sky Mavis to realise they were compromised, a total of 6 days passed until a user realised the bridge wasn’t working when they tried withdrawing 5000 ETH from ronin bridge</p><p>Since the incident, the ronin network has increased the number of validators needed for authorisation from 5 to 9, which still isn’t a large amount but is more secure than before. Unfortunately, the benefits of fast transactions and low fees do not coincide with high security. If Ronin were to increase the amount of validator nodes in their ecosystem to thousands, they will likely encounter the same issues faced when Axie Infinity was originally built on top of Ethereum.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a22ae12ff0bf" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>