<?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"><channel><title><![CDATA[Shubh Patni]]></title><description><![CDATA[Programmer | Blogger | Student]]></description><link>https://blog.shubhpatni.com</link><generator>RSS for Node</generator><lastBuildDate>Sat, 11 Apr 2026 21:15:33 GMT</lastBuildDate><atom:link href="https://blog.shubhpatni.com/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[How to make decisions]]></title><description><![CDATA[Separate Cravings from Decisions: Making Short Term Decisions
We waste an incredible amount of time negotiating with ourselves over small, recurring decisions: what to eat, whether to work out, whether to go out tonight.
I used to think discipline me...]]></description><link>https://blog.shubhpatni.com/how-to-make-decisions</link><guid isPermaLink="true">https://blog.shubhpatni.com/how-to-make-decisions</guid><category><![CDATA[Programming Blogs]]></category><category><![CDATA[Productivity]]></category><category><![CDATA[Time management]]></category><category><![CDATA[Philosophy]]></category><dc:creator><![CDATA[Shubh Patni]]></dc:creator><pubDate>Sat, 10 May 2025 03:25:54 GMT</pubDate><content:encoded><![CDATA[<h3 id="heading-separate-cravings-from-decisions-making-short-term-decisions">Separate Cravings from Decisions: Making Short Term Decisions</h3>
<p>We waste an incredible amount of time negotiating with ourselves over small, recurring decisions: what to eat, whether to work out, whether to go out tonight.</p>
<p>I used to think discipline meant fighting every urge in real-time. But most of the damage wasn’t from giving in, it was from the 30 minutes I’d spend debating the urge, then doing it anyway and regretting it.</p>
<p>I feel like we are often taught to fight our urges when they come when the real fight is before the battle starts.</p>
<p>Habits and Cravings are long term decisions. if you crave unhealthy food a lot, the solution is not to fight the craving every time it comes, but to work out, be forced to eat a protein rich diet to keep up with your workout and naturally reduce the cravings over time.</p>
<p>You don’t fix the craving, you change the context in which it exists.</p>
<hr />
<h3 id="heading-dont-think-short-term-while-making-long-term-decisions">Don’t think short term while making long term decisions</h3>
<p>This is quite obvious if you think about it and yet it’s so easy to make this mistake. Taking a high-paying job you’ll hate. Dating someone out of loneliness. Starting a project just to feel like you’re doing something. I’ve done all three.</p>
<p>When we’re unsure what to want, we copy others. Girard called it <em>mimetic desire</em>. I’ve chased countless ideas that weren’t mine. I’d see someone ship a product, get praised online, and feel behind. So I’d start something, anything, just to catch up. It never ended well.</p>
<blockquote>
<p>Humans are creatures who do not know what to desire, and they turn toothers to make up their minds — Rene Girard</p>
</blockquote>
<p>The hardest decision isn’t <em>how</em> to do something. It’s <em>what</em> to do. Altman, Naval, and Chris Lattner have all said versions of this: your biggest leverage comes from choosing the right problem. And yet, many of us waste years solving the wrong one really well.</p>
<p>I am now way more conscious and strategic about my long term decisions keeping in mind not to be paralyzed with infinite options and never actually making a decision, which is the next problem.</p>
<hr />
<h3 id="heading-what-to-choose">What to choose</h3>
<p>Set a deadline for your search based on your luxury of time and money.</p>
<p>For the 75% of this duration find all the possible decisions you can make. For the 25% of time, try to find a better option than best one previously found. If found, make the decision, if not try to get back to the previous best.</p>
<p>In this case, it’s important to realize that you may not make the “best possible” decision and that’s okay. It’s not in your hands. I don’t believe in fate but I do believe fate loves irony.</p>
<hr />
<h3 id="heading-patience-and-faith">Patience and Faith</h3>
<p>I have a tendency of worry about every decision I make. I always try to optimize and try to get the best possible outcome. This ironically has costed me a lot more than if I had just taken a conventional path. It’s like trying to find the best combination of stocks for years and seeing people making more money with S&amp;P500, literally.</p>
<p>In my case, I could have tried to work at FAANGs but that’s not cool right, where’s your 100M startup. I didn’t realize that conventional paths become conventional because they work and it doesn’t mean if you choose it you can’t steer from it.</p>
<p>If I am not working on a project I get like tinglings to do something, I just can’t sit still, watch a movie or party. Idk i just can’t do it. This is severe disadvantage imo. Empty space, nothingness is necessary to figure out what to do.</p>
<p>I need to understand to play my cards and sit still for others to play theirs, it may so happen that they fold better cards and I win with nothing.</p>
]]></content:encoded></item><item><title><![CDATA[How Are 100,000% Gains In Crypto Possible]]></title><description><![CDATA[Yes! You can earn over 100,000 APY by just staking cryptocurrencies. The crazier part is that this number was around 200k APY just a few months ago. Before you think that I am just spitting random crazy numbers at you, I am going to explain to you ho...]]></description><link>https://blog.shubhpatni.com/how-are-100000-gains-in-crypto-possible</link><guid isPermaLink="true">https://blog.shubhpatni.com/how-are-100000-gains-in-crypto-possible</guid><category><![CDATA[Blockchain]]></category><category><![CDATA[Cryptocurrency]]></category><category><![CDATA[technology]]></category><category><![CDATA[Technical writing ]]></category><category><![CDATA[Business and Finance ]]></category><dc:creator><![CDATA[Shubh Patni]]></dc:creator><pubDate>Tue, 04 Jan 2022 16:58:04 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1641315873692/wjedcZHX_C.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Yes! You can earn over 100,000 APY by just staking cryptocurrencies. The crazier part is that this number was around 200k APY just a few months ago. Before you think that I am just spitting random crazy numbers at you, I am going to explain to you how all this is possible, how you can earn these crazy rates, and obviously, what could go wrong.</p>
<p>When I first found out about this, I was very skeptical and simply ignored the project for weeks. My friend told me about it and he himself didn’t understand how it properly functions, so it seemed to me like a Ponzi scheme. But Olympus stood for months and many of its forks like Time wonderland were becoming popular. So, I thought of putting some money into these projects and then started learning about them.</p>
<p>What’s a better motivator to learn than your own money.</p>
<blockquote>
<p>Before we go ahead, I would like to disclose that I have personally used these platforms but I am not affiliated or sponsored by any of them in any form. This article is based on my understanding of Olympus and how it works, please share your thought so that I can refine mine.</p>
</blockquote>
<p>Here’s what you will learn from this article -</p>
<ul>
<li>What is DeFi</li>
<li>DeFi 1.0 (Liquidity Mining)</li>
<li>Problems with DeFi 1.0</li>
<li>Enter DeFi 2.0</li>
<li>How Olympus works</li>
<li>APY is an illusion</li>
</ul>
<h1 id="heading-what-is-defi">What is DeFi</h1>
<p>In case you haven’t heard of DeFi, it stands for Decentralized Finance.</p>
<blockquote>
<p>DeFi is an attempt to replicate and enhance the current system of finance and the way we interact and use our money</p>
</blockquote>
<p>DeFi, unlike traditional finance, is trying to create a platform that is more accessible to anyone. This accessibility includes not only basic financial services such as lending, borrowing, investing, etc but provides anyone with the ability to create their own financial products and solutions.</p>
<p>In theory, DeFi would provide anyone with an internet connection, access to lending, borrowing, investing, plus the ability to create financial products, and improve/contribute to existing financial solutions, regardless of their demographics, income, or other factors.</p>
<p>Contrary to this definition, most of the DeFi protocols are controlled by a few individuals and are not actually <strong>Decentralized Autonomous Organizations (DAOs)</strong>. However, most of these protocols aspire to be DAOs in the future. Initially, it is hard for any organization to become DAOs because of management, incentivization, and logistic difficulties. In my opinion, a true DeFi protocol should be a DAO.</p>
<h1 id="heading-defi-10-liquidity-mining">DeFi 1.0 (Liquidity Mining)</h1>
<p>One of the most basic functions of an asset is to be able to trade for another asset. To facilitate this trade, we need a middleman or a protocol that oversees and executes this transaction.</p>
<p>In a traditional setting, this is done by Centralized Exchanges (CEXs) which is an organization registered in a nation, controlled by a few board members and lives on a central server. Centralized exchanges maintain liquidity of certain assets they want their users to be able to trade and charge a transaction fee to the user to make this trade.</p>
<p>I won’t go into details about how centralized exchanges work but if you are interested in it, you can check out an article written by —</p>
<p>Let’s head over to the decentralized world again, shall we?</p>
<p>In the decentralized world, there is no central authority with liquidity. To access liquidity, these platforms provide users with incentives in the form of transaction fees and free tokens proportional to the provided liquidity. This is also known as liquidity mining or farming. The liquidity is usually provided in the pairs of two tokens ex ETH/USDT in a 50/50 ratio. The received tokens are called <strong>LP tokens.</strong></p>
<p>Here’s a more detailed article on how to make money with DeFi 1.0 —</p>
<h3 id="heading-problems-with-defi-10">Problems with DeFi 1.0</h3>
<p>To incentivize people to provide liquidity, DeXs introduced the concept of farming but there are several problems with that concept.</p>
<ul>
<li>If the platform stops providing lucrative LP tokens, the protocols might lose a lot of their liquidity.</li>
<li>Liquidity providers often sell the LP tokens thus influencing the price of the token and making the platform less lucrative.</li>
<li>Sudden price movements of assets can reduce the platform’s inventory value.</li>
<li>When the users deposit a pair of assets, they are exposed to the price volatility of both of them. Thus, price movements can lead to impermanent loss and this loss is realized when users take out their stake.</li>
<li>Smart contract bugs can lead to huge losses. (True for any Dapp)</li>
</ul>
<p>In short, DeFi 1.0 attracts yield farmers who just want high APY, and once that APY is not sustainable, they dump the tokens for profit. Thus the whole protocol has a time limit and is therefore not sustainable. Let’s look at what DeFi 2.0 brings to the table.</p>
<h1 id="heading-enter-defi-20">Enter DeFi 2.0</h1>
<p>Just to be clear there is no textbook distinction between DeFi 1.0 and DeFi 2.0, people on twitter just started referring to Olympus DAO and it’s alternatives as DeFi 2.0.</p>
<p>DeFi 2.0 introduced the concept of protocols owning their own liquidity. Let’s break it down.</p>
<p>So in the DeFi 1.0 mechanism, protocols needed a way to distribute their LP tokens thus they would offer high APYs initially and attract liquidity providers who would stick as long as that APYs last. In the DeFi 2.0 system, there are incentive mechanisms that allow the protocol to own its liquidity and thus never run out of it like DeFi 1.0 protocols.</p>
<p>First, let’s start with what is Olympus and what it is trying to achieve.</p>
<blockquote>
<p>Olympus is a algorithmic decentralized protocol that wishes to become a reserve currency of the world. To achieve this, it created a token called OHM which in the long term should be a stable floating currency backed by other assets, much like money was backed by gold.</p>
</blockquote>
<p>How does it do it?</p>
<h1 id="heading-how-olympus-works">How Olympus works</h1>
<p>There are 3 key components that make all this possible- <strong>Bonding</strong>, <strong>Treasury</strong>, and <strong>Staking</strong>.</p>
<h3 id="heading-treasury">Treasury</h3>
<p>OHM is backed by assets such as Ethereum, DAI, Frax, etc in its treasury. This treasury consists of stable coin and non-stable coin assets which makes the <strong>risk-free value of treasury assets</strong>. The current treasury market values/market cap is 0.25 or 25%. The minimum value of an OHM is the value of treasury/supply of OHM. The current prize of OHM is $326.76 and backing per OHM is $96.02, thus OHM is currently valued at 3.4x its backed value.</p>
<p>But the new OHM is minted and backed by stable coins thus the reserve treasury backing per OHM is currently $64.4. If the value of OHM goes below this price, the protocol will burn OHM or buy more treasury assets. Thus OHM will always be ≥ value in reserve treasury assets.</p>
<h3 id="heading-bonding">Bonding</h3>
<p>Bonding is essentially similar to the bonds you get from the federal reserve. Olympus provides you OHM tokens for cheaper than the market price, i.e what it is selling on DEXs. Currently, there are two bonds available- Frax bond (5.97%) and OHM-Frax LP (0.47%) So over the lockup period of 5 days, you will unlock certain OHM tokens, proportional to your position.</p>
<p><em>In Time Wonderland, you can even claim and stake the minted tokens every 8 hours to attain the highest yield possible.</em></p>
<p>The amount of OHM that would be received by the bonder is determined by a simple equation. </p>
<pre><code>Bond payout <span class="hljs-operator">=</span> mkt value of an asset or LP token <span class="hljs-operator">/</span> bond price
</code></pre><p>You can think of bond price as the value that the protocol thinks OHM is worth. Use the  <a target="_blank" href="https://docs.olympusdao.finance/main/references/equations">link</a>  for details.</p>
<p>This bonding mechanism works as a profit mechanism for the protocol and allows it to buy its own liquidity from the market. Thus, the protocol makes money from the sale of these bonds and through transaction fees accumulated through transactions. Olympus DAO has made over  <a target="_blank" href="https://dune.xyz/queries/239518/498941">$28.8M in LP fees alone.</a> </p>
<p>But there is a catch. The supply of OHM is not capped! What does this mean, you ask?</p>
<p>When you purchase OHM bonds, you are getting OHM for a cheaper price than market value but the lockup period is 5 days. If the price of OHM increases or remains the same you are at no loss but if it decreases, you incur a loss. If you hold the token, you again incur the loss as the supply just increases because other participants are minting new tokens. So to be profitable you can either sell the tokens as soon as you mint them or stake them.</p>
<p>Staking
In staking, users stake the OHM token which removes those tokens from the circulation, and in return, the platform awards these users with staking rewards. Rebase is the amount of sOHM you receive after an epoch (8hrs) As of this writing, TIME is currently offering 0.5928% reward per epoch and Olympus is offering 0.3771%. This means that 5 day reward i.e 15 epochs is around 8.892% and 5.65% respectively. The APY number is the annualized return rate that is derived from this rebase reward.</p>
<p>So far in the history of Olympus DAO, the average OHM staked has been over 90%. This is the case because it does not matter how many OHM tokens you have, but the percent of the market cap you own. This is because the market cap of OHM might keep increasing with the circulating supply but the tokens you own will be constant if you don’t stake them.</p>
<h1 id="heading-apy-is-an-illusion">APY is an illusion</h1>
<p>Remember that there are two groups involved — bonders and stakers, and they both are trying to capture as much market cap of Olympus as possible.</p>
<p>Let’s say that the size of the pie is 1000 and you enter here and own around 100 units of this pie with a random guy who has the same amount. Now to grow your share of the pie, you either stake or bond. Looking at the crazy 85,000% APY, you decide to stake and the other guy is bonding.</p>
<p>If the bonding rate is higher than staking, bonders are growing their piece of the pie faster than the stakers and vice versa. So in this situation, one party would benefit more than the other. For a 100k APY, the 5 day ROI would be</p>
<pre><code><span class="hljs-attribute">x</span>⁷³=<span class="hljs-number">1000</span> , where x is the <span class="hljs-number">5</span> day ROI, <span class="hljs-number">73</span> is the number of <span class="hljs-number">5</span>-day epochs.
</code></pre><p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1641314571074/jxm-firXd.png" alt="image.png" /></p>
<p>This means <code>x = 1.09925 or 9.92%</code>. For simplicity’s sake, let’s say that 5 day ROI is 6% i.e 7k APY for staking, and the bonding rate is 9%. It’s a no-brainer that Bonders would capture more of the growing pie. This means that the high APY that these protocols including Olympus or Time Wonderland offer does not mean much because of dilution.</p>
<p>Now you might be saying-<em> but Bonding doesn’t always offer a higher APY! It’s usually less than staking.</em></p>
<p>This is true. It’s very rare for the bonding rate to be higher than staking but it’s not that it’s not possible. But even if the bonding rate is lower, you can make more money by bonding! Here’s how-</p>
<p>Let’s say that the bonding rate is 5% and staking is 6% for 5 days. At each epoch, you would get <code>5/15 = 0.33%</code> for bonding and <code>6/15 = 0.4%</code> for staking. The vesting period for bonding is 5 days but you can claim the rewards every epoch i.e 8 hours, and you can stake these back! Let’s say you claim these rewards every day and stake them back, if we do the calculation, we get —</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1641314659266/IOOm6g0Yhd.png" alt="image.png" /></p>
<p>As you can see we get an 8.57% return which is greater than both staking and bonding individually! Now claiming and re-staking involves a gas fee so if you do this in Olympus, it might not be feasible because of the Ethereum gas fee. But you can do this in Time Wonderland and earn more rewards.</p>
<h2 id="heading-resources-and-references">Resources and References</h2>
<p> -<a target="_blank" href="https://dune.xyz/shadow/Olympus-%28OHM%29">Dune Analytics</a></p>
<p> -<a target="_blank" href="https://olympusdao.medium.com/">Oympus DAO</a></p>
<p> -<a target="_blank" href="https://networked.substack.com/p/beware-of-greeks-bearing-grifts">Beware of Geeks Bearing Gifts</a></p>
<p> -<a target="_blank" href="https://docs.olympusdao.finance/main/">Docs Olympus DAO</a>    </p>
]]></content:encoded></item><item><title><![CDATA[Know Your Tools Before You Craft]]></title><description><![CDATA[Have you ever thought that excitement and that adrenaline rush to just get started or to do your work can be less productive? Well, I have experienced it.
My Story
Let me explain-
When I started my journey as a programmer, I was very excited to just ...]]></description><link>https://blog.shubhpatni.com/know-your-tools-before-you-craft</link><guid isPermaLink="true">https://blog.shubhpatni.com/know-your-tools-before-you-craft</guid><category><![CDATA[Programming Blogs]]></category><category><![CDATA[Productivity]]></category><category><![CDATA[technology]]></category><category><![CDATA[life]]></category><dc:creator><![CDATA[Shubh Patni]]></dc:creator><pubDate>Fri, 20 Aug 2021 09:45:07 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1629452510539/-VJZRSO8u.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Have you ever thought that excitement and that adrenaline rush to just get started or to do your work can be less productive? Well, I have experienced it.</p>
<h3 id="my-story">My Story</h3>
<p>Let me explain-</p>
<p>When I started my journey as a programmer, I was very excited to just create something new and show something to the world. I worked very hard on my first app and launched it within a few days of starting, at this time I didn’t even know how to leverage the power of object-oriented programming. As soon as my first app was publicly visible on the app store, I was already working on my next project, A game, called Star Crash. Even at this point, I was not aware of how to use objects and classes. I wrote around 4000 lines of code in a single file and during test runs, it would run but soon crash. As my Macbook was not that powerful, I thought it’s just the Xcode simulator that is not working properly, everything else should be fine.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1629452616676/CPiMX5Iqb.png" alt="image.png" /></p>
<p>I launched my game on the app store. I was happy and thinking about what would I do with all that money that I would receive from google ads if only I knew about my tools.</p>
<p>If you are not a programmer or you are not aware of anything I just wrote above. Just understand that, even though I was super productive in creating those apps, it didn’t take me anywhere, because I was not aware of my tools.</p>
<h3 id="how-do-you-make-sure-that-you-dont-fall-in-the-same-pit">How do you make sure that you don’t fall in the same pit?</h3>
<p>It’s simple, know your tools before you craft.</p>
<p>If you are a photographer, then first learn what your camera can do. Watch youtube tutorials, read the camera guide (better google it) spend at least 2 hours to know the basics about the camera.</p>
<p>If you want to be a YouTuber, watch some YouTubers talking about their journey, the tools they use, and how you can use them.</p>
<p>For those who are self-taught programmers-</p>
<p>I know it is fun to work on projects and create cool things, but at least once take a basics course. People say that theory is bullshit and just work on projects, you will learn everything you need to know.</p>
<p>from my experience it’s not true, I am a self-taught programmer and I spent a lot of time working on projects that would have been much easier to create if I had only taken a data structure and algorithms course before. So, at least take a complete theory course on basics (its boring as hell), but once you finish it, you will appreciate it more than anything.</p>
<p>NOTE — These opinions and thoughts are my personal. I write what I observe and feel, your opinions and thoughts might differ. Leave your response as I would love to read your views (if time permits)</p>
]]></content:encoded></item><item><title><![CDATA[3 Huge Mistakes Django Developers Make]]></title><description><![CDATA[Django is a very interesting framework as it allows you to create web applications with python as a backend. Not only that, but it can also handle most of the database stuff so we don’t have to worry about tables, for small applications at least, and...]]></description><link>https://blog.shubhpatni.com/3-huge-mistakes-django-developers-make-9fe588540088</link><guid isPermaLink="true">https://blog.shubhpatni.com/3-huge-mistakes-django-developers-make-9fe588540088</guid><category><![CDATA[Programming Blogs]]></category><category><![CDATA[Python]]></category><category><![CDATA[Django]]></category><category><![CDATA[Web Development]]></category><category><![CDATA[coding]]></category><dc:creator><![CDATA[Shubh Patni]]></dc:creator><pubDate>Sun, 01 Aug 2021 16:06:27 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1629189138833/BlyQ8RE95.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Django is a very interesting framework as it allows you to create web applications with python as a backend. Not only that, but it can also handle most of the database stuff so we don’t have to worry about tables, for small applications at least, and can focus on the dinner.</p>
<p>Despite being a very helpful framework, Django has a steep learning curve that can startle beginners and leave them unchained — I hope you are getting my jokes.</p>
<p>In this post, I will try to make your life much easier by introducing you to some of the best Django features and practices.</p>
<h2 id="1-repeating-the-template-code">1. Repeating The Template Code</h2>
<p>Django provides you with a lot of different ways to reuse your code and make your code more efficient and readable. One such feature is Django's <strong>template tags and filters.</strong></p>
<p>It allows you to write logic inside of an HTML file and display relevant data. There are many <a target="_blank" href="https://docs.djangoproject.com/en/3.2/ref/templates/builtins/">built-in tags and filters</a> but you can also create your own.</p>
<p>One such tag is <code>include</code> and it allows us to reuse our HTML. Here’s how I used it on my website:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1629189132496/PBrjGoT2B.png" alt /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1629189134643/I1D45wvtA.png" alt="Left: latest articles on my Home page. Right: all articles on my Articles page" /><em>Left: latest articles on my Home page. Right: all articles on my Articles page</em></p>
<p>I wanted to display my latest articles on the ‘Home’ page and also on the ‘Articles’ page.</p>
<p>As the design of the article card remains the same, the best way to tackle this would be to create a common HTML and reuse it on both the pages using include. Here’s what it looks like in code:</p>
<pre><code class="lang-html"><span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"articles-div container"</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"left-col"</span>&gt;</span>
        {% for article in left %}
        {% include "main/includes/article.html" with link=article.medium_link image=article.image.url title=article.title tags=article.tags date=article.date_created %}
        {% endfor %}
    <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>

    <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"right-col"</span>&gt;</span>
        {% for article in right %}
        {% include "main/includes/article.html" with link=article.medium_link image=article.image.url title=article.title tags=article.tags date=article.date_created %}
        {% endfor %}
    <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
</code></pre>
<p>As you can see in the above code, I am looping through all the articles passed by <code>views.py</code> file, and for each article, it is creating <code>{% include %}</code> to add the desired HTML. (In the next example we will see how the views.py file passes this data) The syntax to use include looks like this:</p>
<pre><code>{% <span class="hljs-keyword">include</span> “file_name” <span class="hljs-keyword">with</span> argument_name=”some_argument” second_argument_name=”another_argument” %}
</code></pre><p>The <code>with</code> keyword is optional, use it when you need to pass arguments to your HTML. To pass string arguments, put it inside <code>“”</code> or you can also pass variables.</p>
<pre><code class="lang-html">{% load static %}
<span class="hljs-tag">&lt;<span class="hljs-name">link</span> <span class="hljs-attr">rel</span>=<span class="hljs-string">"stylesheet"</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"{% static 'css/include/articles.css' %}"</span>&gt;</span>

