<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Blockchain on Going the distance</title>
    <link>https://jeiwan.net/tags/blockchain/</link>
    <description>Recent content in Blockchain on Going the distance</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en</language>
    <lastBuildDate>Sat, 21 Jan 2023 00:00:00 +0000</lastBuildDate><atom:link href="https://jeiwan.net/tags/blockchain/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Public Bug Report: Uniswap&#39;s SwapRouter doesn&#39;t refund unspent ETH in partial swaps</title>
      <link>https://jeiwan.net/posts/public-bug-report-uniswap-swaprouter/</link>
      <pubDate>Sat, 21 Jan 2023 00:00:00 +0000</pubDate>
      
      <guid>https://jeiwan.net/posts/public-bug-report-uniswap-swaprouter/</guid>
      <description>Photo by Florian Olivo on Unsplash
In December 2022, I found a bug in Uniswap&amp;rsquo;s SwapRouter contract. The bug allows users to lose funds, while interacting with the contract in the standard way. You don&amp;rsquo;t really find critical and high severity bugs in projects like Uniswap, especially after they&amp;rsquo;ve run in production for several years. So I didn&amp;rsquo;t really had high expectations and I was sure I wouldn&amp;rsquo;t be awarded for the report.</description>
    </item>
    
    <item>
      <title>Programming DeFi: Uniswap V2. Part 4</title>
      <link>https://jeiwan.net/posts/programming-defi-uniswapv2-4/</link>
      <pubDate>Sun, 24 Apr 2022 00:00:00 +0000</pubDate>
      
      <guid>https://jeiwan.net/posts/programming-defi-uniswapv2-4/</guid>
      <description>Photo by British Library on Unsplash
Introduction Welcome to the final part of this series! Yes, we&amp;rsquo;ve almost done implementing a Uniswap V2 clone from scratch, and today we&amp;rsquo;re going to fill missing gaps. There&amp;rsquo;s a lot of things to do, so let&amp;rsquo;s get straight to business.
 You can find full source code of this part here: source code, part 4.
 LP-tokens burning bug We&amp;rsquo;ll begin with finishing the Router contract.</description>
    </item>
    
    <item>
      <title>Evaluating DeFi Strategies Using Foundry</title>
      <link>https://jeiwan.net/posts/evaluating-defi-strategy-in-foundry/</link>
      <pubDate>Mon, 11 Apr 2022 00:00:00 +0000</pubDate>
      
      <guid>https://jeiwan.net/posts/evaluating-defi-strategy-in-foundry/</guid>
      <description>Photo by Brett Jordan on Unsplash
Introduction Nowadays, the ecosystem of Ethereum is quite rich and complex. There are multitudes of DeFi applications: decentralized exchanges, staking protocols, money markets, yield farming vaults, derivatives, leverages, etc. As DeFi protocol evolve, they become more and more intertwined, allowing for new complex strategies.
In this article, I&amp;rsquo;ll show you how to program a custom DeFi strategy that interacts with several DeFi platforms to produce a leveraged position that earns passive income.</description>
    </item>
    
    <item>
      <title>Programming DeFi: Uniswap V2. Part 3</title>
      <link>https://jeiwan.net/posts/programming-defi-uniswapv2-3/</link>
      <pubDate>Tue, 15 Mar 2022 00:00:00 +0000</pubDate>
      
      <guid>https://jeiwan.net/posts/programming-defi-uniswapv2-3/</guid>
      <description>Photo by C Dustin on Unsplash
Introduction Another month, another blog post! 🙈
So far, our UniswapV2 implementation had the most crucial part done–the pair contract. We haven&amp;rsquo;t yet implemented protocol fees (the fee Uniswap takes from each liquidity deposit) but we&amp;rsquo;ll do this a little bit later since this is not a critical part of the exchange.
Today, we&amp;rsquo;ll move forward and implement the factory contract, which serves as a registry of all deployed pair contracts.</description>
    </item>
    
    <item>
      <title>Programming DeFi: Uniswap V2. Part 2</title>
      <link>https://jeiwan.net/posts/programming-defi-uniswapv2-2/</link>
      <pubDate>Mon, 31 Jan 2022 00:00:00 +0000</pubDate>
      
      <guid>https://jeiwan.net/posts/programming-defi-uniswapv2-2/</guid>
      <description>Photo by Jon Cellier on Unsplash
