Introduction to web3, Crypto & ReFi
Course Notes (May 2022)
by Stephen Reid
Best viewed with 'Print layout' off (View > uncheck 'Print layout')
Session 1: Introduction to Crypto
10,000 foot view: what is Bitcoin?
Public key (asymmetric) cryptography
The simplest possible blockchain
Bitcoin: the first cryptocurrency
DeFi newsletters, channels & podcasts
EVM-compatible chains: Layer 1s and Layer 2s
CeDeFi(!) and Binance Smart Chain
Fiat-backed Stablecoins: USDT & USDC
Decentralised exchanges (DEXs) / Automated Market Makers (AMMs)
Slippage (price impact/loss rate)
Buy-And-Hold vs. Constant-Mix (aka impermanent loss or divergence loss)
Money markets: Aave and Compound
Yield farming (liquidity mining)
Parallels with platform co-operativism
What about 'effort/contribution mining'?
Automated farming/Yield aggregators
DeFi composability: Money legos with FURUCOMBO
Ethereum's transition to Proof-of-Stake
Proof-of-Work vs Proof-of-Stake
Good Proof-of-Stake discussions on Reddit
The Cosmoverse/Cosmosphere/Interchain
Inter-Blockchain Communication
Thank you for registering for Introduction to web3, Crypto & ReFi! I'm honoured you've chosen me as your guide to lead you down the web3 rabbit hole 🐰
A reminder: You will be sent prep tasks at least a few days before each session (allow 1 hour), and homework at the end of each session (allow 1 hour). To get the most out of the course you should also set aside at least 2 hours per session to go back through the notes, read some of the links provided and make sure you've understood everything we've covered. So that's a minimum of 6 hours per session for maximum benefit (1 hour prep, 2 hours live, 2 hours revision, 1 hour homework).
Recordings will be provided shortly after each live session.
Please try to watch the following before our first session:
Optional:
The course notes are accessible at https://tinyurl.com/intro-to-web3-may-2022 (same link for all sessions).
For course discussion, you are welcome to join the Telegram group. You are also welcome to leave comments on the course notes Google Doc.
I look forward to seeing you at 4pm UK time (UTC+1) on Wednesday 4th May at https://zoom.us/j/98848824414 (same Zoom link for all sessions).
Best,
Stephen
Please note, you don't need to study this section beforehand (though you are welcome to) – I will be going over it in the live session.
"Perhaps the most enduring source of conflict within the Bitcoin community derives from incompatible visions of what Bitcoin is and should become. Businesses building on Bitcoin, believing it a cheap global payments network, eventually became nonviable when blocks filled up in 2017. They weren’t necessarily wrong, they just had a vision of the world that ended up being a minority view within the Bitcoin community, and was ultimately not expressed by the protocol on their desired timeline… Visions of Bitcoin are not static. Technological developments, practical realities and real-world events have shaped collective views."
"Censorship-resistance… implies that any party wishing to transact on the network can do so as long as they follow the rules of the network protocol… Censorship-resistance is considered to be one of the main value propositions of Bitcoin. The idea is that no nation-state, corporation, or third party has the power to control who can transact or store their wealth on the network. Censorship-resistance ensures that the laws that govern the network are set in advance and can’t be retroactively altered to fit a specific agenda."
From Who Needs Censorship Resistance? Not Most Of Us (a skeptical take):
"Addressing problems of government repression and privacy vulnerability around the world is going to take more than technology. Policymakers and cryptocurrency experts should join forces as much as possible to help enable environments where human dignity, prosperity, and freedom can coexist."
"Cryptography is the science of hiding information. More specifically, modern cryptography makes use of mathematical theories and computation to encrypt and decrypt data or to guarantee the integrity and authenticity of the information.
In a basic process of text encryption, a plaintext (data that can be clearly understood) undergoes an encryption process that turns it into ciphertext (which is unreadable). By doing this, one can guarantee that the information sent can only be read by a person in possession of a specific decryption key."
"Modern cryptography is heavily based on mathematical theory and computer science practice; cryptographic algorithms are designed around computational hardness assumptions, making such algorithms hard to break in practice by any adversary. It is theoretically possible to break such a system, but it is infeasible to do so by any known practical means."
"If he had anything confidential to say, he wrote it in cipher, that is, by so changing the order of the letters of the alphabet, that not a word could be made out. If anyone wishes to decipher these, and get at their meaning, he must substitute the fourth letter of the alphabet, namely D, for A, and so with the others."
— Suetonius, The Twelve Caesars, AD 121
QEB NRFZH YOLTK CLU GRJMP LSBO QEB IXWV ALD
"Some modern cryptographic techniques can only keep their keys secret if certain mathematical problems are intractable, such as the integer factorization or the discrete logarithm problems, so there are deep connections with abstract mathematics. There are very few cryptosystems that are proven to be unconditionally secure. The one-time pad is one, and was proven to be so by Claude Shannon. There are a few important algorithms that have been proven secure under certain assumptions. For example, the infeasibility of factoring extremely large integers is the basis for believing that RSA is secure, and some other systems, but even so proof of unbreakability is unavailable since the underlying mathematical problem remains open."
"Different hash functions will produce outputs of differing sizes, but the possible output sizes for each hashing algorithm is always constant. For instance, the SHA-256 algorithm can only produce outputs of 256 bits."
Input |
Output |
The Psychedelic Society |
b35f1988c86023905d2bbcea3c8b27701130876010e530c79090bede35f1e10b |
the psychedelic society |
627d1e4602200811c602696ac0e96ca441d4ada768c5824011d83de711e3df51 |
require 'digest' Digest::SHA256.hexdigest 'the psychedelic society' # 627d1e4602200811c602696ac0e96ca441d4ada768c5824011d83de711e3df51 |
"Note that a minor change (the case) resulted in a totally different hash value. But since we are using SHA-256, the outputs will always have a fixed size of 256-bits (or 64 characters) - regardless of the input size. Also, it doesn’t matter how many times we run the two words through the algorithm, the two outputs will remain constant."
nonce = 0 puts "nonce: #{nonce}" |
"When a new cryptocurrency wallet is set up, a pair of keys is generated (public and private keys). The wallet address is generated using the public key and can be securely shared with others. The private key, on the other hand, is used for creating digital signatures and verifying transactions, and therefore, must be kept in secret.
Once a transaction has been verified by confirming the hash contained in the digital signature, that transaction can be added to the blockchain ledger. This system of digital signature verification ensures that only the person who has the private key associated with the corresponding cryptocurrency wallet can move the funds."
A public key can be generated from a private key, but not vice-versa.
A blockchain is a growing list of records, called blocks, that are linked using cryptography. Each block contains a timestamp, transaction data, and a cryptographic hash of the previous block.
By design, a blockchain is resistant to modification of its data. This is because once recorded, the data in any given block cannot be altered retroactively without alteration of all subsequent blocks. For use as a distributed ledger, a blockchain is typically managed by a peer-to-peer network collectively adhering to a protocol for inter-node communication and validating new blocks… Peer-to-peer blockchains can be described as open, distributed ledgers that record transactions between two parties efficiently and in a verifiable and permanent way.
Peer-to-peer blockchain was invented by a person (or group of people) using the name Satoshi Nakamoto in 2008 to serve as the public transaction ledger of the cryptocurrency Bitcoin. The identity of Satoshi Nakamoto remains unknown to date. The invention of the peer-to-peer blockchain for bitcoin made it the first digital currency to solve the double-spending problem without the need of a trusted authority or central server. The bitcoin design has inspired other applications, and blockchains that are readable by the public are widely used by cryptocurrencies.
require 'digest' |
What Is Proof-of-Work (PoW)? [video]
require 'digest' attr_reader :hash |
b0.hash == Digest::SHA256.hexdigest(b0.nonce.to_s + b0.timestamp.to_s + b0.data + b0.previous_hash) |
From |
To |
Amount |
COINBASE |
Alice |
1 BTC |
Alice |
Bob |
1 BTC |
Bob |
Charlie |
0.5 BTC |
"Since ancient times, ledgers have been at the heart of economic transactions, with the purpose of recording contracts, payments, buy-sell deals, or moving assets or property. The journey which began with recording on clay tablets or papyrus made a big leap with the invention of paper.
Over the last couple of decades, computers have provided the process of record-keeping and ledger maintenance with great convenience and speed. Today, with innovation, the information stored on computers is moving towards much higher forms, which is cryptographically secured, fast, and decentralized. Companies can take advantage of this technology in many forms, one way being through distributed ledgers.
A distributed ledger can be described as a ledger of any transactions or contracts maintained in decentralized form across different locations and people, eliminating the need for a central authority to keep a check against manipulation. In this manner, a central authority is not needed to authorize or validate any transactions."
"The Times 03/Jan/2009 Chancellor on brink of second bailout for banks"
— Bitcoin genesis block
From The Genesis Files: How Hal Finney’s Quest For Digital Cash Led To RPOW (And More):
"For one, the prototype depended on a central server. Thanks to the open-source code and trusted computing, this didn’t give Finney unchecked power over the system — although, perhaps, a rogue IBM employee could do some damage. A more realistic concern, however, was that Finney could for example choose to take his server offline altogether, or be forced to do so. This would instantly render all RPOW tokens useless…
In October 2008, Finney received an email through the Cryptography mailing list that he subscribed to, which was widely considered to be the spiritual successor of the Cypherpunks mailing list. In the email, Satoshi Nakamoto — only later to be assumed to be a mysterious pseudonym — proposed a new type of electronic cash: Bitcoin. Like RPOW, Bitcoin was based on Hashcash’s Proof-of-Work system, but unlike RPOW, it didn’t depend on any central server."
From Satoshi's whitepaper:
"Abstract. A purely peer-to-peer version of electronic cash would allow online payments to be sent directly from one party to another without going through a financial institution. Digital signatures provide part of the solution, but the main benefits are lost if a trusted third party is still required to prevent double-spending. We propose a solution to the double-spending problem using a peer-to-peer network. The network timestamps transactions by hashing them into an ongoing chain of hash-based Proof-of-Work, forming a record that cannot be changed without redoing the Proof-of-Work. The longest chain not only serves as proof of the sequence of events witnessed, but proof that it came from the largest pool of CPU power. As long as a majority of CPU power is controlled by nodes that are not cooperating to attack the network, they'll generate the longest chain and outpace attackers. The network itself requires minimal structure. Messages are broadcast on a best effort basis, and nodes can leave and rejoin the network at will, accepting the longest Proof-of-Work chain as proof of what happened while they were gone."
Through the use of a peer-to-peer Proof-of-Work blockchain, Bitcoin became the first Byzantine fault tolerant distributed ledger – the first cryptocurrency.
Whilst peer-to-peer blockchains are the most widely-known distributed ledger technology (DLT), there exist DLTs that are not blockchain-based (for example, DLTs based on other directed acyclic graphs [DAGs]).
Nakamoto Consensus = Agreement to mine on the longest chain:
"This is akin to a majority-vote system. The reason is because the longest chain is the version of the blockchain that the majority of CPUs have informally agreed to honor; it has become the longest because most miners have put their time, electricity, and computational resources behind mining it… Said succinctly, you default to the longest chain because you know most people already have and you expect everyone else to do so. This is known as Nakamoto consensus."
"[If] a miner starts mining on a chain, and then sees a new chain that is longer, she should stop mining on the original chain and start mining on the new longer chain. Contrary to popular belief, this implies that the Bitcoin blockchain is mutable by design! There is no transaction finality because, regardless of what you think you know about the transaction history, your history [could] be overwritten by any other longer, legitimate chain. For example, in your view of the blockchain where Alice and Bob are transactors and Alice sends a 5 BTC transaction to Bob, Alice’s 5 BTC transaction to Bob may be included, but if someone sends you a longer chain that does not include Alice’s transaction, you switch chains, and you start to accept that Alice never sent Bob 5 BTC! If the majority of miners switch over to this longer chain (as they should), then Bob will be unable to spend those 5 BTC that he thought he owned because miners agree that he never received them!"
"As you can see, the Bitcoin blockchain is subjective by nature. Fortunately, you can usually assure that a transaction will be part of the longest chain with some high probability and in normal conditions, it is very unlikely someone can rewrite the chain’s history.
To illustrate this point in economic terms, imagine that you see a chain which has Alice and Bob’s transaction contained in a block that was mined roughly 17 blocks ago and this is the longest chain you are aware of. In order for someone to create a longer version of the blockchain that doesn’t include the transaction sent from Alice to Bob, they must mine at least 18 blocks. If each block’s PoW algorithm takes $100,000 to mine, then that attack costs at least $1.8 million. Proof-of-Work therefore makes the economic cost of creating a different longest chain very expensive. In the meanwhile, the current version of the blockchain is also growing, probably faster than the attacker’s version of the chain. It’s a game of catch-up that, normally, is futile for the attacker."
Normally, but not always:
A bitcoin mining farm
"Given that there is no finality in traditional Proof-of-Work blockchains like Bitcoin, this exposes a potential attack vector; the 51% attack. The ‘finality’ of a block is probabilistic, contingent upon it being the chain with the majority/plurality of mining power behind it. But if someone gets 51% of the hashpower, they will be able to solve PoW puzzles at a faster rate than any other network participant and so their version of the blockchain will grow faster than all other versions of the chain combined. Therefore, the attacker can theoretically start mining from the genesis block (i.e. the first block) and mine until their chain is longer than others, thereby wiping out the history of the blockchain and undoing every transaction that ever happened.
This is a bleak situation for the blockchain. Unfortunately, in the future, every block will be from the attacker (this may be undetectable because of Sybil accounts). They can arbitrarily censor transactions, and essentially, in the long run, the blockchain is controlled by the 51% attacker. Even though the attacker will only find 51% of future blocks, they know their chain will grow faster than any other miner’s, and so the attacker will ignore other transactions that are mined before theirs.
This distributed systems attack has a strong economic argument that defends against it. In the Bitcoin whitepaper, Satoshi says that the economics of the system will again prevent a 51% attacker from acting maliciously; if someone has a majority of mining power, they will obviously gain all future mining rewards and transaction fees in the system. That is, they have great future earning power in Bitcoin. The detection of an attack would ostensibly tank the value of the Bitcoin cryptocurrency, and so, would diminish the future earning power of the attacker. So an attacker will refrain from an attack."
From Bitcoin vs. Ethereum: What's the Difference?:
"Ethereum proposed to utilize blockchain technology not only for maintaining a decentralized payment network but also for storing [and running] computer code which can be used to power tamper-proof decentralized financial contracts and applications."
From the introductory chapter of the Mastering Ethereum e-book:
"Ethereum is an open source, globally decentralized computing infrastructure that executes programs called smart contracts. It uses a blockchain to synchronize and store the system’s state changes, along with a cryptocurrency called ether to meter and constrain execution resource costs…
Ethereum’s purpose is not primarily to be a digital currency payment network. While the digital currency ether is both integral to and necessary for the operation of Ethereum, ether is intended as a utility currency to pay for use of the Ethereum platform as the world computer.
Unlike Bitcoin, which has a very limited scripting language, Ethereum is designed to be a general-purpose programmable blockchain that runs a virtual machine capable of executing code of arbitrary and unbounded complexity. Where Bitcoin’s Script language is, intentionally, constrained to simple true/false evaluation of spending conditions, Ethereum’s language is Turing complete, meaning that Ethereum can straightforwardly function as a general-purpose computer…
The original blockchain, namely Bitcoin’s blockchain, tracks the state of units of bitcoin and their ownership. You can think of Bitcoin as a distributed consensus state machine, where transactions cause a global state transition, altering the ownership of coins. The state transitions are constrained by the rules of consensus, allowing all participants to (eventually) converge on a common (consensus) state of the system, after several blocks are mined.
Ethereum is also a distributed state machine. But instead of tracking only the state of currency ownership, Ethereum tracks the state transitions of a general-purpose data store, i.e., a store that can hold any data expressible as a key–value tuple... In some ways, this serves the same purpose as the data storage model of Random Access Memory (RAM) used by most general-purpose computers. Ethereum has memory that stores both code and data, and it uses the Ethereum blockchain to track how this memory changes over time. Like a general-purpose stored-program computer, Ethereum can load code into its state machine and run that code, storing the resulting state changes in its blockchain. Two of the critical differences from most general-purpose computers are that Ethereum state changes are governed by the rules of consensus and the state is distributed globally. Ethereum answers the question: "What if we could track any arbitrary state and program the state machine to create a world-wide computer operating under consensus?"
From the whitepaper:
"The intent of Ethereum is to create an alternative protocol for building decentralized applications, providing a different set of tradeoffs that we believe will be very useful for a large class of decentralized applications, with particular emphasis on situations where rapid development time, security for small and rarely used applications, and the ability of different applications to very efficiently interact, are important. Ethereum does this by building what is essentially the ultimate abstract foundational layer: a blockchain with a built-in Turing-complete programming language, allowing anyone to write smart contracts and decentralized applications where they can create their own arbitrary rules for ownership, transaction formats and state transition functions… protocols like currencies and reputation systems can be built in under twenty [lines of code]. Smart contracts, cryptographic "boxes" that contain value and only unlock it if certain conditions are met, can also be built on top of the platform, with vastly more power than that offered by Bitcoin scripting because of the added powers of Turing-completeness, value-awareness, blockchain-awareness and state."
From What is Ethereum? (EthHub):
"While the word "contract" brings to mind legal agreements; in Ethereum "smart contracts" are just pieces of code that run on the blockchain and are guaranteed to produce the same result for everyone who runs them. These can be used to create a wide range of Decentralized Applications (DApps) which can include games, digital collectibles, online-voting systems, financial products and many others."
From Chapter 7: Smart Contracts and Solidity of Mastering Ethereum:
"The term smart contract has been used over the years to describe a wide variety of different things. In the 1990s, cryptographer Nick Szabo coined the term and defined it as “a set of promises, specified in digital form, including protocols within which the parties perform on the other promises.” Since then, the concept of smart contracts has evolved, especially after the introduction of decentralized blockchain platforms with the invention of Bitcoin in 2009. In the context of Ethereum, the term is actually a bit of a misnomer, given that Ethereum smart contracts are neither smart nor legal contracts, but the term has stuck. In this book, we use the term “smart contracts” to refer to immutable computer programs that run deterministically in the context of an Ethereum Virtual Machine as part of the Ethereum network protocol—i.e., on the decentralized Ethereum world computer.
Let’s unpack that definition:
Computer programs
Smart contracts are simply computer programs. The word “contract” has no legal meaning in this context.
Immutable
Once deployed, the code of a smart contract cannot change. Unlike with traditional software, the only way to modify a smart contract is to deploy a new instance.
Deterministic
The outcome of the execution of a smart contract is the same for everyone who runs it, given the context of the transaction that initiated its execution and the state of the Ethereum blockchain at the moment of execution.
EVM context
Smart contracts operate with a very limited execution context. They can access their own state, the context of the transaction that called them, and some information about the most recent blocks.
Decentralized world computer
The EVM runs as a local instance on every Ethereum node, but because all instances of the EVM operate on the same initial state and produce the same final state, the system as a whole operates as a single "world computer.""
Passcode: 4=ev+fO6
Please try to read and watch the following before the session:
The course notes are accessible at https://tinyurl.com/intro-to-web3-may-2022 (same link for all sessions).
For course discussion, you are welcome to join the Telegram group. You are also welcome to leave comments on the course notes Google Doc.
I look forward to seeing you at 4pm UK time (UTC+1) on Wednesday 11th May at https://zoom.us/j/98848824414 (same Zoom link for all sessions).
Best,
Stephen
"Ownership for Web3 means that the builders, operators, and users of a platform own a piece of what they use. Bitcoin and Ethereum are the earliest examples: in return for updating the ledger and keeping other actors honest, they receive a reward in BTC or ETH in exchange for securing the network. Token-based networks built on Ethereum and other smart contract blockchains have even introduced new models of ownership that are not necessarily the same as a cooperative or shareholder equity model. For example, ownership might be given in the form of a token provided for a service, such as providing liquidity for a trade, and that same token could also be used for governing the future changes to the network. The grand vision is that participants of any network will be able to own a piece of the products and services that they use everyday. "
"“In May 2018, Dharma hosted a meetup at the Polychain offices in San Francisco, called the ‘Decentralized Finance Meetup,'” Dharma co-founder Brendan Forster told CoinDesk this month.
It included all the early companies – the Maker Foundation, Compound Labs, 0x, dYdX, Wyre – and he said roughly 150 people showed. Forster credited the gathering with a dawning realization at the time that DeFi startups were a distinct “cohort” within the industry…
The name from that meetup – “decentralized finance” – stuck, because “decentralized” was more specific (and perhaps aspirational) than prior terms like “open finance” or “crypto-finance.”
Its shorthand, “DeFi,” had that double entendre with “defy.”"
From DeFi principles:
"When using a traditional cryptocurrency exchange, such as Binance, Coinbase, or Kraken, users send funds to the exchange to manage them within an internal account. While funds are on the exchange, they are stored outside of users’ custody and are therefore vulnerable to threats in the event that the security measures put in place by the exchange fail."
"The most significant difference between DeFi and CeFi is custody of the underlying digital assets. CeFi platforms hold customer deposits and control the accrual and payment of interest. DeFi, for the most part, is non-custodial. Users lock their funds in smart contracts to access financial services. No company is holding their coins. Moreover, whether the person is in Zimbabwe or Los Angeles, no one can prevent them from accessing those services. Terrorists and financiers alike can obtain these services without the need to disclose their identity. Crypto purists argue that third party custody is anathema to the ethos of cryptocurrency. The “not your keys, not your coins” argument implores people to assume the responsibility of maintaining custody over their crypto assets."
From Ethereum Layer 2 Scaling Explained:
"Layer 1 is our standard base consensus layer where pretty much all transactions are currently settled… Layer 2 is another layer built on top of Layer 1. There are a few important points here. Layer 2 doesn’t require any changes in Layer 1, it can be just built on top of Layer 1 using its existing elements such as smart contracts. Layer 2 also leverages the security of Layer 1 by anchoring its state into Layer 1.
Ethereum can currently process around 15 transactions per second on its base layer (Layer 1). Layer 2 scaling can dramatically increase the number of transactions. Depending on the solution, we’re talking about processing between 2000-4000 tx/second."
From Layer 2 (Binance Academy):
"Layer 2 refers to a secondary framework or protocol that is built on top of an existing blockchain system. The main goal of these protocols is to solve the transaction speed and scaling difficulties that are being faced by the major cryptocurrency networks.
For instance, Bitcoin and Ethereum are still not able to process thousands of transactions per second (TPS), and this is certainly detrimental to their long-term growth. There is a need for higher throughput before these networks can be effectively adopted and used on a wider scale. In this context, the term “layer 2” refers to the multiple solutions being proposed to the blockchain scalability problem."
Some popular bridge protocols:
Bridge aggregator:
"Ether (ETH), being the native currency on the Ethereum blockchain, was created before the ERC-20 standard and others standards were implemented; hence ether itself is not ERC-20 compatible and cannot be exchanged directly for other ERC-20 tokens in a decentralized manner without the mediation of a trusted third party or the addition of complex technical implementations. Instead of implementing two interfaces (one for ether and another for ERC-20 tokens) within the same smart contract leading to unnecessary complexities, developers decided to “wrap” ether to upgrade it to the ERC-20 standard in order to conveniently handle WETH and other ERC-20s within the same contract."
"Tethers can be securely stored, sent and received across the blockchain and are redeemable for cash (the underlying pegged asset) pursuant to Tether Limited’s terms of service."
"USDC is issued by regulated financial institutions, and backed by fully reserved assets, and redeemable on a 1:1 basis for US dollars."
From The Dai Stablecoin is a Game Changer for Ethereum and the Entire Cryptocurrency Ecosystem:
"Dai is a masterpiece of game theory that carefully balances economic incentives in the pursuit of one goal — a token that is continuously approaching the value of $1 USD.
When Dai is worth above $1, mechanisms work to decrease the price. When Dai is worth below $1, mechanisms work to increase the price. The rational actors that take part in these mechanisms do so because they earn money anytime Dai is not perfectly worth $1. This is why Dai is always floating slightly above or below $1 — it is an endless wave function bouncing infinitely close to $1, but never quite achieving it. The farther Dai goes from $1, the more incentive there is to fix it. This is the magic of Dai."
From Maker for Dummies: A Plain English Explanation of the Dai Stablecoin:
"The core smart contract at Maker is the CDP (collateralised debt position). Let’s use an analogy to describe these. Pretend you are at the bank asking for a home equity loan. You put up your house as collateral and they give you cash as a loan in return. If the value of your house decreases, they’re going to ask you to pay the loan back. If you can’t pay the loan back, they’re going to take your house. To bring this back to Maker, just replace your house with ether (ETH), the bank with a smart contract, and the loan with Dai. That’s all there is to it. You give the Maker CDP smart contract your ether and it lets you take out a loan in Dai. If the value of your ether goes below a certain threshold, you either have to pay back the smart contract as you would a bank or it will auction off your ether to the highest bidder."
From The Dai Stablecoin is a Game Changer for Ethereum and the Entire Cryptocurrency Ecosystem:
"Some may ask why you need something like Dai at all. Doesn’t Tether already fulfill the purpose of a dollar-denominated token? My answer is that Tether, or any other centralized stablecoin, can be hacked, shutdown, steal your money, and is always operating at the whims of politics and human fallibility."
No individual person or company has control over it.
No government or authority can shut it down.
The basic market logic (replace DAI with MAI and ETH with MATIC if you like):
When the price of DAI rises above $1, ETH holders are able to create DAI for just $1 and sell it for more than $1. This incentivises the creation of DAI, and pushes the price of DAI back down towards $1.
When the price of DAI drops below $1, those who already have a CDP can pay down their debt at less than $1. This gives them a discount on their loan, and ensures DAI will be destroyed when necessary to move the price back up towards $1.
Other mechanisms include varying the liquidation ratio and stability fee.
"You can think of an AMM as a primitive robotic market maker that is always willing to quote prices between two assets according to a simple pricing algorithm."
"Some use a simple formula like Uniswap, while Curve, Balancer and others use more complicated ones.
Not only can you trade trustlessly using an AMM, but you can also become the house by providing liquidity to a liquidity pool. This allows essentially anyone to become a market maker on an exchange and earn fees for providing liquidity."
"The price slippage is the difference between the effective exchange rate obtained by the trader and the market price. In absence of slippage, the trader would pay the market price regardless of the volume traded. "
The more abundant the liquidity, the less price slippage for traders.
The larger the trade size, the higher the slippage. (Slippage increases exponentially with trade size – graph)
From a thread by @krugman25:
"The 'loss' is the cost of selling your overperformers for your underperformers versus a buy and hold."
divergence_loss = 2 * sqrt(price_ratio) / (1 + price_ratio) - 1 |
Note: if the price of just one of the pair of tokens goes to zero, you lose EVERYTHING. You end with a lot of something worth nothing, and (almost) nothing of something worth (potentially) a lot (graph)
From What the heck is an automated market maker (AMM)?, The Correlation Spectrum:
"By funding [a] pool, there are two simultaneous things you have to believe for being an LP to be better than just holding onto your original funds:
The general principle is this: [being a LP] works best when the two assets are mean-reverting. Think of a pool like USDC/DAI, or WBTC/TBTC — these are assets that should exhibit minimal impermanent loss and will purely accrue fees over time… highly volatile mean-reverting pairs are great, because they’ll produce lots of trading fees."
Warning: never click Google Ad links! If in doubt, verify website URLs via multiple sources and type the URL into the address bar yourself
Passcode: L9!UT%1r
I offer a 10-minute one-on-one session to all course participants. I hope that most one-on-ones can take place on either the 19th May, 23rd May or 1st June. Book a slot here (If you really can't make any of these dates, let me know by reply and we'll sort something out.)
Please try to read and watch the following before the session:
The course notes are accessible at https://tinyurl.com/intro-to-web3-may-2022 (same link for all sessions).
For course discussion, you are welcome to join the Telegram group. You are also welcome to leave comments on the course notes Google Doc.
I look forward to seeing you at 4pm UK time (UTC+1) on Wednesday 18th May at https://zoom.us/j/98848824414 (same Zoom link for all sessions).
Best,
Stephen
From Aave (LEND) Review: Decentralised Lending Platform:
"Aave and Compound are both overcollateralized cryptocurrency lending protocols and operate in effectively the same way. Both pool the assets of lenders into lending pools from which borrowers can take, they both have their own governance token, and they along with MakerDAO are the largest protocols in DeFi in terms of “assets under management” (AUM). That being said, Compound is much less complex and consequently does not offer nearly as many features as Aave."
A token is only worth something if you can swap it for something else (valuable!)
From What Is Yield Farming in Decentralized Finance (DeFi)?:
"Governance tokens grant governance rights to token holders. But how do you distribute these tokens if you want to make the network as decentralized as possible?
A common way to kickstart a [blockchain project] is distributing these governance tokens algorithmically, with liquidity incentives. This attracts liquidity providers to “farm” the new token by providing liquidity to the protocol."
From What Is Yield Farming? The Rocket Fuel of DeFi, Explained:
"Liquidity mining as we now know it first showed up on Ethereum when the marketplace for synthetic tokens, Synthetix, announced in July 2019 an award in its SNX token for users who helped add liquidity to the sETH/ETH pool on Uniswap. By October, that was one of Uniswap’s biggest pools."
Remember, if the price of just one the pair of tokens goes to zero, you lose EVERYTHING. Thus yield farming new/unproven tokens for high APYs is incredibly risky, especially as many people are likely to be farming-and-dumping, putting downwards pressure on the price. It often ends up being a game of chicken!
Note there are always smart contract risks!
From Yearn Finance docs:
Vaults: "Capital pools that automatically generate yield based on opportunities present in the market. Vaults benefit users by socializing gas costs, automating the yield generation and rebalancing process, and automatically shifting capital as opportunities arise. End users also do not need to have a proficient knowledge of the underlying protocols involved or DeFi, thus the Vaults represent a passive-investing strategy."
"Furucombo is a tool that allows you to construct an Ethereum transaction using a simple drag-and-drop user interface. It can visualise complex DeFi transaction by showing a chain of interactions displayed as individual “cubes”. Each cube represents one specific interaction, for example, taking a flash loan or swapping coins on Uniswap."
Passive indices
Managed funds
Rewriting The Laws Of Finance
Self-Repaying Loans
Spend And Save At The Same Time
Take a loan against your collateral
Use the yield from your collateral to pay off the debt!
"On Alchemix, users deposit stablecoins as collateral to borrow against and that collateral generates yield in Yearn.Finance vaults. The borrowed synthetic assets are backed by the yield, which is automatically sent back and applied to the original loan as it is generated. "
tl;dr:
Both Proof-of-Stake and Proof-of-Work have a tendency to increase inequality
…but this problem is much worse in Proof-of-Work systems!
"As far as I can see, there are no real downsides to Proof-of-Stake. The only argument that comes up repeatedly is that "the rich get richer". It's an absolutely true statement, but the same goes for Proof-of-Work - having a lot of money gives you the opportunity to buy more mining hardware. I'd say it's even worse for PoW since large amounts of money actually give you better access and prices to mining specific chips, whereas your 100th validator on PoS will cost just as much as your first."
"In PoW there are economies of scale so the more money you have the greater your ROI%. In PoS your money only scales up your profits linearly. The rich will always get richer but won't do so as easily in PoS."
"Proof-of-Stake, similar to Proof-of-Work, is a cryptoeconomic protocol in which users tie economic assets to a protocol in exchange for rewards in that protocol.
In the case of PoW, this is compute power in the form of sophisticated hardware and electricity. In the case of PoS, this is a locking up of the core economic token in the protocol.
In both cases, the owning of an asset allows for seeking gains on that asset. The difference between the two is that in PoS, the mapping of capital to gains is much more direct and fair (i.e. buy token, lock token, perform duties, gain X).
Where in PoW, the mapping of capital to gains is highly dependent upon extra-protocol factors. How many machines can I buy at once (bulk discount), do I have special connections with hardware manufacturers so I can get new hardware sooner than the consumer market, am I the manufacturer and can have access to some sort of speedup while I sell old machines to consumers? <-- All of these real world considerations general distort the clean mapping of capital to gains in such a way that the rich acceleratingly get richer and new entrants tend to have a major disadvantage.
tldr;
Cryptoeconomic protocols like PoS and PoW allow for gains on capital. This is core to it. PoS allows for relatively fair gains on capital across the different levels of participation (small and large). PoW skews this curve allowing for entrenched and wealthy players to have much higher gains than "normal" users."
"It turns out, the wealth gap between rich and poor operators in a PoW network increases much more than the wealth gap between rich and poor operators in a PoS network. Once we apply our assumptions to all sides accurately, the only distinction between PoW and PoS becomes the economies of scale."
"Won’t PoS give an advantage to the rich? While this is certainly a valid criticism of PoS, it’s important to note that it is still much more equitable than PoW. With PoS, your chance of being chosen as the validator is a linear function of your staked money. In contrast, since your chances of receiving the reward in PoW are a function of your computing power, there is also an advantage given to wealthier miners. This advantage, however, increases the richer you are because of economies of scale, or the increased efficiency of mining rigs as you spend more on your computing infrastructure.
In other words, in PoS, the person who spends $100 has a 10x advantage over the person who spends $10. With PoW, economies of scale can give the person who spends $100 significantly more than a 10x advantage. While we can hope for a consensus mechanism to arise in the future that is more equitable than PoS, it is still nevertheless a step in the right direction when it comes to equity."
Coin Bureau videos:
Coin Bureau videos:
"Proof-of-History is a mechanism that is used to enhance Solana's Proof-of-Stake implementation to allow it to be the fastest Proof-of-Stake network while still retaining the safety needed to ensure that the network is secure."
Advanced:
"Other blockchains require validators to talk to one another in order to agree that time has passed, but Solana requires all validators to maintain its own clock by constantly solving SHA256-based VDF. Because each validator maintains its own clock, leader selection is scheduled ahead of time for an entire epoch which lasts for thousands of blocks. "
"PoH solves communication overhead. Since Proof of History (PoH) provides a trustless sense of time and ordering of messages, network nodes can trust the relative message times that they receive in the PoH broadcast without having to communicate with all the other nodes in the network. For many distributed networks, the time to finality (the guarantee that past transactions on a digital ledger are legitimate and will not change) scales as the square or even the cube of the number of nodes in the system due to the necessity to confer with other network participants on message ordering.
Because of our Proof of History implementation, Solana blockchain’s time to finality scales with the logarithm of the number of nodes. This translates into a high throughput network that can support tens of thousands of nodes, while retaining sub-second confirmation times."
Passcode: 88qGx^Ft
Please try to read and watch the following before the session:
Proof of Humanity:
Celo:
Regen Network:
The course notes are accessible at https://tinyurl.com/intro-to-web3-may-2022 (same link for all sessions).
For course discussion, you are welcome to join the Telegram group. You are also welcome to leave comments on the course notes Google Doc.
I look forward to seeing you at 4pm UK time (UTC+1) on Wednesday 25th May at https://zoom.us/j/98848824414 (same Zoom link for all sessions).
Best,
Stephen
Finematics videos:
Explainers:
Technical aspects:
Pro- and anti- documentaries:
"An asset is considered fungible when its units are interchangeable with one another, meaning they are indistinguishable. In other words, an asset class is fungible when each unit of the asset has the same validity and market value. For example, a pound of pure gold is equal to any other pound of pure gold, regardless of the shape. Other examples of fungible asset classes may include commodities, fiat currencies, bonds, precious metals, and cryptocurrencies."
"ERC-721 tokens differ to ERC-20 tokens in the sense that ERC-721 tokens are non-fungible. This means that each token is unique and as a result, not interchangeable."
"NFTX is a platform for creating liquid markets for illiquid Non-Fungible Tokens (NFTs). Users deposit their NFT into an NFTX vault and mint a fungible ERC20 token (vToken) that represents a claim on a random asset from within the vault. vTokens can also be used to redeem a specific NFT from a vault.
Benefits include:
"We bring together two cutting edge technologies: satellite driven earth observation science, and blockchain technology, to create the foundation of a new digital monitoring, reporting and verification system for ecological health."
"UBI is the first application to be built on top of the Proof of Humanity registry, an anti-Sybil attack tool designed by Kleros.
The UBI token will be streamed directly to an Ethereum address as long as it gets verified as a human in the Proof of Humanity registry and starts the accrual process, establishing a fair and ongoing distribution model. It will provide universal access to liquidity that serves to inhibit financial coercion of public decisions and will be tradeable in all open markets…
The value of UBI resides in its innovative fair distribution system based on human time. Such value is bound by two natural limiting factors: time [limited to 24 hours in a day] and population [limited to the number of humans on Earth].
This currency scales with population and is bound by the time such population exists. $UBI is a ‘missing currency layer’ necessary to put a value on time, and do so in an open, global market.
While we can't predict what the global market will determine as the fair market value of time, we can find some guideposts in existing fiat markets. For example, the minimum wage in the United States is $7.25. By transacting with UBI, you will effectively be “buying someone’s time”."
"Currently, the world’s financial system excludes roughly 1 in 3 adults. At the same time, 6 billion smartphones will be connected by 2020 as these devices spread throughout emerging markets. Cryptocurrencies accessible on mobile phones hold great promise in bringing financial inclusion to the world’s underbanked.
Despite this potential, cryptocurrencies have still not significantly impacted these populations over the last 10 years. Using cryptocurrencies is still much too complex for the average person and price volatility makes them undesirable for merchants to accept as payment. Additionally, blockchain networks are often inaccessible to unbanked and underbanked populations due to data constraints from their mobile providers.
Inspired by extensive research in emerging markets and developing countries — Tanzania, Colombia, Argentina, Mexico, the Philippines, and Kenya — Celo is building a mobile-first blockchain platform alongside a suite of financial tools accessible to anyone with a basic smartphone. On this platform, value can be transferred faster and cheaper than traditional bank wires using globally accessible technology. Since cryptocurrencies are completely programmable, a wide array of financial services can be created without costly intermediaries."
5 potential innovations on money presented by Sep:
From KlimaDAO: An Introduction. Vision (Jan 2022):
"Vision: Create a future where the cost of carbon to the climate is embedded into our economic system, through the creation and governance of a carbon-backed currency that aligns incentives between investors, civil society, and organizations.
Mission: KlimaDAO’s mission is to leverage Web3 technologies that enable coordination and mass participation within the carbon markets, and fully integrate them into the emerging economic system by delivering on the following objectives:
From Introducing KLIMA, a liquidity engine for the carbon markets | by KlimaDAO (Jul 2021):
"KlimaDAO’s purpose is to accelerate the price appreciation of carbon assets in order to force quicker adaption to the realities of climate change and drive additional finance toward low-carbon technologies. As further voluntary commitments and compliance regimes come online the world’s companies will be forced to compensate, i.e. offset, their carbon emissions. The costlier the negative externality of their damage becomes, the more economic the decision to reduce emissions and invest in green alternatives."
From New Institutions for Civic Life in Cyberspace - Panvala Handbook:
"One traditional type of subsidy is the corporate sponsorships that civic associations often earn from businesses in their communities. By cooperating within the League, communities will potentially earn larger sponsorships from bigger brands than they would be able to independently. Sports leagues are the inspiration for this model: they are exceptionally successful at securing “subsidies” (revenue from sponsorships and ads) both collectively at the league level, and individually at the team level.
A newer form of subsidy that has shown incredible promise is the subsidy model that powers the Bitcoin network. The fees that Bitcoin users pay to send transactions don’t come close to funding the operations of the network. Instead, the network issues new bitcoins to reward the miners who operate the network. These new bitcoins are the “block rewards,” and have recently been about 60 times the value of the fees on the network. The people who hold on to bitcoins have opted into a system that they know will dilute their holdings over time to fund this subsidy."
"Think of Gitcoin Grants as Ethereum’s largest crowdfunding platform – a crypto-enabled Patreon that is focused on financing the infrastructure of the new open financial internet. In the past 18 months over $4.5 million in funding has been distributed to public goods on Gitcoin Grants, culminating with $1 million given in the first two weeks of December."
"Let’s face it, tax-deductible donations can be a bit of a headache. Nonprofit projects have to cut through miles of red tape and donors have to do accounting each year, saving associated paperwork for some arbitrary number of years.
GIVbacks provides a similar end, but cuts the bureaucracy. If a project can prove they are legitimately adding value to society, they can become a verified project in the GIVbacks program, no matter what their legal or DAO structure is. If a donor is moved by a verified project’s work, they can give and receive GIV in return, no matter where (or if) they pay taxes. No need to save receipts or paperwork for fear of getting audited. Web3 makes it so that we don’t need governments and taxes to make this kind of system. We can transcend borders to connect people with projects anywhere in the world!"
Decide whether you're an investor or a trader, and stick with it!
When investing, do what you can to protect yourself from yourself/protect yourself from 'weak hands':
If you do end up investing/trading, please be aware that these activities can be highly addictive. Seek help if necessary. Read more
"You only have to pay capital gains tax on overall gains above the annual exempt amount of £12,000 (for the year 2019–2020). If your total assets sold was over 4x this amount (£48,000), you still need to report the gains on your tax return regardless of the gains amount."
Thank you for participating in the Introduction to web3, Crypto & ReFi course!
Your feedback is much appreciated (the more honest and detailed the better).
Best wishes,
Stephen
Passcode: cn?47rQ&