GET YOUR KNOWLEDGE!
What is Cryptocurrency
What is a Blockchain
How does mining verification work
What is Proof of Work
What is Proof of Stake
What is the difference between a Coin and a Token
What is Bitcoin
What is Ethereum
What is DeFi
Lending and Borrowing
Decentralized Exchange (DEX)
What is a Blockchain Fork?
What is Yield Farming?
Cryptocurrency is a digital currency that is used as medium of exchange for goods and services peer-to-peer with no third party involved to act as intermediary, such as a bank or credit card company. This is possible because cryptocurrencies (cryptos), functions based on a technology called Blockchain which is a decentralized network of computers that holds the ledger, monitors, and verifies all the transactions made. Due to the decentralized nature of the blockchain, that most cryptos run on, and the exhaustive checks that are made for verification, and encryptions, make it nearly impossible to steal and are immune to government interference and manipulation.
Cryptography is the study and practice of sending and receiving information securely, as it relates to computers sciences, and cryptocurrency, this is done through encryption and decryption algorithms. By encrypting the transaction, as it is sent over the network to become part of the blockchain, any prying eyes that try to look at what the details of the transaction are, like the parties involved or items or services bought and sold, will be unable to. The encryption ensures that only those with the key to de-crypt it will be privy to that information. As you might have guessed with all this encryption, security is the key component to any cryptocurrency and different methods, which we will talk about later, are used to ensure that coins/tokens are not stolen or duplicated.
Getting cryptocurrency is actually quite easy for anyone. All you have to do is create a digital wallet through any of the available services and you’re set, as long as you have internet. There are pros and cons to all things and cryptocurrency is no exception.
- The use of blockchain technology makes it virtually impossible to hack, fake, duplicate, or steal.
- Anonymity is prized above all else. Making the identity of the parties involved as well as the items or services completely or semi-private. Different coins have varying levels of privacy protections.
- A decentralized network means that there are no limits to how much or when something can be purchased. You have full access to all you own 24/7.
- Lower or even no fees at all when making a transaction.
- The secure and private nature of cryptocurrency means it could be, and has been, used for criminal activity like money laundering, tax evasion, ransoms, etc.
- Losing your digital wallet, i.e forgetting your passwords and/or losing your private key, means losing all the crypto within the wallet. It is important to keep both digital and hard copy backups of such information in case of unfortunate events like a lost or stolen phone, or hard drive failure, etc.
- Because of the completely digital nature of cryptocurrency, if there is no internet then there is no way to send or receive your digital currency. Also in the event, although highly unlikely, of an EMP that knocks out all power and infrastructure all that cryptocurrency could be lost forever.
- “Hard Forks” may be created if the overwhelming majority of the community decides which would invalidate any transaction made of the old blockchain in favor of the new one.
When it comes to cryptocurrency it is important to that we talk about what a blockchain is first as it is fundamental to all cryptocurrencies. For the purpose of simplicity, we will discuss generally what a blockchain is and how it works, we will leave the specifics of how the different types of Cryptos (Bitcoin and Ethereum) implement its encryption when we cover them.
To start, a blockchain is like a database, it is a collection of information that is stored electronically that anyone who is a part of the network can access. A typical database is usually stored in a centralized location where the people in charge can add, edit, or remove any information they like; however, this is where a blockchain starts to differ. A blockchain shares its information with everyone apart of the network so that they all have their own copy of it, in the case of cryptocurrency this chain would be called a DTL (Digital Transaction Ledger) which will keep track of every account and transaction ever made. Now this would normally be a terrible idea, to give everyone a copy and access to your records, but this actually works in your favor thanks to the cryptography used by any of the cryptocurrencies and the verification needed to validate any changes. This adds a level of transparency that keeps everyone playing honest and fair.
After a block has been filled with the allotted transaction it must then be verified in ordered to be added to the chain. Depending on the crypto, a crypt o-logical puzzle must be solved and once this is solved it is then broadcast across the network for verification. Once the has been verified the maximum number of nodes needed it is then accepted and added to the blockchain, at which point not a single bit of information can be changed without having to do the entire process over again. This process is known as mining and anyone apart of the network can be a miner who verifies transactions as long as they have the necessary hardware.
However even with all the encryption and verification there are some who still try to cheat. There are times when a fork in the chain does occur however and there is a simple remedy for this.
Sometimes two blocks appear in the same spot in the chain, both have been verified, so which one is the correct one? The simple answer is you trust the chain that is the longest. In the world of blockchains, as the chains start to get longer, they start to get harder to solve and require more computational power to do so. Someone who is maliciously trying to forge a transaction might be lucky enough to solve the verification puzzles for a short time with his own hardware but would soon fall off thanks to the collective computational power of the network working on the other chain. For any blockchain this person or group of people would need more than 51% of the ENTIRE network’s computing power which would be infeasible and cost millions, if not billions, of dollars. This makes the blockchain an immutable ledger that can always be trusted.
Blockchain technology is not regulated solely to the world of cryptocurrency. Due to its hack-proof and un-falsifiable nature it is even being considered for multiple other applications. Things like tracking supply, healthcare records, property records or titles, and voting could all be added to a blockchain to ensure crucial information is never lost, stolen, or maliciously used for one’s own benefit. As blockchain technology continues to prove itself this may very well become a reality in the near future.
There are two census methods that are used to verify blocks to be added:
- Proof of work
- Proof of stake
Proof of work is the older of the two methods and is used by Bitcoin, Ethereum 1.0, and many others cryptos of the older variety. The newer method, Proof of Stake, is used by Cardano, Ethereum 2.0, and many other newer varieties of cryptocurrency.
Proof of work is a consensus method that was introduced along with the birth of Bitcoin. This method was used as it was the best way to eliminate the problem of double spending, as well as a variety of other major security problems, when implementing a distributed digital ledger. Transactions are added to a new block in order of the time they are made, then once the block has been filled it is left for the miners to verify. These miners must, essentially, solve a difficult math problem which is known as a hash function. This problem is based off the current block that is trying to be solve and in reference to the previous block which has a target hash key they must be met using the variable that is given known as a nonce value. It a bit confusing but this is done to ensure that the data remains consistent and continuous. Think of the blockchain as a complete record of every transaction ever made and the math problem to be solved ensures no one is double spending or doing something else malicious.
This consensus method is a very robust system of ensuring that everything is on the up and up. For someone to try and cheat and steal bitcoins from others they would have to have control of at least 51% of the entire power on the Bitcoin network which would amount to billions of dollars of hardware in order to outperform the miners of the rest of the world who are on the network. Also, such an event would be noticed and would immediately reduce the value of said currency to zero as it could no longer be trusted.
While Proof of work is a very robust system and has proven itself to be extremely reliable, it is not without its drawbacks. To date, the energy consumption level for the Bitcoin network is the same amount that all of Switzerland uses. This is due to the extraordinary amount of computational power needed to solve the ever-growing number of blocks on the chain. This also means that this consensus method is not the most scalable, as the chain continues to grow larger the more power is needed and as more power is needed you need more money to pay for new hardware and the electric bill. This is the trade off, reliability vs cost.
In any proof of work type model, all miners who are participating are essentially competing against one another. This is because the miner who is able to solve the problem first and have it verified across the network is then rewarded with coins of the network, so a Bitcoin miner would be rewarded with some bitcoin. There are companies or groups who will pool their resources together so that they can have a better chance at solving the problem first, but nothing is guaranteed. This method of problem solves, and reward is mainly why it costs so much for new blocks to be added but could also be quite lucrative if one manages to hit one of these mini lotteries; for Bitcoin that’s about every 10 minutes.
Now that we have an understanding of what proof of work is let’s talk about proof of stake. Proof of stake functions similarly to proof of work, but instead of a free-for-all to be the first miner to solve a problem one miner is selected instead. This miner now has the sole responsibility of solving the problem and will receive a reward for his efforts. However, in order to have the privilege of even solving the block to be rewarded the miner must put up, or “stake”, some of their own cryptocurrency in order to do so. This acts as incentive for the miner to not only solve the block in a timely manner but also do it correctly. The miner’s work will be checked by validators and if it is found to be wrong then the miner will be penalized, which will result in some of the crypto that they staked taken away, this is known as “slashing.” This is one of the major differences between proof of work vs proof of stake as there are no penalties for bad actors in a proof of work system.
Now one might ask how exactly a miner is selected to mine the block and that is a very good question. As you know already the miner must put up a stake in order to have the chance to mine it however there are other variables that are also taken into account for the selection process. Things like how much the miner has staked, how long has the stake been locked up, and history. This helps to spread out the miners who are selected to give a more even playing field.
However, there are some drawbacks to the proof of stake methodology as well. The first is that a miner is going to have to know what they are doing, they must have the hardware as well as the coding knowledge in order to mine the block properly otherwise the block could be solved wrong and transactions within the block are then delayed. In such an event the miner’s stake will be slashed. Alternatively, the miner may solve it correctly but the validators or the system may flag the block as wrong causing it to then be rejecting and again slashing the stake of the miner. Time is also an issue, with proof of work, Bitcoin for example, blocks are solved on an average of 10 minutes per block. Proof of stake blocks could take up to hours, days, or even weeks for a block to be validated, remember the work is being done by only 1 miner instead of everyone on the network. However just because you do not know the code or have the proper hardware does not mean you cannot become a miner as well. There are multiple groups that you could, in essence, out-source the work to so that it gets done properly and in return they would take a percentage of the reward you would end up receiving. This option does present its own flaws as it relies on the trustworthiness of the individual or group/company you are outsourcing to since they could easily run off with all the reward and leave you high and dry.
Overall, a proof of stake consensus method is built more upon trust and has penalties built in to punish bad actors within the system, so it is to everyone’s benefit that the process works correctly, and everyone plays fair. Otherwise, the major issue that proof of stake aims to solve from proof of work, scalability, and massive energy consumption, is all for not.
The word token and coin are used pretty much interchangeably. Both of them could get used and traded like currency but there are more subtle distinctions between the two.
A coin, like Bitcoin (BTC) or Ethereum (ETH known as Ether), is digital currency, it can be used to buy goods and services and the coin will remain within its respective blockchain. Any coin that is used always remains within its blockchain and it represents money. A token is a part of the blockchain, but it works on top of it. It is able to be traded and exchanged for other tokens or coins of another network. It is a separate chain that work in conjunction with its host.
This exchange occurs because tokens represent more of a physical asset like a NFT, title, or deed. It in and of itself does not have intrinsic value but what it may represent could be worth far more. A token is a “physical” transfer of property compared to a coin which is digital value. Think of it this way, when you wire a friend some money, it does not physically change hands instead the balance from your account decreases and theirs increases. Whereas if you sign over a title to a house you give documents that releases ownership of the house to the recipient.
Lastly, one notable difference between the two is that coins are able to be mined. There is a method that must be used depending on the blockchain and the miner(s) is rewarded for the work. A token is not able to be mined but are instead created and traded. Some blockchains like Ethereum even have templates for the easy creation of tokens for use so anyone can make something that they think is of value.
Bitcoin, easily the most popular and well-known crypto out there, was created back in 2009 by “Satoshi Nakamoto”. To this day we still do not know if this was a singular person or a group as he has not been seen or heard of since but with the amount of Bitcoin he owns, about 980,000, it makes him one of the richest people(s) in the world. Since he has not been seen or heard of since, some homage has been paid to him in that the smallest unit of bitcoin a person can own is called a Satoshi.
A fun side note. It is estimated that about 60% of Bitcoin accounts are ghost accounts. That is to say these are accounts of owners who have lost their Bitcoin address, or private keys, and are no longer able to access their wallets. This essentially means that these coins are lost forever in the digital cosmos unable to be recovered.
As mentioned before, mining can be done by anyone who has the proper hardware and is a part of the bitcoin network. In the Bitcoin blockchain, the transactions are verified by Bitcoin users(miners). These transactions are processed by difficult mathematical process called proof of work. Upon being the first miner to complete this proof of work for the transactions, and then approved by the rest of the nodes in the network, they will be rewarded with bitcoin and the new block will be added to the chain. This is how new bitcoin is injected into the economy.
Bitcoin uses a hash function called SHA-256 which will take any information, no matter how big or small, and create a 256 hash for it. The information stored within the blocks combined with the public and secret key of the users for the transaction help create the unique hash code that is generated at the end. This feature of the blockchain is another way of guarding against any individual from trying to edit or add new transaction as it will completely change the resulting hash code generated by the SHA-256 function. Furthermore, because of this there is no way that the input can be derived from its output without simply just guessing correctly.
Mining is a way for a person to obtain a Bitcoin without “purchasing” it outright with money. However, it is a costly endeavor and one that isn’t guaranteed at that. A miner is paid 6.25Bitcoin upon being the first to solve a block. These blocks are complex math problems that, would have been easy for a home computer to solve, have now grown to something that a farm of computers is needed to solve. As such the cost for electricity for such farms can easily be up to 60 or event 80 percent of the profits earned.
The number of bitcoins rewarded for each block is 6.25 and is halved every 4 years. The last halving just happened back in 2020 and the next halving will be in 2024 reducing it to 3.125. As you can see mining will become a less lucrative practice for farming unless prices shoot up dramatically or the cost to operate huge mining facilities falls.
The reason for this is that as the chain gets larger the difficulty of solving the puzzle and computational power needed to create the correct hash key has increased. This is due to a predefined condition that is adjusts the hash target every 2016 blocks. It does this by taking the first block and dividing it by the current block. Since this new hash target gets harder the longer the chain gets the more computing power it takes to mine newer blocks. While the difficulty may increase each time a new hash target is created, this adjustment also ensures that the average time to solve a block is about 10 minutes. The trade of for this security is power and time vs cost. Below you can see a graph of how the difficulty has increased over the years.
In earlier days of mining, it was possible for a basic CPU to solve these problems, the difficulty was not too difficult at the start, but it still took a lot of time for the problems to be solved. Soon after it was discovered that by utilizing the GPU (graphics card) could handle the ever-increasing difficulty while keeping the time to solve down as they were better suited to handle the problems as the entire GPU could be dedicated to solving the hash problem. Now a days most miners and farms use hardware known as ASIC (Application-Specific Integrated Circuit) which is faster and consumes less power than a bank of GPUs. As the name suggests, this is a microchip that is specifically designed to perform a process and somewhere designed and created for the sole purpose of working with the blockchain and mining bitcoin.
While both Ethereum and Bitcoin are blockchains that have their own currency, each of them set out to accomplish two different things. Bitcoin was created for the singular purpose of replacing the current Fiat system used globally by governed nations with a digital currency that could be universally used and trusted regardless of the government. Ethereum on the other hand takes that idea and runs with it, setting out to create a truly decentralized network for users, creators, and businesses on the internet through the use of Dapps making it a programmable blockchain. The developers wanted the blockchain to be used for just about anything while the Bitcoin blockchain is just a digital bank account. As such the Ethereum blockchain allows for the creation of games, dApps, and markets it to its users, the tracking of its currency is actually secondary and is used as a means to power the blockchain.
As one of its key features let us talk about what dApps are. “dApps” are decentralized applications that run on the Ethereum blockchain network. They provide useful services to anyone who use them and are impervious to fraud or tampering once they are published on the network. Once on the network they run autonomously and have zero downtime even if part of the network is down because they exist on the network and not in a centralized location.
Smart contracts work similarly to dApps, they both work autonomously once published and require gas to execute. The main difference is that smart contracts are programs stored within the blockchain itself while dApps interact with it. Think of the dApp being the front-end a user interacts with while the smart contract handles everything in the back end.
The current version of Ethereum solves blocks in the same way that Bitcoin solves blocks, which is proof of work. However, Ethereum developers are working on a new version called Ethereum 2.0 and switching are the consensus mod. to proof of stake to help solve the issue of massive power consumption and scalability.
They will also be implementing a new method of verification for newly solved blocks called ‘sharding’. Sharding is another way its developers hope to improve the speed of verification across the network which is achieved by breaking down the solved blocks into smaller sections and sent off to different validators for verification. Each node will only be responsible for their section and as the section itself is much smaller than the whole block, having them solved separately by different validators and then returned will increase overall speed.
Another difference between the two is the hashing algorithm that is used to solve the block. Bitcoin uses a SHA-256 algorithm for its blockchain hashing while Ethereum uses Etash. Both are one-way algorithms that output a hash code that cannot but reversed engineered but at the same time is easy to check to verify it is correct.
Also, unlike Bitcoin, there is no limit to the amount of ETH that can be generated. Bitcoin has a hard cap of 21 million coins and these last coins will be mine sometime around 2140.
The use of dApps and smart contracts is the key difference that separates the two blockchains. They make it possible for the Ethereum network to work autonomously. These are created by using Ethereum’s programming language Solidity and once they are created and sent to the network, they are not able to be altered ensuring that no tampering can take place once implemented. Changes to the contracts or dApps can be done but the entire network would have to come to agree that the change is necessary and should be done. While essential and are the basis of which the whole network works around, they do come with some downsides. Since they are just code they execute and actions as explicitly written within the code so if there is an error that has gone unnoticed and it is published, there would be no way to fix it unless the entire network agreed to.
It is extremely important that these dApps/smart contracts are coded properly and are error free so that they work exactly as the developer intended. In 2016 a project group called The DAO had $50 million “stolen” from them because of such an error in coding. I say “stolen” because it is not like this person tampered with the contract or used some other malicious means to extract the money. They simply took advantage of a loophole in the code that the developers created, it is akin to someone taking advantage of a tax loophole. After this event, the community opted to reverse the transfer and created a “hard fork” in the blockchain thereby invalidating the other where the $50 million transaction occurred.
This new fork is the Ethereum that most people recognize and are referring to when they talk about Ethereum. There are those who did not agree with this shift since the person who took the money technically did not do anything wrong. They had just used the contract as it was written, this is important because in the Ethereum blockchain the motto is “code is law” so therefore he did nothing wrong, it actually the fault of the developer. The original blockchain is still in use today and that is known as Ethereum Classic (ETC).
Ethereum’s cryptocurrency is actually secondary to the blockchain itself unlike Bitcoin who’s blockchain was built for the sole purpose of managing its currency. Ethereum’s cryptocurrency, Ether, is an in-house currency that members of the network use to run the Dapps on the Ethereum network. Smart contracts and Dapps are on the network and when they are executed, they take up time and computational power on the network. Ether acts as the gas to run these Dapps or smart contracts.
We currently live in a world of Centralized Finance, which is to say the banks and government control the money. They can print the money, dictate what you can and cannot do with it, or even change the rules by how it operates like interests’ rates. A DeFi, Decentralized Finance, seeks to eliminate the control that any one person may have over your finances. DeFi is also more of an umbrella term of all the financial services that you would find on the decentralized market and are direct copies of the real world CeFi services you would likely use but with the added benefit of not being centralized.
To understand DeFi, how it works, and benefits we will have to cover the pillars that DeFi rest upon.
In order for a DeFi to work it needs to be based on a Stablecoin. A Stablecoin is a cryptocurrency that is pegged to a centralized currency and in our case that would be the U.S dollar or USD. DAI, Tether, USDT are the main 3 stablecoins that are tied to the USD. These coins act a bridge between the DeFi world and CeFi world.
Stablecoins do not fluctuate, when a USDT is bought 1 coin is made and when it is spent or cashed out the coin is then burned. This ensures that the coin is representative of the currency that it is tied to and does not increase or decrease in value like BTC or ETH. Having a stability is key as it encourages people to trade, spend, and be confident in the value of the currency they have instead of saving it. You would not be going around spending Bitcoin everywhere if you knew that within a few days it may increase in value 10%. This volatile and uncertainty is what stablecoins seek to resolve.
Stablecoins can be thought of as a virtual cryptographic version of the money that it is tied to. It is something that can be easily traded to buy or sell cryptocurrency without dealing with the laborious task of going through centralized cryptocurrency exchanges like Coinbase, Gemini and your bank while accumulating transaction fees along the way.
For instance, let us say you bought ETH at $500 and after a month it increased to $1500. At this point you decided to sell and reap the profits as you fear the value may drop soon in the future. You would sell the ETH to Gemini and have it transferred to your bank account. All of this takes time, in most cases days to receive your money, and Gemini and your bank will be taking out fees for the transaction. Let’s also not forget that Coinbase and Gemini are also regulated by the government so the IRS will know of the transaction and will be coming to you for taxes. Then, as you predicted, ETH decreases a month later and you wish to buy more, so you have to transfer your money again and again collecting fees along the way.
Alternatively, when the ETH you bought for $600 increased to $1000 you could simply exchange it for 1000 USDT using a smart contract on a decentralized exchange (DEX), which we will cover later. The fee would be far less, typically less than 1%, and the money would be available within a matter of seconds to be used immediately. What’s more, since the money isn’t going through a centralized service the IRS also wouldn’t be notified of the trade being made. This enables you to stay and trade within the crypto sphere without having to use a centralized service and your bank to exchange your coins.
To summarize these stablecoins are stable because they are collateralized by real money or commodities like gold or silver. You will not have to have to worry about the price of the stablecoins suddenly losing their value. Also, companies like TrueUSD have regular audits and are completely transparent to give its users confidence in that what they own has value.
Lending and borrowing money are one of the most essential elements of any financial system. The concept is quite simple, lenders loan out money to borrowers in exchange for interest and borrowers receive a sum of money to do what they need immediately. If you have ever taken out student loans, a mortgage, or even used credit cards, you have borrowed money to pay for something you did not have the liquidity at the time for. This process is usually facilitated by a 3rd party such as a bank or a peer-to-peer service. This process was only possible with real money because of its reliability, however with stablecoins this process can now be brought to DeFi while cutting out the middleman.
Typically, when a person wishes to borrow money, they would go to a bank or lender. They would sign a contract and would have to put up something like 20% or more as collateral, this could be cash or another asset like a house or car. This gives the borrower incentive to pay back the loan as stipulated by the contract or risk losing their collateral and other legal troubles, they may find themselves in. There is no escaping, they have your name, number, address, and other information to track you down to get what they are owed. In the crypto world this is a huge problem because everyone is anonymous. There is no guarantee that the person who borrowed the money does not just put down the 20% and leave with a substantial amount more to never be seen or heard of again.
DeFi aims to solve this with the use of over-collateralization and smart contracts to facilitate the agreement. When someone on a DeFi money market wishes to borrow coins, they would have to put up coins valued at a higher sum than what they wish to borrow. So, let’s say Jeff wishes to borrow $1000 he would have to put up $2000 as collateral. This is important for a few reasons. First, it gives the borrower incentive to payback their loan to release the greater amount they had in collateral, protects the lender from losing the money they have loaned, and lastly, to guard against the volatile nature of cryptocurrency. The coins put up for collateral are then locked by the smart contract ensure that none of the parties run off with the money. Plus, since the smart contracts are immutable, neither party has to worry about tampering with the terms of the agreement.
Now you may be wondering why someone who is trying to borrow money would want or need to put double the coins of what they are trying to borrow in the first place. After all, if you already have it then why not just sell it? Well, there is a few reasons for that, but the main reason is this method allows for people to use the value of their cryptocurrency without actually selling it.
Let us say Jeff had $20,000 in ETH but knows of another upcoming crypto that is making a huge splash and he see potential to make some money. He could sale half of his ETH to invest in the new crypto but the gains from doing so would not cover the gains he would have made from just leaving his money in ETH. Instead, Jeff could borrow the $10,000 by using his $20,000 ETH as collateral and invest in the new crypto. Jeff ends up turning his $10,000 into $20,000 and decides to pay back his loan to release his locked-up coins. ETH in the meantime has doubled in price to $40,000 making his net gains $30,000 instead of $20,000 if he were to sell and invest instead.
Now there is another type of loan that is somewhat new to DeFi known as a Flash Loan. A Flash loan is a smart contract that allows someone can borrow millions of dollars’ worth of crypto with absolutely no collateral. The catch is that the loan must be paid back within the same transaction block that the loan was made. This is usually taking place over a matter of seconds hence the name flash loan. The reason these loan types of loans are even possible is due to the smart contract itself. The contract will only execute if everything within can be executed and the money loaned can be returned otherwise it will not run and the loan will not be taken.
There are currently three main reasons for utilizing a flash loan: Arbitrage, Collateral Swap, and Self Liquidation.
Arbitrage is the act of buying a security, or in this case crypto, from one market and then selling it immediately on another market for a higher price. In the Ethereum DeFi crypto world all these transactions would be executed via code written and put into a smart contract. The smart contract would run, check to see if the transactions are possible and if so, execute the loan. Remember that everything on the Ethereum network requires Gas so even if the contracts fail you are still required to pay the Gas fee. This sounds simple enough so let us see what a flash loan like this would look like.
You see that on Coinbase you are able to buy the BAT token for $10 but Gemini is offering it $11. You could write a contract that borrows $1,000,000 from AAVE, then buys $1,000,000 worth of BAT at $10, and then sell it to Gemini for $11 a share for a total of $1,010,000. You then pay back your loan from AAVE and take $10,000 as profit. There are some fees though like Gas price to run the contract and AAVE charges 0.09% for taking the loan which in this case would be $900. This is the most common use of a flash loan.
Flash loans can also be used for a process called collateral swapping. As you know with borrowing you have to put up your own crypto as collateral. So, you end up using ETH as collateral to get some DAI, all is well but at some point, you decide you no longer wish to have your ETH as collateral and want to switch it, but you do not have the DAI needed to pay back the loan. Here you could write a smart contract that borrows the DAI from AAVE to pay the loan, get the ETH back, swap the ETH for BAT, borrow the DAI again using BAT, and then finally pay back the loan with the DAI. This multi-step process would be taken care of in seconds, and you now have access to your ETH. Just remember that AAVE or any other DeFi lender will charge a small fee for taking out the loan.
The last but not least example for flash loans is Self-Liquidation. This process is remarkably similar to collateral swapping but the two main reasons for using a flash loan for self-liquidation is what we will cover.
For our first scenario let us say you used ETH to borrow some DAI. After a few months, the price of the ETH you used as collateral starts to drop significantly and you are approaching the liquidation level. To avoid having the contract liquidate your collateral and charge additional fees you borrow the DAI needed to pay the original loan to unlock and get back your ETH. Then you convert enough of your ETH into DAI to payback your flash loan. This way you get out of your loan and keep your ETH after paying much smaller fees to borrow.
Now imagine a years ago you deposited 2,000 ETHS into AAVE for lending and earning interest. At the time it was only worth $50 a coin which means it is total worth is $100,000. Soon you end up needing some money to pay bills, so you borrow $30,000 against it. Fast-forward to present day ETH has sky-rocketed in value to $1,000 making the ETH you have locked up worth $2,000,000! The only problem is you just do not have the $30,000 to pay back to unlock your ETH. Like above you can utilize a flash loan to self-liquidate and unlock your ETH.
A Decentralized exchange (DEX) is a peer-to-peer(p2p) service that allows two parties to exchange cryptocurrency directly. DEXs fulfill one of crypto’s core principles which is fostering financial transaction that do not use any type of intermediary like a bank or payment processor.
Now you may have heard of some advertisements for crypto exchanges like Coinbase or Gemini, but it is important to know that they are not a DEX. These services are actually a centralized exchange (CEX), they are regulated and are able to trade fiat currency for crypto. Also, because they are regulated, they will also require you to divulge your information in order to take part in them. A DEX on the other hand does not require any information at all and merely acts as a service to set up trades through its smart contracts. The tradeoff is that a DEX only allows for the exchange of crypto for other crypto. Another thing to keep in mind when trading on a DEX is that you can only exchange coins or tokens that are a part of that blockchain.
Now that you know what a DEX is let us take a look at how it works. There are two methodologies that a DEX can employ for trading which are the order book method or an automated market maker.
The order book method is a tried-and-true method of trading as it is what uses to negotiate trading as it is what the US stock market currently uses. How this works is that if you want to buy or sell an asset you would pick a price and put in an order for it. When the CEX or smart contract finds someone else who wants to make that same trade it will make the exchange and give you what you want. Alternatively, you could even browse the order book yourself until you find a trade you would like to make and complete the transaction that way. While this is a proven method it does have some minor drawbacks like having to wait to find another party who is willing to agree to your terms and in the process, the money, or assets you are using will be locked up during this time.
The more favored and widely used method of an automated market maker (AMM). AMMs use algorithms, smart contracts, and a liquidity pool to make exchanges. This allows people to make exchanges instantly as they are not having to wait around for someone to come around and agree to the terms of buying or selling that they have set; they can trade directly with the pool itself at the price the liquidity pool has it set at.
For a better understanding of how AMM work we need to dive into how a liquidity pool works. A liquidity pool is a pool of crypto assets that typical stores two tokens, although some can go as high as 8. It then uses an algorithm, an inverse formula known as a Constant Product AMM, to adjust the price of each token as they are exchanged so that each half of the pool is responsible for 50% of the total value. The formula for the constant product is written as X*Y=K where X and Y are the tokens in the pool and K is the constant. This formula is used to calculate price and ensure that the total value of the pool remains the same. Let’s say that we have a pool that exchanged ETH and BAT, and each are worth $1. If the pool had $1,000 in liquidity at the start, then there would be 500 tokens of each in the pool since each are worth $1 and both tokens in total would equal $1,000. Now before trading can begin, we need to find our constant 500 x 500 = 250,000. Since our constant is 250,000 that means that any time an exchange is made the total of the two tokens must equal our constant. Someone now comes by and want to exchange 150 BATS for ETH, and we need to figure out how much to give in return. We use the constant and divide it by the new total of BAT, 250,000 / 650 = 384.6153846153846 and then subtract this from our current stock of ETH 500 – 384.6153846153846 = 115.3846153846154. This means that for the 150 BAT this person is exchanging they will receive 115.3846153846154 in ETH. This may seem a bit odd but if you multiply the amount of ETH received by the new total of BAT in the pool you will see that the constant that must be kept between the two is reached. Balance must always be kept within the liquidity pool. We also use this formula when finding out the price of the token. Since the pool is $1,000 that means we take our constant of $500, remember the pool maintains a 50:50 ratio, and divide it by the new values. For BAT 500 / 650 = ~$0.769 and ETH 500 / 384 = ~$1.30. An important thing to note is that this formula is run for each token that is exchanged, so the more tokens that are bought the more it will cost per token or the more that is sold the less you will receive per token. This is why we received less ETH than the amount of BAT we used to trade for it. The value of BAT gradually dropped the more we traded for ETH which simultaneously gradually increased in price. This is the basic concept of supply and demand.
Now you may be asking yourself where does the liquidity come from? That’s an easy question and doesn’t require any math to explain it. The liquidity comes from investors known as Liquidity Providers (LPs) and there is a great reason to become a LP yourself, interest. While all these exchanges are happening there is going to be a small fee that is charged to process and run the exchange some of that fee will end up going back to the investors who have put crypto into that pool on a percentage basis. If 30% of all the liquidity in the pool belongs to you then you would receive 30% of the total in fees collected that day. Just keep in mind that if you decide to invest in a pool then you would need to invest and equal amount of each token so that the constant can be maintained.
While DEXs offer many great advantages like security, anonymity, manipulation protection, and transparency due to its open-source nature, there are some drawbacks you should be aware of.
Unlike a CEX which would have a vast pool of resources to draw from, some DEXs do not and at times can suffer from low liquidity. This is because they do not have enough investors to give the tokens that are needed to make the trades happen and also don’t have resources lying around to be moved to make the trade possible. Also, because a DEX resides on the blockchain it may take longer for a transaction to execute because the transaction would have to be verified by miners unlike a CEX. This also leads to what is known as “price slippage.” This refers to the difference in what the expected price of the trade to the price at which the trade was executed. Price slippage can occur at any time, but it is most prevalent at times of high market volatility.
Scam coins could also be used for what is known as a “Rug pull.” Essentially the developer would make a new worthless token and then get people to invest in their new token via a liquidity pool. At this point one of three things can happen which will make the coin you thought was doing well and turn it into the worthless token it really is. The developer could yank all of their liquidity out of the pool taking away far more of the valuable tokens used to invest by other LPs, than the worthless tokens they put in. Which would now leave the pool unable to make any further trades as there are no more tokens to do so. The second way is that they simply sell all of the tokens that they gave themselves after it has reached a sufficient price for them and in turn crashing the market for it. Lastly, they could even write in the code that the token can only be sold by the developers and not by anyone else. After waiting for the price to go up, which it will since supply would constantly be draining as no one can sell back to the market, they sell what tokens they have given themselves and make off with the valuable crypto.
Then there is Impermanent Loss which can only happen to you as an LP. Impermanent loss occurs when your share as a LP becomes uneven compared to its original position. This happens as others perform an arbitrage with the liquidity pool you are a part of. The greater the spread in value of the token to where it is being bought or sold to the greater the loss of your investment compared if you had just held onto your assets. In essence you want the tokens being invested to remain roughly the same the more one of tokens increases or decreases the greater the impermanent loss. You should also know that the reason it is called “impermanent loss” is because there is always the possibility that the prices stabilize at which point there would be no loss at all if you withdrew your investment. Impermanent loss only because permanent loss if you withdraw your investment before it stabilizes.
I know we mentioned the open-source nature of DEXs to be a pro, which it is, it is actually a double-sided sword because of it. While transparency is nice and allows you to do research and know what you are getting into, it also allows for hackers to find exploits within the contract that they can then utilize to attack the chain, game the system, and make off with the money. Remember that code is law and will run as written so any smart contract will only be as good as the developer coding it. Sometimes people make mistakes and there will always be others out there looking for a chance to capitalize on such errors.
One last thing we should mention is that when using a DEX you can only exchange tokens for other tokens that are on the same blockchain. For instance, you can exchange ETH for BAT because BAT uses the Ethereum blockchain. If you wanted to exchange ETH for POLY, you would have to use what is known as a blockchain bridge. Every coin, Ethereum, Cardano, Polygon, Salona, etc. has their own networks. Tokens are virtual version of an asset that can be built on another coin’s blockchain. This makes it possible for you to have a virtual representation of a coin on another network, allowing you to make use of that coin on that network’s dApps. Currently these transfers are only made possible by using a CEX like xPollinate or bridge which will take your coin or token and give you a token that represents what you want from another network. Research should be done on what bridge you want to use as some trade could take hours to days to complete due to low liquidity or various other reasons. Now you might ask yourself why you would want to move a coin/token from one network to another and that is quite simple. Some lending and borrowing apps may offer better interest rates depending on the network that the coin is coming from. ETH may only have a .5% interest rate within its own network but on the Cardano network it could be 4%! That is a lot of money that can be earned via interest just by lending your coins or tokens out on another network.
Insurance is something we all have, we all hate having to pay the premium but when something terrible happens, like a car accident, we are certainly glad that we have it. There are all types of insurance currently out on the market like car, home, traveler, rental, life, etc. and they are all there to protect your assets. This holds true in DeFi and insurance here, at least currently, is for the most important asset you have, your cryptocurrency.
Nexus Mutual is a company that offers coverage to those who wish to insure their cryptocurrency. Underwriters use smart contracts to set the parameters of the insurance agreement and the “user” (I know there is a better term but cannot think of it at the moment) puts in some money and pays a premium. Their money is now covered in the event a “rug pull” happens or if a hacker exploits a bug in a smart contract and drains the money of a liquidity pool, they are a part of. The benefit here is that you have your money protected and the liquidity providers can reap premiums.
There are many benefits to having insurances in DeFi from being able to set the terms and tailor the insurance to fit your needs to the most obvious, protecting your money. There is another thing worth mentioning and that they are often cheaper too. Without having to deal with a centralized insurance provider that would have to send someone to appraise the value, create paperwork, file claims, adjudicate disputes, etc., the overall cost to you is much cheaper. Not only that, because everything is set within the smart contract as soon as the parameters are met the insurance will pay you out immediately. There is no arguing back and forth about how an incident occurred, or burden of proof required to show what happened actually happened, the smart contract takes care of it.
As of right now, DeFi insurances only exist for cryptocurrencies, but we may see this type of insurance into other areas like, farm, car, and home insurance.
Margin trading essentially works the same way in crypto as it does in stocks. In stocks, if you wanted to trade on the margin you would borrow from a broker to buy in on a position. You would put up a down payment depending on the amount being borrowed and there would also be a percentage fee attached to the amount borrowed. After the stock goes up, you can then sell, pay back the the amount borrowed minus the down-payment plus the fee, whatever is left over is your profit. This amount can be multiplicative higher than your initial investment (your down-payment). On the other hand, the stock could end up falling instead at which point your broker will force you to sell your position at the point that the position point plus your down-payment equals the amount that was borrowed. In this case you would have lost your initial down-payment plus whatever fees are attached.
Let us look at an example of both scenarios.
Netflix stock is at $200, and you are feeling bullish about it, so you go to your broker and ask for a loan to trade on the margin. They say that for $40 down and a 10% fee they will do it, so you take the loan and buy the stock. After a while, the stock increases to $300 and you decided to sell. Now with the $300 you payback the $160 plus the fee of $20 leaving you with $120. This is a 3x ROI on a $40 investment even though the value of the stock only increased by 50%!
Well unlike with the positive gain that you can decide to sell at any point in time, the broker will force you to liquidate the moment your deposit and the value of the stock equal that of what was borrowed. So, using the example above, if the stock of Netflix dropped to $160 you would be forced to liquidate your shares to payback your broker on top of the fees accrued for the transaction. This means you would lose $60.
If you are going to be investing in any type of crypto you are going to need a crypto wallet. This, unlike the one you have in your pocket, is a digital wallet that keeps tracks of all the crypto you currently have. It allows you to send, receive and verify transaction on whatever networks it is compatible with so multiple wallets may be necessary depending on your circumstances. Not only that, but there are also few diverse types of crypto wallets out there, so it is best to pick the one that fits your needs. So now that you know all of that lets get into how they work and the different types.
For starters, you should know that crypto wallets do not actually store the cryptocurrency that you own within them. These digital wallets instead store the addresses of where the crypto is held within that crypto’s blockchain. This is because coins and tokens never leave the blockchain that they are a part of. Even when using a blockchain bridge to move coins/tokens from one network to another, the coin being moved to the new blockchain never leaves, instead a token of the coin/token is created within the new blockchain.
Aside from the address, the crypto wallet also stores two key items, namely, a Public Key and a Private Key. These two keys play a significant role as they allow you to send and receive crypto but also access your crypto and verify transactions. The Public Key is available for everyone see at is what enables others to send or request money. The Private Key is considerably more important as it allows you to verify transactions, control over your crypto, and in the event, you lose your wallet, the ability to recover your wallet on another device. Your Private Key should be known by no one else but yourself and it is advised to keep a copy of it somewhere in a safe and secure location. Losing this or letting others (hackers) get a hold of your Private Key means losing everything you have within your crypto wallet.
Lastly let us talk about the different types of crypto wallets out there. Every wallet does the same thing but there four different types that evenly fall into two categories: Hot wallets and Cold wallets. Each of which have their own advantages and disadvantages that we will get into.
Software wallets and web wallets are two kinds of a hot wallet. These are connected to the internet, so they are easy to use and access from a device with an internet connection. A web wallet is a wallet that is hosted by an exchange like Coinbase or Binance. As long as you have internet, you can access the site and access your wallet. Exchanges like these make it quite easy for trading to happen as it only takes a few buttons clicks to complete a transaction. However, you may not want to have your crypto wallet through them because you are relying on them to keep your Private Key safe, you do not have access to it, so you must have trust in the 3rd party which may be a prime target for hacker attacks. Wallets like this are known as custodial wallets.
If you are not too keen on the idea of having someone else in possession of your Private Key but still want the easy-of-use of a hot wallet then check out a software based one. Software wallets are wallets(programs) you install on your computer or mobile device. They do everything the same with the main difference that you are in possession of your Private Key. Blockchain and MEW offer great software wallets that lets you be in charge of your Private Key.
Next, we have two, but really only one, types of cold wallets, hardware and paper wallets. Hardware wallets like Ledger and Trezor store your crypto wallet on a USB, or similar hard drive. These are interacted with by connecting it to your computer via a USB cable and as a result are not directly connected to the internet. Because they are not connected to the internet that makes them much more secure compared to hot wallets which trades security for easy access. Most hardware wallets also require a special pin to access so even if someone were acquiring your drive, they would still need another password in order to access your wallet. Trezor even gives you the ability to recover your wallet should you happen to lose your drive all together so long as you have to your seed phrases or Private Key.
Finally, the last of the cold wallets is the paper wallet. This wallet entails actually printing your wallet onto a piece of paper with a QR code on it. While this is secure it is very tedious to make transactions with and in most cases partial transaction is not able to be made. What’s more, if you were to lose this piece of paper or it got damaged to the point the QR code couldn’t be read anymore, the wallet and all the crypto within it would be lost forever. This is the least recommended option to go with and has mainly been phased out by more accessible and secured wallets.
Dark Pools may sound scary or be the term for some illegal activity but that actually serve a very useful purpose that guards the market and helps whales trade.
Let us explain what a ‘whale’ is first. A whale is a person who owns a very substantial percentage of a given stock. Generally, the owning the shares they do keeps the price of the stock where it is at. When a whale decides to sell all of the position, they own of a given stock it could have very dramatic effects on the price, called price impact, causing it to plummet. This could lead to a trickle-down effect in which others seeing this happen sell their shares as well creating a huge domino effect the crashes the price of the stock.
Dark pools allow people to trade in secret. This effect limits the amount of crypto seen by the market to avoid price volatility or a devastating market crash. They also come with another benefit that allows its sellers to get what their crypto is worth by avoiding slippage. Price slippage is avoided because of how they take orders. Dark pools use a limit order system that lets the seller set the price of what they are selling, this price does not change and all they have to do is wait for a buyer to come along. Waiting can take quite a bit of time though.
Really the main take away is that dark pool protects the market from fear. Fear plays a huge role in everyone’s life and often effect decision making, the same is true when it comes to the market.
An Altcoin is simply any other cryptocurrency that is not Bitcoin. Since Bitcoin was the first to market it becomes ‘The’ coin and everything else is an alternative. This means that popular coins that you know today like Ethereum, Cardano, Maker, Polygon, etc., are all considered to be altcoins. These other coins, altcoins, are not bad by any means and some, like Ethereum, are gaining in popularity and exceeding in usefulness to rival Bitcoin.
While no altcoin may reach the extraordinary value of Bitcoin some are far more practical for use, trading, and applications beyond that of a strict currency. Many programmable chains like Ethereum other offer a wide variety of use for its crypto from lending and borrowing to powering dApps on its block chain.
Bitcoin, however, does make up around ~55% of the crypto marketplace and essentially acts a flagship to all the altcoins out on the market. This means that Bitcoin can be used currently as a reliable marker as to how well the crypto market is doing. If Bitcoin is on the rise, then in general everything else is on the rise as well, conversely if it is doing poorly, you can expect them same for everything else. As more altcoins start to take over the market, filling in the short comings of Bitcoin and their competitors, we will start to see more crypto that fluctuates independently from Bitcoin.
A Fork in a blockchain is a change in how the blockchain works essentially it’s a change in protocol. This change can either be major or minor and depending on what or how it is changed it would be considered either a Hard or Soft Fork. When a fork is created it is typically done to help improve the blockchain, however even though the changes were done in order to improve the chain it isn’t without it’s risks and it’s still out to debate which type of fork is more dangerous.
A Soft Fork is a update to a blockchain that makes minor changes to the rules without making major changes to how it works fundamentally. Soft forks are also done in a way that they are also backwards compatible so older nodes that aren’t updated to the new version can still add on to the new block chain as long as it is in line with the new changes.
The thing about soft forks is that there doesn’t need to be a consensus to switch over to the new blockchain. These changes can be done and it would then be up to the community to adopt the changes.
A Hard Fork is an update that completely changes the protocol of how the chain works. These changes require a consensus from everyone, although not always necessary, on the network in order for it to be implemented. Forks of this nature are not backwards compatible and a switch from one chain to another via a hard fork means that the older version is no longer recognized as valid by the new blockchain created.
The reason for hard forks on a chain can vary from fixing a malicious attack to restore funds to simply wanting to change the way things work to make a more efficient chain. As mentioned a hard fork creates an entirely different block chain. An example of such a fork can be seen with Ethereum and Ethereum Classic. In the early days of Ethereum a venture capitalist fund had about 1/3rd of it’s money stolen by hackers, and we’re talking about tens of millions of dollars. The creator of Ethereum thought that this wasn’t right and decided to give the money back to the venture. In doing so he created a hard fork in the chain that no longer recognized the old chain as valid. Many people made the switch to the new chain but there were also many who believed that making the change wasn’t right because that went entire against the notion that “code is law”. As such many stayed on the old chain and continued with it. The old chain became known as Ethereum Classic while the new chain created by the hard fork retained the original name of Ethereum.
A Roll up is actually quite a complicated topic so without getting too much in to the nitty gritty we’ll just explain the general idea of what they are and what they accomplish.
Roll ups are used to add scalability to a blockchain’s network. If a network is only able to process 20 transactions per block at a rate of 10 minutes per block but there are 300 transactions that are trying to get processed then we have an issue. A network may choose the transaction that have the highest costs associated with the transaction and process them first while the rest are left to wait until the next line. This creates a huge bottle neck and could leave transaction waiting in limbo for quite some time and this is in no way ideal and take away one of the benefits of a DeFi, speed.
Now, using the example above, what if you could take 30 of those transactions, bundle them up, and process them as one? This would alleviate the strain and bottle neck on the network and be able to process all the transaction within one block. This essentially is what a roll up is.
There are currently two methods that are being used on the Ethereum network in order to accomplish this: Optimistic Rollup and ZKSnark Rollup. Each of which perform the same task but go about it by different means. Arguably, ZKSnark appears to be the better method as the transaction within are actually verified before being sent back to the blockchain to be added to the new block.
If you had Bitcoin and tried to spend the coin on the Ethereum network you would find out very quickly that you are unable to do so. This is because they are two separate blockchains that function very differently from one another and as such they are incompatible. This creates a problem where you may have a lot of a coin or token you wish to use on a certain network but are unable to because of the incompatibility. This leaves you with 2 options, a) deal with it, or b) buy new crypto on the chain you wish to make use of. Obviously, neither of these choices are ideal. To solve this we create a wrapped token which is a virtual representation of the asset that can be used on the desired network.
This touches back to the topic of a blockchain bridge. They use a 3rd party, either a custodian or a smart contract, to verify that you have the asset and then give you a token that represents said asset to be used on the desired network.
The reason for many to move their tokens to another chain for use are many. Other chains may have better transaction speeds, lower costs, or better investment rates which would incentive holders to move their money around to seek higher gains or perform the same transaction at a lower cost.
If you ever tried to exchange one cryptocurrency for another you know that it can be quite the long task. Not only is it less than optimal but it is also riddled with fees all along the exchange process. For example if you lets say you have Bitcoin and you wish to exchange it for Litecoin you would have to find an exchange that has both coins. Then you would need to transfer your coins from your wallet to the exchange, incurring a fee. Sell the coin, also incurring a fee. Buy the Litecoin, yes another fee. Then finally if you wanted to move the crypto back to you personal crypto wallet you’d have to pay another fee as well. As you can see it’s quite the long task and there are fees everywhere you go, after all, you’re using the exchange’s service to do all of this for you so of course they are going to collect whenever they can in order to make some money.
There is a better way to swap your coins or tokens for more hotly desired cryptos without going through such a long process, racking up fees along the way, which is called Atomic Swap.
Atomic swapping is a way for two parties to swap their coins or tokens for other coins or tokens. This is done through the use of a smart contract. This smart contract is a little different from others, it is known as a Hashed Time Locked Smart Contract. Basically there is a time frame in which both parties must fulfill their end of the deal or the contract is canceled and the crypto is returned to their respective owners. Once both parties submit the agreed upon amounts of their respective cryptos the contract executes the swap for a small fee required to run the contract and now each party has their desired crypto.
Obviously there are some limitation to this. As you know different coins and tokens operate on different blockchains. This means that if you wanted to make a swap you would need to swap a coin or token for a coin/token that is present on that blockchain. Sadly, that means you can’t Atomic Swap your Bitcoin for Ethereum, at least directly, I’m sure you can already think of a way to make this possible indirectly.
An Airdrop is when a developers of a crypto platform gives out free coins or tokens. Sounds good right? Even almost to good to be true? Well there is a reason why this is done and that reason is advertisement. Handing out free crypto to others to use is a great way for developers to spread the word around about the new crypto they’ve made and to give people a chance to use it. If things go well then the token becomes more popular which will drive more and more people to the token and in turn cause the price to go up.
Obviously there can be some issues because sometimes things just are too good to be true. Scams are definitely possible when it comes to Airdrops as they can be used as a method of luring unsuspecting investors in. It’s quite simple; airdrop some crypto on a long list of users, the more that is given out the more the price is artificially inflated. Current holders see the price rise and start to buy more while spreading the word which brings even more investors. This has a chain effect which causes the price to shoot up, at which point every investor is then rug-pulled by the developers.
Now it’s not to say this happens all the time but it is a possibility that you should be aware of and keep in mind. Also if you would like to know more or find out when airdrops will happen you can visit airdrops.io for dates and more information. Remember to always do your research.
Yield farming is a way of maximizing the rate of return on capital by utilizing and leveraging different DeFi protocols. There is nothing entirely special about yield farming, in fact we have already talked about a few methods that people could earn interest on their crypto, like becoming a liquidity pool provider or by lending their crypto out on a platform like AAVE so they may collect interest. The idea with yield farming is that you are constantly trying to find the best rates so that the crypto makes more crypto for you.