<span class="hljs-tag">&lt;<span class="hljs-name">a</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"{{ link }}"</span> <span class="hljs-attr">target</span>=<span class="hljs-string">"blank"</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"article"</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">img</span> <span class="hljs-attr">class</span> = <span class="hljs-string">"article-img"</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"{{ image }}"</span> <span class="hljs-attr">alt</span>=<span class="hljs-string">""</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">h4</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"article-title"</span>&gt;</span>{{ title }}<span class="hljs-tag">&lt;/<span class="hljs-name">h4</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">ul</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"tags"</span>&gt;</span>
          <span class="hljs-tag">&lt;<span class="hljs-name">li</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"{{ tags }}"</span>&gt;</span>{{ tags }}<span class="hljs-tag">&lt;/<span class="hljs-name">li</span>&gt;</span>
          <span class="hljs-tag">&lt;<span class="hljs-name">p</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"date"</span>&gt;</span>{{ date }}<span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span>
      <span class="hljs-tag">&lt;/<span class="hljs-name">ul</span>&gt;</span>

  <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">a</span>&gt;</span>
</code></pre>
<p>The above code is for my article card. In the first line, I am using <code>{% load static %}</code> to access static files i.e any CSS, JS, or image file. To use the arguments passed from <code>include</code> tag, you must put the argument name inside <code>{{}}</code> like — <code>{{ argument_name }}</code></p>
<p>So that was how to reuse your HTML. Now let’s look at class-based views which are often neglected or not known to new Django developers.</p>
<h2 id="2-using-function-based-views">2. Using Function Based Views</h2>
<p>Firstly, I would like to clear the misconception that class-based views (CBV) are better than function-based views (FBV): they are not.</p>
<p>It depends on the use case and both have their own advantages. I added CBV in this article because they allow you to remove redundancy from your code which is often present with FBV. So, it's good to know about CBVs.</p>
<p>If you have ever created any Django project, you must be aware of FBV. They are easy to create and read but not so good when it comes to reusability.</p>
<p>Django provides you with generic views which you can inherit into your own view class and override its contents. So most of the things are already created for you, you just need to customize them to fit your needs. Here’s how I used it in my blog.</p>
<pre><code class="lang-python"><span class="hljs-keyword">from</span> django.views.generic <span class="hljs-keyword">import</span> ListView
<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">ArticlePage</span>(<span class="hljs-params">ListView</span>):</span>
    model = Articles
    template_name = <span class="hljs-string">"main/articles.html"</span>

    <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">get_context_data</span>(<span class="hljs-params">self, **kwargs</span>):</span>
        article_data = super(ArticlePage, self).get_context_data(**kwargs)

        tag = self.kwargs.get(<span class="hljs-string">'tag'</span>, <span class="hljs-literal">None</span>)
        <span class="hljs-keyword">if</span> tag != <span class="hljs-literal">None</span>:
            <span class="hljs-keyword">if</span> tag <span class="hljs-keyword">in</span> <span class="hljs-string">"Tech Programming Productivity Crypto"</span>:
                articles = Articles.objects.filter(
                    tags=tag).order_by(<span class="hljs-string">'-date_created'</span>)
        <span class="hljs-keyword">else</span>:
            articles = Articles.objects.order_by(<span class="hljs-string">'-date_created'</span>)

        left, middle, right = left_middle_right(articles)
        article_data[<span class="hljs-string">'left'</span>] = left
        article_data[<span class="hljs-string">'middle'</span>] = middle
        article_data[<span class="hljs-string">'right'</span>] = right
        <span class="hljs-keyword">return</span> article_data
</code></pre>
<p><code>ListView</code> is one of the most common generic classes which is used to list all the items in a database. To use it, just create a class in your <code>views.py</code> file and inherit the class from<code>django.views.generic import ListView</code> .</p>
<p>In the simplest case, you just need to create a <code>model</code> variable and everything else is taken care of. The default template name is <code>“model_name”_list.html</code> but of course you can change it as I have done above.</p>
<p>To further customize it, you can override the functions. In my case, I wanted to sort the articles by date or tags and then separate them into three chunks for my three columns in the template file. Below is how you can use <code>article_data</code> in your template file.</p>
<pre><code class="lang-html"><span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"articles-div container"</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"left-col"</span>&gt;</span>
        {% for article in left %}
        {% include "main/includes/article.html" with link=article.medium_link image=article.image.url title=article.title tags=article.tags date=article.date_created %}
        {% endfor %}
    <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"mid-col"</span>&gt;</span>
        {% for article in middle %}
        {% include "main/includes/article.html" with link=article.medium_link image=article.image.url title=article.title tags=article.tags date=article.date_created %}
        {% endfor %}
    <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>

    <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"right-col"</span>&gt;</span>
        {% for article in right %}
        {% include "main/includes/article.html" with link=article.medium_link image=article.image.url title=article.title tags=article.tags date=article.date_created %}
        {% endfor %}
    <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>

<span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
</code></pre>
<p>In the previous example, we saw how to reuse templates using include. That template gets the data from <code>left</code> <code>right</code> and <code>middle</code> of out <code>article_data</code> variable. But, that’s not it. There is one thing we need to do in our <code>urls.py</code> file to use CBV.</p>
<pre><code class="lang-python"><span class="hljs-keyword">from</span> .views <span class="hljs-keyword">import</span> ArticlePage

app_name = <span class="hljs-string">"main"</span>

urlpatterns = [
    path(<span class="hljs-string">'articles'</span>, ArticlePage.as_view(), name=<span class="hljs-string">"articles"</span>),
]
</code></pre>
<p>We first need to import our class and then use it in the <code>urlpatterns</code> with <code>.as_view()</code> function. This is because Django’s URL resolver expects to send the request and arguments to a function and not a class. You just need to use <code>.as_view()</code> function and Django takes care of the rest.</p>
<h2 id="3-large-viewspy-file">3. Large views.py File</h2>
<p>The <code>views.py</code> file contains most of our logic and therefore it can grow to hundreds of lines of code. This makes debugging tougher and makes the code harder to read. Here’s how to break the file without breaking your code.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1629189136607/XlhUqizES.png" alt="Screenshot of views folder" /><em>Screenshot of views folder</em></p>
<p>Create a folder named views and create a file inside it called <code>__init__.py</code> . Now you can break your views.py file and put each of its classes or functions into different files.</p>
<p>In my case, I am using <code>views_a.py</code> file for all CBVs and have created more files for each operation.</p>
<p>If you have split functions and classes from the original views.py file into multiple files, import all the things from those files inside your <code>__init__.py</code> file as shown below:</p>
<pre><code class="lang-python"><span class="hljs-keyword">from</span> .medium_scraper <span class="hljs-keyword">import</span> *
<span class="hljs-keyword">from</span> .views_a <span class="hljs-keyword">import</span> *
<span class="hljs-keyword">from</span> .articles <span class="hljs-keyword">import</span> *
</code></pre>
<p>In the above case, I actually don’t need to import anything other than <code>views_a</code> . This is because all of my view objects, which will be used in <code>urls.py</code> file, are inside <code>views_a</code>.</p>
<p>But if you have them separated into multiple files you would need to import each one of them like shown above:</p>
<pre><code class="lang-python"><span class="hljs-keyword">from</span> django.contrib <span class="hljs-keyword">import</span> admin
<span class="hljs-keyword">from</span> django.urls <span class="hljs-keyword">import</span> path
<span class="hljs-keyword">from</span> .views <span class="hljs-keyword">import</span> *

app_name = <span class="hljs-string">"main"</span>