Introduction Welcome back! Today we&amp;rsquo;ll add the core functionality to our clone of Uniswap V2–swapping. Decentralized tokens exchanging is what Uniswap was created for, and today we&amp;rsquo;ll see how it&amp;rsquo;s done. We&amp;rsquo;re still working on the core pair contract, which means that our implementation will be very low-level and minimal. There&amp;rsquo;s no convenient interface and we won&amp;rsquo;t even have price calculation at this point!</description>
    </item>
    
    <item>
      <title>Programming DeFi: Uniswap V2. Part 1</title>
      <link>https://jeiwan.net/posts/programming-defi-uniswapv2-1/</link>
      <pubDate>Tue, 11 Jan 2022 00:00:00 +0000</pubDate>
      
      <guid>https://jeiwan.net/posts/programming-defi-uniswapv2-1/</guid>
      <description>Photo by Evangelos Mpikakis on Unsplash
Introduction Uniswap is a decentralized exchange running on the Ethereum blockchain. It&amp;rsquo;s fully automated, not managed, and decentralized. It has come through multiple iterations of development: first version was launched in November 2018; second version–in May 2020; and final, third, version was launched in March 2021.
In my previous series on Uniswap V1, I showed how to build it from scratch and explained its core mechanics.</description>
    </item>
    
    <item>
      <title>Ethernaut tips and solutions</title>
      <link>https://jeiwan.net/posts/ethernaut-tips-and-solutions/</link>
      <pubDate>Thu, 02 Dec 2021 00:00:00 +0000</pubDate>
      
      <guid>https://jeiwan.net/posts/ethernaut-tips-and-solutions/</guid>
      <description>Photo by Jukan Tateisi on Unsplash
Introduction Ethernaut is an (awesome) browser game that let&amp;rsquo;s you practice Web3 and Solidity whilte solving different tasks. The game consists of 23 levels (as of August 2021) and each level is focused on some Solidity feature or bug, smart contract design flaw, or unexpected behaviour of a contract. Your goals in each level is to hack it: to find a way of becoming a contract owner, to transfer all tokens to your own address, or abuse a feature of Solidity that wasn&amp;rsquo;t taken into consideration by a smart contract developer.</description>
    </item>
    
    <item>
      <title>Upgradeable proxy contract from scratch</title>
      <link>https://jeiwan.net/posts/upgradeable-proxy-from-scratch/</link>
      <pubDate>Wed, 25 Aug 2021 00:00:00 +0000</pubDate>
      
      <guid>https://jeiwan.net/posts/upgradeable-proxy-from-scratch/</guid>
      <description>Photo by Rafał Naczyński on Unsplash
Immutability gives Ethereum a big benefit: once a smart contract is deployed, there&amp;rsquo;s no way to change it. This means that smart contract logic won&amp;rsquo;t change over time and it&amp;rsquo;ll remain as reliable as it was from the beginning, e.g. you won&amp;rsquo;t suddenly see a contract doing something no one thought it could do.
However, immutability comes with drawbacks that can be significant in some cases.</description>
    </item>
    
    <item>
      <title>Programming DeFi: Uniswap. Part 3</title>
      <link>https://jeiwan.net/posts/programming-defi-uniswap-3/</link>
      <pubDate>Tue, 22 Jun 2021 00:00:00 +0000</pubDate>
      
      <guid>https://jeiwan.net/posts/programming-defi-uniswap-3/</guid>
      <description>Photo by carlos aranda on Unsplash
