Live Dabbling with Crypto:

Getting your hands dirty




 

Andreas Park

Step 0:

what is a blockchain wallet?

the following slides are background information and not necessary for the hands-on exercise

  • blockchains are built on public-private key cryptography*
  • the public key is derived from the private key
  • you use the private key to sign transactions and prove ownership of a public key
  • you must never reveal the private key to a third party
  • crypto-assets are associated with a public key
  • public keys are also referred as public addresses (this is not 100% precise, there is a subtle difference which I will skip over)

Public/Private Key Cryptography

*for an extensive explainer see here: https://slides.com/ap248/mgt411-cryptography

  • a wallet is a piece of software that allows you to use and control your private keys and sign transactions
  • often the terms wallets and addresses are used interchangeably \(\to) not accurate because a wallet can control multiple keys
  • a wallet does not contain crypto-assets, it contains the private keys that control the assets
  • wallets are "constructed" with a seed phrase (usually 12+ words)
    • if you lose the password to the wallet you can rebuild the wallet with the seed phrase
    • if you lose the seed phrase but have access to the wallet, you can obtain the seed phrase or private key
    • if someone gets hold of your seed phrase (or private key) they can rebuild the wallet and steal your assets

Cryptography & Wallets

  • there are many different types of wallets
    • hot wallets: browser extensions and smartphone apps that are connected to the internet
    • cold storage wallets: software and other means that store private keys and that are never connected to the internet
    • hardware wallets: physical items (e.g., USB sticks) that connect to the internet only temporarily
    • multi-sig wallets: multiple parties need to sign for a transaction to be processed
  • wallets can be hacked, and there are incessant phishing attempts

Types of Wallets

  • Custodial vs. self-custody wallets
    • by default, users alone have control over their private keys
      • \(\to\) self-custody
    • crypto-exchanges assign their users a public address for crypto withdrawals/deposits but the exchange controls the private keys
      • \(\to\) custodial wallet
  • users of crypto-exchanges have to go through KYC
    • \(\to\) custodial wallet \(=\) KYC-ed wallet
  • ​creation of a self-custody wallet is instantaneous and requires no-one's permission
    • \(\to\) self-custody \(=\) pseudo-anonymous & non-KYC-ed

Wallet KYC

  • BUT: wallet \(\not=\) address!
  • Smart contracts/decentralized applications etc all have public addresses
  • Owner of a contract may not be continuously identifiable
  • Transfers between addresses are visible & traceable
  • Note: crypto-assets
    • are *not* exclusive for investment purposes
    • have utility in applications
    • need to be pledged for many uses (e.g., voting)
    • are necessary to pay for blockchain services (e.g., cryptocurrencies)
  • If governments/regulators require that transfers must be between KYC-ed wallets
    • people lose all privacy  
    • people cannot access or use decentralized applications

KYC/AML vs. privacy & utility

Step 1:

getting a hot wallet

1. navigate to metamask.io

2. click here

click here and go through the steps

NB: works with the Firefox and Chrome browsers

your wallet should be visible among your browser apps

now click on the icon

click here

click here

click here

NB: there are other steps that I skip

when you reach this screen, your wallet has been created!

if you click on the icon, it will look like this

Step 2:

enable testnets

  • in the next step, we want to get test crypto
     
  • this is *not* the real thing, it's on a test network where developers can try their code without committing "real" money to it
     
  • first, we need to connect to a test network 
  • up here it says which network your MetaMask wallet is connected to
  • MetaMask can connect to various networks, not just Ethereum 
  • click on the dropdown arrow
  • we will use a testnet but these networks are not shown by default
  • click on "show/hide"
  • by default, this radio button is "off"
  • switch it "on" (shown below)
  • then scroll up/click on the browser extension
  • the app/browser extension now shows the test networks
  • select "Ropsten Test Network"

Step 3:
getting test crypto

navigate to app.mycrypto.com

click on tools

click on
Use Testnet Faucet

click to select account you want to request funds for

check wallet address you want to request funds to (next page: where to find your wallet address!)

gives the beginning and end of address & allows to copy address

click here to get:

your full public address

click to get funds

you will have received 0.01 ETH, visible now in your wallet app

you can view this transaction using a blockchain explorer

Step 4:
using crypto

we will trade testnet ETH using uniswap, a decentralized, automated market maker protocol

  1. navigate to uniswap.org

2. launch app

you need to connect your wallet to use the app

Step 1: click on MetaMask

Step 2: authorize connection

shows your wallet

shows we're in testnet mode

enter an amount to trade (not too much, like 0.001)

click here to select the token we want to buy

let's use DAI (a digital representation of the USD)

that's the projected amount that you get for 0.001 ETH

click here

click to confirm

NB: sometimes it doesn't directly go to "confirm"; you may have to navigate to your wallet app (which will show a small notification indicator)

(there may be another step)

by default, the new token does not show up in your wallet

\(\to\) click on add DAI to Metamask

should now show up in your wallet

Step 5a:
advanced dabbling: liquidity supply in UniSwap

Part 1 of advanced dabbling: we will now put our ETH and DAI to good use and become UniSwap liquidity providers

1. navigate to "pool"

2. establish a new position

There are lots of options here. I'll keep it simple:

  • select lowest fee tier
     
  • select maximum amount of DAI (there is a button "max")
     
  • select the "Full Range" for liquidity supply

before we can use the DAI tokens, we need to give the app the permission to access the DAI on your behalf \(\to\) you need to sign this as a transaction with your wallet

you are now ready to supply liquidity:

Step 1

Step 2

Step 3: sign with wallet

details on Etherscan

your wallet also tells you what you did

the UniSwap App tells you what you have; click on the field to get:

Step 5b:
advanced dabbling: borrowing and lending in Compound

Part 2 of advanced dabbling: we will be lenders in Compound 

navigate to app.compound.finance and connect your wallet

NB: you may want/have to request more ETH from the faucet and you may want to purchase some other tokens on UniSwap, such as the UNI token

as with UniSwap liquidity supply, you first need to allow the app to use tokens (I am allowing the use of the UNI token) on your behalf 

unfortunately, I don't have the UNI token ... but Compound has a faucet to try it out - so click there 

which generously gave me 0.35 UNI

click max and supply

confirm

congrats: you are now a supplier of liquidity!

Now on to borrowing: 

  • one trick: for testnet in Compound, you need to enable your supplied liquidity as collateral
  • We can now borrow against our collateral (provided in UNI)
  • We will borrow 1 DAI

Blockchain 1: Dabbling with Crypto Wallets

By Andreas Park

Blockchain 1: Dabbling with Crypto Wallets

A step-by-step guide on how crypto wallets work, how to operate them, and how to use them for DeFi apps. The guide is based on using the Ropsten Test Network and does not use "real" crypto. No compliance rules will be broken (I hope).

  • 197