urlpatterns = [
    path(<span class="hljs-string">'home'</span>, Homepage.as_view(), name=<span class="hljs-string">"home"</span>),
    path(<span class="hljs-string">'articles'</span>, ArticlePage.as_view(), name=<span class="hljs-string">"articles"</span>),
    path(<span class="hljs-string">'articles/&lt;str:tag&gt;/'</span>, ArticlePage.as_view(), name=<span class="hljs-string">"articles"</span>),
    path(<span class="hljs-string">'about'</span>, AboutPage.as_view(), name=<span class="hljs-string">"about"</span>),
    path(<span class="hljs-string">'courses'</span>, CoursePage.as_view(), name=<span class="hljs-string">"courses"</span>),
    path(<span class="hljs-string">'resources'</span>, ResourcesPage.as_view(), name=<span class="hljs-string">"resources"</span>),
    path(<span class="hljs-string">'projects'</span>, views.projects, name=<span class="hljs-string">"projects"</span>),

]
</code></pre>
<p>Finally, type <code>from .views import *</code> to import all your view objects.</p>
<h2 id="conclusion">Conclusion</h2>
<p>That’s it for this one! I hope it improves your Django code by at least 2x.</p>
<p><em>If you have doubts or suggestions, you can reach me out on my <a target="_blank" href="https://y.at/%F0%9F%92%BB%F0%9F%8E%A5%E2%9C%8D%E2%98%95">socials</a>.</em></p>
]]></content:encoded></item><item><title><![CDATA[6 Ways To Generate Passive Income With Crypto]]></title><description><![CDATA[Photo by Timothy Dykes on Unsplash
After a roller coaster ride for veteran crypto investors and a love affair for newcomers, we are in a position where no one really knows what will happen to the crypto market. Some analysts such as Willy Woo, Plan B...]]></description><link>https://blog.shubhpatni.com/6-ways-to-generate-passive-income-with-crypto-eb02c611e150</link><guid isPermaLink="true">https://blog.shubhpatni.com/6-ways-to-generate-passive-income-with-crypto-eb02c611e150</guid><category><![CDATA[Cryptocurrency]]></category><category><![CDATA[Blockchain]]></category><category><![CDATA[technology]]></category><category><![CDATA[Ethereum]]></category><category><![CDATA[Monetization]]></category><dc:creator><![CDATA[Shubh Patni]]></dc:creator><pubDate>Mon, 19 Jul 2021 01:23:31 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1627479756541/x0jN8nvpx.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><em>Photo by <a target="_blank" href="https://unsplash.com/@timothycdykes?utm_source=medium&amp;utm_medium=referral">Timothy Dykes</a> on <a target="_blank" href="https://unsplash.com?utm_source=medium&amp;utm_medium=referral">Unsplash</a></em></p>
<p>After a roller coaster ride for veteran crypto investors and a love affair for newcomers, we are in a position where no one really knows what will happen to the crypto market. Some analysts such as <a target="_blank" href="https://twitter.com/woonomic/status/1416248306141855744?s=20">Willy Woo</a>, <a target="_blank" href="https://twitter.com/100trillionUSD/status/1410933951741501442?s=20">Plan B</a> still think that the bull market is intact and others fear the worst crash ever.</p>
<blockquote>
<h1 id="but-one-thing-is-clear-hodling-has-been-historically-for-whatever-little-history-we-have-the-easiest-strategy-for-highest-gains">But one thing is clear — Hodling has been, historically (for whatever little history we have), the easiest strategy for highest gains.</h1>
</blockquote>
<p>So you probably don’t want to sell all of your cryptos and be a legendary holder, but still wanna make up for over 50% dumpage.<em> </em>You are not alone.</p>
<p>I had the same thing in mind. So, I looked at every nook and corner of the internet to find the best ways to make my crypto work for me, and here, I am going to let you pick my brain — <em>not literally though.</em></p>
<blockquote>
<p>Disclaimer — Please do not consider this article as a financial advice. This market is everchainging so please do your own research before doing anything.</p>
</blockquote>
<h2 id="deposit">Deposit</h2>
<p>In <a target="_blank" href="https://www.investopedia.com/personal-finance/banks-pay-highest-interest-rates-savings-accounts/">traditional finance</a>, you usually deposit your money in the bank for which you receive some interest. This interest can vary anywhere from<strong> 0.06%</strong> to — in the best case —<strong> 0.7%</strong>. <em>I know, it’s not enough.</em></p>
<p>Platforms such as <a target="_blank" href="https://app.aave.com/markets">AAVE</a> give you <strong>1.88% APY + 3.65% APR</strong> (MATIC) just to deposit your MATIC in the platform. You can deposit wrapped versions of BTC, ETH, and many other cryptos to earn interest in them. Some platforms also provide temporary incentives in the form of their native token to promote their platform such as compound.</p>
<h2 id="lend">Lend</h2>
<p>Lending platforms allow you to lock your cryptocurrencies into smart contracts. These funds can then be borrowed by borrowers who pay interest, part of which is given to lenders. Since borrowing in most DeFi protocols is <strong>over-collateralized</strong> and locked in smart contracts, it is almost risk-free — <em>Make sure the platform and smart contract is safe and there are no backdoors.</em></p>
<blockquote>
<p>over-collateralization means that borrowers must put more funds in collateral than they want to borrow. For example, if the collaterl factor is 70% and you have 1ETH ($1800), you need to put all of it as collateral to borrow $1260 (DAI)</p>
</blockquote>
<p>You can use <a target="_blank" href="https://app.compound.finance/">compound finance</a> to lend UNI tokens and earn <strong>1.49% UNI + 0.62% COMP </strong>APY and you can also use it as collateral to borrow something else.</p>
<h2 id="borrow">Borrow</h2>
<p>At this point, you might think- <em>as these platforms are over-collateralized there is no point in borrowing, I mean you are getting less money. </em>So let’s clear this point first.</p>
<p>If you are a long-term holder, you don’t want to sell your crypto but you also want to use the money. Borrowing makes this possible. You can put your crypto as collateral and borrow USDC, you can use this USDC as you like and you can pay the initial amount plus interest when you want your crypto back. During this time, if your crypto gained in value you would only have to pay the initial USDC you borrowed, and it gets better.</p>
<blockquote>
<h1 id="it-might-seem-weird-but-you-can-actually-make-money-by-borrowing-money">It might seem weird but you can actually make money by borrowing money.</h1>
</blockquote>
<p>So let's say you want to borrow 1 BTC. First, you would have to deposit some assets as collateral then you can borrow BTC at some interest which you would have to pay. In AAVE, you can currently borrow BTC at <strong>0.3% APY</strong> interest, and you can receive <strong>1.17% APR on MATIC.</strong> Yes! You would receive MATIC to borrow BTC. It gets even crazier.</p>
<p>You can now use the borrowed amount to do whatever you like. You can buy or trade another crypto in some other platform, or just deposit it back to borrow more <strong>endlessly</strong>! You just need to keep track of your health factor otherwise you can <strong>lose everything</strong>!
<a target="_blank" href="https://medium.com/coinmonks/is-decentralized-finance-defi-really-a-game-changer-2b9ff1ae6bb9"><strong>Is Decentralized Finance (DeFi) Really a Game-Changer</strong>
<em>No hype analysis based on facts</em>medium.com</a></p>
<h2 id="staking">Staking</h2>
<p>In staking, you lock your funds in a certain blockchain platform for a certain amount of time which gives you some <em>superpowers.</em></p>
<p>These <em>superpowers </em>differ for each platform but usually, you receive a certain percentage of interest of the same token and gain voting rights for the governance of the platform. The stake is used as an incentive/penality mechanism to run the blockchain network and keep it safe.</p>
<p>For example, Cardano (ADA) allows you to stake as little as 10 ADA to a staking pool of your choice. The current staking reward according to <a target="_blank" href="https://cardano.org/calculator/?calculator=delegator">Cardano's website is 4.6083%</a> and your fund will not be slashed if the staking pool malpractices. You can use<a target="_blank" href="https://www.youtube.com/watch?v=sqtyFmpcrg0&amp;t=30s"> this video guide</a> to learn more.</p>
<p>If you wish to learn more about Cardano, you can read my previous post
<a target="_blank" href="https://levelup.gitconnected.com/why-i-am-betting-on-cardano-ada-93e34ea59bda"><strong>Why I am Betting on Cardano (ADA)</strong>
<em>The crypto of the future</em>levelup.gitconnected.com</a></p>
<h2 id="liquidity-pool">Liquidity Pool</h2>
<p>A liquidity pool is a basket of assets on a decentralized exchange. Usually, there are two assets in the basket in a 50:50 ratio ex <strong>USDC/ETH</strong>. Liquidity providers provide both the assets in some ratio to the pool and in exchange receive a portion of the trade fee proportional to their provided liquidity.</p>
<p>An LP token gets issued when you provide liquidity, it is the same as an <strong>ERC-20</strong> token and you can use it to redeem your collected rewards. This means that instead of owning those two tokens, you now own a certain percentage of the pool.</p>
<p>When investing in a liquidity pool, keep in mind that the price fluctuations of both the assets can result in an <strong>impermanent loss. </strong>Although this loss is not permanent, and you can get 100% of your funds back if the price of both the assets return to the price you provided liquidity, it is a rare occurrence.</p>
<p>The best way to make money in a liquidity pool is to invest in stable assets or during calm times. Currently, you can provide liquidity to a <a target="_blank" href="https://info.uniswap.org/#/pools/0x8ad599c3a0ff1de082011efddc58f1908eb6e6d8">USDC/ETH pool in Uniswap </a>and any trade that occurs will have a <strong>0.3% fee</strong> which will be collected and distributed amongst the liquidity providers.</p>
<h2 id="farming">Farming</h2>
<p>When you receive LP tokens by participating in a liquidity pool, you can lock these tokens in yield farms to earn more tokens. This is called <strong>farming</strong>.</p>
<p>Farmers look for the best liquidity pools and sometimes are even willing to take a loss to receive good LP tokens. They lock these tokens in other DeFi protocols to earn interest.</p>
<p>One thing to look out for while farming is the DeFi protocol you are locking your funds in. A lot of times, developers of these DeFi protocols steal LP tokens and withdraw the funds from liquidity pools.</p>
<p>At this point, a lot of you might be thinking <em>‘I have heard people talking about 1000% APY and more on DeFi, but here you only discussed a fraction of it’</em></p>
<p>It is true that you can use the methods mentioned above to make lucrative gains on DeFi, but they are usually on newer DeFi platforms which may not be safe. This is why I only mentioned the safest and most trusted platforms in the DeFi space.</p>
<p><em>If you wish to learn more about crypto, you can check out my free curated list of resources on <a target="_blank" href="https://shubhpatni.gumroad.com/">Gumroad</a>. If you have doubts, suggestions, or want me to make a more lucrative post on DeFi, let me know through my <a target="_blank" href="https://y.at/%F0%9F%92%BB%F0%9F%8E%A5%E2%9C%8D%E2%98%95">socials</a>.</em></p>
]]></content:encoded></item><item><title><![CDATA[Is Decentralized Finance (DeFi) Really a Game-Changer]]></title><description><![CDATA[Photo by Jonathan Petersson on Unsplash
There are two types of people in the world right now: Crypto believers and haters.
On one hand, there are people who think that bitcoin is the only money in existence, DeFi is the only financial solution, and N...]]></description><link>https://blog.shubhpatni.com/is-decentralized-finance-defi-really-a-game-changer-2b9ff1ae6bb9</link><guid isPermaLink="true">https://blog.shubhpatni.com/is-decentralized-finance-defi-really-a-game-changer-2b9ff1ae6bb9</guid><category><![CDATA[Blockchain]]></category><category><![CDATA[technology]]></category><category><![CDATA[Cryptocurrency]]></category><category><![CDATA[Business and Finance ]]></category><category><![CDATA[Technical writing ]]></category><dc:creator><![CDATA[Shubh Patni]]></dc:creator><pubDate>Mon, 12 Jul 2021 15:28:29 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1627479770967/FFu06ktTu.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><em>Photo by <a target="_blank" href="https://unsplash.com/@grizzlybear?utm_source=medium&amp;utm_medium=referral">Jonathan Petersson</a> on <a target="_blank" href="https://unsplash.com?utm_source=medium&amp;utm_medium=referral">Unsplash</a></em></p>
<p>There are two types of people in the world right now: Crypto believers and haters.</p>
<p>On one hand, there are people who think that bitcoin is the only money in existence, DeFi is the only financial solution, and NFTs are the only real proof of ownership, and on the other side, we have people who think all of it is just a big scam.</p>
<p>How can there be so contrasting opinions about the same technology? Time and time again we have seen technology taking over the legacy systems: horses and cars, telephone and internet, etc. Still, with blockchain, we are back in the same game.</p>
<p>I can’t talk about everything blockchain is trying to solve in one post so here I will just look at DeFi and give you my unbiased opinion on it based on facts. If you are new to crypto, and still wondering <em>‘what the heck is this DeFi?’, here’s a brief introduction-</em></p>
<blockquote>
<p>DeFi stands for Decentralized Finance. It uses decentralized ledger technology such as the blockchain to manage financial data and provide all the financial services for which we currently rely on central authority such as the banks. DeFi gets rid of intermediaries and instead uses smart contracts to automate and safeguard the entire process.</p>
</blockquote>
<p>Now let’s look at some facts and get into the meat of this article and find out if DeFi is actually a game-changer.</p>
<h2 id="the-growth-of-defi">The Growth of DeFi</h2>
<p>Below are some statistics that prove that DeFi is growing at a tremendous rate and providing value to people which is unheard of in the traditional industry.</p>
<p><img src="https://cdn-images-1.medium.com/max/4856/1*FcfQBh3c4R0TQ6JY3Yck1A.png" alt="Screenshot from[ DeFi Llama](https://cdn.hashnode.com/res/hashnode/image/upload/v1627479761854/TdtcGpfyw.html)" /><em>Screenshot from<a target="_blank" href="https://defillama.com/home"> DeFi Llama</a></em></p>
<h3 id="tvl"><strong>TVL</strong></h3>
<p>The most common metric to measure the growth of DeFi is <strong>Total Value Locked</strong> <strong>(TVL)</strong> which is the amount of wealth locked into all DeFi protocols. According to <a target="_blank" href="https://defillama.com/home">DeFi Llama</a>, In March 2020, TVL was around $500M, now it is $114.05B and in May 2021, it peaked at over $153B across all blockchains.</p>
<h3 id="interest-rates"><strong>Interest Rates</strong></h3>
<p>According to <a target="_blank" href="https://dappradar.com/defi">Dapp Radar,</a> DeFi is giving rates as high as 8% for deposits. According to <a target="_blank" href="https://www.investopedia.com/personal-finance/banks-pay-highest-interest-rates-savings-accounts/">Investopedia</a>, the national average interest rate for savings accounts is 0.06% and the highest you can get is 0.7% APY.</p>
<h3 id="lending-and-borrowing"><strong>Lending and Borrowing</strong></h3>
<p>Traditional services are only available to certain income groups, credit scores, and certain locations. DeFi opens up this market to anyone with an internet connection and there is no minimum capital required, you can also collect interest at any time. This is great in theory but later as we will see it’s not actually that accessible.</p>
<h3 id="financial-products"><strong>Financial Products</strong></h3>
<p>DeFi has created a plethora of new ways to make your money work for you. With a few button clicks, you can deposit money to earn interest on it, use it to <em>get paid (as other tokens) </em>to borrow more money using which you can again borrow more, put it in liquidity mining to earn more and it just gets crazier — You can watch <a target="_blank" href="https://youtu.be/B0FiTC_Pl3w">this video</a> on Benjamin Cowen’s channel to learn how to do this — No such thing exists in traditional finance.</p>
<h3 id="growth"><strong>Growth</strong></h3>
<p>According to <a target="_blank" href="https://messari.io/article/q1-2021-defi-review-defi-booms-as-bull-market-heats-up">Messari</a>, trading volumes on DEX’s have grown by over 8000% compared to 2020. DeFi users have increased by<a target="_blank" href="https://consensys.net/reports/defi-report-q1-2021/">10x and the supply of stable coins has increased 7x compared</a> to Q1 2020.</p>
<h3 id="institutional-interest"><strong>Institutional Interest</strong></h3>
<p>According to a <a target="_blank" href="https://www.fidelitydigitalassets.com/bin-public/060_www_fidelity_com/documents/FDAS/institutional-investor-study.pdf">survey by fidelity digital assets, </a>36% of 800 respondents say they are currently invested in digital assets, and 6 out of 10 believe digital assets have a place in their investment portfolio. In March, visa announced that payments can be settled through USDC.</p>
<p>While these statistics look impressive and might convince you that DeFi will soon give a hard time to traditional services, in reality, that may not be the case.</p>
<p>Keep in mind that we got these stats during a bull run and during these times all the institutions and everyone shows interest in crypto and the same people are nowhere to be found during bear times. Many of the projects such as AAVE, COMP, etc don’t have a long history and they matured during this bull run.
<a target="_blank" href="https://medium.com/coinmonks/crypto-trading-bot-c2ffce8acb2a"><strong>Best Free Crypto Trading Bots — Top 16 Bitcoin Trading Bot [2021]</strong>
<em>Best crypto trading bots for Binance, Coinbase, Kucoin, and other crypto exchanges in 2021. Quadency, Bitsgap…</em>medium.com</a></p>
<h2 id="challenges-in-defi">Challenges in DeFi</h2>
<p>Below are some problems which are stopping DeFi from becoming a viable solution.</p>
<h3 id="scams"><strong>Scams</strong></h3>
<p>Massive exit scams and rug pulls are common in DeFi and formed <a target="_blank" href="https://ciphertrace.com/2020-year-end-cryptocurrency-crime-and-anti-money-laundering-report/">99% </a>of all major fraud volume in the second half of 2020. Exit-scams and rug-pulls both involve insiders taking a majority of the user's and investors' funds. The difference is that rug pulls are initiated through a backdoor in smart contracts.</p>
<blockquote>
<h1 id="a-lot-of-times-users-are-aware-of-scams-but-they-still-go-through-with-the-hype-hoping-to-get-massive-gains-instantly-and-exiting">A lot of times users are aware of scams but they still go through with the hype hoping to get massive gains instantly and exiting.</h1>
</blockquote>
<h3 id="hacks">Hacks</h3>
<p>In 2019, the amount of DeFi hacks were negligible, but in 2020 that number grew to <a target="_blank" href="https://hacken.io/researches-and-investigations/biggest-defi-hacks-of-2020-report/">$100M </a>and we can expect this number to rise even more because of growth in value locked in DeFi. The most common method for the attack was flash loans, as they can be used to quickly influence the price and get away with a profit.</p>
<p>Most of the DeFi platforms are still fragile and a lot of times they are just a fork (copy) of popular projects with no active developer. These new platforms have lucrative rates which attract newcomers who think they have discovered the next big thing, only to be exploited by hackers.</p>
<h3 id="smart-contract-bugs">Smart Contract Bugs</h3>
<p><img src="https://cdn-images-1.medium.com/max/3068/1*vF7qh7A9m5bMSAORg8ruGQ.png" alt="[*Heatmap](https://cdn.hashnode.com/res/hashnode/image/upload/v1627479768645/mqE7v6EY2.html): world blockchain developers by country, 2018*" /><em>[</em>Heatmap](https://www.dappros.com/201809/blockchain-developers-worldwide-stats-absolute-vs-relative-to-population/): world blockchain developers by country, 2018**</p>
<p>Bugs and hacks go hand in hand as exploits are only made possible because of vulnerability in code. There are very few skilled developers relative to demand in blockchain space and these developers are creating the next asset management systems, exchanges, reliable data sources, and more.</p>
<p>I am a developer and I have tried learning solidity, and let me tell you, it’s not easy. The level of efficiency required to write valuable code is crazy. You need to make sure you are only storing valuable data in smart contracts or your clients would empty their pockets on just gas fees, and that’s just one example.</p>
<p>According to <a target="_blank" href="https://arxiv.org/pdf/1802.06038.pdf">research</a> conducted in 2018, 1 in 20 smart contracts is at risk for hacking.</p>
<h3 id="complexity">Complexity</h3>
<p>Forget DeFi, most people aren’t even aware of what blockchain is how it works. Only the tech-savvy can find their way around using metamask to cleverly allocate funds in lucrative protocols for maximum gains. If you have done this before you might think <em>‘What’s so hard in it, it's just a 5-minute job’</em></p>
<p>I agree. you don’t have to code anything, file paperwork for loans, or get permission. Using DeFi is pretty straight forward but because governments have done no job to spread the technology or even put clear regulations on it, people are scared to even learn the tech. In reality, DeFi is not complicated anymore at least for just earning interest on deposits.</p>
<p>There are varying risks involved with liquidity pools, farming, staking, etc and you need to understand the tech to use them but from the recent rise in meme coins and scams, it is clear that people are interested in crypto and DeFi, it’s just that not enough effort is being put to teach people about these topics.</p>
<h3 id="digital-divide">Digital Divide</h3>
<p>According to the <a target="_blank" href="https://consensys.net/reports/defi-report-q1-2021/">consensus annual DeFi report,</a> as of April 2021, there are 146 million unique Ethereum addresses, only <a target="_blank" href="https://cryptobriefing.com/wallets-holding-1-eth-hit-all-time-high-ethereum-crosses-500/#:~:text=Glassnode%20data%20shows%20that%201.170,since%20risen%20to%201.171%20million.">1.1 million</a> addresses have over 1 ETH, and surprisingly only 1% of them use DeFi. Out of those users, I bet most of them are tech enthusiasts or investors.</p>
<p>DeFi was meant to provide banking services to the unbanked, the needy, the helpless population of the society, instead, it's serving the rich. Around <a target="_blank" href="https://globalfindex.worldbank.org/sites/globalfindex/files/chapters/2017%20Findex%20full%20report_chapter2.pdf">31%</a> of the world is unbanked and most of them don’t have an internet connection or technical know-how to use DeFi.
<a target="_blank" href="https://medium.com/coinmonks/best-crypto-signals-telegram-5785cdbc4b2b"><strong>Best 6 Crypto Trading Signals Telegram Channels</strong>
<em>It is tedious to find the right crypto trading signals provider. So, in this article, we will be talking about the best…</em>medium.com</a></p>
<p>It turns out that DeFi is just a small fish in the ocean amongst big players. By 2022, it is estimated that the financial service market is expected to reach $26.5 Trillion. DeFi is still very new, and it’s certainly not a big deal for big institutions. Most of the institutions show interest in tech to get media attention and get their name on headlines.</p>
<p>I expect DeFi to get much safer, useful, and grow by 20x in the next 4 years as many of the third generation blockchain projects such as Ethereum 2.0, Cardano, Polkadot would become more efficient. 4 years after that, I expect DeFi to become mainstream and even integrated with central banking services. Of course, all of this is just my wild speculation.</p>
<p><em>You can check out my free curated list of resources on <a target="_blank" href="https://shubhpatni.gumroad.com/">Gumroad</a> to learn more about cryptocurrencies, or visit my <a target="_blank" href="https://y.at/%F0%9F%92%BB%F0%9F%8E%A5%E2%9C%8D%E2%98%95">socials</a>.</em></p>
]]></content:encoded></item><item><title><![CDATA[How I Increased My Productivity Using Spotify]]></title><description><![CDATA[Photo by Haithem Ferdi on Unsplash
Sometimes trying to be more productive makes you less productive. You get stuck in the content dungeon, trying to memorize/implement all the new laws and techniques out there. You watch videos about how to get the w...]]></description><link>https://blog.shubhpatni.com/how-i-increased-my-productivity-using-spotify-c02b2269dddf</link><guid isPermaLink="true">https://blog.shubhpatni.com/how-i-increased-my-productivity-using-spotify-c02b2269dddf</guid><category><![CDATA[technology]]></category><category><![CDATA[Productivity]]></category><category><![CDATA[General Programming]]></category><category><![CDATA[life]]></category><category><![CDATA[Self Improvement ]]></category><dc:creator><![CDATA[Shubh Patni]]></dc:creator><pubDate>Sun, 04 Jul 2021 23:49:56 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1627479815046/RUYgrrzCR.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><em>Photo by <a target="_blank" href="https://unsplash.com/@haithemfrd_off?utm_source=medium&amp;utm_medium=referral">Haithem Ferdi</a> on <a target="_blank" href="https://unsplash.com?utm_source=medium&amp;utm_medium=referral">Unsplash</a></em></p>
<p>Sometimes trying to be more productive makes you less productive. You get stuck in the content dungeon, trying to memorize/implement all the new laws and techniques out there. You watch videos about how to get the work done, instead of doing the work; you time-block the entire week when you are uncertain of tomorrow.</p>
<blockquote>
<h1 id="you-become-a-productivity-guru-without-actually-being-productive">You become a productivity guru without actually being productive.</h1>
</blockquote>
<p>I think that being productive should not be work in itself and hard to keep track of. You try too hard to be productive and end up doing nothing.</p>
<p>In this article, I will talk to you about a Spotify podcast (it’s more of a music playlist) that will take care of all your productivity problems. Yes, I am talking about a music app and suggesting it for productivity! I know it sounds absurd but hear me out.</p>
<blockquote>
<p>I am not sponsored by Spotify, the artist, or anyone to create this post.</p>
</blockquote>
<p>If you care little about the research behind the thing and technical details, check out <a target="_blank" href="https://open.spotify.com/show/4IssY4XjHXdpTNOzpaeyxh">**Flow State on Spotify</a>**, hosted by <a target="_blank" href="https://twitter.com/_bobbylyte">Bobby Lyte </a>— a DJ and producer. It consists of minimal, instrumental, electronic music. Below is a breakdown of why I like this podcast/playlist and the research behind the techniques used in the podcast.</p>
<h2 id="built-in-pomodoro">Built-in Pomodoro</h2>
<blockquote>
<p>The <a target="_blank" href="https://en.wikipedia.org/wiki/Pomodoro_Technique#:~:text=The%20Pomodoro%20Technique%20is%20a,length%2C%20separated%20by%20short%20breaks.">**Pomodoro Technique</a>** is a time management method developed by Francesco Cirillo in the late 1980s. The technique uses a timer to break down work into intervals, traditionally 25 minutes in length, separated by short breaks — definition from Wikipedia.</p>
</blockquote>
<p>Out of all the productivity techniques out there, the Pomodoro technique is probably the easiest to implement and has significant results. <a target="_blank" href="http://www.chriswinfield.com/40-pomodoro-workweek/">Chris Winfield</a>, a writer, and entrepreneur could get 40 hours of work done in 16.7 hours using this technique.</p>
<h3 id="25-minute-sessions">25-minute sessions</h3>
<p>Let’s see why the 25-minute sessions of Pomodoro are important.</p>
<ul>
<li><p><strong>Distractions — *</strong>According to psychologists Matthew A. Killingsworth and Daniel T. Gilbert of Harvard University,<a target="_blank" href="https://news.harvard.edu/gazette/story/2010/11/wandering-mind-not-a-happy-mind/#:~:text=On%20average%2C%20respondents%20reported%20that,student%20in%20psychology%20at%20Harvard."> people spend 46.9 percent of their waking hours </a>thinking about something other than what they’re doing.* Thoughts are one thing but nowadays we are surrounded by all sorts of visual and auditory cues which distract us from what really matters.</p>
</li>
<li><p><strong>Boredom —</strong> <em>According to<a target="_blank" href="https://www.tandfonline.com/doi/full/10.1080/02678373.2016.1206151"> research by Madelon L. M. and Edwin A. J</a>, employees with high work centrality are prone to experience diminished well-being as a consequence of boredom, whereas fulfilling one’s basic psychological needs on a daily basis after work mitigates these negative effects.</em></p>
</li>
<li><p><strong>Physical health — [*</strong>Three different studies](https://www.cochranelibrary.com/cdsr/doi/10.1002/14651858.CD010912.pub4/full#CD010912-sec1-0002)<strong> </strong>have shown that excessive time spent sitting at work may increase the risk of <a target="_blank" href="https://journals.lww.com/co-cardiology/Abstract/2011/09000/Prolonged_sitting__is_it_a_distinct_coronary_heart.8.aspx">cardiovascular</a> <a target="_blank" href="https://www.sciencedirect.com/science/article/abs/pii/S1440244013000522">disease</a>, obesity, diabetes, and all‐cause mortality.* Also, we all know that sitting for long can cause back and neck problems.</p>
</li>
</ul>
<p>The 25-minute sessions seize your attention and knowing that you will get a break afterward, motivates you to stay focused.</p>
<h3 id="5-minute-breaks">5-minute breaks</h3>
<p>You can use the 5-minute breaks between sessions in several ways depending on your situation.</p>
<ul>
<li><p><strong>Figuring out what to do — *</strong>According to a <a target="_blank" href="https://www.mckinsey.com/business-functions/organization/our-insights/decision-making-in-the-age-of-urgency#">McKinsey Survey</a>, on average, respondents spent 37 percent of their time making decisions, and more than half of this time was thought to be spent ineffectively*. A lot of times while working, we get stuck between to-do lists and take the mental toll of tasks we haven’t even begun.</p>
</li>
<li><p><strong>Exercise — </strong>If you are feeling tired of work or can hear your bones pop, then a little stretching is probably the best way to spend the break time.</p>
</li>
<li><p><strong>Reward — </strong>You can give yourself a reward such as a desert, or use Twitter or YouTube during the break — I would not recommend this because you may postpone your next session. Any form of reward will keep you motivated.</p>
</li>
</ul>
<p>The Pomodoro technique is the most common productivity technique out there because it works. The problem is the distraction caused by these Pomodoro timers which are usually on our phones, and once you touch your phone, your brain is simply hijacked by world-class marketers through notifications or our own temptation to check your feed. ‘<em>This will only take a few seconds’</em> turns into minutes or hours.</p>
<p><a target="_blank" href="https://open.spotify.com/show/4IssY4XjHXdpTNOzpaeyxh">Flow State</a> has a built-in Pomodoro timer. It consists of two 30 minute playlists of music followed by 5-minute breaks to allow you to plan your next session, reflect on your work, or do some stretching.</p>
<p>This is great because you won’t have to worry about the next song, set timers, and you can let go of all your tracking apps, timers, and music playlists. You just need to start the podcast and all the above is taken care of.</p>
<h3 id="binaural-beats">Binaural Beats</h3>
<p>The 5-minute break is a binaural sound wave to help you maintain focus. As mentioned earlier, during this break-time you can do several things to ease your mind, but I would recommend you to reflect on your work or plan for the next session. If you are tired, take a longer break.</p>
<p>As for the effectiveness of binaural beats, here’s what I could find-</p>
<blockquote>
<p>According to the <a target="_blank" href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC5233742/">research by L.S. Colzato</a>, high-frequency binaural beats did have a significant impact on the global precedence effect: the precedence effect became smaller, suggesting that visual attention became more focused than in the control condition.</p>
</blockquote>
<p>Global precedence effect means the global aspects of a scene or object in question are processed before the local aspects. If global precedence becomes small, it means the focus has increased.</p>
<p><em>I hope you found this post useful. Check out my <a target="_blank" href="https://youtube.com/channel/UCDXQNb3linY9EksWAvJhPyQ">YouTube Channel</a> or <a target="_blank" href="https://www.instagram.com/patnishubh/">Instagram</a> for more content.</em></p>
]]></content:encoded></item><item><title><![CDATA[Let’s Clear Up the Most Confusing Thing in CSS]]></title><description><![CDATA[I finally defeated my procrastination and sat in front of my computer to at last work on the one project I have been postponing for months: my website. I am not a web developer, but I’ve always wanted to craft my website from scratch. So I had to lea...]]></description><link>https://blog.shubhpatni.com/lets-clear-up-the-most-confusing-thing-in-css-dbea584ff523</link><guid isPermaLink="true">https://blog.shubhpatni.com/lets-clear-up-the-most-confusing-thing-in-css-dbea584ff523</guid><category><![CDATA[CSS]]></category><category><![CDATA[Frontend Development]]></category><category><![CDATA[Web Development]]></category><category><![CDATA[Programming Blogs]]></category><category><![CDATA[coding]]></category><dc:creator><![CDATA[Shubh Patni]]></dc:creator><pubDate>Mon, 21 Jun 2021 15:31:32 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1627480412102/MalMd80oj.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>I finally defeated my procrastination and sat in front of my computer to at last work on the one project I have been postponing for months: my website. I am not a web developer, but I’ve always wanted to craft my website from scratch. So I had to learn CSS.</p>
<p>While learning the art of making my UI look good and be more responsive, I encountered probably the most confusing thing in CSS: the <code>display</code> and <code>position</code> properties. These properties are quite useful because they make the UI elements more dynamic and responsive, so they are pretty important — but also one of the most daunting things I encountered.</p>
<p>To explain to you the <code>position</code> property, I will use the example below. The image below has five <code>&amp;lt;div&amp;gt;</code> blocks: The pink one has <code>parent</code> class and the others are <code>div1-div4</code> inside of it. I have not used the <code>position</code> property on any of them yet.</p>
<p>We will discuss each property one by one. Think of the below image and code as the default. For simplicity, instead of calling the elements <code>&amp;lt;div class=’div2’&amp;gt;</code>, I will just refer to their class name.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1627479820806/5OiMKf-oS.png" alt="This is what the below code looks like in the browser" /><em>This is what the below code looks like in the browser</em></p>
<pre><code class="lang-scss"><span class="hljs-selector-tag">body</span> {
    <span class="hljs-attribute">margin</span>: <span class="hljs-number">0</span>;
}
<span class="hljs-selector-class">.parent</span> {
    <span class="hljs-attribute">background-color</span>: <span class="hljs-number">#f68787</span>;
}
<span class="hljs-selector-tag">div</span> {
    <span class="hljs-attribute">color</span>: white;
    <span class="hljs-attribute">font-family</span>: <span class="hljs-string">'Poppins'</span>;
    <span class="hljs-attribute">font-weight</span>: bold;
    <span class="hljs-attribute">padding</span>: <span class="hljs-number">2em</span>;
}