Introduction Here we are again building a clone of Uniswap V1! Our implementation is almost ready: we&amp;rsquo;ve implemented all core mechanics of Exchange contract, including pricing functions, swapping, LP-tokens, and fees. It looks like our clone is complete, however there&amp;rsquo;s a missing piece: Factory contract. Today, we&amp;rsquo;ll implement it and our Uniswap V1 clone will be done. However, this is not the end: in the next part we&amp;rsquo;ll be building Uniswap V2 and it&amp;rsquo;ll be not less interesting than V1!</description>
    </item>
    
    <item>
      <title>Programming DeFi: Uniswap. Part 2</title>
      <link>https://jeiwan.net/posts/programming-defi-uniswap-2/</link>
      <pubDate>Wed, 16 Jun 2021 00:00:00 +0000</pubDate>
      
      <guid>https://jeiwan.net/posts/programming-defi-uniswap-2/</guid>
      <description>Photo by Susan Kuriakose on Unsplash
Introduction This is part two of my series on programming DeFi smart contracts. In the previous part, we learned about Uniswap and its core mechanics and started building an exchange contract. The contract can accept liquidity from users, calculate output amounts, and perform swaps.
Today, we&amp;rsquo;re going to finish Uniswap V1 implementation. While it won&amp;rsquo;t be a full copy of Uniswap V1, it&amp;rsquo;ll have all core features.</description>
    </item>
    
    <item>
      <title>Programming DeFi: Uniswap. Part 1</title>
      <link>https://jeiwan.net/posts/programming-defi-uniswap-1/</link>
      <pubDate>Mon, 07 Jun 2021 00:00:00 +0000</pubDate>
      
      <guid>https://jeiwan.net/posts/programming-defi-uniswap-1/</guid>
      <description>Photo by Piret Ilver on Unsplash
Introduction The best way to learn something is to teach others. Second best way to learn something is to do it yourself. I decided to combine the two ways and teach myself and you how to program DeFi services on Ethereum (and any other blockchains based on EVM – Ethereum Virtual Machine).
Our main focus will be on how those services work, we&amp;rsquo;ll try to understand the economical mechanics that make them what they are (and they all based on economical mechanics).</description>
    </item>
    
    <item>
      <title>Programming Bitcoin Network, part 4</title>
      <link>https://jeiwan.net/posts/programming-bitcoin-network-4/</link>
      <pubDate>Wed, 22 Jan 2020 00:00:00 +0000</pubDate>
      
      <guid>https://jeiwan.net/posts/programming-bitcoin-network-4/</guid>
      <description>Previous parts:
 Part 1 Part 2 Part 3   DISCLAIMER. In these blog posts I describe only significant changes I made to the code since the last part. There are also insignificant refactorings and improvements I make along the way and don&amp;rsquo;t explain them here for brevity. Please, check these links to see all the changes:
  Full code of this part: Jeiwan/tinybit/part_4
  Changes since the previous part: part3&amp;hellip;part4</description>
    </item>
    
    <item>
      <title>Programming Bitcoin Network, part 3</title>
      <link>https://jeiwan.net/posts/programming-bitcoin-network-3/</link>
      <pubDate>Tue, 03 Dec 2019 00:00:00 +0000</pubDate>
      
      <guid>https://jeiwan.net/posts/programming-bitcoin-network-3/</guid>
      <description>Previous parts:
 Part 1 Part 2   DISCLAIMER. In these blog posts I describe only significant changes I made to the code since the last part. There are also insignificant refactorings and improvements I make along the way and don&amp;rsquo;t explain them here for brevity. Please, check these links to see all the changes:
  Full code of this part: Jeiwan/tinybit/part_3
  Changes since the previous part: part2&amp;hellip;part3</description>
    </item>
    
    <item>
      <title>Programming Bitcoin Network, part 2</title>
      <link>https://jeiwan.net/posts/programming-bitcoin-network-2/</link>
      <pubDate>Sun, 17 Nov 2019 15:29:48 +0700</pubDate>
      
      <guid>https://jeiwan.net/posts/programming-bitcoin-network-2/</guid>
      <description>Previous part: here
 DISCLAIMER. In these blog posts I describe only significant changes I made to the code since the last part. There are also insignificant refactorings and improvements I make along the way and don&amp;rsquo;t explain them here for brevity. Please, check these links to see all the changes:
  Full code of this part: Jeiwan/tinybit/part_2
  Changes since the previous part: part1&amp;hellip;part2
 Introduction So far, we built a very basic Bitcoin node that connects to the network and sends version message.</description>
    </item>
    
    <item>
      <title>Programming Bitcoin Network</title>
      <link>https://jeiwan.net/posts/programming-bitcoin-network/</link>
      <pubDate>Wed, 30 Oct 2019 00:00:00 +0000</pubDate>
      
      <guid>https://jeiwan.net/posts/programming-bitcoin-network/</guid>
      <description>Full code: Jeiwan/tinybit/part_1