<span class="hljs-selector-class">.div1</span> {
    <span class="hljs-attribute">background-color</span>: <span class="hljs-number">#743c08</span>;
}
<span class="hljs-selector-class">.div2</span> {
    <span class="hljs-attribute">background-color</span>: <span class="hljs-number">#df760b</span>;
}
<span class="hljs-selector-class">.div3</span> {
    <span class="hljs-attribute">background-color</span>: <span class="hljs-number">#f6b61e</span>;
}
<span class="hljs-selector-class">.div4</span> {
    <span class="hljs-attribute">background-color</span>: <span class="hljs-number">#f8a978</span>;
}
</code></pre>
<h2 id="position">Position</h2>
<p>Note: All the things on a website are placed relative to other elements. The navbar is usually relative to the viewport, elements inside a div are placed relative to the div, and so on.</p>
<blockquote>
<p>Here is my <a target="_blank" href="https://youtu.be/YmaSe-YtI5Q">YouTube video</a> on the position property.</p>
</blockquote>
<p>The <code>position</code> property in CSS determines how an element is positioned on the webpage relative to other elements. The <code>top</code>, <code>right</code>, <code>left</code>, <code>bottom</code>, and <code>z-index</code> values give the position to an element with a <code>position</code> property. This property can have the following values.</p>
<h3 id="static">static</h3>
<p>This is the default position for all the HTML elements. Elements with this value go with the flow of basic HTML and do not have any special privileges such as the <code>top</code>, <code>bottom</code>, <code>right</code>, <code>left</code>, or <code>z-index</code>; these are simply ignored even if you try to assign them.</p>
<pre><code class="lang-scss"><span class="hljs-selector-class">.div1</span> {
    <span class="hljs-attribute">background-color</span>: <span class="hljs-number">#743c08</span>;
    <span class="hljs-attribute">top</span>: <span class="hljs-number">400px</span>;
}
<span class="hljs-selector-class">.div2</span> {
    <span class="hljs-attribute">background-color</span>: <span class="hljs-number">#df760b</span>;
    <span class="hljs-attribute">left</span>: <span class="hljs-number">400px</span>;
}
<span class="hljs-selector-class">.div3</span> {
    <span class="hljs-attribute">background-color</span>: <span class="hljs-number">#f6b61e</span>;
    <span class="hljs-attribute">right</span>: <span class="hljs-number">400px</span>;
}
<span class="hljs-selector-class">.div4</span> {
    <span class="hljs-attribute">background-color</span>: <span class="hljs-number">#f8a978</span>;
    <span class="hljs-attribute">bottom</span>: <span class="hljs-number">400px</span>;
    <span class="hljs-attribute">z-index</span>: -<span class="hljs-number">2</span>;
}
</code></pre>
<p>The above code will have no effect because all the elements are <code>static</code> by default. So our output will look exactly like the default image.</p>
<h3 id="relative">relative</h3>
<pre><code class="lang-css"><span class="hljs-selector-class">.div1</span> {
    <span class="hljs-attribute">background-color</span>: <span class="hljs-number">#743c08</span>;
    <span class="hljs-attribute">position</span>: relative;
    <span class="hljs-attribute">top</span>: <span class="hljs-number">4em</span>;
    <span class="hljs-attribute">left</span>: <span class="hljs-number">3em</span>;
}
</code></pre>
<p>The <code>relative</code> property allows you to add <code>to</code>p, <code>botto</code>m, <code>right</code>, or <code>left</code> properties. The changes take place relative to the element as if it were <code>static</code>, i.e., the changes are made based on the element’s normal (static) position. Other elements are not affected and ignore the element with the relative property. You can use this property if you want to change the position of a particular element without affecting others.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1627479823040/V3SXy0kNl.png" alt="div1 moves relative to its static position" /><em>div1 moves relative to its static position</em></p>
<p>As you can see in the image, <code>&amp;lt;div1&amp;gt;</code> is <code>4em</code>away from the top and <code>3em</code> away from the left relative to its static position. All the other <code>divs</code> are not affected.</p>
<h3 id="fixed">fixed</h3>
<p>Elements with this property go out of the flow of the document and can display on top of everything if they have a higher z-index. This property positions the element relative to the page — a more accurate word would be <em>viewport**</em> **— and other elements are not affected. This is usually used to create a navbar.</p>
<pre><code class="lang-scss"><span class="hljs-selector-class">.div3</span> {
    <span class="hljs-attribute">background-color</span>: <span class="hljs-number">#f6b61e</span>;
    <span class="hljs-attribute">position</span>: fixed;
    <span class="hljs-attribute">top</span>: <span class="hljs-number">300px</span>;
    <span class="hljs-attribute">left</span>: <span class="hljs-number">400px</span>;
    <span class="hljs-attribute">z-index</span>: <span class="hljs-number">999</span>;
}
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1627479824570/bcmj0HnbN.png" alt="&lt;div3&gt; is fixed at 300px away from top and 400px away from left" /><em>&lt;div3&gt; is fixed at 300px away from top and 400px away from left</em></p>
<p>As you can see, <code>&amp;lt;div3&amp;gt;</code> is out of its parent element and other <code>&amp;lt;div&amp;gt;</code> elements behave as if it never existed.</p>
<h3 id="absolute">absolute</h3>
<p>This is the same as <code>fixed</code> except that the element is not positioned relative to the viewport but to the nearest element with any position value other than <code>static</code>. In simple terms, this is exactly as same as <code>fixed</code>, except now it’s relative to its nearest neighbor with a position property.</p>
<pre><code class="lang-scss"><span class="hljs-selector-tag">div</span> {
    <span class="hljs-attribute">color</span>: white;
    <span class="hljs-attribute">font-family</span>: <span class="hljs-string">'Poppins'</span>;
    <span class="hljs-attribute">font-weight</span>: bold;
    <span class="hljs-attribute">padding</span>: <span class="hljs-number">2em</span>;
    <span class="hljs-attribute">position</span>: relative;
}
<span class="hljs-selector-class">.div2</span> {
    <span class="hljs-attribute">background-color</span>: <span class="hljs-number">#df760b</span>;
    <span class="hljs-attribute">position</span>: absolute;
    <span class="hljs-attribute">bottom</span>: <span class="hljs-number">50px</span>;
    <span class="hljs-attribute">z-index</span>: <span class="hljs-number">9</span>;
}
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1627479832698/PgDlvM6zh.gif" alt="This gif shows the use of absolute position in CSS" /><em>This gif shows the use of absolute position in CSS</em></p>
<p>In the above gif, <code>&amp;lt;div2&amp;gt;</code> has an absolute position with <code>z-index: 9;</code> and <code>bottom:50px;</code>. Initially, the<code>position:relative;</code> part of the code in <code>&amp;lt;div&amp;gt;</code> is commented. When I uncomment it, <code>&amp;lt;div2&amp;gt;</code> is positioned 50px away from the bottom of the parent.</p>
<h3 id="sticky">sticky</h3>
<p>The <code>sticky</code> property behaves both as <code>fixed</code> and <code>relative</code>, and switches between them depending on the scroll value. This is one of those properties which you will have to see in action to understand. It is commonly used with large lists to keep the title on top when viewing list items.</p>
<p>To explain this property, I have added an unordered list in the code.</p>
<pre><code class="lang-scss"><span class="hljs-selector-tag">div</span> {
    <span class="hljs-attribute">color</span>: white;
    <span class="hljs-attribute">font-family</span>: <span class="hljs-string">'Poppins'</span>;
    <span class="hljs-attribute">font-weight</span>: bold;
    <span class="hljs-attribute">padding</span>: <span class="hljs-number">2em</span>;
    <span class="hljs-attribute">position</span>: sticky;
    <span class="hljs-attribute">top</span>: <span class="hljs-number">0</span>;
}
<span class="hljs-selector-tag">ul</span> {
    <span class="hljs-attribute">background-color</span>: white;
    <span class="hljs-attribute">color</span>: black;
    <span class="hljs-attribute">padding</span>: <span class="hljs-number">2em</span>;
    <span class="hljs-attribute">margin</span>: <span class="hljs-number">0</span>;
}
<span class="hljs-selector-tag">li</span> {
    <span class="hljs-attribute">margin</span>: <span class="hljs-number">1em</span> <span class="hljs-number">0</span>;
}
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1627479844660/fjlcMo0_U.plain" alt="The `stick`y property is commonly used with lists" /><em>The <code>stick</code>y property is commonly used with lists</em></p>
<p>In the above code, all the <code>&amp;lt;div&amp;gt;</code> elements have <code>position:sticky;</code> with <code>top:0;</code> . This means that all the <code>&amp;lt;div&amp;gt;</code> will be relative initially but when they touch the top, they turn to fixed. This is why it appears that they are replacing each other but they are on top of each other.</p>
<h2 id="display">Display</h2>
<p>The <code>display</code> property specifies how the rectangular block of an element will be rendered on the screen. Every element is a rectangle on the webpage, and this has neighboring rectangles. So put simply, the <code>display</code> property controls the width and height of an element, whether it will be displayed or not, and if it will have neighbors.</p>
<p>The <code>display</code> property has <a target="_blank" href="https://www.w3schools.com/cssref/pr_class_display.asp">many possible values</a>, so we will discuss the most common ones.</p>
<h3 id="inline">inline</h3>
<p>An element with this property can sit between other elements; they are not pushed to the next line. However, <strong>this does not allow you to set the width or height; these are simply ignored.</strong> <code>&amp;lt;span&amp;gt;</code> and <code>&amp;lt;a&amp;gt;</code> elements are <code>inline</code> by default.</p>
<h3 id="block">block</h3>
<p>An element with a <code>block</code> value does not allow any other element next to it. It takes the entire horizontal space it can possibly take if no width is set. This is useful when you want a heading or a div to take the entire space in a line. <strong>This is also used to give an element width and height.</strong> <code>&amp;lt;p&amp;gt;</code>, <code>&amp;lt;div&amp;gt;</code>, <code>&amp;lt;header&amp;gt;</code> elements are <code>display:block</code> by default.</p>
<h3 id="inline-block">inline-block</h3>
<p><code>inline-block</code> has benefits of both <code>inline</code> and <code>block</code>. With this value, you can set the width and height of an element and it stays in line with other elements. You can use this to place a div or an image between text. <code>&amp;lt;img&amp;gt;</code> is <code>inline-block</code> by default.</p>
<h3 id="none">none</h3>
<p>This property makes an element disappear completely from the webpage. <strong>The element does not become invisible; it is completely removed as if it never existed.</strong> This is used to hide certain elements from the mobile version of the webpage to compensate for the small screen size.</p>
<p>I hope that now you have a solid understanding of <code>position</code> and <code>display</code> properties in CSS.</p>
]]></content:encoded></item><item><title><![CDATA[Why I am Betting on Polkadot (DOT)]]></title><description><![CDATA[Bitcoin and Ethereum are probably the most used cryptocurrencies but they still face the three major issues that plague all the existing decentralized networks: Scalability, Interoperability, and Sustainability. These problems are the reason you stil...]]></description><link>https://blog.shubhpatni.com/why-i-am-betting-on-polkadot-dot-765a05aa1d4d</link><guid isPermaLink="true">https://blog.shubhpatni.com/why-i-am-betting-on-polkadot-dot-765a05aa1d4d</guid><category><![CDATA[Blockchain]]></category><category><![CDATA[Cryptocurrency]]></category><category><![CDATA[crypto]]></category><category><![CDATA[technology]]></category><category><![CDATA[tech ]]></category><dc:creator><![CDATA[Shubh Patni]]></dc:creator><pubDate>Sun, 13 Jun 2021 13:50:11 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1627479806629/qmRVkQHYV.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Bitcoin and Ethereum are probably the most used cryptocurrencies but they still face the three major issues that plague all the existing decentralized networks: <strong>Scalability, Interoperability, and Sustainability</strong>. These problems are the reason you still can’t escape from the clutches of Twitter, Instagram, or centralized financial options or why crypto is not yet mainstream.</p>
<p>There is one platform that claims to be a decentralized clone of Twitter — BitClout. But I still have some doubts and concerns over this platform and <a target="_blank" href="https://levelup.gitconnected.com/we-finally-have-a-decentralized-twitter-dd550dee86db">I have written about it.</a></p>
<p>There are many blockchain projects working on these issues, and one of the most promising ones is <a target="_blank" href="https://polkadot.network/technology/">Polkadot</a>. Polkadot aims to be a third-generation cryptocurrency and a hub for blockchain technologies to build on top of it. This means that the next Facebook or Twitter or hedge fund may build on top of it.</p>
<blockquote>
<h1 id="a-third-generation-blockchain-aims-to-solve-problems-such-as-scalability-interoperability-and-sustainability">A third-generation blockchain aims to solve problems such as scalability, interoperability, and sustainability<em>.</em></h1>
</blockquote>
<p>In one of my previous articles, I discussed why Cardano will become a third-generation cryptocurrency.
<a target="_blank" href="https://levelup.gitconnected.com/why-i-am-betting-on-cardano-ada-93e34ea59bda"><strong>Why I am Betting on Cardano (ADA)</strong>
<em>The crypto of the future</em>levelup.gitconnected.com</a></p>
<p>Let me present a similar case for Polkadot.</p>
<blockquote>
<p>Note — I am not a financial advisor and the contents of this post should not be considered as financial advice, they are merely my opinions. Please make any investments at your own risk.</p>
</blockquote>
<h2 id="the-team-and-development">The Team and Development</h2>
<p>Just as important as marketing is to take a shit coin project to the moon, a great team of developers is required to lift a project such as Polkadot. Dr. Gavin Wood, who co-founded Ethereum and created Solidity, Proof-of-Authority consensus, and Whisper, started Polkadot in 2016 along with Robert Habermeier and Peter Czaban.</p>
<p>Parity technologies and Web 3 Foundation are working on Polkadot and they have developed a framework called <strong>Substrate</strong> to ease the development of blockchains.</p>
<p><a target="_blank" href="https://www.parity.io/substrate/">Substrate</a> is a framework to allow developers to create their own blockchain without caring about intricate details such as scalability, interoperability, and governance issues. It runs in Web assembly and is implemented using Rust and JavaScript.</p>
<blockquote>
<p>In Polkadot cofounder <a target="_blank" href="https://www.parity.io/a-brief-summary-of-everything-substrate-polkadot/">Robert Habermeier’s</a> words, Substrate is, “a set of libraries for doing all the things that are really annoying about writing blockchains.”</p>
</blockquote>
<h2 id="scalability">Scalability</h2>
<p><img src="https://cdn-images-1.medium.com/max/11910/0*CfwaQWVzesTWHPjE" alt="Photo by [Marc-Olivier Jodoin](https://cdn.hashnode.com/res/hashnode/image/upload/v1627479801327/6Ok26bzPb.html) on [Unsplash](https://unsplash.com?utm_source=medium&amp;utm_medium=referral)" /><em>Photo by <a target="_blank" href="https://unsplash.com/@marcojodoin?utm_source=medium&amp;utm_medium=referral">Marc-Olivier Jodoin</a> on <a target="_blank" href="https://unsplash.com?utm_source=medium&amp;utm_medium=referral">Unsplash</a></em></p>
<p>Scalability is an essential component to make any blockchain network or even any startup successful. Scalability in decentralized networks consists of Transactions Per Second (TPS), network bandwidth, and data storage. For TPS, there is a common benchmark in the industry, of around 24000 TPS, set by VISA.</p>
<p>But blockchain networks of the future would not only work with daily transactions, they would also have to serve communication, stream content, and provide all sorts of online services which would require much higher TPS, storage, and bandwidth.</p>
<blockquote>
<h1 id="internet-has-already-solved-scalability-issues-and-thus-will-always-be-preferred-by-most-of-the-population-who-are-not-paranoid-about-privacy">Internet has already solved scalability issues and thus will always be preferred by most of the population who are not paranoid about privacy.</h1>
</blockquote>
<p>Let’s look at how Polkadot solves scalability.</p>
<p>Polkadot has a multichain framework that supports independent blockchain networks called <a target="_blank" href="https://wiki.polkadot.network/docs/en/learn-parachains">**Parachains</a><strong>. These parachains are coordinated by the main chain called the [</strong>Relay Chain**,](https://wiki.polkadot.network/docs/en/learn-architecture#relay-chain) which provides consensus to the entire platform through a set of validators.</p>
<blockquote>
<p>Parachains are independent blockchain networks created using the substrate framework. These networks can have their own token, governance, and specific use cases to attract developers and projects for specific applications.</p>
</blockquote>
<p>There will be around 100 parachain slots which will be auctioned and leased. As these parachains are their own specific blockchains for specific applications, they can run in parallel. These parachains will host several DApps on top of them; a parachain for DeFi will have DeFi projects, an NFT parachain will host games, digital assets, etc. <strong>This three layer architecture provides scalability.</strong></p>
<p><em>But there are still a few problems.</em></p>
<ul>
<li><p>First, there are limited parachain slots</p>
</li>
<li><p>Second, these slots are not economically feasible for everyone.</p>
</li>
</ul>
<p><strong>Enter <a target="_blank" href="https://wiki.polkadot.network/docs/en/learn-parathreads">Parathreads</a>.</strong></p>
<p>Parathreads enjoy the same technical and security benefits as parachains but have a different economic model. Parathreads have a fixed registration fee much lower than the cost of acquiring a parachain slot, but they must compete for the inclusion of each block through economical means, similar to how Ethereum currently works.</p>
<h2 id="interoperability">Interoperability</h2>
<p><img src="https://cdn-images-1.medium.com/max/10944/0*91_xdPiCmBkAcNq1" alt="Photo by [Priscilla Du Preez](https://cdn.hashnode.com/res/hashnode/image/upload/v1627479802785/-09tzMdi2.html) on [Unsplash](https://unsplash.com?utm_source=medium&amp;utm_medium=referral)" /><em>Photo by <a target="_blank" href="https://unsplash.com/@priscilladupreez?utm_source=medium&amp;utm_medium=referral">Priscilla Du Preez</a> on <a target="_blank" href="https://unsplash.com?utm_source=medium&amp;utm_medium=referral">Unsplash</a></em></p>
<p>The scalability issues in blockchain networks give rise to another problem: <strong>interoperability</strong>. <em>How?</em></p>
<p>Well, as a blockchain network grows it attracts more developers and projects to it because of an increase in security and networking effects. But because there are limited resources in any network, the fee to operate in such a system increases, the prime example is the Ethereum gas fee. This means that there cannot be a <em>‘winner take all’</em> blockchain network.</p>
<p>Secondly, each blockchain platform such as Cardano, Polkadot, Ethereum, and others have their own philosophy which can be seen through their own implementation of consensus algorithm, economic incentives, and governance. So, developers would choose a network that aligns with their values.</p>
<blockquote>
<h1 id="thus-blockchain-networks-must-be-interoperable-to-communicate-with-each-other-and-the-centralized-world-to-transfer-all-kinds-of-data">Thus blockchain networks must be interoperable to communicate with each other and the centralized world to transfer all kinds of data.</h1>
</blockquote>
<p>Let’s see how Polkadot solves this problem.</p>
<p>In Polkadot, there are two types of bridges. <a target="_blank" href="https://wiki.polkadot.network/docs/en/learn-bridges">Substrate-based bridges</a> facilitate bi-directional communication between prarachain, parathreads, and other blockchains built using the substrate. Parity technologies are heading the development of this bridge.</p>
<p>The <a target="_blank" href="https://web3.foundation/grants/">Web3 Foundation</a> is giving grants to projects to build cross-chain bridges for Polkadot. <a target="_blank" href="https://interlay.io/">**Interlay</a><strong> is working on a trustless bridge from Bitcoin to Polkadot which would open up DeFi opportunities for Bitcoin in Polkadot ecosystem. [</strong>Snowfork](http://www.snowfork.com/)<strong> is working on a bridge for Ethereum to facilitate the cross-chain transfer of assets and data, from ERC-20 tokens to smart contracts. There are other projects such as [</strong>ChainX](https://chainx.org/)<strong>, [</strong>Bifrost](https://thebifrost.io/)<strong>, [</strong>Darwinia](https://darwinia.network/)<strong>, and [</strong>Centrifuge](https://centrifuge.io/)**, working on their own bridges for all kinds of solutions.</p>
<p>There are a few other cryptocurrency projects trying to connect the decentralized and centralized world. A major one is Chainlink.
<a target="_blank" href="https://levelup.gitconnected.com/centralized-and-decentralized-systems-finally-get-chained-ba702dea972"><strong>Centralized and Decentralized Systems Finally Get ‘Chained’</strong>
<em>What is Chainlink and how it differs from other crypto-currencies</em>levelup.gitconnected.com</a></p>
<h2 id="sustainability">Sustainability</h2>
<p><img src="https://cdn-images-1.medium.com/max/11520/0*M6C-Z8hnytjXjeqL" alt="Photo by [kazuend](https://cdn.hashnode.com/res/hashnode/image/upload/v1627479804849/leBZQWA_z.html) on [Unsplash](https://unsplash.com?utm_source=medium&amp;utm_medium=referral)" /><em>Photo by <a target="_blank" href="https://unsplash.com/@kazuend?utm_source=medium&amp;utm_medium=referral">kazuend</a> on <a target="_blank" href="https://unsplash.com?utm_source=medium&amp;utm_medium=referral">Unsplash</a></em></p>
<p>The last piece of the puzzle is Sustainability. <em>How do you make a blockchain network self-sufficient, beyond a certain group of developers and founders?</em></p>
<p>For a decentralized network, sustainability is way more important than you think. People use these systems to escape from centralized dictatorship thus a well-designed governance model, economic incentives, and security is essential.</p>
<p>For security, Polkadot has nominators, validators, collators, fishermen, and all sorts of protocols. Let’s discuss them in brief.</p>
<p><a target="_blank" href="https://wiki.polkadot.network/docs/en/learn-nominator">**Nominators</a> **elect validators to secure the relay chain. Let’s say you have some DOT tokens and you want to put them for work, but you don’t want to set up a node. You can pick a few validators and stake your DOT. The rewards/penalties will be shared by you and the validator.</p>
<p><a target="_blank" href="https://wiki.polkadot.network/docs/en/learn-validator">**Validators</a> <strong>secure the relay chain and provide consensus by</strong> **validating proofs provided by collators. There can be a maximum of 1000 validators and you need 1.7 M DOTS ($34 M) to become a validator.</p>
<p><a target="_blank" href="https://wiki.polkadot.network/docs/en/learn-collator">**Collators</a> **maintain a full-node for the Relay chain and their specific parachain. They collect the parachain transactions and create a block candidate. These are basically miners who process each transaction.</p>
<p><a target="_blank" href="https://wiki.polkadot.network/docs/en/learn-availability#fishermen">**Fishermen</a> **look for bad actors and invalid state transitions. They report on any misconduct by the parachain and receive tokens if proven correct, but risk losing their stake if proven wrong.</p>
<p><a target="_blank" href="https://wiki.polkadot.network/docs/en/learn-governance">Governance</a> in Polkadot is very complicated, so I’ll try to keep it as simple as possible.</p>
<blockquote>
<p>Polkadot has a <a target="_blank" href="https://wiki.polkadot.network/docs/en/learn-governance">council which governs the network</a>, and every change must go through them. There can be 24 council members and each needs around 11 million DOTS ($220 million)</p>
</blockquote>
<p>Anyone can propose a solution to the committee, but there are several roadblocks. The proposer must put a few DOTs as bond and if the proposal is rejected, all those who voted yes, would lose their bond to treasury. Any council member can veto the proposal, thus you lost the DOTs. In case it passes, if the technical committee deems it as harmful to network, you guessed it, your DOTs are gone.</p>
<p>These governance issues plague a lot of POS chains and Polkadot is no different. I don’t like the governance model of Polkadot, and it obviously favors the rich. This will make the chain more centralized and riskier. Regardless, I think Polkadot has an amazing team and clever ideas which can make the network successful.</p>
<p><em>You can check out my free curated list of resources on <a target="_blank" href="https://shubhpatni.gumroad.com/">Gumroad</a> to learn more about cryptocurrencies, or visit my <a target="_blank" href="https://y.at/%F0%9F%92%BB%F0%9F%8E%A5%E2%9C%8D%E2%98%95">socials</a>.</em></p>
<h2 id="resources-and-references">Resources and References</h2>
<p><a target="_blank" href="https://medium.com/polkadot-network/polkadot-substrate-and-ethereum-f0bf1ccbfd13"><strong>Polkadot, Substrate and Ethereum</strong>
<em>Ever since the release of the Polkadot paper three years ago, we knew that bridging with the Ethereum ecosystem to help…</em>medium.com</a>
<a target="_blank" href="https://wiki.polkadot.network/docs/en/learn-governance"><strong>Governance · Polkadot Wiki</strong>
<em>Polkadot uses a sophisticated governance mechanism that allows it to evolve gracefully over time at the ultimate behest…</em>wiki.polkadot.network</a>
<a target="_blank" href="https://medium.com/polkadot-network/polkadot-bridges-connecting-the-polkadot-ecosystem-with-external-networks-1118916392e3"><strong>Polkadot Bridges — Connecting the Polkadot Ecosystem with External Networks</strong>
<em>Web 3.0, the next generation of the internet, has been envisioned as a fully functional and user-friendly web where our…</em>medium.com</a>
<a target="_blank" href="https://polkadot.network/technology/"><strong>Polkadot Network</strong>
<em>Any type of data across any type of blockchain Polkadot is a network protocol that allows arbitrary data-not just…</em>polkadot.network</a></p>
<p><a target="_blank" href="http://Here’s Why Polkadot Will Fail?">Pro vs Cons: Here’s Why Polkadot Will Fail?</a></p>
]]></content:encoded></item><item><title><![CDATA[We Finally Have a Decentralized Twitter]]></title><description><![CDATA[Credit: Author and Alexander Shatov on Unsplash
It is pretty clear that existing social media platforms suck. So, we need something which is controlled by the community, something which is aligned with the needs of users. If you are not convinced, be...]]></description><link>https://blog.shubhpatni.com/we-finally-have-a-decentralized-twitter-dd550dee86db</link><guid isPermaLink="true">https://blog.shubhpatni.com/we-finally-have-a-decentralized-twitter-dd550dee86db</guid><category><![CDATA[Twitter]]></category><category><![CDATA[Blockchain]]></category><category><![CDATA[Cryptocurrency]]></category><category><![CDATA[technology]]></category><dc:creator><![CDATA[Shubh Patni]]></dc:creator><pubDate>Tue, 25 May 2021 14:53:02 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1627479795905/yAc7ixUK1D.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><em>Credit: Author and <a target="_blank" href="https://unsplash.com/@alexbemore?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Alexander Shatov</a> on <a target="_blank" href="https://unsplash.com/s/photos/twitter?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></em></p>
<p>It is pretty clear that existing social media platforms suck. So, we need something which is controlled by the community, something which is aligned with the needs of users. If you are not convinced, below is a brief rundown of problems with current social media platforms.</p>
<p>For over a decade, centralized social media have reined control over our digital lifestyles; Twitter can ban whichever account it pleases, Facebook can sell our data to anyone it wishes, and YouTube can bend the rules of monetization whenever it sees fit.</p>
<blockquote>
<h1 id="from-privacy-to-the-economic-aspects-of-our-digital-life-social-media-platforms-can-makebend-the-rules">From privacy to the economic aspects of our digital life, social media platforms can make/bend the rules</h1>
</blockquote>
<p>Existing social media platforms’ incentives are in stark contrast with those of the users.</p>
<ul>
<li><p>Social Media platforms rely heavily on advertisements for their revenue (users hate ads)</p>
</li>
<li><p>To attract advertisers, social media platforms create a digital copy of each individual to predict their needs for more ad clicks. (users want privacy)</p>
</li>
</ul>
<p>You might ask, <em>Why not just leave the platform and move to another one?</em></p>
<p><strong>Networking Effects — </strong>if you move to another platform, you need to start from zero; You need to gather your followers, likes, and reputation on a completely new platform with fewer users. No one wants to be in a complete ghost town with no friends.</p>
<p><strong>Barrier to Entry — </strong>the barrier to entry is immense. Any new idea is quickly copied or acquired by the giants. You probably know that Facebook acquired Instagram, but no one remembers that Snapchat introduced the concept of stories which was quickly copied by Instagram and then almost all social media platforms.</p>
<p>Therefore, just a handful of social media platforms exist and a few control the market. Let’s see if decentralized social media is any better.</p>
<h2 id="bitclout-decentralized-twitter">BitClout: Decentralized Twitter</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1627479790674/DZBNiNHXV.png" alt="Screenshot" /><em>Screenshot</em></p>
<p>BitClout is the first popular decentralized social media with the same look and feel as Twitter. It aims to give as much power to the community as possible and a handful of individuals, or even the creator himself, can not solely influence the platform.</p>
<blockquote>
<p>Before we start with the crypto, let me tell you I am no financial advisor and the contents of this post should not be considered as financial advice, they are merely my opinions. Please make any investments at your own risk.</p>
</blockquote>
<p>BitClout has its own native cryptocurrency called $BitClout which is used to purchase secondary currency on the platform called <strong>Creator Coins. </strong>There also exists a diamond button to easily pay creators if you more than just ‘<em>liked’ </em>their content.</p>
<h2 id="what-are-creator-coins"><strong>What are Creator Coins</strong></h2>
<p>Every account on the platform has its own currency called creator coins represented by the name of the creator. The value of this currency is determined by an exponential function. We will discuss this later. First, let's address the obvious question — <em>‘Why would I buy any creator coins or Why would anyone buy my coin?’</em></p>
<p>In theory, creator coins are intended to represent the trustworthiness or the reputation of an individual. This means that if a creator, VC, entrepreneur, or any user is creating value for its followers, the value of their currency should go high as more people would be willing to bet on them. You can even purchase your own currency to show that you are on the platform for the long term and would provide value to the token holders.</p>
<blockquote>
<p>Again, above is the intended purpose of the creator coins. The platform is very new, so no one knows how people would find ways to plummet or skyrocket the value of any token.</p>
</blockquote>
<p><strong>Existing uses of creator coins:</strong></p>
<ul>
<li><p>People are building software products that require users to hold certain creator coins to use the service</p>
</li>
<li><p>Creator coins works as a marketing strategy to gain followers in return for diamonds</p>
</li>
<li><p>Speculate on a creator’s success</p>
</li>
<li><p>Giveaway of an NFT or anything to the latest/most/longest token holder</p>
</li>
</ul>
<p><strong>Potential use cases</strong></p>
<ul>
<li><p>Creators can unclutter their inbox by only allowing messages from individuals with the most tokens</p>
</li>
<li><p>Creators can hold an AMA session for the largest token holders</p>
</li>
<li><p>Tokens can be used as a sponsorship payment for retweets, posts, etc</p>
</li>
<li><p>Creator coins can function as funding for new projects</p>
</li>
</ul>
<h3 id="the-risk-you-take">The Risk You Take</h3>
<p>Before you pour every dollar into the platform, here are a few things you need to consider-</p>
<ul>
<li><p>The founders of BitClout are anonymous.</p>
</li>
<li><p>You cannot cash out BitClout to BitCoin and out of the platform, so it is a closed-loop.</p>
</li>
<li><p>There are legal concerns surrounding BitClout and how it functions.</p>
</li>
</ul>
<p>With that said, I personally have a <a target="_blank" href="https://bitclout.com/u/PatniShubh">BitClout account</a>, and I have bought some creator coins. This is because there are people like Balaji S (former CTO Coinbase), Fred Wilson (VC) Chamath P (CEO Social Capital) who have invested in the platform and are using it. Please do your own research before making any decisions.</p>
<h3 id="value-of-creator-coins">Value of Creator Coins</h3>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1627479792716/SKOSjcA59.png" alt /></p>
<p><img src="https://cdn-images-1.medium.com/max/3244/1*JSNWOT96fCSTyN5ekU-hVg.png" alt="Source: [BitClout](https://cdn.hashnode.com/res/hashnode/image/upload/v1627479794482/wTa0PCYJA.html)" /><em>Source: <a target="_blank" href="https://docs.bitclout.com/">BitClout</a></em></p>
<p>The value of creator coins is determined by the formula — <code>*price*_*in*_*bitclout*=.003×*creator*_*coins*_*in*_*circulation2</code> &lt;- (that 2 is squared)*</p>
<p>As you can see from the graph and the formula, the value of creator coins grows exponentially as more coins are held in the wallet. Initially, all accounts have zero coins and more are minted as users or the creator buys them. The value of the coin is determined by the quantity as per the graph above.</p>
<p>When a user buys creator coins, the value is locked into that profile and a sell action takes this value out of the profile. All of this happens in accordance with the curve, thus the value of coin goes up or down.</p>
<blockquote>
<h1 id="creator-coins-create-a-positive-sum-game-which-benefits-both-the-creator-and-their-follower-who-supported-and-believed-in-their-work">Creator coins create a positive sum game which benefits both the creator and their follower who supported and believed in their work</h1>
</blockquote>
<p><strong>Founder Rewards</strong></p>
<p>Founder rewards are associated with the account of the creator coin. When any user buys the creator coins, a certain percentage of the coin goes to the creator. This is called founder rewards. You can set founder rewards to 100% if you are charging for a service so that the total purchase amount goes to you, or you can set it to around 8% to encourage people to buy your coin.</p>
<p>This is just the tip of the iceberg. BitClout is decentralized and its code is publically available. All the data in BitClout can be accessed by anyone to create more products, features, or data analysis. In legacy social media platforms, the central authority solely controls all of this information and can misuse it for their personal benefit.</p>
<p>There are more possibilities than we can discuss here. This is literally a digital currency tied to an individual. They can decide how it operates and how users use it.</p>
<p><em>You can check out my free curated list of resources on <a target="_blank" href="https://shubhpatni.gumroad.com/">Gumroad</a> to learn more about cryptocurrencies, or visit my <a target="_blank" href="https://y.at/%F0%9F%92%BB%F0%9F%8E%A5%E2%9C%8D%E2%98%95">socials</a>.</em></p>
]]></content:encoded></item><item><title><![CDATA[5 Exciting Projects in the Polkadot Ecosystem]]></title><description><![CDATA[As the gas fees continue to plague the Ethereum ecosystem, many projects are finding refuge in other smart contract platforms, such as Binance Smart Chain, Polkadot, etc. I will not argue about the Ethereum gas fee being a security mechanism or how o...]]></description><link>https://blog.shubhpatni.com/5-exciting-projects-in-the-polkadot-ecosystem-2e2d0d657e3e</link><guid isPermaLink="true">https://blog.shubhpatni.com/5-exciting-projects-in-the-polkadot-ecosystem-2e2d0d657e3e</guid><category><![CDATA[Blockchain]]></category><category><![CDATA[Cryptocurrency]]></category><category><![CDATA[technology]]></category><category><![CDATA[Smart Contracts]]></category><dc:creator><![CDATA[Shubh Patni]]></dc:creator><pubDate>Mon, 17 May 2021 11:58:36 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1627479783704/da6kmjgK9.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>As the gas fees continue to plague the Ethereum ecosystem, many projects are finding refuge in other smart contract platforms, such as Binance Smart Chain, Polkadot, etc. I will not argue about the Ethereum gas fee being a security mechanism or how other networks have security tradeoffs. The fact is, the jungle is too big for a single lion and Polkadot is another contender.</p>
<p>In this article, we will look at some projects coming into the Polkadot ecosystem which I think are here to stay.</p>
<blockquote>
<p><em>I am not affiliated with any projects listed in the article nor I advise you to invest in them, I just want to share them with you and help you make your own decision. All price data is taken from <a target="_blank" href="https://www.coingecko.com/en">coingecko</a>.</em></p>
</blockquote>
<h2 id="chainx-pcx">ChainX (PCX)</h2>
<p><a target="_blank" href="https://chainx.org/">ChainX </a>is a bridge built on substrate and one of the oldest projects in the dot ecosystem. It is the layer 2 solution for Bitcoin with an aim to make Bitcoin more useful by providing smart contracts, a faster payment channel, and DeFi through a synthetic version of Bitcoin called<strong> XBTC</strong>.</p>
<p>ChainX is also a cross-chain bridge for any blockchain to the dot ecosystem. Moreover, it would also facilitate inter-chain communication for different chain assets and the X-Tokens.</p>
<p>Put simply, ChainX has 4 modules to perform the mentioned operations-</p>
<ul>
<li><p><strong>PCX Module — </strong>It takes care of staking, payment of fees, on-chain governance, distribution of inter-chain mining rewards, and backing bitcoin financial derivatives.</p>
</li>
<li><p><strong>DEX Module — </strong>This is a cross-chain transaction module to circulate assets on different chains for minimum costs.</p>
</li>
<li><p><strong>Inter-Chain Module — </strong>This is a gateway for different chain assets and X-Token. It mainly includes an inter-chain transaction verification system, an on-chain mintage program, and a deposit and withdrawal program for X-Tokens.</p>
</li>
<li><p><strong>Relay Module — </strong>This is an information exchange and verification system between ChainX and outside chains. It mainly consists of a chain information update program, chain monitor program, and inter-chain information collection and transmission program.</p>
</li>
</ul>
<p><strong>Current Price /Market Cap — $10.15/$103,196,028</strong></p>
<p><strong>Circulating/Total Supply — 10,167,800 / 21,000,000</strong></p>
<h2 id="reef-finance-reef">Reef Finance (REEF)</h2>
<p><a target="_blank" href="https://reef.finance/">Reef finance</a> is a DeFi platform with access to liquidity from CEXs and DEXs and blockchain networks such as Ethereum, Avalanche, and others outside Polkadot.</p>
<blockquote>
<p>Reef uses an AI-driven personalized engine called <strong>Reef Yeld Engine</strong> to provide customized DeFi investments for users with varying risk tolerance and requirements.</p>
</blockquote>
<p>Reef recently introduced the first DeFi blockchain called reef chain on substrate framework. This would provide a hub for DeFi projects to build on. Reef chain is also an EVM-compatible chain with functionality to port your existing solidity project from Ethereum to Reef chain without changing any code.</p>
<p>Reef Token is the native currency on Reef Chain for transaction fees and on-chain governance. The token is also available as an <strong>ERC-20</strong> token on Ethereum and BSC with a 1:1 with the native token.</p>
<p><strong>Current Price /Market Cap — $0.041/$519,695,842</strong></p>
<p><strong>Circulating/Total Supply — 12,666,667,338 / 20,000,000,000</strong></p>
<blockquote>
<p>Also Read: <a target="_blank" href="https://blog.coincodecap.com/coinbase-card-review">Coinbase Card Review</a></p>
</blockquote>
<h2 id="phala-pha">Phala (PHA)</h2>
<p><a target="_blank" href="https://phala.network/">Phala Network</a> is a privacy-preserving cloud computing service that offers computing power similar to traditional cloud services but with the additional security of <strong>Trusted Execution Environments (TEE) </strong>Hybrid Blockchain Architecture where developers can deploy their smart contracts.</p>
<blockquote>
<p><a target="_blank" href="https://www.trustonic.com/technical-articles/what-is-a-trusted-execution-environment-tee/">**Trusted Execution Environments</a>** run on CPU but outside of operating system and main memory. TEE holds its own cryptographic keys and only allows data from third party which meet its security criteria.</p>
</blockquote>
<p>PHA token has several use cases-</p>
<ul>
<li><p>Phala CPU miners must stake 1,620 PHA/core which could be slashed in case of misbehavior. This is to ensure security.</p>
</li>
<li><p>PHA also functions as a governance token that must be staked to take part in Phala DAO.</p>
</li>
<li><p>PHA tokens are used to purchase network resources such as trusted computing resources, on-chain/off-chain computing, and storage.</p>
</li>
<li><p>Settlements for other services or products such as Web3 Analytics, cross-chain bridges for permission-less chains, and trading protocols.</p>
</li>
</ul>
<p><strong>Current Price /Market Cap — $0.94/$164,883,953</strong></p>
<p><strong>Circulating/Total Supply — 177,634,380 / 1,000,000,000</strong></p>
<h2 id="ocean-protocol-ocean">Ocean Protocol (OCEAN)</h2>
<p>The value of data is reaching new highs each day and with that, corporations are doing everything in their power to control and misuse it for their own benefit. Ocean protocol aims to give users control over their data and how it is used by using a decentralized blockchain.</p>
<p>Ocean Protocol has two main products-</p>
<ul>
<li><p><strong>Data Ecosystem Platform —</strong> It comprises tools such as Ocean blockchain, smart contracts, and software development kits, to allow owners to upload their data, retain control over it, and monetize it to buyers.</p>
</li>
<li><p><strong>Decentralized Data Marketplace — </strong>It consists of two marketplaces: Enterprise and Community, to meet the needs of clients in healthcare, logistics, mobility, etc, and the wider community.</p>
</li>
</ul>
<p>The OCEAN token is used to stake, buy, and sell data, and govern community funding.</p>
<p><strong>Current Price /Market Cap — </strong>$1.19/$503,421,403</p>
<p><strong>Circulating/Total Supply — </strong>426,026,836 / 1.41b</p>
<h2 id="kusama-ksm">Kusama (KSM)</h2>
<p>Kusama needs no introduction, thus I kept it for the last. It is the cousin of Polkadot built on nearly the same code base. It is an experimental development environment for teams/developers to prepare for Polkadot. It is used for research and development and as a testbed for Polkadot.</p>
<p>Kusama has two blockchains: relay chain and parachains. In the relay chain, the transactions are permanent, much like Polkadot, and parachains are customizable and can use relay chains for additional security. This allows projects to attract users and gain traction before their official launch on Polkadot.</p>
<p>KSM token can be used for network validation, nominate validators, bond parathreads or parachains, and network governance.</p>
<p><strong>Current Price /Market Cap — </strong>$524.38/$4,707,988,360</p>
<p><strong>Circulating/Total Supply — </strong>8,980,098 / 10,000,000</p>
<p>These were the few projects building on Polkadot which I think have huge potential. I don’t think Polkadot is the only solution and that it will thrash the competition.</p>
<p>There are other networks, of course, such as Cardano, Avalance, Solana, Atom, and Binance Chain which are also trying to solve the three major problems: Scalability, Interoperability, and Sustainability. These platforms have their own benefits and also attract amazing projects.</p>
<p><em>You can check out my free curated list of resources on <a target="_blank" href="https://shubhpatni.gumroad.com/">Gumroad</a> to learn more about cryptocurrencies, or visit my <a target="_blank" href="https://y.at/%F0%9F%92%BB%F0%9F%8E%A5%E2%9C%8D%E2%98%95">socials</a>.</em>
<a target="_blank" href="https://levelup.gitconnected.com/why-i-am-betting-on-cardano-ada-93e34ea59bda"><strong>Why I am Betting on Cardano (ADA)</strong>
<em>The crypto of the future</em>levelup.gitconnected.com</a>
<a target="_blank" href="https://medium.com/coinmonks/these-5-cryptocurrency-projects-may-surpass-bitcoin-701159358886"><strong>These 5 Cryptocurrency Projects May Surpass Bitcoin</strong>
<em>These projects will lead the crypto industry</em>medium.com</a>
<a target="_blank" href="https://medium.com/coinmonks/how-to-make-money-with-eth2-0-f33cda3fb915"><strong>How to Make Money With ETH2.0</strong>
<em>Hold, Stake, DeFi</em>medium.com</a></p>
]]></content:encoded></item><item><title><![CDATA[5 Python Practices To Take Your Skills to the Next Level]]></title><description><![CDATA[Python is one of the most powerful beginner’s programming languages. It has a large development community and loads of frameworks for all sorts of applications.
If you are a self-taught programmer like me, who makes many projects just for fun, you ma...]]></description><link>https://blog.shubhpatni.com/5-python-practices-to-take-your-skills-to-the-next-level-8d5c0f51f90a</link><guid isPermaLink="true">https://blog.shubhpatni.com/5-python-practices-to-take-your-skills-to-the-next-level-8d5c0f51f90a</guid><category><![CDATA[Python]]></category><category><![CDATA[Programming Blogs]]></category><category><![CDATA[General Programming]]></category><category><![CDATA[Programming Tips]]></category><category><![CDATA[coding]]></category><dc:creator><![CDATA[Shubh Patni]]></dc:creator><pubDate>Thu, 13 May 2021 14:48:19 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1627479600307/z_ddg1HJY.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Python is one of the most powerful beginner’s programming languages. It has a large development community and loads of frameworks for all sorts of applications.</p>
<p>If you are a self-taught programmer like me, who makes many projects just for fun, you may be accustomed to using Python as a functional programming language — just hundreds of plain old functions in a file for everything. But if you work on a similar or big project, you need to retype the thing again or copy it, if you still remember where you wrote it. Plus, there is a lot of advanced Python stuff that can make stuff much easier to code and read.</p>
<p>Therefore, you need to up your game and learn more about Python. I have used real-world examples from my Django project because a lot of tutorials talk about fruits, animals, cars, etc., to explain classes that are easier to understand but confusing in actual development.</p>
<h2 id="classes-and-inheritance">Classes and Inheritance</h2>
<p>This is the most obvious one, and you probably already know Object Oriented Programming (OOP) if you are coming from another programming language, but let’s get started with the obvious one.</p>
<p>Classes work as a template that you can reuse in multiple projects. Instantiation (creating objects from classes) allows you to replicate the functionality of code written inside the classes as many times as you like.</p>
<p><strong>Why use classes?</strong></p>
<p>It is much easier to handle class variables across functions that operate on a related thing. We can use inheritance to use/add functions to existing classes; plus we have dunder/magic functions as well, which we will discuss later. Let’s get a taste of classes with the following example:</p>
<pre><code class="lang-python"><span class="hljs-comment">#This code is for django's models </span>
<span class="hljs-keyword">from</span> django.db <span class="hljs-keyword">import</span> models

<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Ambulance</span>(<span class="hljs-params">models.Model</span>):</span> <span class="hljs-comment">#Inheriting models.Model. This will allow us to use all of its functions.</span>
    ambulance_state = models.BooleanField() 
    ambulance_lat = models.DecimalField(max_digits=<span class="hljs-number">10</span>, decimal_places=<span class="hljs-number">6</span>)
    ambulance_long = models.DecimalField(max_digits=<span class="hljs-number">10</span>, decimal_places=<span class="hljs-number">6</span>)
    ambulance_pickup_time = models.DateTimeField(<span class="hljs-string">"Pickup Time"</span>)

    <span class="hljs-comment"># As you can see inheriting another class allows us to reuse its fucntions and gain its properties.</span>

abulance = Ambulance() <span class="hljs-comment">#Instantiation,  to create an object of the class and use its properties.</span>
<span class="hljs-comment"># In django we can use it to create row in our django table</span>
</code></pre>
<p>In the above example, you can see that inheriting allows us to create models for our Django project with minimal code — and with instantiation, we can create as many objects with the same properties as we like.</p>
<h2 id="args-and-kwargs">Args and Kwargs</h2>
<p><code>args</code> stand for arguments and <code>kwargs</code> stands for keyword arguments. They allow us to pass multiple arguments to a function. Let’s look at an example:</p>
<pre><code class="lang-python"><span class="hljs-comment"># '*' is an uncpaking operator which returns an unmutable iterable tuple</span>
<span class="hljs-comment"># '**' unpacks a dictionary</span>

<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">concatenate</span>(<span class="hljs-params">*args, **kwargs</span>):</span> <span class="hljs-comment">#The function can take as many arguments as you want and concatenate them</span>
    int_values = <span class="hljs-string">""</span>
    string = <span class="hljs-string">""</span>

    <span class="hljs-keyword">for</span> arg <span class="hljs-keyword">in</span> args:
        int_values += str(arg)

    <span class="hljs-keyword">for</span> val <span class="hljs-keyword">in</span> kwargs.values():
        string += str(val)

    <span class="hljs-keyword">return</span> int_values, string


print(concatenate(<span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>, <span class="hljs-number">4</span>, <span class="hljs-number">5</span>, <span class="hljs-number">6</span>, <span class="hljs-number">7</span>, <span class="hljs-number">8</span>, <span class="hljs-number">9</span>,
                  <span class="hljs-number">10</span>, a=<span class="hljs-string">"abcd"</span>, b=<span class="hljs-number">4352</span>, c=<span class="hljs-string">"safda"</span>, e=<span class="hljs-number">95</span>))
</code></pre>
<p>This function concatenates all the arguments that are passed to it. Inside the function, <code>args</code> is basically a tuple and <code>kwargs</code> is a dictionary, <code>‘*’</code> and <code>‘**’</code> are <strong>unpack operators</strong>. We can use names other than args and kwargs, what matters is the operator. The above code prints — <code>12345678910, abcd4352safda95</code></p>
<p>We can also use these operators outside the function, like this:</p>
<p><code>values = [1,2,3,4,5]</code></p>
<p><code>print(values) #Prints — [1,2,3,4,5]</code></p>
<p><code>print(*values) #Prints — 1,2,3,4,5</code></p>
<h2 id="decorators">Decorators</h2>
<p>Decorators allow us to add additional functionality to functions without changing the inner workings of that function. Let’s look at an example:</p>
<pre><code class="lang-python"><span class="hljs-comment">#Decorator Function</span>
<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">unautherized_user</span>(<span class="hljs-params">view_func</span>):</span>
    <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">wrapper</span>(<span class="hljs-params">request, *args, **kwargs</span>):</span> <span class="hljs-comment">#The wrapper function allows us to control what happens before and after our view_func() is called</span>
        <span class="hljs-keyword">if</span> request.user.is_authenticated:
            <span class="hljs-keyword">return</span> redirect(<span class="hljs-string">'/'</span>)
        <span class="hljs-keyword">else</span>:
            <span class="hljs-keyword">return</span> view_func(request, *args, **kwargs)

    <span class="hljs-keyword">return</span> wrapper

<span class="hljs-meta">@unautherized_user #Calling the decorator function. This is same as doing - unautherized_user(login(request))</span>
<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">login</span>(<span class="hljs-params">request</span>):</span>
  <span class="hljs-comment">#This function can authenticate users</span>
  <span class="hljs-keyword">pass</span>
</code></pre>
<p>In the above example, we call the login function whenever we want to access the login page (we do not care about the inner workings of the login function). <em>But what if the user is already logged in? We don’t want them to access the page.</em></p>
<p>To add this functionality to the login function, we could have used an if statement inside the login function, something like the following:</p>
<p><code>if request.user.is_authenticated: return homepage</code></p>
<p>But what if we want to add this functionality to our sign-up page or other pages on our website? We will repeat the code again and again. To solve this, we use a decorator.</p>
<p>In our decorator function:<code>unautherized_user()</code> , we create another function that does the same job as our if statement declared above. Now we can just use the Python decorator syntax <code>@</code> and call the decorator function <code>@unautherized_user</code> over our login function to use the functionality.</p>
<p>Decorators allow us to do something before a function is called, and after a function is called.</p>
<h2 id="magic-methods">Magic Methods</h2>
<p>It is much easier to explain what magic/dunder methods are with an example, so let's just get down to business:</p>
<pre><code class="lang-python"><span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Ambulance</span>(<span class="hljs-params">models.Model</span>):</span>
    ambulance_state = models.BooleanField()
    ambulance_lat = models.DecimalField(max_digits=<span class="hljs-number">10</span>, decimal_places=<span class="hljs-number">6</span>)
    ambulance_long = models.DecimalField(max_digits=<span class="hljs-number">10</span>, decimal_places=<span class="hljs-number">6</span>)
    ambulance_free_est_time = models.DateTimeField(
        <span class="hljs-string">"Estimated Time for Next Patient"</span>)
    ambulance_pickup_time = models.DateTimeField(<span class="hljs-string">"Pickup Time"</span>)

    <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">__str__</span>(<span class="hljs-params">self</span>):</span> <span class="hljs-comment">#when we use the class object as a string, this function will be called</span>
        <span class="hljs-keyword">if</span> self.ambulance_state:
            state = <span class="hljs-string">"OCCUPIED"</span>
            next_available = <span class="hljs-string">f"IT WILL BE AVAILABLE IN <span class="hljs-subst">{str(self.ambulance_pickup_time)}</span>"</span>

        <span class="hljs-keyword">else</span>:
            state = <span class="hljs-string">"AVAILABLE"</span>
            next_available = <span class="hljs-string">""</span>

        <span class="hljs-keyword">return</span> <span class="hljs-string">f"AMBULANCE IS CURRENTLY <span class="hljs-subst">{state}</span>"</span>