Introduction This blog starts a series of posts dedicated to programming of the Bitcoin network in Golang. The goal of this series is to build a tiny Bitcoin network client that&amp;rsquo;s able to:
 Connect to a Bitcoin network (whether that&amp;rsquo;s mainnet, testnet, simnet, or a local network). Introduce itself to the network (what&amp;rsquo;s called &amp;ldquo;version handshake&amp;rdquo;). Get information about current blockchain state from a node in the network.</description>
    </item>
    
    <item>
      <title>What is Lightning Network and How to Try It Today</title>
      <link>https://jeiwan.net/posts/what-is-lightning-network/</link>
      <pubDate>Fri, 02 Mar 2018 16:58:56 +0700</pubDate>
      
      <guid>https://jeiwan.net/posts/what-is-lightning-network/</guid>
      <description>Introduction As soon as the Bitcoin network started processing more-or-less significant number of transactions, it became obvious that the network is not scalable: the size of blocks is limited to 1 Mb, and since the number of transactions is growing, one day the limit will be hit and the mempool will start growing resulting in delayed transactions. This scalability issue gave birth to many Bitcoin clones, which pursued the goal of building a really scalable blockchain.</description>
    </item>
    
    <item>
      <title>Building Blockchain in Go. Part 7: Network</title>
      <link>https://jeiwan.net/posts/building-blockchain-in-go-part-7/</link>
      <pubDate>Fri, 06 Oct 2017 12:31:19 +0700</pubDate>
      
      <guid>https://jeiwan.net/posts/building-blockchain-in-go-part-7/</guid>
      <description>Chinese translations: by liuchengxu, by zhangli1
 Introduction So far, we&amp;rsquo;ve build a blockchain that has all key features: anonymous, secure, and randomly generated addresses; blockchain data storage; Proof-of-Work system; reliable way to store transactions. While these features are crucial, it&amp;rsquo;s not enough. What makes these features really shine, and what make cryptocurrencies possible, is network. What&amp;rsquo;s the use of having such blockchain implementation running just on a single computer?</description>
    </item>
    
    <item>
      <title>Building Blockchain in Go. Part 6: Transactions 2</title>
      <link>https://jeiwan.net/posts/building-blockchain-in-go-part-6/</link>
      <pubDate>Mon, 18 Sep 2017 13:02:26 +0700</pubDate>
      
      <guid>https://jeiwan.net/posts/building-blockchain-in-go-part-6/</guid>
      <description>Chinese translations: by liuchengxu, by zhangli1
 Introduction In the very first part of this series I said that blockchain is a distributed database. Back then, we decided to skip the &amp;ldquo;distributed&amp;rdquo; part and focus on the &amp;ldquo;database&amp;rdquo; part. So far, we&amp;rsquo;ve implemented almost all the things that make a blockchain database. In this post, we&amp;rsquo;ll cover some mechanisms that were skipped in the previous parts, and in the next part we&amp;rsquo;ll start working on the distributed nature of blockchain.</description>
    </item>
    
    <item>
      <title>Building Blockchain in Go. Part 5: Addresses</title>
      <link>https://jeiwan.net/posts/building-blockchain-in-go-part-5/</link>
      <pubDate>Mon, 11 Sep 2017 11:20:43 +0700</pubDate>
      
      <guid>https://jeiwan.net/posts/building-blockchain-in-go-part-5/</guid>
      <description>Chinese translations: by liuchengxu, by zhangli1
 Introduction In the previous article, we started implementing transactions. You were also introduced to the impersonal nature of transactions: there are no user accounts, your personal data (e.g., name, passport number or SSN) is not required and not stored anywhere in Bitcoin. But there still must be something that identifies you as the owner of transaction outputs (i.e. the owner of coins locked on these outputs).</description>
    </item>
    
    <item>
      <title>Building Blockchain in Go. Part 4: Transactions 1</title>
      <link>https://jeiwan.net/posts/building-blockchain-in-go-part-4/</link>
      <pubDate>Mon, 04 Sep 2017 11:32:39 +0700</pubDate>
      
      <guid>https://jeiwan.net/posts/building-blockchain-in-go-part-4/</guid>
      <description>Chinese translations: by liuchengxu, by zhangli1
 Introduction Transactions are the heart of Bitcoin and the only purpose of blockchain is to store transactions in a secure and reliable way, so no one could modify them after they are created. Today we&amp;rsquo;re starting implementing transactions. But because this is quite a big topic, I&amp;rsquo;ll split it into two parts: in this part, we&amp;rsquo;ll implement the general mechanism of transactions and in the second part we&amp;rsquo;ll work through details.</description>
    </item>
    
    <item>
      <title>Building Blockchain in Go. Part 3: Persistence and CLI</title>
      <link>https://jeiwan.net/posts/building-blockchain-in-go-part-3/</link>
      <pubDate>Tue, 29 Aug 2017 12:10:04 +0700</pubDate>
      
      <guid>https://jeiwan.net/posts/building-blockchain-in-go-part-3/</guid>
      <description>Chinese translations: by liuchengxu, by zhangli1.
 Introduction So far, we&amp;rsquo;ve built a blockchain with a proof-of-work system, which makes mining possible. Our implementation is getting closer to a fully functional blockchain, but it still lacks some important features. Today will start storing a blockchain in a database, and after that we&amp;rsquo;ll make a simple command-line interface to perform operations with the blockchain. In its essence, blockchain is a distributed database.</description>
    </item>
    
    <item>
      <title>Building Blockchain in Go. Part 2: Proof-of-Work</title>
      <link>https://jeiwan.net/posts/building-blockchain-in-go-part-2/</link>
      <pubDate>Tue, 22 Aug 2017 12:42:19 +0700</pubDate>
      
      <guid>https://jeiwan.net/posts/building-blockchain-in-go-part-2/</guid>
      <description>Chinese translations: by liuchengxu, by zhangli1.
 Introduction In the previous article we built a very simple data structure, which is the essence of blockchain database. And we made it possible to add blocks to it with the chain-like relation between them: each block is linked to the previous one. Alas, our blockchain implementation has one significant flaw: adding blocks to the chain is easy and cheap. One of the keystones of blockchain and Bitcoin is that adding new blocks is a hard work.</description>
    </item>
    
    <item>
      <title>Building Blockchain in Go. Part 1: Basic Prototype</title>
      <link>https://jeiwan.net/posts/building-blockchain-in-go-part-1/</link>
      <pubDate>Wed, 16 Aug 2017 12:29:11 +0700</pubDate>
      
      <guid>https://jeiwan.net/posts/building-blockchain-in-go-part-1/</guid>
      <description>Chinese translations: by liuchengxu, by zhangli1.
 Introduction Blockchain is one of the most revolutionary technologies of the 21st century, which is still maturing and which potential is not fully realized yet. In its essence, blockchain is just a distributed database of records. But what makes it unique is that it&amp;rsquo;s not a private database, but a public one, i.e. everyone who uses it has a full or partial copy of it.</description>
    </item>
    
  </channel>
</rss>