ambulance = Ambulance()
print(ambulance)
</code></pre>
<p>If we print an object of Ambulance class without the <code>__str__</code>method, we will get something like this-<code>&amp;lt;__main__.Ambulance object at 0x10a21b910&amp;gt;</code></p>
<p>This output is not very useful and not something we want, so we can define a <code>__str__</code> to handle what happens when we use the object as a string. We can use other magic methods such as <code>__add__</code> <code>__mod__</code> <code>__int__</code> and others to handle what happens when we use <code>+</code> ,<code>%</code> , and<code>int()</code> respectively.</p>
<p>With the <code>__str__</code> magic method, if we print our class object, we will get — <code>AMBULANCE IS CURRENTLY OCCUPIED</code></p>
<p>This can be very useful because now we can define how our object behaves when we use such operators and perform various operations on it.</p>
<h2 id="generators">Generators</h2>
<p>Generators are a much more efficient way of implementing something like a list comprehension. When we use a list comprehension, the output is stored in the memory with all the values. On the other hand, generators do not take up much space and the output is generated when required. Here’s an example:</p>
<pre><code class="lang-python">list_a = [x <span class="hljs-keyword">for</span> x <span class="hljs-keyword">in</span> range(<span class="hljs-number">10</span>)] <span class="hljs-comment">#stores everything in memory before returning</span>
list_b = (x <span class="hljs-keyword">for</span> x <span class="hljs-keyword">in</span> range(<span class="hljs-number">10</span>)) <span class="hljs-comment">#generators are created using ()</span>

print(list_a) <span class="hljs-comment">#prints - [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]</span>
print(list_b) <span class="hljs-comment">#prints - &lt;generator object &lt;genexpr&gt; at 0x10f6d0c50&gt;</span>

<span class="hljs-comment">#To use generator, we need to do iterate over it</span>
<span class="hljs-comment"># This is because generator can only output one at a time</span>
<span class="hljs-keyword">for</span> x <span class="hljs-keyword">in</span> list_b:
  print(x)
</code></pre>
<p>We use a generator when we have to deal with a large amount of data or do not want it to take up space.</p>
<p>There also exist generator functions that make it much easier to work with iterators in Python. The difference between a generator and a normal function is that it has a <code>yield</code> statement and can also have a <code>return</code> statement. <code>yield</code> works as same as <code>return</code>, but it does not terminate the function and maintains its state. Here’s an example:</p>
<pre><code class="lang-python"><span class="hljs-comment"># generator function</span>
<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">even_nums</span>():</span>
    x = <span class="hljs-number">0</span>
    <span class="hljs-keyword">while</span> <span class="hljs-literal">True</span>:
        x += <span class="hljs-number">2</span>
        <span class="hljs-keyword">yield</span> x


<span class="hljs-comment"># if we simply do print(next(even_nums())) it will just print 2</span>
<span class="hljs-comment"># This is because everytime a new function will be created</span>
<span class="hljs-comment"># So we first need to assign it to a variable</span>
num = even_nums()
<span class="hljs-keyword">for</span> i <span class="hljs-keyword">in</span> range(<span class="hljs-number">10</span>):
    print(next(num))
<span class="hljs-comment"># This way we can print as many even numbers as we want, without using any memory</span>
</code></pre>
<p>The above function will print the first ten even numbers. We can use it to print as many even numbers as we want, without consuming any memory.</p>
<p>I know these concepts can be tough to grasp, especially if you are getting acquainted with them for the first time. Below are links to more detailed explanations of these concepts. If you still have some doubts, please leave a comment.</p>
<p><a target="_blank" href="https://youtu.be/W1WLiJKaYD0">Here’s a detailed video.</a></p>
<h2 id="resources">Resources</h2>
<p>Corey Schafer’s playlist on OOP in Python is below:</p>
<p>Sentdex’s playlist on advanced Python is below:</p>
<p>Thanks for reading!</p>
]]></content:encoded></item><item><title><![CDATA[Why You Need a ‘.ETH’ Domain Name]]></title><description><![CDATA[I was learning about applications of blockchain technology, how smart contracts, third-gen cryptos, and IPFS work, then I came across the Ethereum Name Service (ENS). The idea of ENS seemed pretty obvious to me, but I found that only a few people act...]]></description><link>https://blog.shubhpatni.com/why-you-need-a-eth-domain-name-b16762fd16b4</link><guid isPermaLink="true">https://blog.shubhpatni.com/why-you-need-a-eth-domain-name-b16762fd16b4</guid><category><![CDATA[domain]]></category><category><![CDATA[Ethereum]]></category><category><![CDATA[Blockchain]]></category><category><![CDATA[Cryptocurrency]]></category><category><![CDATA[technology]]></category><dc:creator><![CDATA[Shubh Patni]]></dc:creator><pubDate>Tue, 04 May 2021 12:59:53 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1627479776931/ffPSJfKtz.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>I was learning about applications of blockchain technology, how smart contracts, third-gen cryptos, and IPFS work, then I came across the <strong>Ethereum Name Service (ENS)</strong>. The idea of ENS seemed pretty obvious to me, but I found that only a few people actually use it. So, I took it upon myself to share it with the world and save them some money and time.</p>
<h2 id="what-is-ethereum-name-service">What is Ethereum Name <strong>Service</strong></h2>
<p>In the early days of the internet, users had to type a long string of characters just to visit a webpage. This IP address looked something like this <code>142.250.183.46</code> Can you recognize which website it is?</p>
<p>That’s google. Copy that address and paste it in a browser to confirm.</p>
<p><strong>Domain Name Service (DNS)</strong> provided a way to convert the human-readable address to a long, unreadable string of IP address that is readable by the computer. These services keep a track of all the domain names and provide the right IP address when requested.</p>
<p>Where does ENS come in?</p>
<p>The same problem which plagued the early web haunts web 3.0 now. To transfer crypto from one account to another requires a relatively long and cryptic address, which is impossible to remember and easy to mess up.</p>
<p>Unlike visiting websites, where if you mess up the IP address you can retype it again with no consequences; if you mess up the crypto address, you can lose the transferred amount. What’s worse is that now the recipient is angry because he did not receive the payment, and now the sender is broke.</p>
<blockquote>
<p>The <a target="_blank" href="https://docs.ens.domains/">Ethereum Name Service (ENS)</a> is a distributed, open, and extensible naming system based on the Ethereum blockchain.</p>
</blockquote>
<p>ENS is a lookup system that converts the long unreadable address to something like <code>[shubhpatni.eth</code>](https://app.ens.domains/name/shubhpatni.eth) (you can actually send some eth there 😉). So, you can send ETH or any other cryptocurrency registered by the recipient to this address, and it will automatically send the money to the desired crypto account.</p>
<p><em>Note: Make sure to check if the recipient has registered the address for the cryptocurrency you want to send. You can check it by visiting <code>https://app.ens.domains/name/{reciepient_name.eth}</code></em></p>
<h3 id="how-ens-works">How ENS works</h3>
<p>ENS has a registry smart contract that keeps track of all domain names, sub-domains, owners, resolvers, etc, and allows the owner to change this data. The registry is the backbone of ENS.</p>
<p>The other key component of ENS is the resolver. Resolvers are responsible for translating names into addresses. So, a resolver must handle different types of data such as cryptocurrency addresses, IPFS content hash, user profile, avatar, etc. If need be, we can also add other data types through the EIP standardization process, with no changes in the ENS registry or any other resolvers.</p>
<p><em>How resolver and registry work together?</em></p>
<p>Getting data from ENS is a two-step process. First, we need to find the correct resolver from the registry. To do this, we pass the ENS domain name to the register, which returns the address of the resolver. Now, we ask for the desired data from this resolver.</p>
<h2 id="benefits-of-ens">Benefits of ENS</h2>
<p>Enough with the technical details. Now let’s see what you can actually do with an ENS domain and how it is much more than just a DNS for the decentralized web.</p>
<h3 id="host-ipfs-sites">Host IPFS sites</h3>
<p><a target="_blank" href="http://ipfs.io/">IPFS (InterPlanetary File System)</a> with ENS allows you to host any website in a truly decentralized way. This means your website will be censorship-resistant, immutable, and in a decentralized network. If you don't want your website to end with <code>.eth</code> or want to connect your existing domain name to your IPFS hosted site, you can do so.</p>
<p>Here’s a good guide by <a target="_blank" href="https://twitter.com/KohorstLucas">Lucas Kohorst</a> on how to host your site-
<a target="_blank" href="https://towardsdatascience.com/decentralizing-your-website-f5bca765f9ed"><strong>Decentralizing your Website</strong>
<em>IPFS + ENS</em>towardsdatascience.com</a></p>
<h3 id="store-your-e-mail-profile-bio-and-other-info">Store your E-Mail, profile, bio, and other info</h3>
<p>ENS allows you to store more than just your cryptocurrency addresses or IPFS site. You can add addresses of other <a target="_blank" href="https://github.com/ensdomains/address-encoder">ENS-supported blockchains</a>, your Twitter profile, bio, avatar, E-mail, and a lot of other things. People can find all these details by just visiting your <code>.eth</code> domain.</p>
<p>Here’s a guide by <a target="_blank" href="https://twitter.com/BrantlyMillegan">Brantly Millegan</a> on how to set it up-
<a target="_blank" href="https://medium.com/the-ethereum-name-service/guide-for-soulja-boy-to-setting-up-his-eth-name-and-beyond-b382717bdc71"><strong>Guide for Soulja Boy to Setting Up His .ETH Name and Beyond</strong>
<em>Soulja Boy tweeted out his Ethereum address earlier today.</em>medium.com</a></p>
<h3 id="receive-blockchain-based-assets">Receive blockchain-based assets</h3>
<p>You can use your one ENS domain to receive native assets of over 100 blockchains. This means you can receive tokens of those cryptocurrencies and any other asset, such as an NFT that lives on that blockchain. So, let’s say you added a BNB address to your domain, you can now receive any BEP20 token. The same is true for any other supported blockchain for which you have registered on ENS.</p>
<p>Below is the list of all the supported blockchains
<a target="_blank" href="https://github.com/ensdomains/address-encoder"><strong>ensdomains/address-encoder</strong>
<em>This typescript library encodes and decodes address formats for various cryptocurrencies. Text-format addresses are…</em>github.com</a></p>
<h3 id="ens-as-an-nft">ENS as an NFT</h3>
<p>All ENS domains are registered under the ERC-721 standard, so they are an NFT, which means you can treat these domains as you treat an NFT. You can buy and sell it, transfer it to another account, or use it as collateral on projects which provide that service.</p>
<h3 id="dont-worry-if-you-enter-the-wrong-address">Don’t worry if you enter the wrong address</h3>
<p>Another small but useful feature of an ENS domain is that it would tell you if you have entered an unregistered domain name. What does it mean?</p>
<p>Let’s say you wanted to send some ether to your friend or employee. If you enter the long string of hash, the application does not tell you if that address exists or is correct or not. But if you enter an ENS domain name, it will tell you if that address exists or not, and it will throw an error if the address is not owned by anyone.</p>
<p><em>One more thing! Storing any data on the ethereum blockchain costs gas. So, I would recommend you to add your cryptocurrency addresses, bio, etc in one go to save on the gas fee.</em></p>
<p>This is all you need to know about ENS before creating your own domain. Below is a step-by-step guide by <a target="_blank" href="https://twitter.com/BrantlyMillegan">Brantly Millegan</a> on how to set it up.
<a target="_blank" href="https://medium.com/the-ethereum-name-service/step-by-step-guide-to-registering-a-eth-name-on-the-new-ens-registrar-c07d3ab9d6a6"><strong>Step-by-Step Guide to Registering a .ETH Name</strong>
<em>This guide will give you step-by-step instructions of how to register and set up a new .ETH name with the official ENS…</em>medium.com</a></p>
<p><em>You can check out my free curated list of resources on <a target="_blank" href="https://shubhpatni.gumroad.com/">Gumroad</a> to learn more about cryptocurrencies, or visit my <a target="_blank" href="https://y.at/%F0%9F%92%BB%F0%9F%8E%A5%E2%9C%8D%E2%98%95">socials</a>.</em></p>
]]></content:encoded></item><item><title><![CDATA[What’s The Best Way to Learn Computer Science]]></title><description><![CDATA[Photo by Serhii Butenko on Unsplash
A year ago, I finished high school and after that hurdle, another one popped up: the pandemic. I had to put my studies on hold and take a gap year. Surprisingly, it was one of the best decisions I ever made because...]]></description><link>https://blog.shubhpatni.com/whats-the-best-way-to-learn-computer-science-de53224466bc</link><guid isPermaLink="true">https://blog.shubhpatni.com/whats-the-best-way-to-learn-computer-science-de53224466bc</guid><category><![CDATA[Computer Science]]></category><category><![CDATA[Programming Blogs]]></category><category><![CDATA[Technical writing ]]></category><category><![CDATA[algorithms]]></category><category><![CDATA[Blogging]]></category><dc:creator><![CDATA[Shubh Patni]]></dc:creator><pubDate>Fri, 23 Apr 2021 18:24:01 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1627479591954/Cd03Vqk0d.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><em>Photo by <a target="_blank" href="https://unsplash.com/@serejahh?utm_source=medium&amp;utm_medium=referral">Serhii Butenko</a> on <a target="_blank" href="https://unsplash.com?utm_source=medium&amp;utm_medium=referral">Unsplash</a></em></p>
<p>A year ago, I finished high school and after that hurdle, another one popped up: the pandemic. I had to put my studies on hold and take a gap year. Surprisingly, it was one of the best decisions I ever made because I gained a lot of free time, an uncluttered mind, and the freedom to do anything.</p>
<blockquote>
<h1 id="if-you-are-a-self-taught-programmer-you-must-have-had-a-similar-journey-made-projects-googling-a-bunch-of-stuff-jumped-from-one-technologylanguage-to-another-dont-know-anything-in-particular-finally-realized-github-is-a-lifesaver">If you are a self-taught programmer, you must have had a similar journey: made projects googling a bunch of stuff, jumped from one technology/language to another, don’t know anything in particular, finally realized GitHub is a lifesaver.</h1>
</blockquote>
<p>Yes, I am in the same mess. So, I decided to take my computer science skills to the next level. I had built a few apps, websites, machine learning models, and a bunch of other stuff, but I knew that I still didn’t understand the basics. I didn’t know the most efficient way of doing stuff. I surfed around the internet and found that data structures and algorithm was one of the basics about computer science that I must know, and then there were low-level languages, operating systems, compilers, etc.</p>
<p>I took a course on Coursera by Stanford called <a target="_blank" href="https://www.coursera.org/specializations/algorithms#courses">Algorithms Specialization</a>. It was good and helpful, but a little boring. I completed 3/4 of it and put it on hold. Then, I turned to a book: <a target="_blank" href="https://www.pearson.com/us/higher-education/program/Bryant-Computer-Systems-A-Programmer-s-Perspective-3rd-Edition/PGM2476825.html">Computer systems: A programmer's perspective.</a> This was probably the biggest mistake. As with most of the technical books, it was gigantic and boring, but somehow I survived till page 200.</p>
<p>Then I found <a target="_blank" href="https://www.coursera.org/learn/build-a-computer">Nand2Tetris.</a></p>
<h2 id="nand2tetris">Nand2Tetris</h2>
<p>Nand2Tetris is a project-centric course with an aim to teach computer science by building a modern computer from the ground up. The course is instructed by Shimon Schocken and Noam Nisan, who are both professors at The Hebrew University of Jerusalem.</p>
<p><strong>You might ask: <em>Why learn CS from the ground up? Wouldn’t I land a job just with python?</em></strong></p>
<ul>
<li><p>A lot of computer science degree programs expect you to know how operating systems, low-level languages, assemblers work.</p>
</li>
<li><p>Traditional education expects you to understand everything by reading books.</p>
</li>
<li><p>Project-based learning is a lot more fun; You are making a computer from the ground up in weeks!!!</p>
</li>
<li><p>You will really need to use your brain for this one :)</p>
<blockquote>
<h1 id="its-important-to-reason-from-first-principles-rather-than-by-analogy-with-first-principles-you-boil-things-down-to-the-most-fundamental-truths-and-then-reason-up-from-there-elon-musk">It’s important to reason from first principles rather than by analogy… With first principles, you boil things down to the most fundamental truths… and then reason up from there. — Elon Musk</h1>
</blockquote>
</li>
</ul>
<p>The whole course is divided into 2 parts. The first part focuses on the hardware side of things such as making elementary logic gates, ALU, RAM, etc. The second part is more inclined towards the software side of things: making the operating system, high-level language, compiler, etc.</p>
<h2 id="my-experience">My Experience</h2>
<p>As of this writing, I am in week 5 of the course. The course is divided into 12 weeks, with the first 6 being part one of the course. When I took the course, I thought it would be hard and complicated. However, I completed 3 weeks' worth of course in just the first week.</p>
<p>I have documented my thought process, explanation, and code in a GitHub repository. If you need help with the course, you can check it out and ask me questions.
<a target="_blank" href="https://github.com/patni11/Nand2Tetris"><strong>patni11/Nand2Tetris</strong>
<em>Learning how to build my own computer What is the best way to learn computer science and understand a computer? I asked…</em>github.com</a></p>
<p>The course was more than learning computer science for me. Have you ever heard of John Conway’s game of life or rules of life? It is a simple game with just 4 basic rules and people have made logic gates, other games, and spectacular things out of it. <a target="_blank" href="https://www.youtube.com/watch?v=6avJHaC3C2U&amp;t=284s">You should definitely check it out</a>. Similarly, in the course, we built logic gates, ALU, RAM, etc. with just 1 gate: Nand. It left a smile on my face when I realized that all the computer logic, complexity, beauty is created by simple rules. Maybe our universe is designed in the same way: The Theory of Everything might be just a simple rule.</p>
<p>You can find more content/reach out to me using this link — <a target="_blank" href="https://shubhpatni.com">Shubh Patni</a></p>
]]></content:encoded></item><item><title><![CDATA[Can NFTs Be More Than Just Art]]></title><description><![CDATA[Here’s an NFT I created. I call it — “Whoops Where Am I?”
NFT FAD is in the air. Art worth millions of dollars are being bought as if it's free. This NFT bubble gave artists opportunity amid the crisis, and while NFT gave artists control over their w...]]></description><link>https://blog.shubhpatni.com/nfts-are-not-just-for-art-and-gains-d1733ff617d3</link><guid isPermaLink="true">https://blog.shubhpatni.com/nfts-are-not-just-for-art-and-gains-d1733ff617d3</guid><category><![CDATA[Blockchain]]></category><category><![CDATA[Cryptocurrency]]></category><category><![CDATA[technology]]></category><dc:creator><![CDATA[Shubh Patni]]></dc:creator><pubDate>Mon, 12 Apr 2021 11:08:31 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1627479888725/qiDwwARO6.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><img src="https://cdn-images-1.medium.com/max/9600/1*XQKitdwk6t_0GpVGFl72BA.jpeg" alt="[Here’s an NFT I created. I call it — “Whoops Where Am I?”](https://cdn.hashnode.com/res/hashnode/image/upload/v1627479881760/OVznM1Oi9.html)" /><em><a target="_blank" href="https://rarible.com/token/0xd07dc4262bcdbf85190c01c996b4c06a461d2430:99435:0x678e06e78b65f5f61d715b9619f2f8f1da62b711">Here’s an NFT I created. I call it — “Whoops Where Am I?”</a></em></p>
<p>NFT FAD is in the air. Art worth millions of dollars are being bought as if it's free. This NFT bubble gave artists opportunity amid the crisis, and while NFT gave artists control over their work, a lot of <a target="_blank" href="https://www.theartnewspaper.com/news/fake-or-appropriation-banksy-style-nfts-sell-for-usd900-000-but-who-is-behind-the-spin-offs">fake copies of masterpieces</a> swirled around the internet.</p>
<blockquote>
<h1 id="the-value-of-art-lies-in-the-eyes-of-the-beholder">The value of Art lies in the eyes of the beholder.</h1>
</blockquote>
<p><em>I’ll say we got to see the above phrase in action, thanks to NFTs.</em></p>
<p><strong>Let’s look at what we will discuss-</strong></p>
<ul>
<li><p>What is an NFT</p>
</li>
<li><p>NFTs for our digital identities</p>
</li>
<li><p>Market of everything</p>
</li>
<li><p>Birth of new businesses</p>
</li>
</ul>
<p>If you are still wondering, <em>“what the hell is even an NFT?”</em> Well…</p>
<p>NFT stands for <strong>Non-Fungible Token</strong>. Let’s break it down.</p>
<p>Non-fungible assets have unique qualities that give a unique value to each good; ex- diamonds, cards, used cars, art, have a unique value. We can derive this value from qualities such as age, color, location, size, condition, depending on what good we are talking about. On the other hand, fungible goods such as notes, stocks, commodities have equal value. All $1 American notes have the same value: $1, no matter how old they get, they will be worth $1, but diamonds have different values based on size, cut, etc.</p>
<p>Now let’s look at the ‘<strong>*token</strong>’* side of the equation.</p>
<p>We can take these non-fungible goods, create a digital representation of them, and then sell them online. This is called <a target="_blank" href="https://www.tokenex.com/resource-center/what-is-tokenization#:~:text=Tokenization%20is%20the%20process%20of,without%20bringing%20it%20into%20scope.">**tokenization</a><em>*. So, let’s say you have some digital item like an image, video, logo, or anything. You can use websites like <a target="_blank" href="https://opensea.io/">Opensea</a> or <a target="_blank" href="https://rarible.com/">Rarible</a>, upload them there, and </em>‘mint tokens’. <em>These tokens live on a blockchain, thus each one of them has a unique </em>hash *that gives them a unique identity and proves their authenticity.</p>
<p>You can mint multiple copies of the thing and decide on their rarity.</p>
<p><a target="_blank" href="https://youtu.be/j99vvrQhtgs">I have also created a YouTube video on this topic.</a></p>
<p><em>Ok, I assume you got a basic understanding of what NFTs are. We will now look at more applications of NFTs.</em></p>
<h2 id="reputation-digital-identity-credentials">Reputation/ Digital Identity/ Credentials</h2>
<p><img src="https://cdn-images-1.medium.com/max/9000/0*jeeIBe0G_0SEhe4J" alt="Photo by [Ben Sweet](https://cdn.hashnode.com/res/hashnode/image/upload/v1627479883461/fgUj__pkh.html) on [Unsplash](https://unsplash.com?utm_source=medium&amp;utm_medium=referral)" /><em>Photo by <a target="_blank" href="https://unsplash.com/@benjaminsweet?utm_source=medium&amp;utm_medium=referral">Ben Sweet</a> on <a target="_blank" href="https://unsplash.com?utm_source=medium&amp;utm_medium=referral">Unsplash</a></em></p>
<p><em>After watching a spy or a hacking movie, did you ever asked yourself — how cool it would be if I could be anonymous? Well, I feel that all the time.</em></p>
<p>But!!!! there’s always a but. What about your credibility and social reputation?</p>
<p>If you are a content creator, artist, or anyone who values your number of followers, likes, etc; you know we cannot transfer them. In sites like Reddit, where your karma and awards mean a lot, you cannot transfer them from one account to another, let alone to any other social networking platform.</p>
<p>So, let’s say if you have a million likes on YouTube, you have definitively amassed some trust and reputation. If you decide to post content on some other platform or release new something new, maybe a new business anonymously, you will have to start from zero.</p>
<p>NFT’s can change that. NFTs may not transfer your followers or subscribers, but they can definitely quantify your credibility and show how trustworthy you are. As NFTs exist on a blockchain, so users can easily verify if the person with X credentials actually has X credentials or not, they just need to trust the blockchain platform.</p>
<p>We can use the same score for all social media platforms, NFT marketplaces, etc. Do you remember, before we talked about how some people are creating fake art and selling its NFTs? this can change that. We can extend the idea to land ownership, university degrees, and a lot more things.</p>
<h2 id="market-of-everything">Market of Everything</h2>
<p><img src="https://cdn-images-1.medium.com/max/4096/0*2SRDBQfyE-KtAcCm" alt="Photo by [Joshua Rawson-Harris](https://cdn.hashnode.com/res/hashnode/image/upload/v1627479885163/igFoUhe_v.html) on [Unsplash](https://unsplash.com?utm_source=medium&amp;utm_medium=referral)" /><em>Photo by <a target="_blank" href="https://unsplash.com/@joshrh19?utm_source=medium&amp;utm_medium=referral">Joshua Rawson-Harris</a> on <a target="_blank" href="https://unsplash.com?utm_source=medium&amp;utm_medium=referral">Unsplash</a></em></p>
<p>Take this scenario- <em>you are in a hurry, late for work. You reach a taxi stand and grabbed one as soon as it came. In the taxi, you are busy with your presentation which you forgot to finish yesterday. You arrive at the office and off-course; you are in a rush. You forgot your wallet, and for some reason, you don’t have enough digital money. Sounds familiar, isn’t it?</em></p>
<p>That’s a pretty unpleasant situation if you ask me. It’s not like you don’t have money or you don’t own valuable things. The problem is, things are illiquid and cannot be exchanged easily for money.</p>
<p>NFTs come to the rescue.</p>
<p>As it is possible to tokenize anything with a price tag, we can create NFTs for real estate, stocks, cattle, etc, and create a decentralized market for them. Then, you can go to a random coffee shop and buy a cup of coffee in exchange for a fraction of your real estate.</p>
<p>You might ask ‘<em>what if the coffee shop doesn’t accept the method of payment? And why would anyone want to hold a fraction of land?’</em></p>
<p>Let’s say the coffee shop only accepts USD. There will be services that would take your fraction of land, sell it in some market, for let’s say BTC, then they would sell that BTC for USD and transfer USD to a coffee shop. These services would look for the most efficient route to USD from real estate, for minimum costs. You won’t know what happened in between and the coffee shop owner doesn’t need to know what you did, he just got what he wanted: USD.</p>
<h2 id="birth-of-new-businesses">Birth of New Businesses</h2>
<p><img src="https://cdn-images-1.medium.com/max/10368/0*-JQkAYqx5lq5FzED" alt="Photo by [Charles Forerunner](https://cdn.hashnode.com/res/hashnode/image/upload/v1627479887055/gmIuu8Bg6.html) on [Unsplash](https://unsplash.com?utm_source=medium&amp;utm_medium=referral)" /><em>Photo by <a target="_blank" href="https://unsplash.com/@charles_forerunner?utm_source=medium&amp;utm_medium=referral">Charles Forerunner</a> on <a target="_blank" href="https://unsplash.com?utm_source=medium&amp;utm_medium=referral">Unsplash</a></em></p>
<p>There are a lot of things that will change as NFTs conquer our daily lives. I can’t discuss everything here, so let’s just look at a few examples.</p>
<h3 id="blockchain-is-saving-wildlife-in-south-africa">Blockchain Is Saving Wildlife in South Africa</h3>
<p><a target="_blank" href="https://www.studex-e.io/about-us">**Studex</a> **is a startup that tracks animal location, heartbeat, and medical conditions to ensure their health and safety from poachers. They store all this data in a blockchain and also issue an <a target="_blank" href="https://www.youtube.com/watch?v=HTm-1JtI0fA">ERC-721 NFT</a>. Anyone from anyone in the world can own this ERC-721 token, thus claim the ownership of an animal.</p>
<p>The funds collected through the sale of these animals go to farmers who take care of these animals. The revenue generated through the sale of animal products such as milk, meat, is distributed between the farmer and the owner of the animal.</p>
<p>There are marketplaces to buy and sell these animals; IoT devices to check their health, location, and everything; and drones for live footage. To know more about it, use the link below-
<a target="_blank" href="https://medium.datadriveninvestor.com/4-unexpected-ways-blockchain-is-transforming-our-world-4567c691dba"><strong>4 Unexpected Ways Blockchain Is Transforming Our World</strong>
<em>Blockchain is here to stay</em>medium.datadriveninvestor.com</a></p>
<h3 id="gaming">Gaming</h3>
<p>Gaming is one of the most exciting applications of NFTs. If you have spent some money on any game, you know how much it hurts to not be able to use the skins, characters, and other game objects in other games; even from the same studio.</p>
<p>Games in a decentralized blockchain can issue NFTs for characters, skins, guns, etc. Now, as these NFTs are decentralized, anyone who wishes to create a game that supports these NFTs can do so. Thus you can use those items in other games too.</p>
<h3 id="metaverse">Metaverse</h3>
<p>AR glasses may be right around the corner, but what’s most exciting is that now we have blockchain and NFTs.</p>
<p>When AR technology matures, we will have AR glasses or lenses to replace our smartphones. Many companies like the <a target="_blank" href="https://www.superworldapp.com/">superworld</a> are already working on something called the metaverse.</p>
<blockquote>
<p>The <a target="_blank" href="https://en.wikipedia.org/wiki/Metaverse">**Metaverse</a>** is a collective virtual shared space, created by the convergence of virtually enhanced physical reality and physically persistent virtual space, including the sum of all virtual worlds, augmented reality, and the Internet.</p>
</blockquote>
<p>Imagine being able to own a virtual piece of land; rent it, sell it, trade it, or live on it. You can create digital houses, 3D objects of things like shoes, dinosaurs, transformers, anything your mind could fathom. Now, what if you could sell these items or use them for advertising? What if you could customize the whole virtual world to your liking, there will be each world for everyone, off course. Do whatever you want with your own virtual world!</p>
<p>That’s the promise of AR with blockchain. Oh! Do you want to understand the whole thing in detail? Use the link below.
<a target="_blank" href="https://medium.com/geekculture/how-augmented-reality-can-solve-the-internet-cead6dfcf33c"><strong>How Augmented Reality Can Solve The Internet</strong>
<em>AR is more than just ‘another’ innovation</em>medium.co</a></p>
<p>You can find more content/reach out to me using this link — <a target="_blank" href="https://y.at/%F0%9F%92%BB%F0%9F%8E%A5%E2%9C%8D%EF%B8%8F%E2%98%95">https://y.at/💻🎥✍️☕</a></p>
]]></content:encoded></item><item><title><![CDATA[How Augmented Reality Can Solve The Internet]]></title><description><![CDATA[Let’s cut right to the chase. Here are the problems with the current internet.
Business Model
21 Century is the digital age, and data is more valuable than gold. This invaluable data is collected by wiring millions of humans to a web called the inter...]]></description><link>https://blog.shubhpatni.com/how-augmented-reality-can-solve-the-internet-cead6dfcf33c</link><guid isPermaLink="true">https://blog.shubhpatni.com/how-augmented-reality-can-solve-the-internet-cead6dfcf33c</guid><category><![CDATA[AR]]></category><category><![CDATA[technology]]></category><category><![CDATA[internet]]></category><category><![CDATA[Technical writing ]]></category><dc:creator><![CDATA[Shubh Patni]]></dc:creator><pubDate>Wed, 24 Mar 2021 12:03:10 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1627479610329/fr95BbJPa.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Let’s cut right to the chase. Here are the problems with the current internet.</p>
<h3 id="business-model">Business Model</h3>
<p>21 Century is the digital age, and data is more valuable than gold. This invaluable data is collected by wiring millions of humans to a web called the internet. To make the process more efficient, hundreds of scientists are working on algorithms to predict or manipulate our actions and desires.</p>
<p>This is the business model of the current internet: Collect data, analyze your tastes and preferences, and sell it to advertisers.</p>
<p>This is the toughest problem of the 21 century because we cannot enforce a concrete law to stop this; <strong>We need AI, and AI needs data</strong>. While these algorithms are the golden goose for big tech companies, they are hidden devils for the common masses.</p>
<h3 id="advertising">Advertising</h3>
<p>Data is used to create our personal profiles, and each profile is a point on the web of millions of profiles stored in the data centers of large companies. These profiles are meant to become our <a target="_blank" href="https://www.networkworld.com/article/3280225/what-is-digital-twin-technology-and-why-it-matters.html#:~:text=A%20digital%20twin%20is%20a,expanding%20the%20concept%20even%20further.">*digital twins,</a>* as close as possible to the real deal.</p>
<p>These profiles can predict what we want, when we want it, how often we need it, and how much we need it. This ‘<em>it’ </em>includes everything from our morning cereal to dating preferences. Profiles help advertisers pinpoint individuals on the internet and target the most relevant ads, you are most likely to click. Some companies create a catalog of ads for each profile and load them offline into the browser, thus no Javascript blocker can block those ads.</p>
<p><a target="_blank" href="https://www.netflix.com/in/title/81254224">Social Dilemma</a> would be a good documentary to watch to learn more about profiling and how rigged the internet is.</p>
<h3 id="attention"><strong>Attention</strong></h3>
<p>What do the giants need to create profiles and train AI? <strong>Data.</strong></p>
<p>How to get more data? <strong>Hook you in for a long period of time.</strong></p>
<p>Facebook, Google, YouTube, Twitter, all need your attention to function. If the internet runs with such an incentive, these companies are bound to work on algorithms to manipulate you and hook you in.</p>
<p>I hope you have noticed that since we got our smartphones, <a target="_blank" href="https://data.worldbank.org/indicator/NE.CON.TOTL.CD?end=2019&amp;start=1960&amp;view=chart">most of us have purchased more things than we needed</a>. That ‘<em>once a lifetime</em>’ special sale on your favorite shoes never ends, Amazon and Facebook recommendations drive our purchases, and you have no place in your house to keep the extra stuff.</p>
<p>If you are not convinced, just think of the last time you ate your meal without your phone, waited in the queue without meaninglessly scrolling Twitter for no reason whatsoever, went to bed without watching a YouTube video. I know it’s hard to list many such days.</p>
<blockquote>
<h1 id="we-have-lost-the-sense-of-taste-smell-gratitude-appreciation-curiosity-and-cant-make-decisions-for-ourselves">We have lost the sense of taste, smell, gratitude, appreciation, curiosity, and can’t make decisions for ourselves.</h1>
</blockquote>
<p>We cannot stop tech giants from collecting data. Governments can regulate them, monitor them, but they cannot stop them, and from here on out, they will just have more of our data. Regulations may prohibit them from using our data in nefarious ways, but algorithms, to some extent, will still affect our thoughts.</p>
<p>But AR can solve this.</p>
<h2 id="augmented-reality-will-change-the-internet">Augmented Reality Will Change the Internet</h2>
<p><img src="https://cdn-images-1.medium.com/max/8064/0*FdPXaHzCuk2OeGGk" alt="Photo by [UNIBOA](https://cdn.hashnode.com/res/hashnode/image/upload/v1627479608129/-GU9FoeWn.html) on [Unsplash](https://unsplash.com?utm_source=medium&amp;utm_medium=referral)" /><em>Photo by <a target="_blank" href="https://unsplash.com/@uniboa?utm_source=medium&amp;utm_medium=referral">UNIBOA</a> on <a target="_blank" href="https://unsplash.com?utm_source=medium&amp;utm_medium=referral">Unsplash</a></em></p>
<blockquote>
<p>Now, just to be clear, I am not saying that AR can solve the problem of data collection and manipulation, but something equally if not more important: Our Attention.</p>
</blockquote>
<h3 id="advert-20">Advert 2.0</h3>
<p>You must have noticed that YouTube is trying hard to sell their premium membership and to do that, they have increased the length and number of ads in a video.</p>
<p>I know it sucks! Ads always suck.</p>
<p>Do you play Fortnite? Well, I love it and I am pretty good at it.</p>
<p>In Fortnite, there are many ads. Every day there is a new partnership with Marvel, DC, some musician, gamer, movie, car company, you never know what Fortnite is up to. You might think that it must suck. Well, I love it actually. Heck! I get to play with Iron Man’s skin, use Thor’s hammer as a harvesting tool, become wolverine, and whatnot.</p>
<p>Ads don’t suck when you want to experience them. Have you seen <a target="_blank" href="https://www.youtube.com/watch?v=OIFCQMeY3j4&amp;feature=share">Audi’s</a> or <a target="_blank" href="https://www.youtube.com/watch?v=Drt76l25ckY&amp;feature=youtu.be">Nike’s AR unboxing</a>? If not, you are missing out.</p>
<p>AR will change the advertising industry. We will interact with our favorite shoes, cars, devices, characters, everything we can think of, and more. AR will make the ads interesting, and the incentive will change to make ads more interactive and creative.</p>
<p>I know what you are thinking:<em> Wouldn't that collect more data and grab more of our precious attention?</em></p>
<h3 id="enter-superworld">Enter SuperWorld</h3>
<blockquote>
<h1 id="superworldhttpswwwsuperworldappcom-is-a-virtual-world-where-users-can-buy-sell-and-curate-64-billion-unique-plots-of-virtual-land"><a target="_blank" href="https://www.superworldapp.com/">SuperWorld</a> is a virtual world where users can buy, sell, and curate 64 Billion unique plots of virtual land.</h1>
</blockquote>
<p><a target="_blank" href="https://www.superworldapp.com/mobile-app/">Superworld also has an AR app</a> where you can create and explore your personalized AR content on your virtual land. Owning virtual land means you can earn revenue for AR content visible on it through the SuperWorld platform. You can rent virtual land for anything from an advertisement to a scene in a game.</p>
<p>Virtual land in SuperWorld is yours, you get to decide what you see in it, and how it is used. Everyone can have their own world or share a common experience in a community world.</p>
<p>This means that instead of being confined to a 6-inch smartphone, you can experience the whole world. This will make you more attentive, observant, and present in the reality. Instead of having no information about what’s going on around you, you will have more detail about your surroundings as AR can display information on top of anything.</p>
<p>While you are standing in a queue, you can play virtual games with people around you; While having a meal, you can get nutritional facts about your food; While walking on the street, you can know more about the plants, buildings, and history behind the location.</p>
<p>AR can connect us with the real world and help us know more about ourselves. It can strengthen our relationships, help us make new friends, and let us experience/explore this world in a more beautiful way.</p>
]]></content:encoded></item><item><title><![CDATA[Precautions You Need To Take When You Expose Yourself to Crypto]]></title><description><![CDATA[Photo by Mohammadreza alidoost on Unsplash
While many are becoming millionaires every day by investing in crypto, some are just on paper, or rather on the digital ledger. These millionaires have lost their bitcoin because they lost their private key ...]]></description><link>https://blog.shubhpatni.com/precautions-you-need-to-take-while-exposing-yourself-to-crypto-c3ef8f8efda1</link><guid isPermaLink="true">https://blog.shubhpatni.com/precautions-you-need-to-take-while-exposing-yourself-to-crypto-c3ef8f8efda1</guid><category><![CDATA[Cryptocurrency]]></category><category><![CDATA[Blockchain]]></category><category><![CDATA[technology]]></category><category><![CDATA[Technical writing ]]></category><dc:creator><![CDATA[Shubh Patni]]></dc:creator><pubDate>Sat, 20 Mar 2021 14:20:09 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1627479616474/NT8ulcWON.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><em>Photo by <a target="_blank" href="https://unsplash.com/@mralidoost?utm_source=medium&amp;utm_medium=referral">Mohammadreza alidoost</a> on <a target="_blank" href="https://unsplash.com?utm_source=medium&amp;utm_medium=referral">Unsplash</a></em></p>
<p>While many are becoming millionaires every day by investing in crypto, some are just on paper, or rather on the digital ledger. These millionaires have lost their bitcoin because they lost their private key and now can’t access their funds.</p>
<blockquote>
<h1 id="according-to-glassnodehttpsinsightsglassnodecombitcoin-liquid-supply-a-substantial-amount-of-mined-btc-is-lost-forever-we-estimate-this-number-to-be-3m-btchttpsstudioglassnodecommetricsabtcandcategoryandmsupplycurrentadjusted"><a target="_blank" href="https://insights.glassnode.com/bitcoin-liquid-supply/">According to Glassnode</a>, a substantial amount of mined BTC is lost forever (<a target="_blank" href="https://studio.glassnode.com/metrics?a=BTC&amp;category=&amp;m=supply.CurrentAdjusted">we estimate this number to be ~3M BTC</a>)</h1>
</blockquote>
<p>At the time of this writing, 3M BTC is around $179 Billion! Yup, that’s lost forever.</p>
<p>Let’s discuss some other ways you can lose money and how not to make those mistakes, which you will regret for the rest of your life</p>
<h2 id="not-your-keys-not-your-crypto">Not Your Keys, Not Your Crypto</h2>
<p>That’s an old saying in the world of crypto.</p>
<blockquote>
<h1 id="in-a-deterministic-wallet-seed-phrase-can-programmatically-generate-private-and-public-key-pairs-private-key-is-necessary-to-access-and-transfer-funds-from-one-wallet-to-another">In a deterministic wallet, seed-phrase can programmatically generate private and public key pairs. Private key is necessary to access and transfer funds from one wallet to another.</h1>
</blockquote>
<p>So, if you lose your private key, say goodbye to your cryptos. It might seem obvious, but many people don’t save their seed phrase properly and lose their cryptos. Another problem is centralized exchanges.</p>
<p>Most of the centralized exchanges don’t provide users with private keys, so technically, they are the owner of the cryptos, and you just see digits flickering on the screen. So, if the centralized exchange gets regulated or goes out of business, you can lose control over your crypto or even lose all the funds.</p>
<p><em>How to avoid this mistake?</em></p>
<ul>
<li><p>Buy a hardware wallet and store your crypto in it</p>
</li>
<li><p>Note down the seed phrase in a good quality paper or engrave it in metal</p>
</li>
<li><p>Store the seed phrase in a vault</p>
</li>
<li><p>Don’t share the seed phrase with anyone, no matter who the person claims to be.</p>
</li>
</ul>
<p>Below is a small guide of hardware wallets for you-
<a target="_blank" href="https://medium.com/coinmonks/which-cryptocurrency-hardware-wallet-is-best-for-you-7f15d6a60af1"><strong>Which Cryptocurrency Hardware Wallet Is Best for You</strong>
<em>What’s the best place to store your crypto</em>medium.com</a></p>
<h2 id="crypto-scams">Crypto Scams</h2>
<p>This one goes without saying, but it happens so often and with so many people that it’s worth mentioning.</p>
<p>Don’t fall for scams, Ponzi schemes, or pyramid schemes. I know it’s easier said than done. All the small-cap projects with great growth potential and <em>Ph.D.'s</em> behind them look promising. They seem like they can make you a millionaire in a day and can solve all the world's problems but don’t get fooled by the big promises, conferences, and many blind believers.</p>
<p>How to make sure the project is not a scam.</p>
<ul>
<li><p>Check if the blockchain actually exists and functions</p>
</li>
<li><p>Research the project and make sure it is trying to solve a real-world problem and blockchain is actually required to do that (many projects just use blockchain to raise funding)</p>
</li>
<li><p>Go to their GitHub and check the code. If you can’t read the code, check the number of commits, how many contributors are there, and check the profiles of a few contributors.</p>
</li>
<li><p>Check the project roadmap and make sure the team is following the roadmap and progress is being made.
<a target="_blank" href="https://levelup.gitconnected.com/biggest-crypto-scam-in-history-worth-15-billion-381e97cf2c0f"><strong>Crypto Scam Worth $15 Billion, Shook the Whole Industry</strong>
<em>How a Ph.D. fooled the entire world</em>levelup.gitconnected.com</a></p>
</li>
</ul>
<h2 id="volatility-and-fomo">Volatility and FOMO</h2>
<p>It may tempt you to buy bitcoin and other cryptocurrencies when it looks like it is just going up. Your friends might be into it and the media won’t stop talking about it, but don’t FOMO in.</p>
<blockquote>
<p>FOMO stands for Fear Of Missing Out</p>
</blockquote>
<p>If you do not have any experience with trading cryptocurrencies, then you should be extra careful not to invest more than you can lose. The price of especially the small-cap coins can decrease by 80% in a day! Some projects can be mere scams or ponzi schemes.</p>
<p>Even if you are looking to invest in large-cap coins with relatively lower volatility, they are still quite volatile when compared to traditional assets like gold, stocks, and bonds.</p>
<p>How to prevent worse from happening-</p>
<ul>
<li><p>Only invest in the projects you have researched about</p>
</li>
<li><p>Don’t invest more than you can afford to lose</p>
</li>
<li><p>Set stop losses and concrete rules to buy and sell</p>
</li>
<li><p>Set a risk level you are willing to take</p>
</li>
<li><p>Don’t be greedy</p>
</li>
</ul>
<p>I know it’s hard to follow these rules all the time, and even I have disobeyed these a few times. In this case, at least know how much you are risking and be aware of the consequences.</p>
]]></content:encoded></item><item><title><![CDATA[Which Cryptocurrency Hardware Wallet Is Best for You]]></title><description><![CDATA[Photo by Aron Visuals on Unsplash
So you don’t want to miss out on this bull run and you are fomoing in on all the hot cryptos and don’t know the safe place to store them?
Well, you are not alone. Most people still don’t own a hardware wallet and sto...]]></description><link>https://blog.shubhpatni.com/which-cryptocurrency-hardware-wallet-is-best-for-you-7f15d6a60af1</link><guid isPermaLink="true">https://blog.shubhpatni.com/which-cryptocurrency-hardware-wallet-is-best-for-you-7f15d6a60af1</guid><category><![CDATA[Cryptocurrency]]></category><category><![CDATA[Blockchain]]></category><category><![CDATA[technology]]></category><category><![CDATA[Technical writing ]]></category><category><![CDATA[tech ]]></category><dc:creator><![CDATA[Shubh Patni]]></dc:creator><pubDate>Thu, 11 Mar 2021 07:21:05 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1627479878254/MOqrxcn4L.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><em>Photo by <a target="_blank" href="https://unsplash.com/@aronvisuals?utm_source=medium&amp;utm_medium=referral">Aron Visuals</a> on <a target="_blank" href="https://unsplash.com?utm_source=medium&amp;utm_medium=referral">Unsplash</a></em></p>
<p>So you don’t want to miss out on this bull run and you are <em>fomoing</em> in on all the <em>hot</em> cryptos and don’t know the safe place to store them?</p>
<p>Well, you are not alone. Most people still don’t own a hardware wallet and store their crypto assets in a <em>hot</em> wallet or a centralized exchange. <strong>These solutions are risky!</strong> It is easy to hack your computer and access your software wallet, and with the centralized exchanges; you don’t own the private keys.</p>
<blockquote>
<h1 id="if-you-dont-own-your-private-keys-you-dont-own-your-crypto">If you don’t own your private keys, you don’t own your crypto</h1>
</blockquote>
<p><strong>Hardware/cold storage wallets come to the rescue.</strong></p>
<p>They allow you to take responsibility for your own money, giving you all the control, and unrestricted access anytime, anywhere.</p>
<p>There are a lot of wallets out there, and it is confusing to find which one is safe, reliable, easy to use, and supports all your favorite cryptos.</p>
<p>So which hardware wallet is best for you? Let’s find out.</p>
<p><strong>I am not affiliated with any hardware wallet providers.</strong></p>
<h2 id="trezor-t">Trezor T</h2>
<p><img src="https://cdn-images-1.medium.com/max/2000/1*U8RQKNaTkz4rKI6ZKdlcOQ.jpeg" alt="[Credit: Trezor](https://cdn.hashnode.com/res/hashnode/image/upload/v1627479871818/iKOb7pOu1.plain)" /><em><a target="_blank" href="https://shop.trezor.io/">Credit: Trezor</a></em></p>
<p><a target="_blank" href="https://shop.trezor.io/">Trezor Model T</a> is one of the most popular hardware wallets out there. It has an LCD colored touch screen display that makes it easier to use and access without the need to type your pin on the computer. The model T cannot connect to the computer unless you unlock it with a pin.</p>
<p><strong>Safety against potential risks-</strong></p>
<ul>
<li><p><strong>Tampering</strong>: Trezor Model T comes with a holographic sticker stick to its USB-C port. If this holographic sticker is missing or looks damaged, don’t use the wallet.</p>
</li>
<li><p><strong>Pre-configured Seed</strong>: If you receive the wallet with a Pre-configured seed phrase, don’t use that phrase. Trezor allows you to generate a seed phrase.</p>
</li>
<li><p><strong>Evil Maid Attack</strong>: If your hardware wallet gets stolen, don’t worry. Trezor comes with a pin protection mechanism which after every attempt locks the device for 2 to the power n seconds, giving you enough time to transfer funds to another wallet with a different seed phrase.</p>
</li>
<li><p><strong>The $5 wrench attack: </strong>In this type of attack, someone physically threatens to hurt you if you don’t tell them the pin-code or seed phrase. Trezor allows you to create a dummy account that you can access with a particular seed phrase. You can store a tiny amount in this account and save most of your funds.</p>
</li>
</ul>
<p>Trezor Model T supports over 1500 cryptocurrencies including Bitcoin, Ethereum, XEM, Cardano, and many more.</p>
<blockquote>
<p>There is also a cheaper model of Trezor hardware wallet called Trezor One, but it does not support as many cryptos, does not have a color touch screen, and it still uses micro-usb.</p>
</blockquote>
<p><strong>Cost of Model T- 159 EUR ($190 approx)</strong></p>
<h2 id="ledger-nano-x">Ledger Nano X</h2>
<p><img src="https://cdn-images-1.medium.com/max/2000/1*TxB2xWvNlHIoREJc6YZW_A.png" alt="[Credit: Ledger](https://cdn.hashnode.com/res/hashnode/image/upload/v1627479873176/_CvFF6VzW.html)" /><em><a target="_blank" href="https://shop.ledger.com/products/ledger-nano-x">Credit: Ledger</a></em></p>
<p><a target="_blank" href="https://shop.ledger.com/products/ledger-nano-x">Ledger Nano X</a> is another wallet with a large market share in the hardware wallet market. Ledger has a bulletproof history of being one of the most secure wallets out there, with no reported cases of a wallet hack. However, their <a target="_blank" href="https://www.investopedia.com/hackers-leak-customer-info-from-crypto-wallet-ledger-5093577">sales database was hacked in June 2020, and the data of thousands of users was leaked</a>. Hackers stole the crypto of thousands of users through indirect methods such as phishing.</p>
<p>So you might be thinking, <em>why are we discussing ledger when their database has been hacked</em>. Because:</p>
<blockquote>
<h1 id="ledger-does-not-have-user-private-keys-seed-phrases-cryptocurrency-addresses-or-any-information-generated-or-stored-on-ledger-devices">Ledger does not have user private keys, seed phrases, cryptocurrency addresses, or any information generated or stored on ledger devices</h1>
</blockquote>
<p>This means that even if their database was hacked, hackers have no access to your crypto unless you, yourself, give them your seed phrase.</p>
<p>This kind of attack can happen to any hardware wallet, software, or any company/business that runs on the internet. Therefore, it is not just the <em>Ledger’s problem.</em></p>
<p>Ledger has probably the best software to buy and sell crypto without compromising the security called Ledger live. It supports all the cryptocurrencies I use and has the same security benefits as Trezor wallets, except for creating a dummy account. Ledger Nano X supports over 1500 cryptocurrencies and you can store up to 100 cryptos at a time.</p>
<blockquote>
<p>There is also a cheaper model of Ledger hardware wallet called Ledger Nano S which also supports 1500 cryptos, but it can only store 3–10 at a time. It has a smaller display, and it still uses micro-usb.</p>
</blockquote>
<p><strong>Cost of Ledger Nano X- $119</strong></p>
<h2 id="safepal">SafePal</h2>
<p><img src="https://cdn-images-1.medium.com/max/2048/1*FnLfECOxjNoG6kGuXhcj8Q.png" alt="[Credit: SafePal](https://cdn.hashnode.com/res/hashnode/image/upload/v1627479874590/_jYdZG9Pc.html)" /><em><a target="_blank" href="https://shop.safepal.io/products/safepal-hardware-wallet-s1-bitcoin-wallet">Credit: SafePal</a></em></p>
<p><a target="_blank" href="https://shop.safepal.io/products/safepal-hardware-wallet-s1-bitcoin-wallet">SafePal S1</a> is the most advanced wallet (in terms of features) out there. It has a colored display that can properly display all the information more clearly than any other wallet. It has a camera on its back to scan encrypted QR codes and communicate with your phone, which is a handy feature given it does not have Bluetooth, Wi-Fi, or any other form of communication medium, which in itself, is a feature for better security.</p>
<p>I would highly recommend this wallet to anyone who is new to space because of its ease of use and better design.</p>
<p>But there is one caveat. It does not support as many cryptos as its competitors. As of this writing, it is available for pre-order and would take a long time to ship to a lot of places.</p>
<p>In terms of cost, it is surprisingly cheap!</p>
<p><strong>Cost of SafePal S1- $39.99</strong></p>
<p>In terms of security, it does not matter which hardware wallet you use. Most of the popular wallet manufacturers don’t store any data that is stored in the wallet. This means that even if they get hacked or went out of business, your crypto is safe.</p>
<p>You will only lose your crypto if any bad actor gets access to your seed phrase or private key.</p>
<p>I use Ledger Nano X because it supports all the crypto I use, and its UX is very easy. It also has a good history and a lot of industry experts I follow use it.</p>
<p>You can find more content/reach out to me using this link — <a target="_blank" href="https://y.at/%F0%9F%92%BB%F0%9F%8E%A5%E2%9C%8D%EF%B8%8F%E2%98%95">https://y.at/💻🎥✍️☕</a></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1627479876054/QFJj-Fdf6.png" alt /></p>
]]></content:encoded></item><item><title><![CDATA[Blockchain Strikes Again: Solving The World’s Most Pressing Issue]]></title><description><![CDATA[Photo by bantersnaps on Unsplash
What do Apple, Amazon, Google, Tesla, and AECROS have in common?
Disruptive Innovation!

Disruptive innovation replaces an old and established market with a new market and a value network.

Disruptive innovation impro...]]></description><link>https://blog.shubhpatni.com/blockchain-strikes-again-solving-the-worlds-most-pressing-issue-3e43b54b114f</link><guid isPermaLink="true">https://blog.shubhpatni.com/blockchain-strikes-again-solving-the-worlds-most-pressing-issue-3e43b54b114f</guid><category><![CDATA[Blockchain]]></category><category><![CDATA[Cryptocurrency]]></category><category><![CDATA[iot]]></category><category><![CDATA[technology]]></category><category><![CDATA[Technical writing ]]></category><dc:creator><![CDATA[Shubh Patni]]></dc:creator><pubDate>Sat, 27 Feb 2021 15:39:34 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1627505257383/ZcbOe2TBk.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><em>Photo by <a target="_blank" href="https://unsplash.com/@bantersnaps?utm_source=medium&amp;utm_medium=referral">bantersnaps</a> on <a target="_blank" href="https://unsplash.com?utm_source=medium&amp;utm_medium=referral">Unsplash</a></em></p>
<p>What do Apple, Amazon, Google, Tesla, and AECROS have in common?</p>
<p><strong>Disruptive Innovation!</strong></p>
<blockquote>
<h1 id="disruptive-innovation-replaces-an-old-and-established-market-with-a-new-market-and-a-value-network">Disruptive innovation replaces an old and established market with a new market and a value network.</h1>
</blockquote>
<p>Disruptive innovation improves on an existing way of doing things and provides a better value to its customers, and it makes the early investors Millionaires!</p>
<p>All the tech giants are successful because they have recognized the pain points of the existing way of doing things and through technology, made the same job much easier. Construction, being the <a target="_blank" href="https://www.globalinfrastructureinitiative.com/sites/default/files/pdf/The-digital-future-of-construction-Oct-2016.pdf">least digitized industry</a> in the world, is ripe for disruption.</p>
<h3 id="how-disruption-made-apple-amazon-and-tesla-successful">How Disruption made Apple, Amazon, and Tesla successful</h3>
<p>Before Apple, Blackberry was one of the biggest players in the cellphone market. It sold thick b<em>usiness phones </em>with a small keyboard built right in the smartphone. It might sound absurd, but people preferred the keyboard over the touch screen. This is because touch screen technology at the time was annoying and there was not much use of it. iPhone and App Store changed everything. Keyboard phones became irrelevant.</p>
<p>A similar thing happened with Amazon and eBay. Amazon started as an online bookstore and dominated the online book market. At the time, everyone thought it was dumb to sell books online from your garage when people could buy them from a store. Amazon proudly described itself as <em>Earth’s Biggest Bookstore </em>and quickly partnered with many wholesalers and distributors to meet the demand. The rest is history.</p>
<p>It is a common fact that eventually, we will run out of gas. Gasoline cars have no future, it is just a matter of time. Knowing this simple fact, many companies tried making electric cars, but all of them failed miserably because they could not design advanced motors and batteries. They relied on other suppliers and just <em>legoed</em> the pieces together and expected it to work on the market. Musk realized this and made all major components in-house, and now Tesla is the biggest car company in the world in terms of market cap.</p>
<p>The process that seemed normal to others was an inefficient way of doing things for Jobs, Bezos, and Musk. Stats were against them, no one agreed with them, and there was no one in history to learn from.</p>
<p><strong>A similar thing is happening in the construction industry.</strong></p>
<h2 id="aecros-is-changing-the-game">AECROS is Changing The Game</h2>
<p><img src="https://cdn-images-1.medium.com/max/12000/0*33wz4pQ1PeO8f6xQ" alt="Photo by [GR Stocks](https://cdn.hashnode.com/res/hashnode/image/upload/v1627505255558/b2ss_yMKS.html) on [Unsplash](https://unsplash.com?utm_source=medium&amp;utm_medium=referral)" /><em>Photo by <a target="_blank" href="https://unsplash.com/@grstocks?utm_source=medium&amp;utm_medium=referral">GR Stocks</a> on <a target="_blank" href="https://unsplash.com?utm_source=medium&amp;utm_medium=referral">Unsplash</a></em></p>
<p>AECROS is pioneering the auto-construction industry.</p>
<blockquote>
<p><a target="_blank" href="https://autoconstruction.org/2020/10/16/what-is-auto-construction/">*Auto Construction</a> will combine various existing technologies such as IoT, Blockchain, AI, Digital Twin, BIM to create a fully autonomous and most efficient construction method, never fathomable before.*</p>
</blockquote>
<p>Just like touch screen revolutionized cell phones, the internet revolutionized trade, and batteries are revolutionizing cars, blockchain will revolutionize the construction industry.</p>
<p><strong>Pain points in the construction industry</strong></p>
<ul>
<li><p>Traditional construction methods take a lot of time, increasing labor, management, and out-of-business costs.</p>
</li>
<li><p>It requires many middlemen and suppliers, making the supply chain inefficient.</p>
</li>
<li><p>At every step of the process, timely payments must be made to maintain trust amongst stakeholders and carry on the pace of the project.</p>
</li>
<li><p>It is hard to access the adequate quality of materials and make sure there is no theft.</p>
</li>
<li><p>People in developing countries do not have access to the business of construction supply stores because of high costs.</p>
</li>
<li><p>Current construction methods produce a lot of waste, which can be solved using reusable construction methods.</p>
</li>
</ul>
<p>In short, traditional construction methods are inefficient.</p>
<p>AECROS is solving these problems by making <em>self-complete</em> blocks that robots can assemble. These blocks will have all the housing requirements such as drainage pipes, electric fitting, paint, tiles, and will be packed with features such as floor heating, fire resistance, embedded IoT devices, and much more.</p>
<p>As robots can assemble these blocks, it reduces construction time, saving in labor, management, and out-of-business costs. Robots can work 24/7 with precision, reducing the need for a large workforce and thus reducing the overall cost of construction by multiples.</p>
<p>To maintain trust amongst all the stakeholders, all the data regarding construction i.e. expected construction duration, payments, material supplies, etc can be put in a <strong>private blockchain</strong>. This would not only provide transparency through <strong>smart contracts</strong>, but payments can also automatically execute upon the completion of certain tasks. The owner can program these smart contracts as per the agreement between different stakeholders.</p>
<p>The reusable category of blocks is waste-free. The entire life-cycle of a building from construction to demolition results in very little to no waste — previously unheard of in the industry.</p>
<p>Tokenization of blocks enables anyone from anywhere in the world to trade these blocks anytime, giving them access to a <em>construction supply store </em>business.</p>
<p>More about AECROS-
<a target="_blank" href="https://medium.com/datadriveninvestor/blockchain-finds-its-home-in-a-10-trillion-industry-adcb34b1d2b2"><strong>Blockchain Finds Its Home In a $10 Trillion Industry</strong>
<em>Blockchain can now have a real-world impact, tackling real-life problems</em>medium.com</a></p>
<blockquote>
<h1 id="these-are-just-a-few-opportunities-and-innovations-in-the-vast-space-of-auto-construction-innovation-the-industry-will-be-so-big-that-it-is-hard-to-even-imagine-the-implications-and-future-innovations-that-are-yet-to-come">These are just a few opportunities and innovations in the vast space of auto-construction innovation. The industry will be so big that it is hard to even imagine the implications and future innovations that are yet to come.</h1>
</blockquote>
<p>With an ever-increasing population and shortage in the housing market, auto-construction holds the potential to save trillions of dollars and provide billions of new homes.</p>
<p>Here’s how AECROS can end the housing crisis-
<a target="_blank" href="https://medium.com/coinmonks/housing-crisis-will-be-a-thing-of-the-past-1028ea598ed2"><strong>Housing Crisis Will Be a Thing of the Past</strong>
<em>A Blockchain and AI-based solution to the world’s most pressing issue</em>medium.com</a></p>
<p>You can compare AECROS to Lilium, which is working on vertical take-off electric jets. Just think about it! Jets that don’t require long runways and fuel to run, and they already have a working prototype. This was the dream in the aerospace industry.</p>
<p>Lilium is revolutionizing the aerospace and travel industry. In the same way, AECROS is revolutionizing the much bigger housing and construction market.</p>
<p>These two startups are still taking their first steps, just like Tesla and Amazon in their early days. Looking at the bigger picture, disruptive innovation will surely replace traditional construction methods and make new billionaires.</p>
]]></content:encoded></item><item><title><![CDATA[Common Mistakes Beginners Make While Learning Unity]]></title><description><![CDATA[Photo by Pawel Kadysz on Unsplash
I am a beginner in unity myself, but as they say, only a beginner can understand a beginner’s pain, so I wrote this blog post.
I learned unity using an online course, and although I was following the instructions, th...]]></description><link>https://blog.shubhpatni.com/common-mistakes-beginners-make-while-learning-unity-f9ff1f43d9d6</link><guid isPermaLink="true">https://blog.shubhpatni.com/common-mistakes-beginners-make-while-learning-unity-f9ff1f43d9d6</guid><category><![CDATA[Game Development]]></category><category><![CDATA[unity]]></category><category><![CDATA[General Programming]]></category><category><![CDATA[Programming Tips]]></category><category><![CDATA[C#]]></category><dc:creator><![CDATA[Shubh Patni]]></dc:creator><pubDate>Tue, 23 Feb 2021 13:41:33 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1627505269304/s6MvHIyaO.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><em>Photo by <a target="_blank" href="https://unsplash.com/@pawelkadysz?utm_source=medium&amp;utm_medium=referral">Pawel Kadysz</a> on <a target="_blank" href="https://unsplash.com?utm_source=medium&amp;utm_medium=referral">Unsplash</a></em></p>
<p>I am a beginner in unity myself, but as they say, o<em>nly a beginner can understand a beginner’s pain, </em>so<em> </em>I wrote this blog post.</p>
<p>I learned unity using an online course, and although I was following the instructions, there are certain pitfalls that you just can’t avoid. Moreover, if you are trying to be creative and do extra than what they teach in the course, you will surely find yourself in a confused state for hours.</p>
<p>It happened to me! For some reason, all the levels in my game got deleted, and I had to create everything again. I could not understand what was going on with lighting, so everything was pitch black in my first game. I was trying to make a scoreboard for the game and text just won’t appear.</p>
<p>If you have already got your hand dirty, I am sure you know what I am talking about. But if you are new to this, this post will be a lifesaver. It’s difficult to find solutions/reasons for these problems. After surfing on google for hours, here are the solutions to these common problems.</p>
<h3 id="prefabs">Prefabs</h3>
<blockquote>
<p>Unity’s Prefab system allows you to create, configure, and store a GameObject complete with all its components, property values, and child GameObjects
 as a reusable Asset. The Prefab Asset acts as a template from which you can create new Prefab instances in the Scene.</p>
</blockquote>
<p>Prefabs really are a lifesaver if you are working with a lot of similar objects and different levels. However, half-knowledge can destroy your project. That’s what happened to me when I accidentally deleted all the levels.</p>
<p>To create a prefab, simply drag any gameobject to the assets folder and the prefab will be created. You can now use this prefab to create the same game object how many times you want. The new game object will receive all their information about color, material, size, etc from the prefab, only the position and rotation will be different for each gameobject.</p>
<p>As the information is being retrieved from prefab, if you make any changes to that file, all the gameobjects deriving from it will be affected. You can make changes to game objects created using prefab, but make sure not to apply them to prefab, otherwise, all the other game objects (with the same properties as prefab) will be affected.</p>
<p>Ex- Let’s say we have 3 cubes: Cube A, Cube B, Cube C, all created using the same prefab. They can have a unique position and rotation values, but the scale and everything else are the same. Suppose, I change the size of Cube A from 1 to 2, nothing will happen to other cubes. But if I click on <strong><em>apply changes</em></strong> to the prefab, all the cubes will change.</p>
<p>So now we have all three cubes with size 2 and our prefab also has size 2.</p>
<p>Let’s change Cube C’s Z-axis side to 3, Cube B’s Z-axis side to 5, and leave Cube A and prefab to 2. Now if I click on Cube C and apply the prefab, Cube A’s Z-axis side will change to 3 as well, because it was the cube with a similar attribute as the prefab. Cube B won’t change at all!</p>
<p>To understand it better, I recommend you to get your hands dirty.
<a target="_blank" href="https://docs.unity3d.com/Manual/Prefabs.html"><strong>Prefabs</strong>
<em>Unity's The fundamental object in Unity scenes, which can represent characters, props, scenery, cameras, waypoints, and…</em>docs.unity3d.com</a></p>
<h3 id="lighting">Lighting</h3>
<p><img src="https://cdn-images-1.medium.com/max/12000/0*2233amGzVXDP6vVK" alt="Photo by [Brian Suh](https://cdn.hashnode.com/res/hashnode/image/upload/v1627505263607/Mzs1ROgqj.html) on [Unsplash](https://unsplash.com?utm_source=medium&amp;utm_medium=referral)" /><em>Photo by <a target="_blank" href="https://unsplash.com/@_briansuh?utm_source=medium&amp;utm_medium=referral">Brian Suh</a> on <a target="_blank" href="https://unsplash.com?utm_source=medium&amp;utm_medium=referral">Unsplash</a></em></p>
<p>Lighting is one of the most important things in a game. No matter how your scene looks, but without lighting, it is just like food without salt. There are many kinds of lights in unity — point lights, spotlight, directional light, environment lighting, etc. There are various ways to render lights as well, and if you mess it up your scene may just look pitch black.</p>
<p>There are a lot of things we can discuss lighting, but it is not possible to look at everything in a single article.</p>
<blockquote>
<h1 id="to-improve-the-lighting-of-your-scene-you-can-adjust-the-environment-lighting-by-using-different-skyboxes-different-intensities-and-reflections">To improve the lighting of your scene, you can adjust the environment lighting by using different skyboxes, different intensities, and reflections.</h1>
</blockquote>
<p>Turn off environment lighting and add spotlights or point lights as per your requirements. Now turn back on environment lighting to get the final view of the scene.</p>
<p>Turn off <strong>Auto Generate lighting</strong> and generate lighting manually once you have set all the illumination objects. This will create a <strong>Lighting Data Asset </strong>in the project<strong>.</strong> It contains Scene’s GI data, and other data needed to light the scene.</p>
<p>As Auto-generate lighting stores the lighting data in the memory rather than storing it in a file, unity loses the GI data for scenes that are unloaded in the play mode.</p>
<p>Use the link below to learn more.
<a target="_blank" href="https://learn.unity.com/tutorial/lighting-best-practices"><strong>Lighting Best Practices - Unity Learn</strong>
<em>Optimizing Scene lighting is not an exact science - your process usually depends on your artistic direction. For this…</em>learn.unity.com</a></p>
<h3 id="canvas">Canvas</h3>
<p>All the UI elements must be placed in the canvas gameobject as its children.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1627505265347/MGmMMCYqi.png" alt /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1627505267241/OrvhG1xRo.png" alt="Canvas in scene mode, with text in the middle. Treat canvas as full screen. The main game object is on the bottom left corner (left) Result in game mode, the text is displayed as expected — in the middle of the screen (right)" /><em>Canvas in scene mode, with text in the middle. Treat canvas as full screen. The main game object is on the bottom left corner (left) Result in game mode, the text is displayed as expected — in the middle of the screen (right)</em></p>
<p>When you create a text field, a canvas game object is automatically created. As shown in the image, this canvas looks huge compared to the game. One might think that they need to reduce the size of the canvas to fit it according to the game, but it is not the case.</p>
<blockquote>
<h1 id="treat-this-canvas-as-the-same-size-as-your-screen-and-place-ui-elements-as-shown-in-the-image-the-result-in-the-game-scene-will-be-as-you-expect-this-is-true-for-the-default-screen-space-overlay-render-mode">Treat this canvas as the same size as your screen and place UI elements, as shown in the image. The result in the game scene will be as you expect. This is true for the default — screen space overlay render mode.</h1>
</blockquote>
<p>There are 3 render modes available in canvas: screen space-overlay, screen space-camera, and world space. The way UI elements will change is based on what render mode you choose.</p>
<ul>
<li><p>In the <strong>screen space-overlay mode</strong>, if the screen is resized, or the resolution is changed, the canvas will automatically change to match it.</p>
</li>
<li><p>In<strong> screen space-camera mode</strong>, the canvas is placed at a given distance in front of the camera. In this mode, the camera setting affects the appearance of the UI.</p>
</li>
<li><p>In <strong>world space mode</strong>, the canvas will behave as any other game object. You can use this mode when UI must be placed behind or in front of other game objects.
<a target="_blank" href="https://docs.unity3d.com/Packages/com.unity.ugui@1.0/manual/UICanvas.html"><strong>Canvas</strong>
<em>The Canvas is the area that all UI elements should be inside. The Canvas is a Game Object with a Canvas component on…</em>docs.unity3d.com</a></p>
</li>
</ul>
<h3 id="dont-copy-the-tutorial">Don’t copy the tutorial</h3>
<p>In the beginning, in fear of not messing up anything, it feels easy and the right thing to exactly copy the tutorial. But don’t do it.</p>
<p>With time, the UI of unity (or any other program/language) changes. If you cannot make a project without relying upon tutorials, at some point you will get stuck. It’s better not to copy everything, let your imagination run wild, and use google whenever you are stuck.</p>
]]></content:encoded></item></channel></rss>